@linkshell/gateway 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +9 -2
- package/README.md +1 -1
- package/dist/gateway/src/main.js +4 -0
- package/dist/gateway/src/main.js.map +1 -1
- package/dist/gateway/src/serve.d.ts +3 -1
- package/dist/gateway/src/serve.js +5 -1
- package/dist/gateway/src/serve.js.map +1 -1
- package/dist/gateway/src/web.d.ts +12 -0
- package/dist/gateway/src/web.js +53 -0
- package/dist/gateway/src/web.js.map +1 -0
- package/dist/gateway/tsconfig.tsbuildinfo +1 -1
- package/dist/wire/src/computer-preview.d.ts +35 -0
- package/dist/wire/src/computer-preview.js +51 -0
- package/dist/wire/src/computer-preview.js.map +1 -0
- package/dist/wire/src/goal.d.ts +66 -0
- package/dist/wire/src/goal.js +19 -0
- package/dist/wire/src/goal.js.map +1 -0
- package/dist/wire/src/index.d.ts +2 -0
- package/dist/wire/src/index.js +2 -0
- package/dist/wire/src/index.js.map +1 -1
- package/dist/wire/src/model.d.ts +78 -0
- package/dist/wire/src/model.js +31 -0
- package/dist/wire/src/model.js.map +1 -1
- package/dist/wire/src/rpc.d.ts +1289 -60
- package/dist/wire/src/rpc.js +53 -3
- package/dist/wire/src/rpc.js.map +1 -1
- package/dist/wire/src/updates.d.ts +334 -22
- package/dist/wire/src/updates.js +11 -1
- package/dist/wire/src/updates.js.map +1 -1
- package/package.json +7 -4
- package/scripts/build-web.mjs +7 -0
- package/src/main.ts +4 -0
- package/src/serve.ts +5 -1
- package/src/web.ts +57 -0
- package/web-client/assets/Prototype-B4M4qwtx.js +2 -0
- package/web-client/assets/account-R7yD1rZE.js +29 -0
- package/web-client/assets/index-DkcaGYC0.css +1 -0
- package/web-client/assets/index-Dnl-KjuJ.js +200 -0
- package/web-client/assets/mark-CUOqBxI3.png +0 -0
- package/web-client/assets/markdown-SZOrMO_3.js +45 -0
- package/web-client/assets/qr-scanner-worker.min-D85Z9gVD.js +98 -0
- package/web-client/assets/qr-scanner.min-DLeCi9No.js +1 -0
- package/web-client/assets/terminal-DOrYoP_4.css +32 -0
- package/web-client/assets/terminal-DWFexEE4.js +38 -0
- package/web-client/config.js +6 -0
- package/web-client/favicon.png +0 -0
- package/web-client/index.html +21 -0
- package/web-client/preview/bridge.html +38 -0
- package/web-client/preview/bridge.js +100 -0
- package/web-client/preview/worker.js +190 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/qr-scanner.min-DLeCi9No.js","assets/markdown-SZOrMO_3.js","assets/account-R7yD1rZE.js","assets/terminal-DWFexEE4.js","assets/terminal-DOrYoP_4.css","assets/Prototype-B4M4qwtx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as w1,g as iA,a as x,R as Zs,j as h,b as cl,M as oA,c as lA,d as cA}from"./markdown-SZOrMO_3.js";import{_ as Ls,a as S1,b as uA,c as dA}from"./account-R7yD1rZE.js";import{D as fA,o as hA}from"./terminal-DWFexEE4.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();function E1(n){var t,s,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(t=0;t<o;t++)n[t]&&(s=E1(n[t]))&&(r&&(r+=" "),r+=s)}else for(s in n)n[s]&&(r&&(r+=" "),r+=s);return r}function _1(){for(var n,t,s=0,r="",o=arguments.length;s<o;s++)(n=arguments[s])&&(t=E1(n))&&(r&&(r+=" "),r+=t);return r}const mA=(n,t)=>{const s=new Array(n.length+t.length);for(let r=0;r<n.length;r++)s[r]=n[r];for(let r=0;r<t.length;r++)s[n.length+r]=t[r];return s},pA=(n,t)=>({classGroupId:n,validator:t}),C1=(n=new Map,t=null,s)=>({nextPart:n,validators:t,classGroupId:s}),Eu="-",gb=[],gA="arbitrary..",vA=n=>{const t=bA(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return yA(u);const d=u.split(Eu),m=d[0]===""&&d.length>1?1:0;return A1(d,m,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=r[u],p=s[u];return m?p?mA(p,m):m:p||gb}return s[u]||gb}}},A1=(n,t,s)=>{if(n.length-t===0)return s.classGroupId;const o=n[t],l=s.nextPart.get(o);if(l){const p=A1(n,t+1,l);if(p)return p}const u=s.validators;if(u===null)return;const d=t===0?n.join(Eu):n.slice(t).join(Eu),m=u.length;for(let p=0;p<m;p++){const b=u[p];if(b.validator(d))return b.classGroupId}},yA=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=n.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?gA+r:void 0})(),bA=n=>{const{theme:t,classGroups:s}=n;return xA(s,t)},xA=(n,t)=>{const s=C1();for(const r in n){const o=n[r];bp(o,s,r,t)}return s},bp=(n,t,s,r)=>{const o=n.length;for(let l=0;l<o;l++){const u=n[l];wA(u,t,s,r)}},wA=(n,t,s,r)=>{if(typeof n=="string"){SA(n,t,s);return}if(typeof n=="function"){EA(n,t,s,r);return}_A(n,t,s,r)},SA=(n,t,s)=>{const r=n===""?t:j1(t,n);r.classGroupId=s},EA=(n,t,s,r)=>{if(CA(n)){bp(n(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pA(s,n))},_A=(n,t,s,r)=>{const o=Object.entries(n),l=o.length;for(let u=0;u<l;u++){const[d,m]=o[u];bp(m,j1(t,d),s,r)}},j1=(n,t)=>{let s=n;const r=t.split(Eu),o=r.length;for(let l=0;l<o;l++){const u=r[l];let d=s.nextPart.get(u);d||(d=C1(),s.nextPart.set(u,d)),s=d}return s},CA=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,AA=n=>{if(n<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const o=(l,u)=>{s[l]=u,t++,t>n&&(t=0,r=s,s=Object.create(null))};return{get(l){let u=s[l];if(u!==void 0)return u;if((u=r[l])!==void 0)return o(l,u),u},set(l,u){l in s?s[l]=u:o(l,u)}}},Tm="!",vb=":",jA=[],yb=(n,t,s,r,o)=>({modifiers:n,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:o}),TA=n=>{const{prefix:t,experimentalParseClassName:s}=n;let r=o=>{const l=[];let u=0,d=0,m=0,p;const b=o.length;for(let T=0;T<b;T++){const S=o[T];if(u===0&&d===0){if(S===vb){l.push(o.slice(m,T)),m=T+1;continue}if(S==="/"){p=T;continue}}S==="["?u++:S==="]"?u--:S==="("?d++:S===")"&&d--}const v=l.length===0?o:o.slice(m);let y=v,E=!1;v.endsWith(Tm)?(y=v.slice(0,-1),E=!0):v.startsWith(Tm)&&(y=v.slice(1),E=!0);const _=p&&p>m?p-m:void 0;return yb(l,E,y,_)};if(t){const o=t+vb,l=r;r=u=>u.startsWith(o)?l(u.slice(o.length)):yb(jA,!1,u,void 0,!0)}if(s){const o=r;r=l=>s({className:l,parseClassName:o})}return r},kA=n=>{const t=new Map;return n.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let o=[];for(let l=0;l<s.length;l++){const u=s[l],d=u[0]==="[",m=t.has(u);d||m?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(u)):o.push(u)}return o.length>0&&(o.sort(),r.push(...o)),r}},NA=n=>({cache:AA(n.cacheSize),parseClassName:TA(n),sortModifiers:kA(n),postfixLookupClassGroupIds:OA(n),...vA(n)}),OA=n=>{const t=Object.create(null),s=n.postfixLookupClassGroups;if(s)for(let r=0;r<s.length;r++)t[s[r]]=!0;return t},RA=/\s+/,DA=(n,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:u}=t,d=[],m=n.trim().split(RA);let p="";for(let b=m.length-1;b>=0;b-=1){const v=m[b],{isExternal:y,modifiers:E,hasImportantModifier:_,baseClassName:T,maybePostfixModifierPosition:S}=s(v);if(y){p=v+(p.length>0?" "+p:p);continue}let C=!!S,j;if(C){const M=T.substring(0,S);j=r(M);const z=j&&u[j]?r(T):void 0;z&&z!==j&&(j=z,C=!1)}else j=r(T);if(!j){if(!C){p=v+(p.length>0?" "+p:p);continue}if(j=r(T),!j){p=v+(p.length>0?" "+p:p);continue}C=!1}const k=E.length===0?"":E.length===1?E[0]:l(E).join(":"),A=_?k+Tm:k,R=A+j;if(d.indexOf(R)>-1)continue;d.push(R);const O=o(j,C);for(let M=0;M<O.length;++M){const z=O[M];d.push(A+z)}p=v+(p.length>0?" "+p:p)}return p},MA=(...n)=>{let t=0,s,r,o="";for(;t<n.length;)(s=n[t++])&&(r=T1(s))&&(o&&(o+=" "),o+=r);return o},T1=n=>{if(typeof n=="string")return n;let t,s="";for(let r=0;r<n.length;r++)n[r]&&(t=T1(n[r]))&&(s&&(s+=" "),s+=t);return s},zA=(n,...t)=>{let s,r,o,l;const u=m=>{const p=t.reduce((b,v)=>v(b),n());return s=NA(p),r=s.cache.get,o=s.cache.set,l=d,d(m)},d=m=>{const p=r(m);if(p)return p;const b=DA(m,s);return o(m,b),b};return l=u,(...m)=>l(MA(...m))},LA=[],zt=n=>{const t=s=>s[n]||LA;return t.isThemeGetter=!0,t.themeKey=n,t},k1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,N1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UA=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,BA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IA=/\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$/,HA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,VA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,js=n=>UA.test(n),Ve=n=>!!n&&!Number.isNaN(Number(n)),ia=n=>!!n&&Number.isInteger(Number(n)),$h=n=>n.endsWith("%")&&Ve(n.slice(0,-1)),Ba=n=>BA.test(n),O1=()=>!0,$A=n=>IA.test(n)&&!HA.test(n),xp=()=>!1,PA=n=>VA.test(n),GA=n=>qA.test(n),FA=n=>!ve(n)&&!ye(n),ZA=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),YA=n=>Ys(n,M1,xp),ve=n=>k1.test(n),br=n=>Ys(n,z1,$A),bb=n=>Ys(n,nj,Ve),KA=n=>Ys(n,U1,O1),XA=n=>Ys(n,L1,xp),xb=n=>Ys(n,R1,xp),QA=n=>Ys(n,D1,GA),Xc=n=>Ys(n,B1,PA),ye=n=>N1.test(n),sl=n=>Vr(n,z1),WA=n=>Vr(n,L1),wb=n=>Vr(n,R1),JA=n=>Vr(n,M1),ej=n=>Vr(n,D1),Qc=n=>Vr(n,B1,!0),tj=n=>Vr(n,U1,!0),Ys=(n,t,s)=>{const r=k1.exec(n);return r?r[1]?t(r[1]):s(r[2]):!1},Vr=(n,t,s=!1)=>{const r=N1.exec(n);return r?r[1]?t(r[1]):s:!1},R1=n=>n==="position"||n==="percentage",D1=n=>n==="image"||n==="url",M1=n=>n==="length"||n==="size"||n==="bg-size",z1=n=>n==="length",nj=n=>n==="number",L1=n=>n==="family-name",U1=n=>n==="number"||n==="weight",B1=n=>n==="shadow",aj=()=>{const n=zt("color"),t=zt("font"),s=zt("text"),r=zt("font-weight"),o=zt("tracking"),l=zt("leading"),u=zt("breakpoint"),d=zt("container"),m=zt("spacing"),p=zt("radius"),b=zt("shadow"),v=zt("inset-shadow"),y=zt("text-shadow"),E=zt("drop-shadow"),_=zt("blur"),T=zt("perspective"),S=zt("aspect"),C=zt("ease"),j=zt("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...A(),ye,ve],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],z=()=>[ye,ve,m],L=()=>[js,"full","auto",...z()],V=()=>[ia,"none","subgrid",ye,ve],q=()=>["auto",{span:["full",ia,ye,ve]},ia,ye,ve],Y=()=>[ia,"auto",ye,ve],X=()=>["auto","min","max","fr",ye,ve],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...z()],$=()=>[js,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],W=()=>[d,js,"screen","full","dvw","lvw","svw","min","max","fit",...z()],J=()=>[js,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],Q=()=>[n,ye,ve],pe=()=>[...A(),wb,xb,{position:[ye,ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",JA,YA,{size:[ye,ve]}],de=()=>[$h,sl,br],ce=()=>["","none","full",p,ye,ve],ie=()=>["",Ve,sl,br],we=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[Ve,$h,wb,xb],De=()=>["","none",_,ye,ve],Oe=()=>["none",Ve,ye,ve],Me=()=>["none",Ve,ye,ve],He=()=>[Ve,ye,ve],ze=()=>[js,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ba],breakpoint:[Ba],color:[O1],container:[Ba],"drop-shadow":[Ba],ease:["in","out","in-out"],font:[FA],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ba],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ba],shadow:[Ba],spacing:["px",Ve],text:[Ba],"text-shadow":[Ba],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",js,ve,ye,S]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,ve]}],"container-named":[ZA],columns:[{columns:[Ve,"auto",ve,ye,d]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:R()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[ia,"auto",ye,ve]}],basis:[{basis:[js,"full","auto",d,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,js,"auto","initial","none",ve]}],grow:[{grow:["",Ve,ye,ve]}],shrink:[{shrink:["",Ve,ye,ve]}],order:[{order:[ia,"first","last","none",ye,ve]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[d,"screen",...$()]}],"min-w":[{"min-w":[d,"screen","none",...$()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh","none",...$()]}],"font-size":[{text:["base",s,sl,br]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tj,KA]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$h,ve]}],"font-family":[{font:[WA,XA,t]}],"font-features":[{"font-features":[ve]}],"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:[o,ye,ve]}],"line-clamp":[{"line-clamp":[Ve,"none",ye,bb]}],leading:[{leading:["none",l,...z()]}],"list-image":[{"list-image":["none",ye,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Q()}],"text-color":[{text:Q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",ye,br]}],"text-decoration-color":[{decoration:Q()}],"underline-offset":[{"underline-offset":[Ve,"auto",ye,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"tab-size":[{tab:[ia,ye,ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,ve]}],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",ye,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:pe()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ia,ye,ve],radial:["",ye,ve],conic:["",ia,ye,ve]},ej,QA]}],"bg-color":[{bg:Q()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:Q()}],"gradient-via":[{via:Q()}],"gradient-to":[{to:Q()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:Q()}],"border-color-x":[{"border-x":Q()}],"border-color-y":[{"border-y":Q()}],"border-color-s":[{"border-s":Q()}],"border-color-e":[{"border-e":Q()}],"border-color-bs":[{"border-bs":Q()}],"border-color-be":[{"border-be":Q()}],"border-color-t":[{"border-t":Q()}],"border-color-r":[{"border-r":Q()}],"border-color-b":[{"border-b":Q()}],"border-color-l":[{"border-l":Q()}],"divide-color":[{divide:Q()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,ye,ve]}],"outline-w":[{outline:["",Ve,sl,br]}],"outline-color":[{outline:Q()}],shadow:[{shadow:["","inner","none",b,Qc,Xc]}],"shadow-color":[{shadow:Q()}],"inset-shadow":[{"inset-shadow":["none",v,Qc,Xc]}],"inset-shadow-color":[{"inset-shadow":Q()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Q()}],"ring-offset-w":[{"ring-offset":[Ve,br]}],"ring-offset-color":[{"ring-offset":Q()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":Q()}],"text-shadow":[{"text-shadow":["none",y,Qc,Xc]}],"text-shadow-color":[{"text-shadow":Q()}],opacity:[{opacity:[Ve,ye,ve]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"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":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":Q()}],"mask-image-linear-to-color":[{"mask-linear-to":Q()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":Q()}],"mask-image-t-to-color":[{"mask-t-to":Q()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":Q()}],"mask-image-r-to-color":[{"mask-r-to":Q()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":Q()}],"mask-image-b-to-color":[{"mask-b-to":Q()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":Q()}],"mask-image-l-to-color":[{"mask-l-to":Q()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":Q()}],"mask-image-x-to-color":[{"mask-x-to":Q()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":Q()}],"mask-image-y-to-color":[{"mask-y-to":Q()}],"mask-image-radial":[{"mask-radial":[ye,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":Q()}],"mask-image-radial-to-color":[{"mask-radial-to":Q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":Q()}],"mask-image-conic-to-color":[{"mask-conic-to":Q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:pe()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,ve]}],filter:[{filter:["","none",ye,ve]}],blur:[{blur:De()}],brightness:[{brightness:[Ve,ye,ve]}],contrast:[{contrast:[Ve,ye,ve]}],"drop-shadow":[{"drop-shadow":["","none",E,Qc,Xc]}],"drop-shadow-color":[{"drop-shadow":Q()}],grayscale:[{grayscale:["",Ve,ye,ve]}],"hue-rotate":[{"hue-rotate":[Ve,ye,ve]}],invert:[{invert:["",Ve,ye,ve]}],saturate:[{saturate:[Ve,ye,ve]}],sepia:[{sepia:["",Ve,ye,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ve]}],"backdrop-blur":[{"backdrop-blur":De()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,ye,ve]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,ye,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,ye,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,ye,ve]}],"backdrop-invert":[{"backdrop-invert":["",Ve,ye,ve]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,ye,ve]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,ye,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,ye,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",ye,ve]}],ease:[{ease:["linear","initial",C,ye,ve]}],delay:[{delay:[Ve,ye,ve]}],animate:[{animate:["none",j,ye,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,ye,ve]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:Me()}],"scale-x":[{"scale-x":Me()}],"scale-y":[{"scale-y":Me()}],"scale-z":[{"scale-z":Me()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[ye,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],zoom:[{zoom:[ia,ye,ve]}],accent:[{accent:Q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Q()}],"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",ye,ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Q()}],"scrollbar-track-color":[{"scrollbar-track":Q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",ye,ve]}],fill:[{fill:["none",...Q()]}],"stroke-w":[{stroke:[Ve,sl,br,bb]}],stroke:[{stroke:["none",...Q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","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-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","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-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},sj=zA(aj);function qe(...n){return sj(_1(n))}var Ph={exports:{}},en={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-dom.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Sb;function rj(){if(Sb)return en;Sb=1;var n=w1();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(m,p,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:p,implementation:b}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return en.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,en.createPortal=function(m,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return l(m,p,null,b)},en.flushSync=function(m){var p=u.T,b=r.p;try{if(u.T=null,r.p=2,m)return m()}finally{u.T=p,r.p=b,r.d.f()}},en.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(m,p))},en.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},en.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var b=p.as,v=d(b,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,E=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?r.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:E}):b==="script"&&r.d.X(m,{crossOrigin:v,integrity:y,fetchPriority:E,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},en.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=d(p.as,p.crossOrigin);r.d.M(m,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(m)},en.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,v=d(b,p.crossOrigin);r.d.L(m,b,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},en.preloadModule=function(m,p){if(typeof m=="string")if(p){var b=d(p.as,p.crossOrigin);r.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(m)},en.requestFormReset=function(m){r.d.r(m)},en.unstable_batchedUpdates=function(m,p){return m(p)},en.useFormState=function(m,p,b){return u.H.useFormState(m,p,b)},en.useFormStatus=function(){return u.H.useHostTransitionStatus()},en.version="19.2.3",en}var Eb;function I1(){if(Eb)return Ph.exports;Eb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),Ph.exports=rj(),Ph.exports}var qr=I1();const ij=iA(qr);var oj=Object.defineProperty,wp=(n,t)=>oj(n,"name",{value:t,configurable:!0});function km(n,t){if(typeof n=="function")return n(t);n!=null&&(n.current=t)}wp(km,"setRef");function H1(...n){return t=>{let s=!1;const r=n.map(o=>{const l=km(o,t);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():km(n[o],null)}}}}wp(H1,"composeRefs");function We(...n){return x.useCallback(H1(...n),n)}wp(We,"useComposedRefs");var lj=Object.defineProperty,Hn=(n,t)=>lj(n,"name",{value:t,configurable:!0});function Xn(n){const t=x.forwardRef((s,r)=>{let{children:o,...l}=s,u=null,d=!1;const m=[];Nm(o)&&typeof Wc=="function"&&(o=Wc(o._payload)),x.Children.forEach(o,y=>{if(P1(y)){d=!0;const E=y;let _="child"in E.props?E.props.child:E.props.children;Nm(_)&&typeof Wc=="function"&&(_=Wc(_._payload)),u=dj(E,_),m.push(u?.props?.children)}else m.push(y)}),u?u=x.cloneElement(u,void 0,m):!d&&x.Children.count(o)===1&&x.isValidElement(o)&&(u=o);const p=u?$1(u):void 0,b=We(r,p);if(!u){if(o||o===0)throw new Error(d?mj(n):hj(n));return o}const v=q1(l,u.props??{});return u.type!==x.Fragment&&(v.ref=r?b:p),x.cloneElement(u,v)});return t.displayName=`${n}.Slot`,t}Hn(Xn,"createSlot");var cj=Xn("Slot"),V1=Symbol.for("radix.slottable");function uj(n){const t=Hn(s=>"child"in s?s.children(s.child):s.children,"Slottable");return t.displayName=`${n}.Slottable`,t.__radixId=V1,t}Hn(uj,"createSlottable");var dj=Hn((n,t)=>{if("child"in n.props){const s=n.props.child;return x.isValidElement(s)?x.cloneElement(s,void 0,n.props.children(s.props.children)):null}return x.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function q1(n,t){const s={...t};for(const r in t){const o=n[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?s[r]=(...d)=>{const m=l(...d);return o(...d),m}:o&&(s[r]=o):r==="style"?s[r]={...o,...l}:r==="className"?s[r]=[o,l].filter(Boolean).join(" "):r==="aria-describedby"&&(s[r]=F1(l,o))}return{...n,...s}}Hn(q1,"mergeProps");function $1(n){let t=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?n.ref:(t=Object.getOwnPropertyDescriptor(n,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}Hn($1,"getElementRef");function P1(n){return x.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===V1}Hn(P1,"isSlottable");var fj=Symbol.for("react.lazy");function Nm(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===fj&&"_payload"in n&&G1(n._payload)}Hn(Nm,"isLazyComponent");function G1(n){return typeof n=="object"&&n!==null&&"then"in n}Hn(G1,"isPromiseLike");function F1(...n){const t=new Set;for(const s of n)if(typeof s=="string")for(const r of String(s).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Hn(F1,"concatAriaDescribedby");var hj=Hn(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),mj=Hn(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Wc=Zs[" use ".trim().toString()],pj=Object.defineProperty,gj=(n,t)=>pj(n,"name",{value:t,configurable:!0}),vj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=vj.reduce((n,t)=>{const s=Xn(`Primitive.${t}`),r=x.forwardRef((o,l)=>{const{asChild:u,...d}=o,m=u?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(m,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...n,[t]:r}},{});function Sp(n,t){n&&qr.flushSync(()=>n.dispatchEvent(t))}gj(Sp,"dispatchDiscreteCustomEvent");var yj=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bj=Object.defineProperty,Bn=(n,t)=>bj(n,"name",{value:t,configurable:!0});function xj(n,t){const s=x.createContext(t);s.displayName=n+"Context";const r=Bn(l=>{const{children:u,...d}=l,m=x.useMemo(()=>d,Object.values(d));return h.jsx(s.Provider,{value:m,children:u})},"Provider");r.displayName=n+"Provider";function o(l,u={}){const{optional:d=!1}=u,m=x.useContext(s);if(m)return m;if(t!==void 0)return t;if(!d)throw new Error(`\`${l}\` must be used within \`${n}\``)}return Bn(o,"useContext"),[r,o]}Bn(xj,"createContext");function Qn(n,t=[]){let s=[];function r(l,u){const d=x.createContext(u);d.displayName=l+"Context";const m=s.length;s=[...s,u];const p=Bn(v=>{const{scope:y,children:E,..._}=v,T=y?.[n]?.[m]||d,S=x.useMemo(()=>_,Object.values(_));return h.jsx(T.Provider,{value:S,children:E})},"Provider");p.displayName=l+"Provider";function b(v,y,E={}){const{optional:_=!1}=E,T=y?.[n]?.[m]||d,S=x.useContext(T);if(S)return S;if(u!==void 0)return u;if(!_)throw new Error(`\`${v}\` must be used within \`${l}\``)}return Bn(b,"useContext"),[p,b]}Bn(r,"createContext");const o=Bn(()=>{const l=s.map(u=>x.createContext(u));return Bn(function(d){const m=d?.[n]||l;return x.useMemo(()=>({[`__scope${n}`]:{...d,[n]:m}}),[d,m])},"useScope")},"createScope");return o.scopeName=n,[r,Z1(o,...t)]}Bn(Qn,"createContextScope");function Z1(...n){const t=n[0];if(n.length===1)return t;const s=Bn(()=>{const r=n.map(o=>({useScope:o(),scopeName:o.scopeName}));return Bn(function(l){const u=r.reduce((d,{useScope:m,scopeName:p})=>{const v=m(l)[`__scope${p}`];return{...d,...v}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return s.scopeName=t.scopeName,s}Bn(Z1,"composeContextScopes");var wj=Object.defineProperty,Vt=(n,t)=>wj(n,"name",{value:t,configurable:!0});function ed(n){const t=n+"CollectionProvider",[s,r]=Qn(t),[o,l]=s(t,{collectionRef:{current:null},itemMap:new Map}),u=Vt(T=>{const{scope:S,children:C}=T,j=x.useRef(null),k=x.useRef(new Map).current;return h.jsx(o,{scope:S,itemMap:k,collectionRef:j,children:C})},"CollectionProvider");u.displayName=t;const d=n+"CollectionSlot",m=Xn(d),p=x.forwardRef((T,S)=>{const{scope:C,children:j}=T,k=l(d,C),A=We(S,k.collectionRef);return h.jsx(m,{ref:A,children:j})});p.displayName=d;const b=n+"CollectionItemSlot",v="data-radix-collection-item",y=Xn(b),E=x.forwardRef((T,S)=>{const{scope:C,children:j,...k}=T,A=x.useRef(null),R=We(S,A),O=l(b,C);return x.useEffect(()=>(O.itemMap.set(A,{ref:A,...k}),()=>void O.itemMap.delete(A))),h.jsx(y,{[v]:"",ref:R,children:j})});E.displayName=b;function _(T){const S=l(n+"CollectionConsumer",T);return x.useCallback(()=>{const j=S.collectionRef.current;if(!j)return[];const k=Array.from(j.querySelectorAll(`[${v}]`));return Array.from(S.itemMap.values()).sort((O,M)=>k.indexOf(O.ref.current)-k.indexOf(M.ref.current))},[S.collectionRef,S.itemMap])}return Vt(_,"useCollection"),[{Provider:u,Slot:p,ItemSlot:E},_,r]}Vt(ed,"createCollection");var _b=new WeakMap,Gh=class Ds extends Map{static{Vt(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],_b.set(this,!0)}set(t,s){return _b.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,s),this}insert(t,s,r){const o=this.has(s),l=this.#e.length,u=Ep(t);let d=u>=0?u:l+u;const m=d<0||d>=l?-1:d;if(m===this.size||o&&m===this.size-1||m===-1)return this.set(s,r),this;const p=this.size+(o?0:1);u<0&&d++;const b=[...this.#e];let v,y=!1;for(let E=d;E<p;E++)if(d===E){let _=b[E];b[E]===s&&(_=b[E+1]),o&&this.delete(s),v=this.get(_),this.set(s,r)}else{!y&&b[E-1]===s&&(y=!0);const _=b[y?E:E-1],T=v;v=this.get(_),this.delete(_),this.set(_,T)}return this}with(t,s,r){const o=new Ds(this);return o.insert(t,s,r),o}before(t){const s=this.#e.indexOf(t)-1;if(!(s<0))return this.entryAt(s)}setBefore(t,s,r){const o=this.#e.indexOf(t);return o===-1?this:this.insert(o,s,r)}after(t){let s=this.#e.indexOf(t);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(t,s,r){const o=this.#e.indexOf(t);return o===-1?this:this.insert(o+1,s,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){const s=super.delete(t);return s&&this.#e.splice(this.#e.indexOf(t),1),s}deleteAt(t){const s=this.keyAt(t);return s!==void 0?this.delete(s):!1}at(t){const s=pu(this.#e,t);if(s!==void 0)return this.get(s)}entryAt(t){const s=pu(this.#e,t);if(s!==void 0)return[s,this.get(s)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return pu(this.#e,t)}from(t,s){const r=this.indexOf(t);if(r===-1)return;let o=r+s;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.at(o)}keyFrom(t,s){const r=this.indexOf(t);if(r===-1)return;let o=r+s;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.keyAt(o)}find(t,s){let r=0;for(const o of this){if(Reflect.apply(t,s,[o,r,this]))return o;r++}}findIndex(t,s){let r=0;for(const o of this){if(Reflect.apply(t,s,[o,r,this]))return r;r++}return-1}filter(t,s){const r=[];let o=0;for(const l of this)Reflect.apply(t,s,[l,o,this])&&r.push(l),o++;return new Ds(r)}map(t,s){const r=[];let o=0;for(const l of this)r.push([l[0],Reflect.apply(t,s,[l,o,this])]),o++;return new Ds(r)}reduce(...t){const[s,r]=t;let o=0,l=r??this.at(0);for(const u of this)o===0&&t.length===1?l=u:l=Reflect.apply(s,this,[l,u,o,this]),o++;return l}reduceRight(...t){const[s,r]=t;let o=r??this.at(-1);for(let l=this.size-1;l>=0;l--){const u=this.at(l);l===this.size-1&&t.length===1?o=u:o=Reflect.apply(s,this,[o,u,l,this])}return o}toSorted(t){const s=[...this.entries()].sort(t);return new Ds(s)}toReversed(){const t=new Ds;for(let s=this.size-1;s>=0;s--){const r=this.keyAt(s),o=this.get(r);t.set(r,o)}return t}toSpliced(...t){const s=[...this.entries()];return s.splice(...t),new Ds(s)}slice(t,s){const r=new Ds;let o=this.size-1;if(t===void 0)return r;t<0&&(t=t+this.size),s!==void 0&&s>0&&(o=s-1);for(let l=t;l<=o;l++){const u=this.keyAt(l),d=this.get(u);r.set(u,d)}return r}every(t,s){let r=0;for(const o of this){if(!Reflect.apply(t,s,[o,r,this]))return!1;r++}return!0}some(t,s){let r=0;for(const o of this){if(Reflect.apply(t,s,[o,r,this]))return!0;r++}return!1}};function pu(n,t){if("at"in Array.prototype)return Array.prototype.at.call(n,t);const s=Y1(n,t);return s===-1?void 0:n[s]}Vt(pu,"at");function Y1(n,t){const s=n.length,r=Ep(t),o=r>=0?r:s+r;return o<0||o>=s?-1:o}Vt(Y1,"toSafeIndex");function Ep(n){return n!==n||n===0?0:Math.trunc(n)}Vt(Ep,"toSafeInteger");function Sj(n){const t=n+"CollectionProvider",[s,r]=Qn(t),[o,l]=s(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Gh,setItemMap:Vt(()=>{},"setItemMap")}),u=Vt(({state:k,...A})=>k?h.jsx(m,{...A,state:k}):h.jsx(d,{...A}),"CollectionProvider");u.displayName=t;const d=Vt(k=>{const A=S();return h.jsx(m,{...k,state:A})},"CollectionInit");d.displayName=t+"Init";const m=Vt(k=>{const{scope:A,children:R,state:O}=k,M=x.useRef(null),[z,L]=x.useState(null),V=We(M,L),[q,Y]=O;return x.useEffect(()=>{if(!z)return;const X=Q1(()=>{});return X.observe(z,{childList:!0,subtree:!0}),()=>{X.disconnect()}},[z]),h.jsx(o,{scope:A,itemMap:q,setItemMap:Y,collectionRef:V,collectionRefObject:M,collectionElement:z,children:R})},"CollectionProviderImpl");m.displayName=t+"Impl";const p=n+"CollectionSlot",b=Xn(p),v=x.forwardRef((k,A)=>{const{scope:R,children:O}=k,M=l(p,R),z=We(A,M.collectionRef);return h.jsx(b,{ref:z,children:O})});v.displayName=p;const y=n+"CollectionItemSlot",E="data-radix-collection-item",_=Xn(y),T=x.forwardRef((k,A)=>{const{scope:R,children:O,...M}=k,z=x.useRef(null),[L,V]=x.useState(null),q=We(A,z,V),Y=l(y,R),{setItemMap:X}=Y,ee=x.useRef(M);K1(ee.current,M)||(ee.current=M);const re=ee.current;return x.useEffect(()=>{const U=re;return X($=>L?$.has(L)?$.set(L,{...U,element:L}).toSorted(Om):($.set(L,{...U,element:L}),$.toSorted(Om)):$),()=>{X($=>!L||!$.has(L)?$:($.delete(L),new Gh($)))}},[L,re,X]),h.jsx(_,{[E]:"",ref:q,children:O})});T.displayName=y;function S(){return x.useState(new Gh)}Vt(S,"useInitCollection");function C(k){const{itemMap:A}=l(n+"CollectionConsumer",k);return A}return Vt(C,"useCollection"),[{Provider:u,Slot:v,ItemSlot:T},{createCollectionScope:r,useCollection:C,useInitCollection:S}]}Vt(Sj,"createCollection");function K1(n,t){if(n===t)return!0;if(typeof n!="object"||typeof t!="object"||n==null||t==null)return!1;const s=Object.keys(n),r=Object.keys(t);if(s.length!==r.length)return!1;for(const o of s)if(!Object.prototype.hasOwnProperty.call(t,o)||n[o]!==t[o])return!1;return!0}Vt(K1,"shallowEqual");function X1(n,t){return!!(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}Vt(X1,"isElementPreceding");function Om(n,t){return!n[1].element||!t[1].element?0:X1(n[1].element,t[1].element)?-1:1}Vt(Om,"sortByDocumentPosition");function Q1(n){return new MutationObserver(s=>{for(const r of s)if(r.type==="childList"){n();return}})}Vt(Q1,"getChildListObserver");var Ej=Object.defineProperty,no=(n,t)=>Ej(n,"name",{value:t,configurable:!0}),W1=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ae(n,t,{checkForDefaultPrevented:s=!0}={}){return no(function(o){if(n?.(o),s===!1||!o||!o.defaultPrevented)return t?.(o)},"handleEvent")}no(Ae,"composeEventHandlers");function _j(n){if(!W1)throw new Error("Cannot access window outside of the DOM");return n?.ownerDocument?.defaultView??window}no(_j,"getOwnerWindow");function Rm(n){if(!W1)throw new Error("Cannot access document outside of the DOM");return n?.ownerDocument??document}no(Rm,"getOwnerDocument");function J1(n,t=!1){const{activeElement:s}=Rm(n);if(!s?.nodeName)return null;if(ew(s)&&s.contentDocument)return J1(s.contentDocument.body,t);if(t){const r=s.getAttribute("aria-activedescendant");if(r){const o=Rm(s).getElementById(r);if(o)return o}}return s}no(J1,"getActiveElement");function ew(n){return n.tagName==="IFRAME"}no(ew,"isFrame");var Ct=globalThis?.document?x.useLayoutEffect:()=>{},Cj=Object.defineProperty,Aj=(n,t)=>Cj(n,"name",{value:t,configurable:!0}),Cb=Zs[" useEffectEvent ".trim().toString()],Ab=Zs[" useInsertionEffect ".trim().toString()];function tw(n){if(typeof Cb=="function")return Cb(n);const t=x.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ab=="function"?Ab(()=>{t.current=n}):Ct(()=>{t.current=n}),x.useMemo(()=>((...s)=>t.current?.(...s)),[])}Aj(tw,"useEffectEvent");var jj=Object.defineProperty,Al=(n,t)=>jj(n,"name",{value:t,configurable:!0}),Tj=Zs[" useInsertionEffect ".trim().toString()]||Ct;function jr({prop:n,defaultProp:t,onChange:s=Al(()=>{},"onChange"),caller:r}){const[o,l,u]=nw({defaultProp:t,onChange:s}),d=n!==void 0,m=d?n:o,p=x.useCallback(b=>{if(d){const v=aw(b)?b(n):b;v!==n&&u.current?.(v)}else l(b)},[d,n,l,u]);return[m,p]}Al(jr,"useControllableState");function nw({defaultProp:n,onChange:t}){const[s,r]=x.useState(n),o=x.useRef(s),l=x.useRef(t);return Tj(()=>{l.current=t},[t]),x.useEffect(()=>{o.current!==s&&(l.current?.(s),o.current=s)},[s,o]),[s,r,l]}Al(nw,"useUncontrolledState");function aw(n){return typeof n=="function"}Al(aw,"isFunction");var jb=Symbol("RADIX:SYNC_STATE");function kj(n,t,s,r){const{prop:o,defaultProp:l,onChange:u,caller:d}=t,m=o!==void 0,p=tw(u),b=[{...s,state:l}];r&&b.push(r);const[v,y]=x.useReducer((S,C)=>{if(C.type===jb)return{...S,state:C.state};const j=n(S,C);return m&&!Object.is(j.state,S.state)&&p(j.state),j},...b),E=v.state,_=x.useRef(E);x.useEffect(()=>{_.current!==E&&(_.current=E,m||p(E))},[E,_,m]);const T=x.useMemo(()=>o!==void 0?{...v,state:o}:v,[v,o]);return x.useEffect(()=>{m&&!Object.is(o,v.state)&&y({type:jb,state:o})},[o,v.state,m]),[T,y]}Al(kj,"useControllableStateReducer");var Nj=Object.defineProperty,Ka=(n,t)=>Nj(n,"name",{value:t,configurable:!0});function sw(n,t){return x.useReducer((s,r)=>t[s][r]??s,n)}Ka(sw,"useStateMachine");var Ks=Ka(n=>{const{present:t,children:s}=n,r=rw(t),o=typeof s=="function"?s({present:r.isPresent}):x.Children.only(s),l=iw(r.ref,ow(o));return typeof s=="function"||r.isPresent?x.cloneElement(o,{ref:l}):null},"Presence");function rw(n){const[t,s]=x.useState(),r=x.useRef(null),o=x.useRef(n),l=x.useRef("none"),u=x.useRef(void 0),d=n?"mounted":"unmounted",[m,p]=sw(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{m==="mounted"?(l.current=u.current??qi(r.current),u.current=void 0):l.current="none"},[m]),Ct(()=>{const b=r.current,v=o.current;if(v!==n){const E=l.current,_=qi(b);n?(u.current=_,p("MOUNT")):_==="none"||b?.display==="none"?p("UNMOUNT"):p(v&&E!==_?"ANIMATION_OUT":"UNMOUNT"),o.current=n}},[n,p]),Ct(()=>{if(t){let b;const v=t.ownerDocument.defaultView??window,y=Ka(_=>{const S=qi(r.current).includes(CSS.escape(_.animationName));if(_.target===t&&S&&(p("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",b=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},"handleAnimationEnd"),E=Ka(_=>{_.target===t&&(l.current=qi(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",E),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(b),t.removeEventListener("animationstart",E),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:x.useCallback(b=>{if(b){const v=getComputedStyle(b);r.current=v,u.current=qi(v)}else r.current=null;s(b)},[])}}Ka(rw,"usePresence");function Dm(n,t){if(typeof n=="function")return n(t);n!=null&&(n.current=t)}Ka(Dm,"setRef");function iw(...n){const t=x.useRef(n);return t.current=n,x.useCallback(s=>{const r=t.current;let o=!1;const l=r.map(u=>{const d=Dm(u,s);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u<l.length;u++){const d=l[u];typeof d=="function"?d():Dm(r[u],null)}}},[])}Ka(iw,"useStableComposedRefs");function qi(n){return n?.animationName||"none"}Ka(qi,"getAnimationName");function ow(n){let t=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?n.ref:(t=Object.getOwnPropertyDescriptor(n,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}Ka(ow,"getElementRef");var Oj=Object.defineProperty,Rj=(n,t)=>Oj(n,"name",{value:t,configurable:!0}),Dj=Zs[" useId ".trim().toString()]||(()=>{}),Mj=0;function Cn(n){const[t,s]=x.useState(Dj());return Ct(()=>{n||s(r=>r??String(Mj++))},[n]),n||(t?`radix-${t}`:"")}Rj(Cn,"useId");var zj=Object.defineProperty,Lj=(n,t)=>zj(n,"name",{value:t,configurable:!0}),Uj={LTR:"ltr"},Bj=x.createContext(void 0);function td(n){const t=x.useContext(Bj);return n||t||Uj.LTR}Lj(td,"useDirection");var Ij=Object.defineProperty,Hj=(n,t)=>Ij(n,"name",{value:t,configurable:!0});function In(n){const t=x.useRef(n);return x.useEffect(()=>{t.current=n}),x.useMemo(()=>((...s)=>t.current?.(...s)),[])}Hj(In,"useCallbackRef");var Vj=Object.defineProperty,Ht=(n,t)=>Vj(n,"name",{value:t,configurable:!0}),Mm="dismissableLayer.update",qj="dismissableLayer.pointerDownOutside",$j="dismissableLayer.focusOutside",Tb,lw=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nd=x.forwardRef(Ht(function(t,s){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,onDismiss:p,...b}=t,v=x.useContext(lw),[y,E]=x.useState(null),_=y?.ownerDocument??globalThis?.document,[,T]=x.useState({}),S=We(s,E),C=Array.from(v.layers),[j]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),k=j?C.indexOf(j):-1,A=y?C.indexOf(y):-1,R=v.layersWithOutsidePointerEventsDisabled.size>0,O=A>=k,M=x.useRef(!1),z=uw(Y=>{u?.(Y),m?.(Y),Y.defaultPrevented||p?.()},{ownerDocument:_,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:v.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(Y=>{if(!(Y instanceof Node))return!1;const X=[...v.branches].some(ee=>ee.contains(Y));return O&&!X},[v.branches,O])}),L=dw(Y=>{if(o&&M.current)return;const X=Y.target;[...v.branches].some(re=>re.contains(X))||(d?.(Y),m?.(Y),Y.defaultPrevented||p?.())},_),V=y?A===C.length-1:!1,q=In(Y=>{Y.key==="Escape"&&(l?.(Y),!Y.defaultPrevented&&p&&(Y.preventDefault(),p()))});return x.useEffect(()=>{if(V)return _.addEventListener("keydown",q,{capture:!0}),()=>_.removeEventListener("keydown",q,{capture:!0})},[_,V,q]),x.useEffect(()=>{if(y)return r&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(Tb=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(y)),v.layers.add(y),zm(),()=>{r&&(v.layersWithOutsidePointerEventsDisabled.delete(y),v.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=Tb))}},[y,_,r,v]),x.useEffect(()=>()=>{y&&(v.layers.delete(y),v.layersWithOutsidePointerEventsDisabled.delete(y),zm())},[y,v]),x.useEffect(()=>{const Y=Ht(()=>T({}),"handleUpdate");return document.addEventListener(Mm,Y),()=>document.removeEventListener(Mm,Y)},[]),h.jsx(ut.div,{...b,ref:S,style:{pointerEvents:R?O?"auto":"none":void 0,...t.style},onFocusCapture:Ae(t.onFocusCapture,L.onFocusCapture),onBlurCapture:Ae(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ae(t.onPointerDownCapture,z.onPointerDownCapture)})},"DismissableLayer"));function cw(){const n=x.useContext(lw),[t,s]=x.useState(null);return x.useEffect(()=>{if(t)return n.dismissableSurfaces.add(t),()=>{n.dismissableSurfaces.delete(t)}},[t,n.dismissableSurfaces]),s}Ht(cw,"useDismissableLayerSurface");var Pj=Ht(()=>!0,"IS_TRUE");function uw(n,t){const{ownerDocument:s=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=Pj}=t,d=In(n),m=x.useRef(!1),p=x.useRef(!1),b=x.useRef(new Map),v=x.useRef(()=>{});return x.useEffect(()=>{function y(){p.current=!1,o.current=!1,b.current.clear()}Ht(y,"resetOutsideInteraction");function E(){return Array.from(b.current.values()).some(Boolean)}Ht(E,"isOutsideInteractionIntercepted");function _(k){if(!p.current)return;const A=k.target;A instanceof Node&&[...l].some(O=>O.contains(A))||b.current.set(k.type,!0),k.type==="click"&&window.setTimeout(()=>{p.current&&v.current()},0)}Ht(_,"handleInteractionCapture");function T(k){p.current&&b.current.set(k.type,!1)}Ht(T,"handleInteractionBubble");const S=Ht(k=>{if(k.target&&!m.current){let A=function(){s.removeEventListener("click",v.current);const O=E();y(),O||_p(qj,d,R,{discrete:!0})};if(Ht(A,"handleAndDispatchPointerDownOutsideEvent"),!u(k.target)){s.removeEventListener("click",v.current),y(),m.current=!1;return}const R={originalEvent:k};p.current=!0,o.current=r&&k.button===0,b.current.clear(),!r||k.button!==0?A():(s.removeEventListener("click",v.current),v.current=A,s.addEventListener("click",v.current,{once:!0}))}else s.removeEventListener("click",v.current),y();m.current=!1},"handlePointerDown"),C=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const k of C)s.addEventListener(k,_,!0),s.addEventListener(k,T);const j=window.setTimeout(()=>{s.addEventListener("pointerdown",S)},0);return()=>{window.clearTimeout(j),s.removeEventListener("pointerdown",S),s.removeEventListener("click",v.current);for(const k of C)s.removeEventListener(k,_,!0),s.removeEventListener(k,T)}},[s,d,r,o,l,u]),{onPointerDownCapture:Ht(()=>m.current=!0,"onPointerDownCapture")}}Ht(uw,"usePointerDownOutside");function dw(n,t=globalThis?.document){const s=In(n),r=x.useRef(!1);return x.useEffect(()=>{const o=Ht(l=>{l.target&&!r.current&&_p($j,s,{originalEvent:l},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,s]),{onFocusCapture:Ht(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ht(()=>r.current=!1,"onBlurCapture")}}Ht(dw,"useFocusOutside");function zm(){const n=new CustomEvent(Mm);document.dispatchEvent(n)}Ht(zm,"dispatchUpdate");function _p(n,t,s,{discrete:r}){const o=s.originalEvent.target,l=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:s});t&&o.addEventListener(n,t,{once:!0}),r?Sp(o,l):o.dispatchEvent(l)}Ht(_p,"handleAndDispatchCustomEvent");var Gj=Object.defineProperty,Rt=(n,t)=>Gj(n,"name",{value:t,configurable:!0}),Fh="focusScope.autoFocusOnMount",Zh="focusScope.autoFocusOnUnmount",kb={bubbles:!1,cancelable:!0},ad=x.forwardRef(Rt(function(t,s){const{loop:r=!1,trapped:o=!1,branches:l,onMountAutoFocus:u,onUnmountAutoFocus:d,...m}=t,[p,b]=x.useState(null),v=In(u),y=In(d),E=x.useRef(null),_=We(s,b),T=x.useRef(l);x.useEffect(()=>{T.current=l});const S=x.useCallback(k=>k?p?.contains(k)?!0:!!T.current?.some(A=>A.contains(k)):!1,[p]),C=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(o){let k=function(M){if(C.paused||!p)return;const z=M.target;S(z)?E.current=z:qa(E.current,{select:!0})},A=function(M){if(C.paused||!p)return;const z=M.relatedTarget;z!==null&&(S(z)||qa(E.current,{select:!0}))},R=function(M){if(document.activeElement===document.body)for(const L of M)L.removedNodes.length>0&&qa(p)};Rt(k,"handleFocusIn"),Rt(A,"handleFocusOut"),Rt(R,"handleMutations"),document.addEventListener("focusin",k),document.addEventListener("focusout",A);const O=new MutationObserver(R);return p&&O.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",A),O.disconnect()}}},[o,p,C.paused,S]),x.useEffect(()=>{if(p){Nb.add(C);const k=document.activeElement;if(!p.contains(k)){const R=new CustomEvent(Fh,kb);p.addEventListener(Fh,v),p.dispatchEvent(R),R.defaultPrevented||(hw(yw(Ap(p)),{select:!0}),document.activeElement===k&&qa(p))}return()=>{p.removeEventListener(Fh,v),setTimeout(()=>{const R=new CustomEvent(Zh,kb);p.addEventListener(Zh,y),p.dispatchEvent(R),R.defaultPrevented||qa(k??document.body,{select:!0}),p.removeEventListener(Zh,y),Nb.remove(C)},0)}}},[p,v,y,C]);const j=x.useCallback(k=>{if(!r&&!o||C.paused)return;const A=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,R=document.activeElement;if(A&&R){const O=k.currentTarget,[M,z]=mw(O);M&&z?!k.shiftKey&&R===z?(k.preventDefault(),r&&qa(M,{select:!0})):k.shiftKey&&R===M&&(k.preventDefault(),r&&qa(z,{select:!0})):R===O&&k.preventDefault()}},[r,o,C.paused]);return h.jsx(ut.div,{tabIndex:-1,...m,ref:_,onKeyDown:j})},"FocusScope")),fw=x.createContext(null);function sd({registry:n,children:t}){return n?h.jsx(fw.Provider,{value:n,children:t}):t}Rt(sd,"FocusScopeBranchProvider");function rd(){const[n,t]=x.useState([]),s=x.useMemo(()=>({add:Rt(r=>t(o=>o.includes(r)?o:[...o,r]),"add"),remove:Rt(r=>t(o=>o.filter(l=>l!==r)),"remove")}),[]);return{nodes:n,registry:s}}Rt(rd,"useFocusScopeBranchRegistry");function Cp(n){const t=x.useContext(fw);x.useEffect(()=>{if(!(!n||!t))return t.add(n),()=>t.remove(n)},[n,t])}Rt(Cp,"useFocusScopeBranch");function hw(n,{select:t=!1}={}){const s=document.activeElement;for(const r of n)if(qa(r,{select:t}),document.activeElement!==s)return}Rt(hw,"focusFirst");function mw(n){const t=Ap(n),s=Lm(t,n),r=Lm(t.reverse(),n);return[s,r]}Rt(mw,"getTabbableEdges");function Ap(n){const t=[],s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:Rt(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)t.push(s.currentNode);return t}Rt(Ap,"getTabbableCandidates");function Lm(n,t){const s=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of n)if(!(s?!r.checkVisibility({checkVisibilityCSS:!0}):pw(r,{upTo:t})))return r}Rt(Lm,"findVisible");function pw(n,{upTo:t}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(t!==void 0&&n===t)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}Rt(pw,"isHidden");function gw(n){return n instanceof HTMLInputElement&&"select"in n}Rt(gw,"isSelectableInput");function qa(n,{select:t=!1}={}){if(n&&n.focus){const s=document.activeElement;n.focus({preventScroll:!0}),n!==s&&gw(n)&&t&&n.select()}}Rt(qa,"focus");var Nb=vw();function vw(){let n=[];return{add(t){const s=n[0];t!==s&&s?.pause(),n=Um(n,t),n.unshift(t)},remove(t){n=Um(n,t),n[0]?.resume()}}}Rt(vw,"createFocusScopesStack");function Um(n,t){const s=[...n],r=s.indexOf(t);return r!==-1&&s.splice(r,1),s}Rt(Um,"arrayRemove");function yw(n){return n.filter(t=>t.tagName!=="A")}Rt(yw,"removeLinks");var Fj=Object.defineProperty,Zj=(n,t)=>Fj(n,"name",{value:t,configurable:!0}),id=x.forwardRef(Zj(function(t,s){const{container:r,...o}=t,[l,u]=x.useState(!1);Ct(()=>u(!0),[]);const d=r||l&&globalThis?.document?.body;return d?qr.createPortal(h.jsx(ut.div,{...o,ref:s}),d):null},"Portal")),Yj=Object.defineProperty,jp=(n,t)=>Yj(n,"name",{value:t,configurable:!0}),Jc=0,Mi=null;function Kj(n){return ao(),n.children}jp(Kj,"FocusGuards");function ao(){x.useEffect(()=>{Mi||(Mi={start:Bm(),end:Bm()});const{start:n,end:t}=Mi;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Jc++,()=>{Jc===1&&(Mi?.start.remove(),Mi?.end.remove(),Mi=null),Jc=Math.max(0,Jc-1)}},[])}jp(ao,"useFocusGuards");function Bm(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}jp(Bm,"createFocusGuard");var gu="right-scroll-bar-position",vu="width-before-scroll-bar",Xj="with-scroll-bars-hidden",Qj="--removed-body-scroll-bar-size";function Yh(n,t){return typeof n=="function"?n(t):n&&(n.current=t),n}function Wj(n,t){var s=x.useState(function(){return{value:n,callback:t,facade:{get current(){return s.value},set current(r){var o=s.value;o!==r&&(s.value=r,s.callback(r,o))}}}})[0];return s.callback=t,s.facade}var Jj=typeof window<"u"?x.useLayoutEffect:x.useEffect,Ob=new WeakMap;function e4(n,t){var s=Wj(null,function(r){return n.forEach(function(o){return Yh(o,r)})});return Jj(function(){var r=Ob.get(s);if(r){var o=new Set(r),l=new Set(n),u=s.current;o.forEach(function(d){l.has(d)||Yh(d,null)}),l.forEach(function(d){o.has(d)||Yh(d,u)})}Ob.set(s,n)},[n]),s}function t4(n){return n}function n4(n,t){t===void 0&&(t=t4);var s=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:n},useMedium:function(l){var u=t(l,r);return s.push(u),function(){s=s.filter(function(d){return d!==u})}},assignSyncMedium:function(l){for(r=!0;s.length;){var u=s;s=[],u.forEach(l)}s={push:function(d){return l(d)},filter:function(){return s}}},assignMedium:function(l){r=!0;var u=[];if(s.length){var d=s;s=[],d.forEach(l),u=s}var m=function(){var b=u;u=[],b.forEach(l)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(b){u.push(b),p()},filter:function(b){return u=u.filter(b),s}}}};return o}function a4(n){n===void 0&&(n={});var t=n4(null);return t.options=Ls({async:!0,ssr:!1},n),t}var bw=function(n){var t=n.sideCar,s=S1(n,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Ls({},s))};bw.isSideCarExport=!0;function s4(n,t){return n.useMedium(t),bw}var xw=a4(),Kh=function(){},od=x.forwardRef(function(n,t){var s=x.useRef(null),r=x.useState({onScrollCapture:Kh,onWheelCapture:Kh,onTouchMoveCapture:Kh}),o=r[0],l=r[1],u=n.forwardProps,d=n.children,m=n.className,p=n.removeScrollBar,b=n.enabled,v=n.shards,y=n.sideCar,E=n.noRelative,_=n.noIsolation,T=n.inert,S=n.allowPinchZoom,C=n.as,j=C===void 0?"div":C,k=n.gapMode,A=S1(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=y,O=e4([s,t]),M=Ls(Ls({},A),o);return x.createElement(x.Fragment,null,b&&x.createElement(R,{sideCar:xw,removeScrollBar:p,shards:v,noRelative:E,noIsolation:_,inert:T,setCallbacks:l,allowPinchZoom:!!S,lockRef:s,gapMode:k}),u?x.cloneElement(x.Children.only(d),Ls(Ls({},M),{ref:O})):x.createElement(j,Ls({},M,{className:m,ref:O}),d))});od.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};od.classNames={fullWidth:vu,zeroRight:gu};var r4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function i4(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var t=r4();return t&&n.setAttribute("nonce",t),n}function o4(n,t){n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}function l4(n){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(n)}var c4=function(){var n=0,t=null;return{add:function(s){n==0&&(t=i4())&&(o4(t,s),l4(t)),n++},remove:function(){n--,!n&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},u4=function(){var n=c4();return function(t,s){x.useEffect(function(){return n.add(t),function(){n.remove()}},[t&&s])}},ww=function(){var n=u4(),t=function(s){var r=s.styles,o=s.dynamic;return n(r,o),null};return t},d4={left:0,top:0,right:0,gap:0},Xh=function(n){return parseInt(n||"",10)||0},f4=function(n){var t=window.getComputedStyle(document.body),s=t[n==="padding"?"paddingLeft":"marginLeft"],r=t[n==="padding"?"paddingTop":"marginTop"],o=t[n==="padding"?"paddingRight":"marginRight"];return[Xh(s),Xh(r),Xh(o)]},h4=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return d4;var t=f4(n),s=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-s+t[2]-t[0])}},m4=ww(),Fi="data-scroll-locked",p4=function(n,t,s,r){var o=n.left,l=n.top,u=n.right,d=n.gap;return s===void 0&&(s="margin"),`
|
|
11
|
+
.`.concat(Xj,` {
|
|
12
|
+
overflow: hidden `).concat(r,`;
|
|
13
|
+
padding-right: `).concat(d,"px ").concat(r,`;
|
|
14
|
+
}
|
|
15
|
+
body[`).concat(Fi,`] {
|
|
16
|
+
overflow: hidden `).concat(r,`;
|
|
17
|
+
overscroll-behavior: contain;
|
|
18
|
+
`).concat([t&&"position: relative ".concat(r,";"),s==="margin"&&`
|
|
19
|
+
padding-left: `.concat(o,`px;
|
|
20
|
+
padding-top: `).concat(l,`px;
|
|
21
|
+
padding-right: `).concat(u,`px;
|
|
22
|
+
margin-left:0;
|
|
23
|
+
margin-top:0;
|
|
24
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
25
|
+
`),s==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.`).concat(gu,` {
|
|
29
|
+
right: `).concat(d,"px ").concat(r,`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.`).concat(vu,` {
|
|
33
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.`).concat(gu," .").concat(gu,` {
|
|
37
|
+
right: 0 `).concat(r,`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.`).concat(vu," .").concat(vu,` {
|
|
41
|
+
margin-right: 0 `).concat(r,`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
body[`).concat(Fi,`] {
|
|
45
|
+
`).concat(Qj,": ").concat(d,`px;
|
|
46
|
+
}
|
|
47
|
+
`)},Rb=function(){var n=parseInt(document.body.getAttribute(Fi)||"0",10);return isFinite(n)?n:0},g4=function(){x.useEffect(function(){return document.body.setAttribute(Fi,(Rb()+1).toString()),function(){var n=Rb()-1;n<=0?document.body.removeAttribute(Fi):document.body.setAttribute(Fi,n.toString())}},[])},v4=function(n){var t=n.noRelative,s=n.noImportant,r=n.gapMode,o=r===void 0?"margin":r;g4();var l=x.useMemo(function(){return h4(o)},[o]);return x.createElement(m4,{styles:p4(l,!t,o,s?"":"!important")})},Im=!1;if(typeof window<"u")try{var eu=Object.defineProperty({},"passive",{get:function(){return Im=!0,!0}});window.addEventListener("test",eu,eu),window.removeEventListener("test",eu,eu)}catch{Im=!1}var zi=Im?{passive:!1}:!1,y4=function(n){return n.tagName==="TEXTAREA"},Sw=function(n,t){if(!(n instanceof Element))return!1;var s=window.getComputedStyle(n);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!y4(n)&&s[t]==="visible")},b4=function(n){return Sw(n,"overflowY")},x4=function(n){return Sw(n,"overflowX")},Db=function(n,t){var s=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ew(n,r);if(o){var l=_w(n,r),u=l[1],d=l[2];if(u>d)return!0}r=r.parentNode}while(r&&r!==s.body);return!1},w4=function(n){var t=n.scrollTop,s=n.scrollHeight,r=n.clientHeight;return[t,s,r]},S4=function(n){var t=n.scrollLeft,s=n.scrollWidth,r=n.clientWidth;return[t,s,r]},Ew=function(n,t){return n==="v"?b4(t):x4(t)},_w=function(n,t){return n==="v"?w4(t):S4(t)},E4=function(n,t){return n==="h"&&t==="rtl"?-1:1},_4=function(n,t,s,r,o){var l=E4(n,window.getComputedStyle(t).direction),u=l*r,d=s.target,m=t.contains(d),p=!1,b=u>0,v=0,y=0;do{if(!d)break;var E=_w(n,d),_=E[0],T=E[1],S=E[2],C=T-S-l*_;(_||C)&&Ew(n,d)&&(v+=C,y+=_);var j=d.parentNode;d=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!m&&d!==document.body||m&&(t.contains(d)||t===d));return(b&&Math.abs(v)<1||!b&&Math.abs(y)<1)&&(p=!0),p},tu=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Mb=function(n){return[n.deltaX,n.deltaY]},zb=function(n){return n&&"current"in n?n.current:n},C4=function(n,t){return n[0]===t[0]&&n[1]===t[1]},A4=function(n){return`
|
|
48
|
+
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
|
49
|
+
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
|
50
|
+
`)},j4=0,Li=[];function T4(n){var t=x.useRef([]),s=x.useRef([0,0]),r=x.useRef(),o=x.useState(j4++)[0],l=x.useState(ww)[0],u=x.useRef(n);x.useEffect(function(){u.current=n},[n]),x.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(o));var T=uA([n.lockRef.current],(n.shards||[]).map(zb),!0).filter(Boolean);return T.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),T.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[n.inert,n.lockRef.current,n.shards]);var d=x.useCallback(function(T,S){if("touches"in T&&T.touches.length===2||T.type==="wheel"&&T.ctrlKey)return!u.current.allowPinchZoom;var C=tu(T),j=s.current,k="deltaX"in T?T.deltaX:j[0]-C[0],A="deltaY"in T?T.deltaY:j[1]-C[1],R,O=T.target,M=Math.abs(k)>Math.abs(A)?"h":"v";if("touches"in T&&M==="h"&&O.type==="range")return!1;var z=window.getSelection(),L=z&&z.anchorNode,V=L?L===O||L.contains(O):!1;if(V)return!1;var q=Db(M,O);if(!q)return!0;if(q?R=M:(R=M==="v"?"h":"v",q=Db(M,O)),!q)return!1;if(!r.current&&"changedTouches"in T&&(k||A)&&(r.current=R),!R)return!0;var Y=r.current||R;return _4(Y,S,T,Y==="h"?k:A)},[]),m=x.useCallback(function(T){var S=T;if(!(!Li.length||Li[Li.length-1]!==l)){var C="deltaY"in S?Mb(S):tu(S),j=t.current.filter(function(R){return R.name===S.type&&(R.target===S.target||S.target===R.shadowParent)&&C4(R.delta,C)})[0];if(j&&j.should){S.cancelable&&S.preventDefault();return}if(!j){var k=(u.current.shards||[]).map(zb).filter(Boolean).filter(function(R){return R.contains(S.target)}),A=k.length>0?d(S,k[0]):!u.current.noIsolation;A&&S.cancelable&&S.preventDefault()}}},[]),p=x.useCallback(function(T,S,C,j){var k={name:T,delta:S,target:C,should:j,shadowParent:k4(C)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(A){return A!==k})},1)},[]),b=x.useCallback(function(T){s.current=tu(T),r.current=void 0},[]),v=x.useCallback(function(T){p(T.type,Mb(T),T.target,d(T,n.lockRef.current))},[]),y=x.useCallback(function(T){p(T.type,tu(T),T.target,d(T,n.lockRef.current))},[]);x.useEffect(function(){return Li.push(l),n.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:y}),document.addEventListener("wheel",m,zi),document.addEventListener("touchmove",m,zi),document.addEventListener("touchstart",b,zi),function(){Li=Li.filter(function(T){return T!==l}),document.removeEventListener("wheel",m,zi),document.removeEventListener("touchmove",m,zi),document.removeEventListener("touchstart",b,zi)}},[]);var E=n.removeScrollBar,_=n.inert;return x.createElement(x.Fragment,null,_?x.createElement(l,{styles:A4(o)}):null,E?x.createElement(v4,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function k4(n){for(var t=null;n!==null;)n instanceof ShadowRoot&&(t=n.host,n=n.host),n=n.parentNode;return t}const N4=s4(xw,T4);var so=x.forwardRef(function(n,t){return x.createElement(od,Ls({},n,{ref:t,sideCar:N4}))});so.classNames=od.classNames;var O4=function(n){if(typeof document>"u")return null;var t=Array.isArray(n)?n[0]:n;return t.ownerDocument.body},Ui=new WeakMap,nu=new WeakMap,au={},Qh=0,Cw=function(n){return n&&(n.host||Cw(n.parentNode))},R4=function(n,t){return t.map(function(s){if(n.contains(s))return s;var r=Cw(s);return r&&n.contains(r)?r:(console.error("aria-hidden",s,"in not contained inside",n,". Doing nothing"),null)}).filter(function(s){return!!s})},D4=function(n,t,s,r){var o=R4(t,Array.isArray(n)?n:[n]);au[s]||(au[s]=new WeakMap);var l=au[s],u=[],d=new Set,m=new Set(o),p=function(v){!v||d.has(v)||(d.add(v),p(v.parentNode))};o.forEach(p);var b=function(v){!v||m.has(v)||Array.prototype.forEach.call(v.children,function(y){if(d.has(y))b(y);else try{var E=y.getAttribute(r),_=E!==null&&E!=="false",T=(Ui.get(y)||0)+1,S=(l.get(y)||0)+1;Ui.set(y,T),l.set(y,S),u.push(y),T===1&&_&&nu.set(y,!0),S===1&&y.setAttribute(s,"true"),_||y.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",y,C)}})};return b(t),d.clear(),Qh++,function(){u.forEach(function(v){var y=Ui.get(v)-1,E=l.get(v)-1;Ui.set(v,y),l.set(v,E),y||(nu.has(v)||v.removeAttribute(r),nu.delete(v)),E||v.removeAttribute(s)}),Qh--,Qh||(Ui=new WeakMap,Ui=new WeakMap,nu=new WeakMap,au={})}},jl=function(n,t,s){s===void 0&&(s="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),o=O4(n);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),D4(r,o,s,"aria-hidden")):function(){return null}},M4=Object.defineProperty,pn=(n,t)=>M4(n,"name",{value:t,configurable:!0}),Tp="Dialog",[Aw,jw]=Qn(Tp),[z4,Wn]=Aw(Tp),Tw=pn(n=>{const{__scopeDialog:t,children:s,open:r,defaultOpen:o,onOpenChange:l,modal:u=!0}=n,d=x.useRef(null),m=x.useRef(null),{nodes:p,registry:b}=rd(),[v,y]=jr({prop:r,defaultProp:o??!1,onChange:l,caller:Tp}),[E,_]=x.useState(0),[T,S]=x.useState(0);return h.jsx(z4,{scope:t,triggerRef:d,contentRef:m,contentId:Cn(),titleId:Cn(),descriptionId:Cn(),titlePresent:E>0,descriptionPresent:T>0,setTitleCount:_,setDescriptionCount:S,open:v,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(C=>!C),[y]),modal:u,branchNodes:p,branchRegistry:b,children:s})},"Dialog"),L4="DialogTrigger",U4=x.forwardRef(pn(function(t,s){const{__scopeDialog:r,...o}=t,l=Wn(L4,r),u=We(s,l.triggerRef);return h.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":ld(l.open),...o,ref:u,onClick:Ae(t.onClick,l.onOpenToggle)})},"DialogTrigger")),kw="DialogPortal",[B4,Nw]=Aw(kw,{forceMount:void 0}),Ow=pn(n=>{const{__scopeDialog:t,forceMount:s,children:r,container:o}=n,l=Wn(kw,t);return h.jsx(B4,{scope:t,forceMount:s,children:x.Children.map(r,u=>h.jsx(Ks,{present:s||l.open,children:h.jsx(id,{asChild:!0,container:o,children:u})}))})},"DialogPortal"),Hm="DialogOverlay",Rw=x.forwardRef(pn(function(t,s){const r=Nw(Hm,t.__scopeDialog),{forceMount:o=r.forceMount,...l}=t,u=Wn(Hm,t.__scopeDialog);return u.modal?h.jsx(Ks,{present:o||u.open,children:h.jsx(H4,{...l,ref:s})}):null},"DialogOverlay")),I4=Xn("DialogOverlay.RemoveScroll"),H4=x.forwardRef(pn(function(t,s){const{__scopeDialog:r,...o}=t,l=Wn(Hm,r),u=cw(),d=We(s,u);return h.jsx(so,{as:I4,allowPinchZoom:!0,shards:x.useMemo(()=>[l.contentRef,...l.branchNodes.map(m=>({current:m}))],[l.contentRef,l.branchNodes]),children:h.jsx(ut.div,{"data-state":ld(l.open),...o,ref:d,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),ml="DialogContent",Dw=x.forwardRef(pn(function(t,s){const r=Nw(ml,t.__scopeDialog),{forceMount:o=r.forceMount,...l}=t,u=Wn(ml,t.__scopeDialog);return h.jsx(Ks,{present:o||u.open,children:u.modal?h.jsx(V4,{...l,ref:s}):h.jsx(q4,{...l,ref:s})})},"DialogContent")),V4=x.forwardRef(pn(function(t,s){const r=Wn(ml,t.__scopeDialog),o=x.useRef(null),l=We(s,r.contentRef,o);return x.useEffect(()=>{const u=o.current;if(u)return jl(u)},[]),h.jsx(Mw,{...t,ref:l,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Ae(t.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ae(t.onPointerDownOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&u.preventDefault()}),onFocusOutside:Ae(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),q4=x.forwardRef(pn(function(t,s){const r=Wn(ml,t.__scopeDialog),o=x.useRef(!1),l=x.useRef(!1);return h.jsx(Mw,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(o.current||r.triggerRef.current?.focus(),u.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;r.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),Mw=x.forwardRef(pn(function(t,s){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,"aria-describedby":d,children:m,...p}=t,b=Wn(ml,r);return ao(),h.jsx(sd,{registry:b.branchRegistry,children:h.jsx(ad,{asChild:!0,loop:!0,trapped:o,branches:b.branchNodes,onMountAutoFocus:l,onUnmountAutoFocus:u,children:h.jsx(nd,{role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?Uw(d,b.descriptionId):d,"data-state":ld(b.open),...p,ref:s,deferPointerDownOutside:!0,onDismiss:()=>b.onOpenChange(!1),children:m})})})},"DialogContentImpl")),zw=x.forwardRef(pn(function(t,s){const{__scopeDialog:r,...o}=t,l=Wn("DialogTitle",r),{setTitleCount:u}=l;return Ct(()=>(u(d=>d+1),()=>u(d=>d-1)),[u]),h.jsx(ut.h2,{id:l.titleId,...o,ref:s})},"DialogTitle")),Lw=x.forwardRef(pn(function(t,s){const{__scopeDialog:r,...o}=t,l=Wn("DialogDescription",r),{setDescriptionCount:u}=l;return Ct(()=>(u(d=>d+1),()=>u(d=>d-1)),[u]),h.jsx(ut.p,{id:l.descriptionId,...o,ref:s})},"DialogDescription")),$4="DialogClose",kp=x.forwardRef(pn(function(t,s){const{__scopeDialog:r,...o}=t,l=Wn($4,r);return h.jsx(ut.button,{type:"button",...o,ref:s,onClick:Ae(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Uw(...n){const t=new Set;for(const s of n)if(typeof s=="string")for(const r of String(s).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}pn(Uw,"concatAriaDescribedby");function ld(n){return n?"open":"closed"}pn(ld,"getState");var P4=Object.defineProperty,Wa=(n,t)=>P4(n,"name",{value:t,configurable:!0}),G4="AlertDialog",[F4,D8]=Qn(G4,[jw]),Ja=jw(),Z4=Wa(n=>{const{__scopeAlertDialog:t,...s}=n,r=Ja(t);return h.jsx(Tw,{...r,...s,modal:!0})},"AlertDialog");x.forwardRef(Wa(function(t,s){const{__scopeAlertDialog:r,...o}=t,l=Ja(r);return h.jsx(U4,{...l,...o,ref:s})},"AlertDialogTrigger"));var Y4=Wa(n=>{const{__scopeAlertDialog:t,...s}=n,r=Ja(t);return h.jsx(Ow,{...r,...s})},"AlertDialogPortal"),K4=x.forwardRef(Wa(function(t,s){const{__scopeAlertDialog:r,...o}=t,l=Ja(r);return h.jsx(Rw,{...l,...o,ref:s})},"AlertDialogOverlay")),X4="AlertDialogContent",[Q4,W4]=F4(X4),J4=x.forwardRef(Wa(function(t,s){const{__scopeAlertDialog:r,children:o,...l}=t,u=Ja(r),d=x.useRef(null),m=We(s,d),p=x.useRef(null);return h.jsx(Q4,{scope:r,cancelRef:p,children:h.jsx(Dw,{role:"alertdialog",...u,...l,ref:m,onOpenAutoFocus:Ae(l.onOpenAutoFocus,b=>{b.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault(),children:o})})},"AlertDialogContent")),e3=x.forwardRef(Wa(function(t,s){const{__scopeAlertDialog:r,...o}=t,l=Ja(r);return h.jsx(zw,{...l,...o,ref:s})},"AlertDialogTitle")),t3=x.forwardRef(Wa(function(t,s){const{__scopeAlertDialog:r,...o}=t,l=Ja(r);return h.jsx(Lw,{...l,...o,ref:s})},"AlertDialogDescription")),n3=x.forwardRef(Wa(function(t,s){const{__scopeAlertDialog:r,...o}=t,l=Ja(r);return h.jsx(kp,{...l,...o,ref:s})},"AlertDialogAction")),a3="AlertDialogCancel",s3=x.forwardRef(Wa(function(t,s){const{__scopeAlertDialog:r,...o}=t,{cancelRef:l}=W4(a3,r),u=Ja(r),d=We(s,l);return h.jsx(kp,{...u,...o,ref:d})},"AlertDialogCancel")),r3=Object.defineProperty,i3=(n,t)=>r3(n,"name",{value:t,configurable:!0});function Bw(n){const[t,s]=x.useState(void 0);return Ct(()=>{if(n){s({width:n.offsetWidth,height:n.offsetHeight});let r=0;const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let d,m;if("borderBoxSize"in u){const p=u.borderBoxSize,b=Array.isArray(p)?p[0]:p;d=b.inlineSize,m=b.blockSize}else d=n.offsetWidth,m=n.offsetHeight;s({width:d,height:m})})});return o.observe(n,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),o.unobserve(n)}}else s(void 0)},[n]),t}i3(Bw,"useSize");const o3=["top","right","bottom","left"],Hs=Math.min,Ga=Math.max,_u=Math.round,su=Math.floor,Fa=n=>({x:n,y:n}),l3={left:"right",right:"left",bottom:"top",top:"bottom"};function Iw(n,t,s){return Ga(n,Hs(t,s))}function Xa(n,t){return typeof n=="function"?n(t):n}function Vs(n){return n.split("-")[0]}function ro(n){return n.split("-")[1]}function Np(n){return n==="x"?"y":"x"}function Op(n){return n==="y"?"height":"width"}function da(n){const t=n[0];return t==="t"||t==="b"?"y":"x"}function Rp(n){return Np(da(n))}function c3(n,t,s){s===void 0&&(s=!1);const r=ro(n),o=Rp(n),l=Op(o);let u=o==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=Cu(u)),[u,Cu(u)]}function u3(n){const t=Cu(n);return[Vm(n),t,Vm(t)]}function Vm(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Lb=["left","right"],Ub=["right","left"],d3=["top","bottom"],f3=["bottom","top"];function h3(n,t,s){switch(n){case"top":case"bottom":return s?t?Ub:Lb:t?Lb:Ub;case"left":case"right":return t?d3:f3;default:return[]}}function m3(n,t,s,r){const o=ro(n);let l=h3(Vs(n),s==="start",r);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Vm)))),l}function Cu(n){const t=Vs(n);return l3[t]+n.slice(t.length)}function p3(n){var t,s,r,o;return{top:(t=n.top)!=null?t:0,right:(s=n.right)!=null?s:0,bottom:(r=n.bottom)!=null?r:0,left:(o=n.left)!=null?o:0}}function Hw(n){return typeof n!="number"?p3(n):{top:n,right:n,bottom:n,left:n}}function Au(n){const{x:t,y:s,width:r,height:o}=n;return{width:r,height:o,top:s,left:t,right:t+r,bottom:s+o,x:t,y:s}}function Bb(n,t,s){let{reference:r,floating:o}=n;const l=da(t),u=Rp(t),d=Op(u),m=Vs(t),p=l==="y",b=r.x+r.width/2-o.width/2,v=r.y+r.height/2-o.height/2,y=r[d]/2-o[d]/2;let E;switch(m){case"top":E={x:b,y:r.y-o.height};break;case"bottom":E={x:b,y:r.y+r.height};break;case"right":E={x:r.x+r.width,y:v};break;case"left":E={x:r.x-o.width,y:v};break;default:E={x:r.x,y:r.y}}const _=ro(t);return _&&(E[u]+=y*(_==="end"?1:-1)*(s&&p?-1:1)),E}async function g3(n,t){var s;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:u,elements:d,strategy:m}=n,{boundary:p="clippingAncestors",rootBoundary:b="viewport",elementContext:v="floating",altBoundary:y=!1,padding:E=0}=Xa(t,n),_=Hw(E),S=d[y?v==="floating"?"reference":"floating":v],C=Au(await l.getClippingRect({element:(s=await(l.isElement==null?void 0:l.isElement(S)))==null||s?S:S.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:b,strategy:m})),j=v==="floating"?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),A=await(l.isElement==null?void 0:l.isElement(k))&&await(l.getScale==null?void 0:l.getScale(k))||{x:1,y:1},R=Au(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:k,strategy:m}):j);return{top:(C.top-R.top+_.top)/A.y,bottom:(R.bottom-C.bottom+_.bottom)/A.y,left:(C.left-R.left+_.left)/A.x,right:(R.right-C.right+_.right)/A.x}}const v3=50,y3=async(n,t,s)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:u}=s,d=u.detectOverflow?u:{...u,detectOverflow:g3},m=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:n,floating:t,strategy:o}),{x:b,y:v}=Bb(p,r,m),y=r,E=0;const _={};for(let T=0;T<l.length;T++){const S=l[T];if(!S)continue;const{name:C,fn:j}=S,{x:k,y:A,data:R,reset:O}=await j({x:b,y:v,initialPlacement:r,placement:y,strategy:o,middlewareData:_,rects:p,platform:d,elements:{reference:n,floating:t}});b=k??b,v=A??v,_[C]={..._[C],...R},O&&E<v3&&(E++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(p=O.rects===!0?await u.getElementRects({reference:n,floating:t,strategy:o}):O.rects),{x:b,y:v}=Bb(p,y,m)),T=-1)}return{x:b,y:v,placement:y,strategy:o,middlewareData:_}},b3=n=>({name:"arrow",options:n,async fn(t){const{x:s,y:r,placement:o,rects:l,platform:u,elements:d,middlewareData:m}=t,{element:p,padding:b=0}=Xa(n,t)||{};if(p==null)return{};const v=Hw(b),y={x:s,y:r},E=Rp(o),_=Op(E),T=await u.getDimensions(p),S=E==="y",C=S?"top":"left",j=S?"bottom":"right",k=S?"clientHeight":"clientWidth",A=l.reference[_]+l.reference[E]-y[E]-l.floating[_],R=y[E]-l.reference[E],O=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let M=O?O[k]:0;(!M||!await(u.isElement==null?void 0:u.isElement(O)))&&(M=d.floating[k]||l.floating[_]);const z=A/2-R/2,L=M/2-T[_]/2-1,V=Hs(v[C],L),q=Hs(v[j],L),Y=M-T[_]-q,X=M/2-T[_]/2+z,ee=Iw(V,X,Y),re=!m.arrow&&ro(o)!=null&&X!==ee&&l.reference[_]/2-(X<V?V:q)-T[_]/2<0,U=re?X<V?X-V:X-Y:0;return{[E]:y[E]+U,data:{[E]:ee,centerOffset:X-ee-U,...re&&{alignmentOffset:U}},reset:re}}}),x3=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var s,r;const{placement:o,middlewareData:l,rects:u,initialPlacement:d,platform:m,elements:p}=t,{mainAxis:b=!0,crossAxis:v=!0,fallbackPlacements:y,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:T=!0,...S}=Xa(n,t);if((s=l.arrow)!=null&&s.alignmentOffset)return{};const C=Vs(o),j=da(d),k=Vs(d)===d,A=await(m.isRTL==null?void 0:m.isRTL(p.floating)),R=y||(k||!T?[Cu(d)]:u3(d)),O=_!=="none";!y&&O&&R.push(...m3(d,T,_,A));const M=[d,...R],z=await m.detectOverflow(t,S),L=[];let V=((r=l.flip)==null?void 0:r.overflows)||[];if(b&&L.push(z[C]),v){const ee=c3(o,u,A);L.push(z[ee[0]],z[ee[1]])}if(V=[...V,{placement:o,overflows:L}],!L.every(ee=>ee<=0)){var q,Y;const ee=(((q=l.flip)==null?void 0:q.index)||0)+1,re=M[ee];if(re&&(!(v==="alignment"?j!==da(re):!1)||V.every(W=>da(W.placement)===j?W.overflows[0]>0:!0)))return{data:{index:ee,overflows:V},reset:{placement:re}};let U=(Y=V.filter($=>$.overflows[0]<=0).sort(($,W)=>$.overflows[1]-W.overflows[1])[0])==null?void 0:Y.placement;if(!U)switch(E){case"bestFit":{var X;const $=(X=V.filter(W=>{if(O){const J=da(W.placement);return J===j||J==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(J=>J>0).reduce((J,Q)=>J+Q,0)]).sort((W,J)=>W[1]-J[1])[0])==null?void 0:X[0];$&&(U=$);break}case"initialPlacement":U=d;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Ib(n,t){return{top:n.top-t.height,right:n.right-t.width,bottom:n.bottom-t.height,left:n.left-t.width}}function Hb(n){return o3.some(t=>n[t]>=0)}const w3=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(t){const{rects:s,platform:r}=t,{strategy:o="referenceHidden",...l}=Xa(n,t);switch(o){case"referenceHidden":{const u=await r.detectOverflow(t,{...l,elementContext:"reference"}),d=Ib(u,s.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Hb(d)}}}case"escaped":{const u=await r.detectOverflow(t,{...l,altBoundary:!0}),d=Ib(u,s.floating);return{data:{escapedOffsets:d,escaped:Hb(d)}}}default:return{}}}}},Vw=new Set(["left","top"]);async function S3(n,t){const{placement:s,platform:r,elements:o}=n,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),u=Vs(s),d=ro(s),m=da(s)==="y",p=Vw.has(u)?-1:1,b=l&&m?-1:1,v=Xa(t,n);let{mainAxis:y,crossAxis:E,alignmentAxis:_}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof _=="number"&&(E=d==="end"?_*-1:_),m?{x:E*b,y:y*p}:{x:y*p,y:E*b}}const E3=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var s,r;const{x:o,y:l,placement:u,middlewareData:d}=t,m=await S3(t,n);return u===((s=d.offset)==null?void 0:s.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+m.x,y:l+m.y,data:{...m,placement:u}}}}},_3=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:s,y:r,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:j=>{let{x:k,y:A}=j;return{x:k,y:A}}},...p}=Xa(n,t),b={x:s,y:r},v=await l.detectOverflow(t,p),y=da(o),E=Np(y);let _=b[E],T=b[y];const S=(j,k)=>Iw(k+v[j==="y"?"top":"left"],k,k-v[j==="y"?"bottom":"right"]);u&&(_=S(E,_)),d&&(T=S(y,T));const C=m.fn({...t,[E]:_,[y]:T});return{...C,data:{x:C.x-s,y:C.y-r,enabled:{[E]:u,[y]:d}}}}}},C3=function(n){return n===void 0&&(n={}),{options:n,fn(t){var s,r;const{x:o,y:l,placement:u,rects:d,middlewareData:m}=t,{offset:p=0,mainAxis:b=!0,crossAxis:v=!0}=Xa(n,t),y={x:o,y:l},E=da(u),_=Np(E);let T=y[_],S=y[E];const C=Xa(p,t),j=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(s=C.mainAxis)!=null?s:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(b){const R=_==="y"?"height":"width",O=d.reference[_]-d.floating[R]+j.mainAxis,M=d.reference[_]+d.reference[R]-j.mainAxis;T<O?T=O:T>M&&(T=M)}if(v){var k,A;const R=_==="y"?"width":"height",O=Vw.has(Vs(u)),M=d.reference[E]-d.floating[R]+(O&&((k=m.offset)==null?void 0:k[E])||0)+(O?0:j.crossAxis),z=d.reference[E]+d.reference[R]+(O?0:((A=m.offset)==null?void 0:A[E])||0)-(O?j.crossAxis:0);S<M?S=M:S>z&&(S=z)}return{[_]:T,[E]:S}}}},A3=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){const{placement:s,rects:r,platform:o,elements:l}=t,{apply:u=()=>{},...d}=Xa(n,t),m=await o.detectOverflow(t,d),p=Vs(s),b=ro(s),v=da(s)==="y",{width:y,height:E}=r.floating;let _,T;p==="top"||p==="bottom"?(_=p,T=b===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(T=p,_=b==="end"?"top":"bottom");const S=E-m.top-m.bottom,C=y-m.left-m.right,j=Hs(E-m[_],S),k=Hs(y-m[T],C),A=t.middlewareData.shift,R=!A;let O=j,M=k;A!=null&&A.enabled.x&&(M=C),A!=null&&A.enabled.y&&(O=S),R&&!b&&(v?M=y-2*Ga(m.left,m.right):O=E-2*Ga(m.top,m.bottom)),await u({...t,availableWidth:M,availableHeight:O});const z=await o.getDimensions(l.floating);return y!==z.width||E!==z.height?{reset:{rects:!0}}:{}}}};function cd(){return typeof window<"u"}function io(n){return qw(n)?(n.nodeName||"").toLowerCase():"#document"}function mn(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function es(n){var t;return(t=(qw(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function qw(n){return cd()?n instanceof Node||n instanceof mn(n).Node:!1}function ga(n){return cd()?n instanceof Element||n instanceof mn(n).Element:!1}function Xs(n){return cd()?n instanceof HTMLElement||n instanceof mn(n).HTMLElement:!1}function Vb(n){return!cd()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof mn(n).ShadowRoot}function ud(n){const{overflow:t,overflowX:s,overflowY:r,display:o}=va(n);return/auto|scroll|overlay|hidden|clip/.test(t+r+s)&&o!=="inline"&&o!=="contents"}function j3(n){return/^(table|td|th)$/.test(io(n))}function dd(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const T3=/transform|translate|scale|rotate|perspective|filter/,k3=/paint|layout|strict|content/,xr=n=>!!n&&n!=="none";let Wh;function Dp(n){const t=ga(n)?va(n):n;return xr(t.transform)||xr(t.translate)||xr(t.scale)||xr(t.rotate)||xr(t.perspective)||!Mp()&&(xr(t.backdropFilter)||xr(t.filter))||T3.test(t.willChange||"")||k3.test(t.contain||"")}function N3(n){let t=Tr(n);for(;Xs(t)&&!pl(t);){if(Dp(t))return t;if(dd(t))return null;t=Tr(t)}return null}function Mp(){return Wh==null&&(Wh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Wh}function pl(n){return/^(html|body|#document)$/.test(io(n))}function va(n){return mn(n).getComputedStyle(n)}function fd(n){return ga(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Tr(n){if(io(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Vb(n)&&n.host||es(n);return Vb(t)?t.host:t}function $w(n){const t=Tr(n);return pl(t)?(n.ownerDocument||n).body:Xs(t)&&ud(t)?t:$w(t)}function gl(n,t,s){var r;t===void 0&&(t=[]),s===void 0&&(s=!0);const o=$w(n),l=o===((r=n.ownerDocument)==null?void 0:r.body),u=mn(o);if(l){const d=qm(u);return t.concat(u,u.visualViewport||[],ud(o)?o:[],d&&s?gl(d):[])}else return t.concat(o,gl(o,[],s))}function qm(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Pw(n){const t=va(n);let s=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xs(n),l=o?n.offsetWidth:s,u=o?n.offsetHeight:r,d=_u(s)!==l||_u(r)!==u;return d&&(s=l,r=u),{width:s,height:r,$:d}}function zp(n){return ga(n)?n:n.contextElement}function Zi(n){const t=zp(n);if(!Xs(t))return Fa(1);const s=t.getBoundingClientRect(),{width:r,height:o,$:l}=Pw(t);let u=(l?_u(s.width):s.width)/r,d=(l?_u(s.height):s.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const O3=Fa(0);function Gw(n){const t=mn(n);return!Mp()||!t.visualViewport?O3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function R3(n,t,s){return t===void 0&&(t=!1),!!s&&t&&s===mn(n)}function kr(n,t,s,r){t===void 0&&(t=!1),s===void 0&&(s=!1);const o=n.getBoundingClientRect(),l=zp(n);let u=Fa(1);t&&(r?ga(r)&&(u=Zi(r)):u=Zi(n));const d=R3(l,s,r)?Gw(l):Fa(0);let m=(o.left+d.x)/u.x,p=(o.top+d.y)/u.y,b=o.width/u.x,v=o.height/u.y;if(l&&r){const y=mn(l),E=ga(r)?mn(r):r;let _=y,T=qm(_);for(;T&&E!==_;){const S=Zi(T),C=T.getBoundingClientRect(),j=va(T),k=C.left+(T.clientLeft+parseFloat(j.paddingLeft))*S.x,A=C.top+(T.clientTop+parseFloat(j.paddingTop))*S.y;m*=S.x,p*=S.y,b*=S.x,v*=S.y,m+=k,p+=A,_=mn(T),T=qm(_)}}return Au({width:b,height:v,x:m,y:p})}function hd(n,t){const s=fd(n).scrollLeft;return t?t.left+s:kr(es(n)).left+s}function Fw(n,t){const s=n.getBoundingClientRect(),r=s.left+t.scrollLeft-hd(n,s),o=s.top+t.scrollTop;return{x:r,y:o}}function D3(n){let{elements:t,rect:s,offsetParent:r,strategy:o}=n;const l=o==="fixed",u=es(r),d=t?dd(t.floating):!1;if(r===u||d&&l)return s;let m={scrollLeft:0,scrollTop:0},p=Fa(1);const b=Fa(0),v=Xs(r);if((v||!l)&&((io(r)!=="body"||ud(u))&&(m=fd(r)),v)){const E=kr(r);p=Zi(r),b.x=E.x+r.clientLeft,b.y=E.y+r.clientTop}const y=u&&!v&&!l?Fw(u,m):Fa(0);return{width:s.width*p.x,height:s.height*p.y,x:s.x*p.x-m.scrollLeft*p.x+b.x+y.x,y:s.y*p.y-m.scrollTop*p.y+b.y+y.y}}function M3(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function z3(n){const t=fd(n),s=n.ownerDocument.body,r=Ga(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),o=Ga(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let l=-t.scrollLeft+hd(n);const u=-t.scrollTop;return va(s).direction==="rtl"&&(l+=Ga(n.clientWidth,s.clientWidth)-r),{width:r,height:o,x:l,y:u}}const L3=25;function U3(n,t,s){s===void 0&&(s="viewport");const r=s==="layoutViewport",o=mn(n),l=es(n),u=o.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,b=0;if(u){const y=!Mp()||t==="fixed";r?y||(p=-u.offsetLeft,b=-u.offsetTop):(d=u.width,m=u.height,y&&(p=u.offsetLeft,b=u.offsetTop))}if(hd(l)<=0){const y=l.ownerDocument,E=y.body,_=getComputedStyle(E),T=y.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(l.clientWidth-E.clientWidth-T),C=getComputedStyle(l).scrollbarGutter==="stable both-edges"?S/2:S;C<=L3&&(d-=C)}return{width:d,height:m,x:p,y:b}}function B3(n,t){const s=kr(n,!0,t==="fixed"),r=s.top+n.clientTop,o=s.left+n.clientLeft,l=Zi(n),u=n.clientWidth*l.x,d=n.clientHeight*l.y,m=o*l.x,p=r*l.y;return{width:u,height:d,x:m,y:p}}function qb(n,t,s){let r;if(t==="viewport"||t==="layoutViewport")r=U3(n,s,t);else if(t==="document")r=z3(es(n));else if(ga(t))r=B3(t,s);else{const o=Gw(n);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Au(r)}function I3(n,t){const s=t.get(n);if(s)return s;let r=gl(n,[],!1).filter(d=>ga(d)&&io(d)!=="body"),o=null;const l=va(n).position==="fixed";let u=l?Tr(n):n;for(;ga(u)&&!pl(u);){const d=va(u),m=Dp(u),p=o?o.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?r=r.filter(v=>v!==u):o=d,u=Tr(u)}return t.set(n,r),r}function H3(n){let{element:t,boundary:s,rootBoundary:r,strategy:o}=n;const u=[...s==="clippingAncestors"?dd(t)?[]:I3(t,this._c):[].concat(s),r],d=qb(t,u[0],o);let m=d.top,p=d.right,b=d.bottom,v=d.left;for(let y=1;y<u.length;y++){const E=qb(t,u[y],o);m=Ga(E.top,m),p=Hs(E.right,p),b=Hs(E.bottom,b),v=Ga(E.left,v)}return{width:p-v,height:b-m,x:v,y:m}}function V3(n){const{width:t,height:s}=Pw(n);return{width:t,height:s}}function q3(n,t,s){const r=Xs(t),o=es(t),l=s==="fixed",u=kr(n,!0,l,t);let d={scrollLeft:0,scrollTop:0};const m=Fa(0);if((r||!l)&&((io(t)!=="body"||ud(o))&&(d=fd(t)),r)){const y=kr(t,!0,l,t);m.x=y.x+t.clientLeft,m.y=y.y+t.clientTop}!r&&o&&(m.x=hd(o));const p=o&&!r&&!l?Fw(o,d):Fa(0),b=u.left+d.scrollLeft-m.x-p.x,v=u.top+d.scrollTop-m.y-p.y;return{x:b,y:v,width:u.width,height:u.height}}function Jh(n){return va(n).position==="static"}function $b(n,t){if(!Xs(n)||va(n).position==="fixed")return null;if(t)return t(n);let s=n.offsetParent;return es(n)===s&&(s=s.ownerDocument.body),s}function Zw(n,t){const s=mn(n);if(dd(n))return s;if(!Xs(n)){let o=Tr(n);for(;o&&!pl(o);){if(ga(o)&&!Jh(o))return o;o=Tr(o)}return s}let r=$b(n,t);for(;r&&j3(r)&&Jh(r);)r=$b(r,t);return r&&pl(r)&&Jh(r)&&!Dp(r)?s:r||N3(n)||s}const $3=async function(n){const t=this.getOffsetParent||Zw,s=this.getDimensions,r=await s(n.floating);return{reference:q3(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function P3(n){return va(n).direction==="rtl"}const G3={convertOffsetParentRelativeRectToViewportRelativeRect:D3,getDocumentElement:es,getClippingRect:H3,getOffsetParent:Zw,getElementRects:$3,getClientRects:M3,getDimensions:V3,getScale:Zi,isElement:ga,isRTL:P3};function Yw(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function F3(n,t,s){let r=null,o;const l=es(n);function u(){var b;clearTimeout(o),(b=r)==null||b.disconnect(),r=null}function d(b,v){b===void 0&&(b=!1),v===void 0&&(v=1),u();const y=n.getBoundingClientRect(),{left:E,top:_,width:T,height:S}=y;if(b||t(),!T||!S)return;const C=su(_),j=su(l.clientWidth-(E+T)),k=su(l.clientHeight-(_+S)),A=su(E),O={rootMargin:-C+"px "+-j+"px "+-k+"px "+-A+"px",threshold:Ga(0,Hs(1,v))||1};let M=!0;function z(L){const V=L[0].intersectionRatio;if(!Yw(y,n.getBoundingClientRect()))return d();if(V!==v){if(!M)return d();V?d(!1,V):o=setTimeout(()=>{d(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(z,{...O,root:l.ownerDocument})}catch{r=new IntersectionObserver(z,O)}r.observe(n)}const m=mn(n),p=()=>d(s);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function Z3(n,t,s,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=r,p=zp(n),b=o||l?[...p?gl(p):[],...t?gl(t):[]]:[];b.forEach(C=>{o&&C.addEventListener("scroll",s),l&&C.addEventListener("resize",s)});const v=p&&d?F3(p,s,l):null;let y=-1,E=null;u&&(E=new ResizeObserver(C=>{let[j]=C;j&&j.target===p&&E&&t&&(E.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=E)==null||k.observe(t)})),s()}),p&&!m&&E.observe(p),t&&E.observe(t));let _,T=m?kr(n):null;m&&S();function S(){const C=kr(n);T&&!Yw(T,C)&&s(),T=C,_=requestAnimationFrame(S)}return s(),()=>{var C;b.forEach(j=>{o&&j.removeEventListener("scroll",s),l&&j.removeEventListener("resize",s)}),v?.(),(C=E)==null||C.disconnect(),E=null,m&&cancelAnimationFrame(_)}}const Y3=E3,K3=_3,X3=x3,Q3=A3,W3=w3,Pb=b3,J3=C3,eT=(n,t,s)=>{const r=new Map,o=s??{},l={...G3,...o.platform,_c:r};return y3(n,t,{...o,platform:l})};var tT=typeof document<"u",nT=function(){},yu=tT?x.useLayoutEffect:nT;function ju(n,t){if(n===t)return!0;if(typeof n!=typeof t)return!1;if(typeof n=="function"&&n.toString()===t.toString())return!0;let s,r,o;if(n&&t&&typeof n=="object"){if(Array.isArray(n)){if(s=n.length,s!==t.length)return!1;for(r=s;r--!==0;)if(!ju(n[r],t[r]))return!1;return!0}if(o=Object.keys(n),s=o.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=s;r--!==0;){const l=o[r];if(!(l==="_owner"&&n.$$typeof)&&!ju(n[l],t[l]))return!1}return!0}return n!==n&&t!==t}function Kw(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Gb(n,t){const s=Kw(n);return Math.round(t*s)/s}function em(n){const t=x.useRef(n);return yu(()=>{t.current=n}),t}function aT(n){n===void 0&&(n={});const{placement:t="bottom",strategy:s="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=n,[b,v]=x.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[y,E]=x.useState(r);ju(y,r)||E(r);const[_,T]=x.useState(null),[S,C]=x.useState(null),j=x.useCallback(W=>{W!==O.current&&(O.current=W,T(W))},[]),k=x.useCallback(W=>{W!==M.current&&(M.current=W,C(W))},[]),A=l||_,R=u||S,O=x.useRef(null),M=x.useRef(null),z=x.useRef(b),L=m!=null,V=em(m),q=em(o),Y=em(p),X=x.useCallback(()=>{if(!O.current||!M.current)return;const W={placement:t,strategy:s,middleware:y};q.current&&(W.platform=q.current),eT(O.current,M.current,W).then(J=>{const Q={...J,isPositioned:Y.current!==!1};ee.current&&!ju(z.current,Q)&&(z.current=Q,qr.flushSync(()=>{v(Q)}))})},[y,t,s,q,Y]);yu(()=>{p===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,v(W=>({...W,isPositioned:!1})))},[p]);const ee=x.useRef(!1);yu(()=>(ee.current=!0,()=>{ee.current=!1}),[]),yu(()=>{if(A&&(O.current=A),R&&(M.current=R),A&&R){if(V.current)return V.current(A,R,X);X()}},[A,R,X,V,L]);const re=x.useMemo(()=>({reference:O,floating:M,setReference:j,setFloating:k}),[j,k]),U=x.useMemo(()=>({reference:A,floating:R}),[A,R]),$=x.useMemo(()=>{const W={position:s,left:0,top:0};if(!U.floating)return W;const J=Gb(U.floating,b.x),Q=Gb(U.floating,b.y);return d?{...W,transform:"translate("+J+"px, "+Q+"px)",...Kw(U.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:J,top:Q}},[s,d,U.floating,b.x,b.y]);return x.useMemo(()=>({...b,update:X,refs:re,elements:U,floatingStyles:$}),[b,X,re,U,$])}const sT=n=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:n,fn(s){const{element:r,padding:o}=typeof n=="function"?n(s):n;return r&&t(r)?r.current!=null?Pb({element:r.current,padding:o}).fn(s):{}:r?Pb({element:r,padding:o}).fn(s):{}}}},rT=(n,t)=>{const s=Y3(n);return{name:s.name,fn:s.fn,options:[n,t]}},iT=(n,t)=>{const s=K3(n);return{name:s.name,fn:s.fn,options:[n,t]}},oT=(n,t)=>({fn:J3(n).fn,options:[n,t]}),lT=(n,t)=>{const s=X3(n);return{name:s.name,fn:s.fn,options:[n,t]}},cT=(n,t)=>{const s=Q3(n);return{name:s.name,fn:s.fn,options:[n,t]}},uT=(n,t)=>{const s=W3(n);return{name:s.name,fn:s.fn,options:[n,t]}},dT=(n,t)=>{const s=sT(n);return{name:s.name,fn:s.fn,options:[n,t]}};var fT=Object.defineProperty,Us=(n,t)=>fT(n,"name",{value:t,configurable:!0}),Fb={Partial:"partial"},Zb={Optimized:"optimized",Always:"always"},Xw="Popper",[Qw,oo]=Qn(Xw),[hT,Ww]=Qw(Xw),Lp=Us(n=>{const{__scopePopper:t,children:s}=n,[r,o]=x.useState(null),[l,u]=x.useState(void 0);return h.jsx(hT,{scope:t,anchor:r,onAnchorChange:o,placementState:l,setPlacementState:u,children:s})},"Popper"),mT="PopperAnchor",Up=x.forwardRef(Us(function(t,s){const{__scopePopper:r,virtualRef:o,...l}=t,u=Ww(mT,r),d=x.useRef(null),m=u.onAnchorChange,p=x.useCallback(T=>{d.current=T,T&&m(T)},[m]),b=We(s,p),v=x.useRef(null);x.useEffect(()=>{if(!o)return;const T=v.current;v.current=o.current,T!==v.current&&m(v.current)});const y=u.placementState&&md(u.placementState),E=y?.[0],_=y?.[1];return o?null:h.jsx(ut.div,{"data-radix-popper-side":E,"data-radix-popper-align":_,...l,ref:b})},"PopperAnchor")),Jw="PopperContent",[pT,M8]=Qw(Jw),Bp=x.forwardRef(Us(function(t,s){const{__scopePopper:r,side:o="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:b=[],collisionPadding:v=0,sticky:y=Fb.Partial,hideWhenDetached:E=!1,updatePositionStrategy:_=Zb.Optimized,onPlaced:T,...S}=t,C=Ww(Jw,r),[j,k]=x.useState(null),A=We(s,k),[R,O]=x.useState(null),M=Bw(R),z=M?.width??0,L=M?.height??0,V=o+(u!=="center"?"-"+u:""),q=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},Y=Array.isArray(b)?b:[b],X=Y.length>0,ee={padding:q,boundary:Y.filter(eS),altBoundary:X},{refs:re,floatingStyles:U,placement:$,isPositioned:W,middlewareData:J}=aT({strategy:"fixed",placement:V,whileElementsMounted:Us((...he)=>Z3(...he,{animationFrame:_===Zb.Always}),"whileElementsMounted"),elements:{reference:C.anchor},middleware:[rT({mainAxis:l+L,alignmentAxis:d}),p&&iT({mainAxis:!0,crossAxis:!1,limiter:y===Fb.Partial?oT():void 0,...ee}),p&&lT({...ee}),cT({...ee,apply:Us(({elements:he,rects:De,availableWidth:Oe,availableHeight:Me})=>{const{width:He,height:ze}=De.reference,ht=he.floating.style;ht.setProperty("--radix-popper-available-width",`${Oe}px`),ht.setProperty("--radix-popper-available-height",`${Me}px`),ht.setProperty("--radix-popper-anchor-width",`${He}px`),ht.setProperty("--radix-popper-anchor-height",`${ze}px`)},"apply")}),R&&dT({element:R,padding:m}),gT({arrowWidth:z,arrowHeight:L}),E&&uT({strategy:"referenceHidden",...ee,boundary:X?ee.boundary:void 0})]}),Q=C.setPlacementState;Ct(()=>(Q($),()=>{Q(void 0)}),[$,Q]);const[pe,G]=md($),te=In(T);Ct(()=>{W&&te?.()},[W,te]);const de=J.arrow?.x,ce=J.arrow?.y,ie=J.arrow?.centerOffset!==0,[we,me]=x.useState();return Ct(()=>{j&&me(window.getComputedStyle(j).zIndex)},[j]),h.jsx("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[J.transformOrigin?.x,J.transformOrigin?.y].join(" "),...J.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(pT,{scope:r,placedSide:pe,placedAlign:G,onArrowChange:O,arrowX:de,arrowY:ce,shouldHideArrow:ie,children:h.jsx(ut.div,{"data-side":pe,"data-align":G,...S,ref:A,style:{...S.style,animation:W?S.style?.animation:"none"}})})})},"PopperContent"));function eS(n){return n!==null}Us(eS,"isNotNull");var gT=Us(n=>({name:"transformOrigin",options:n,fn(t){const{placement:s,rects:r,middlewareData:o}=t,u=o.arrow?.centerOffset!==0,d=u?0:n.arrowWidth,m=u?0:n.arrowHeight,[p,b]=md(s),v={start:"0%",center:"50%",end:"100%"}[b],y=(o.arrow?.x??0)+d/2,E=(o.arrow?.y??0)+m/2;let _="",T="";return p==="bottom"?(_=u?v:`${y}px`,T=`${-m}px`):p==="top"?(_=u?v:`${y}px`,T=`${r.floating.height+m}px`):p==="right"?(_=`${-m}px`,T=u?v:`${E}px`):p==="left"&&(_=`${r.floating.width+m}px`,T=u?v:`${E}px`),{data:{x:_,y:T}}}}),"transformOrigin");function md(n){const[t,s="center"]=n.split("-");return[t,s]}Us(md,"getSideAndAlignFromPlacement");var vT=Object.defineProperty,Ip=(n,t)=>vT(n,"name",{value:t,configurable:!0}),tm=!1;function tS(){const[n,t]=x.useState(tm);return x.useEffect(()=>{tm||(tm=!0,t(!0))},[]),n}Ip(tS,"useIsHydrated");var nS=Zs[" useSyncExternalStore ".trim().toString()];function aS(){return()=>{}}Ip(aS,"subscribe");function sS(){return nS(aS,()=>!0,()=>!1)}Ip(sS,"useIsHydratedModern");var yT=typeof nS=="function"?sS:tS,bT=Object.defineProperty,$r=(n,t)=>bT(n,"name",{value:t,configurable:!0}),nm="rovingFocusGroup.onEntryFocus",xT={bubbles:!1,cancelable:!0},pd="RovingFocusGroup",[$m,rS,wT]=ed(pd),[ST,iS]=Qn(pd,[wT]),Yb={Vertical:"vertical",Horizontal:"horizontal"},ET={RTL:"rtl"},[_T,CT]=ST(pd),AT=x.forwardRef($r(function(t,s){return h.jsx($m.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx($m.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(jT,{...t,ref:s})})})},"RovingFocusGroup")),jT=x.forwardRef($r(function(t,s){const{__scopeRovingFocusGroup:r,orientation:o,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:b,preventScrollOnEntryFocus:v=!1,...y}=t,E=x.useRef(null),_=We(s,E),T=td(u),[S,C]=jr({prop:d,defaultProp:m??null,onChange:p,caller:pd}),[j,k]=x.useState(!1),A=In(b),R=rS(r),O=x.useRef(!1),[M,z]=x.useState(0);return x.useEffect(()=>{const L=E.current;if(L)return L.addEventListener(nm,A),()=>L.removeEventListener(nm,A)},[A]),h.jsx(_T,{scope:r,orientation:o,dir:T,loop:l,currentTabStopId:S,onItemFocus:x.useCallback(L=>C(L),[C]),onItemShiftTab:x.useCallback(()=>k(!0),[]),onFocusableItemAdd:x.useCallback(()=>z(L=>L+1),[]),onFocusableItemRemove:x.useCallback(()=>z(L=>L-1),[]),children:h.jsx(ut.div,{tabIndex:j||M===0?-1:0,"data-orientation":o,...y,ref:_,style:{outline:"none",...t.style},onMouseDown:Ae(t.onMouseDown,()=>{O.current=!0}),onFocus:Ae(t.onFocus,L=>{const V=!O.current;if(L.target===L.currentTarget&&V&&!j){const q=new CustomEvent(nm,xT);if(L.currentTarget.dispatchEvent(q),!q.defaultPrevented){const Y=R().filter($=>$.focusable),X=Y.find($=>$.active),ee=Y.find($=>$.id===S),U=[X,ee,...Y].filter(Boolean).map($=>$.ref.current);Hp(U,v)}}O.current=!1}),onBlur:Ae(t.onBlur,()=>k(!1))})})},"RovingFocusGroupImpl")),TT="RovingFocusGroupItem",kT=x.forwardRef($r(function(t,s){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:l=!1,tabStopId:u,children:d,...m}=t,p=Cn(),b=u||p,v=CT(TT,r),y=v.currentTabStopId===b,E=rS(r),{onFocusableItemAdd:_,onFocusableItemRemove:T,currentTabStopId:S}=v,C=yT();return Ct(()=>{if(!(!C||!o))return _(),()=>T()},[C,o,_,T]),x.useEffect(()=>{if(!(C||!o))return _(),()=>T()},[C,o,_,T]),h.jsx($m.ItemSlot,{scope:r,id:b,focusable:o,active:l,children:h.jsx(ut.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...m,ref:s,onMouseDown:Ae(t.onMouseDown,j=>{o?v.onItemFocus(b):j.preventDefault()}),onFocus:Ae(t.onFocus,()=>v.onItemFocus(b)),onKeyDown:Ae(t.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){v.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const k=lS(j,v.orientation,v.dir);if(k!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let R=E().filter(O=>O.focusable).map(O=>O.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const O=R.indexOf(j.currentTarget);R=v.loop?cS(R,O+1):R.slice(O+1)}setTimeout(()=>Hp(R))}}),children:typeof d=="function"?d({isCurrentTabStop:y,hasTabStop:S!=null}):d})})},"RovingFocusGroupItem")),NT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oS(n,t){return t!==ET.RTL?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}$r(oS,"getDirectionAwareKey");function lS(n,t,s){const r=oS(n.key,s);if(!(t===Yb.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===Yb.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return NT[r]}$r(lS,"getFocusIntent");function Hp(n,t=!1){const s=document.activeElement;for(const r of n)if(r===s||(r.focus({preventScroll:t}),document.activeElement!==s))return}$r(Hp,"focusFirst");function cS(n,t){return n.map((s,r)=>n[(t+r)%n.length])}$r(cS,"wrapArray");var OT=Object.defineProperty,ft=(n,t)=>OT(n,"name",{value:t,configurable:!0}),RT=["Enter"," "],DT=["ArrowDown","PageUp","Home"],uS=["ArrowUp","PageDown","End"],MT=[...DT,...uS],gd="Menu",[Pm,zT,LT]=ed(gd),[Pr,dS]=Qn(gd,[LT,oo,iS]),Vp=oo(),fS=iS(),[UT,Tl]=Pr(gd),[BT,qp]=Pr(gd),IT=ft(n=>{const{__scopeMenu:t,open:s=!1,children:r,dir:o,onOpenChange:l,modal:u=!0}=n,d=Vp(t),[m,p]=x.useState(null),b=x.useRef(!1),v=In(l),y=td(o);return x.useEffect(()=>{const E=ft(()=>{b.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},"handleKeyDown"),_=ft(()=>b.current=!1,"handlePointer");return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),x.useEffect(()=>{if(!s)return;const E=ft(()=>v(!1),"handleBlur");return window.addEventListener("blur",E),()=>window.removeEventListener("blur",E)},[s,v]),h.jsx(Lp,{...d,children:h.jsx(UT,{scope:t,open:s,onOpenChange:v,content:m,onContentChange:p,children:h.jsx(BT,{scope:t,onClose:x.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:b,dir:y,modal:u,children:r})})})},"Menu"),HT=x.forwardRef(ft(function(t,s){const{__scopeMenu:r,...o}=t,l=Vp(r);return h.jsx(Up,{...l,...o,ref:s})},"MenuAnchor")),hS="MenuPortal",[VT,qT]=Pr(hS,{forceMount:void 0}),$T=ft(n=>{const{__scopeMenu:t,forceMount:s,children:r,container:o}=n,l=Tl(hS,t);return h.jsx(VT,{scope:t,forceMount:s,children:h.jsx(Ks,{present:s||l.open,children:h.jsx(id,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Bs="MenuContent",[PT,mS]=Pr(Bs),GT=x.forwardRef(ft(function(t,s){const r=qT(Bs,t.__scopeMenu),{forceMount:o=r.forceMount,...l}=t,u=Tl(Bs,t.__scopeMenu),d=qp(Bs,t.__scopeMenu);return h.jsx(Pm.Provider,{scope:t.__scopeMenu,children:h.jsx(Ks,{present:o||u.open,children:h.jsx(Pm.Slot,{scope:t.__scopeMenu,children:d.modal?h.jsx(FT,{...l,ref:s}):h.jsx(ZT,{...l,ref:s})})})})},"MenuContent")),FT=x.forwardRef(ft(function(t,s){const r=Tl(Bs,t.__scopeMenu),o=x.useRef(null),l=We(s,o);return x.useEffect(()=>{const u=o.current;if(u)return jl(u)},[]),h.jsx(pS,{...t,ref:l,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ae(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),ZT=x.forwardRef(ft(function(t,s){const r=Tl(Bs,t.__scopeMenu);return h.jsx(pS,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),YT=Xn("MenuContent.ScrollLock"),pS=x.forwardRef(ft(function(t,s){const{__scopeMenu:r,loop:o=!1,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:m,onEntryFocus:p,onEscapeKeyDown:b,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:E,onDismiss:_,disableOutsideScroll:T,...S}=t,C=Tl(Bs,r),j=qp(Bs,r),k=Vp(r),A=fS(r),R=zT(r),[O,M]=x.useState(null),z=x.useRef(null),[L,V]=x.useState(null);Cp(L);const{nodes:q,registry:Y}=rd(),X=!!(l||T),ee=We(s,z,C.onContentChange,V),re=x.useRef(0),U=x.useRef(""),$=x.useRef(0),W=x.useRef(null),J=x.useRef("right"),Q=x.useRef(0),pe=x.useMemo(()=>T?[z,...q.map(ie=>({current:ie}))]:[],[z,q,T]),G=T?so:x.Fragment,te=T?{as:YT,allowPinchZoom:!0,shards:pe}:void 0,de=ft(ie=>{const we=U.current+ie,me=R().filter(ze=>!ze.disabled),he=document.activeElement,De=me.find(ze=>ze.ref.current===he)?.textValue,Oe=me.map(ze=>ze.textValue),Me=xS(Oe,we,De),He=me.find(ze=>ze.textValue===Me)?.ref.current;ft((function ze(ht){U.current=ht,window.clearTimeout(re.current),ht!==""&&(re.current=window.setTimeout(()=>ze(""),1e3))}),"updateSearch")(we),He&&setTimeout(()=>He.focus())},"handleTypeaheadSearch");x.useEffect(()=>()=>window.clearTimeout(re.current),[]),ao();const ce=x.useCallback(ie=>J.current===W.current?.side&&SS(ie,W.current?.area),[]);return h.jsx(PT,{scope:r,searchRef:U,onItemEnter:x.useCallback(ie=>{ce(ie)&&ie.preventDefault()},[ce]),onItemLeave:x.useCallback(ie=>{ce(ie)||(z.current?.focus(),M(null))},[ce]),onTriggerLeave:x.useCallback(ie=>{ce(ie)&&ie.preventDefault()},[ce]),pointerGraceTimerRef:$,onPointerGraceIntentChange:x.useCallback(ie=>{W.current=ie},[]),children:h.jsx(sd,{registry:X?Y:null,children:h.jsx(G,{...te,children:h.jsx(ad,{asChild:!0,trapped:l,branches:q,onMountAutoFocus:Ae(u,ie=>{ie.preventDefault(),z.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:b,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:E,onDismiss:_,children:h.jsx(AT,{asChild:!0,...A,dir:j.dir,orientation:"vertical",loop:o,currentTabStopId:O,onCurrentTabStopIdChange:M,onEntryFocus:Ae(p,ie=>{j.isUsingKeyboardRef.current||ie.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Bp,{role:"menu","aria-orientation":"vertical","data-state":gS(C.open),"data-radix-menu-content":"",dir:j.dir,...k,...S,ref:ee,style:{outline:"none",...S.style},onKeyDown:Ae(S.onKeyDown,ie=>{const me=ie.target.closest("[data-radix-menu-content]")===ie.currentTarget,he=ie.ctrlKey||ie.altKey||ie.metaKey,De=ie.key.length===1;me&&(ie.key==="Tab"&&ie.preventDefault(),!he&&De&&de(ie.key));const Oe=z.current;if(ie.target!==Oe||!MT.includes(ie.key))return;ie.preventDefault();const He=R().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);uS.includes(ie.key)&&He.reverse(),yS(He)}),onBlur:Ae(t.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(re.current),U.current="")}),onPointerMove:Ae(t.onPointerMove,Tu(ie=>{const we=ie.target,me=Q.current!==ie.clientX;if(ie.currentTarget.contains(we)&&me){const he=ie.clientX>Q.current?"right":"left";J.current=he,Q.current=ie.clientX}}))})})})})})})})},"MenuContentImpl")),KT=x.forwardRef(ft(function(t,s){const{__scopeMenu:r,...o}=t;return h.jsx(ut.div,{role:"group",...o,ref:s})},"MenuGroup")),Gm="MenuItem",Kb="menu.itemSelect",XT=x.forwardRef(ft(function(t,s){const{disabled:r=!1,onSelect:o,...l}=t,u=x.useRef(null),d=qp(Gm,t.__scopeMenu),m=mS(Gm,t.__scopeMenu),p=We(s,u),b=x.useRef(!1),v=ft(()=>{const y=u.current;if(!r&&y){const E=new CustomEvent(Kb,{bubbles:!0,cancelable:!0});y.addEventListener(Kb,_=>o?.(_),{once:!0}),Sp(y,E),E.defaultPrevented?b.current=!1:d.onClose()}},"handleSelect");return h.jsx(QT,{...l,ref:p,disabled:r,onClick:Ae(t.onClick,v),onPointerDown:y=>{t.onPointerDown?.(y),b.current=!0},onPointerUp:Ae(t.onPointerUp,y=>{b.current||y.currentTarget?.click()}),onKeyDown:Ae(t.onKeyDown,y=>{r||y.target!==y.currentTarget||m.searchRef.current!==""&&y.key===" "||RT.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})},"MenuItem")),QT=x.forwardRef(ft(function(t,s){const{__scopeMenu:r,disabled:o=!1,textValue:l,...u}=t,d=mS(Gm,r),m=fS(r),p=x.useRef(null),b=We(s,p),[v,y]=x.useState(!1),[E,_]=x.useState("");return x.useEffect(()=>{const T=p.current;T&&_((T.textContent??"").trim())},[u.children]),h.jsx(Pm.ItemSlot,{scope:r,disabled:o,textValue:l??E,children:h.jsx(kT,{asChild:!0,...m,focusable:!o,children:h.jsx(ut.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...u,ref:b,onPointerMove:Ae(t.onPointerMove,Tu(T=>{o?d.onItemLeave(T):(d.onItemEnter(T),T.defaultPrevented||T.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(t.onPointerLeave,Tu(T=>d.onItemLeave(T))),onFocus:Ae(t.onFocus,()=>y(!0)),onBlur:Ae(t.onBlur,()=>y(!1))})})})},"MenuItemImpl")),WT="MenuRadioGroup",[z8,L8]=Pr(WT,{value:void 0,onValueChange:ft(()=>{},"onValueChange")}),JT="MenuItemIndicator",[U8,B8]=Pr(JT,{checked:!1}),ek=x.forwardRef(ft(function(t,s){const{__scopeMenu:r,...o}=t;return h.jsx(ut.div,{role:"separator","aria-orientation":"horizontal",...o,ref:s})},"MenuSeparator")),tk="MenuSub",[I8,H8]=Pr(tk);function gS(n){return n?"open":"closed"}ft(gS,"getOpenState");function vS(n){return n==="indeterminate"}ft(vS,"isIndeterminate");function nk(n){return vS(n)?"indeterminate":n?"checked":"unchecked"}ft(nk,"getCheckedState");function yS(n){const t=document.activeElement;for(const s of n)if(s===t||(s.focus(),document.activeElement!==t))return}ft(yS,"focusFirst");function bS(n,t){return n.map((s,r)=>n[(t+r)%n.length])}ft(bS,"wrapArray");function xS(n,t,s){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=s?n.indexOf(s):-1;let u=bS(n,Math.max(l,0));o.length===1&&(u=u.filter(p=>p!==s));const m=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return m!==s?m:void 0}ft(xS,"getNextMatch");function wS(n,t){const{x:s,y:r}=n;let o=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const d=t[l],m=t[u],p=d.x,b=d.y,v=m.x,y=m.y;b>r!=y>r&&s<(v-p)*(r-b)/(y-b)+p&&(o=!o)}return o}ft(wS,"isPointInPolygon");function SS(n,t){if(!t)return!1;const s={x:n.clientX,y:n.clientY};return wS(s,t)}ft(SS,"isPointerInGraceArea");function Tu(n){return t=>t.pointerType==="mouse"?n(t):void 0}ft(Tu,"whenMouse");var ak=Object.defineProperty,Gr=(n,t)=>ak(n,"name",{value:t,configurable:!0}),$p="DropdownMenu",[sk,V8]=Qn($p,[dS]),Fr=dS(),[rk,ES]=sk($p),ik=Gr(n=>{const{__scopeDropdownMenu:t,children:s,dir:r,open:o,defaultOpen:l,onOpenChange:u,modal:d=!0}=n,m=Fr(t),p=x.useRef(null),[b,v]=jr({prop:o,defaultProp:l??!1,onChange:u,caller:$p});return h.jsx(rk,{scope:t,triggerId:Cn(),triggerRef:p,contentId:Cn(),open:b,onOpenChange:v,onOpenToggle:x.useCallback(()=>v(y=>!y),[v]),modal:d,children:h.jsx(IT,{...m,open:b,onOpenChange:v,dir:r,modal:d,children:s})})},"DropdownMenu"),ok="DropdownMenuTrigger",lk=x.forwardRef(Gr(function(t,s){const{__scopeDropdownMenu:r,disabled:o=!1,...l}=t,u=ES(ok,r),d=Fr(r),m=We(s,u.triggerRef);return h.jsx(HT,{asChild:!0,...d,children:h.jsx(ut.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:m,onPointerDown:Ae(t.onPointerDown,p=>{!o&&p.button===0&&p.ctrlKey===!1&&(u.onOpenToggle(),u.open||p.preventDefault())}),onKeyDown:Ae(t.onKeyDown,p=>{o||(["Enter"," "].includes(p.key)&&u.onOpenToggle(),p.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(p.key)&&p.preventDefault())})})})},"DropdownMenuTrigger")),ck=Gr(n=>{const{__scopeDropdownMenu:t,...s}=n,r=Fr(t);return h.jsx($T,{...r,...s})},"DropdownMenuPortal"),uk="DropdownMenuContent",dk=x.forwardRef(Gr(function(t,s){const{__scopeDropdownMenu:r,...o}=t,l=ES(uk,r),u=Fr(r),d=x.useRef(!1);return h.jsx(GT,{id:l.contentId,"aria-labelledby":l.triggerId,...u,...o,ref:s,onCloseAutoFocus:Ae(t.onCloseAutoFocus,m=>{d.current||l.triggerRef.current?.focus(),d.current=!1,m.preventDefault()}),onInteractOutside:Ae(t.onInteractOutside,m=>{const p=m.detail.originalEvent,b=p.button===0&&p.ctrlKey===!0,v=p.button===2||b;(!l.modal||v)&&(d.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),fk=x.forwardRef(Gr(function(t,s){const{__scopeDropdownMenu:r,...o}=t,l=Fr(r);return h.jsx(KT,{...l,...o,ref:s})},"DropdownMenuGroup")),hk=x.forwardRef(Gr(function(t,s){const{__scopeDropdownMenu:r,...o}=t,l=Fr(r);return h.jsx(XT,{...l,...o,ref:s})},"DropdownMenuItem")),mk=x.forwardRef(Gr(function(t,s){const{__scopeDropdownMenu:r,...o}=t,l=Fr(r);return h.jsx(ek,{...l,...o,ref:s})},"DropdownMenuSeparator")),pk=Object.defineProperty,gk=(n,t)=>pk(n,"name",{value:t,configurable:!0}),vk=x.forwardRef(gk(function(t,s){return h.jsx(ut.label,{...t,ref:s,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),yk=Object.defineProperty,bk=(n,t)=>yk(n,"name",{value:t,configurable:!0});function _S(n){const t=x.useRef({value:n,previous:n});return x.useMemo(()=>(t.current.value!==n&&(t.current.previous=t.current.value,t.current.value=n),t.current.previous),[n])}bk(_S,"usePrevious");var xk=Object.defineProperty,wk=(n,t)=>xk(n,"name",{value:t,configurable:!0});function Fm(n,[t,s]){return Math.min(s,Math.max(t,n))}wk(Fm,"clamp");var Sk=Object.defineProperty,ts=(n,t)=>Sk(n,"name",{value:t,configurable:!0}),Pp="Popover",[CS,q8]=Qn(Pp,[oo]),Gp=oo(),[Ek,lo]=CS(Pp),_k=ts(n=>{const{__scopePopover:t,children:s,open:r,defaultOpen:o,onOpenChange:l,modal:u=!1}=n,d=Gp(t),m=x.useRef(null),[p,b]=x.useState(!1),[v,y]=x.useState(0),[E,_]=x.useState(0),[T,S]=jr({prop:r,defaultProp:o??!1,onChange:l,caller:Pp});return h.jsx(Lp,{...d,children:h.jsx(Ek,{scope:t,contentId:Cn(),titleId:Cn(),descriptionId:Cn(),titlePresent:v>0,descriptionPresent:E>0,setTitleCount:y,setDescriptionCount:_,triggerRef:m,open:T,onOpenChange:S,onOpenToggle:x.useCallback(()=>S(C=>!C),[S]),hasCustomAnchor:p,onCustomAnchorAdd:x.useCallback(()=>b(!0),[]),onCustomAnchorRemove:x.useCallback(()=>b(!1),[]),modal:u,children:s})})},"Popover"),Ck="PopoverAnchor",Ak=x.forwardRef(ts(function(t,s){const{__scopePopover:r,...o}=t,l=lo(Ck,r),u=Gp(r),{onCustomAnchorAdd:d,onCustomAnchorRemove:m}=l;return x.useEffect(()=>(d(),()=>m()),[d,m]),h.jsx(Up,{...u,...o,ref:s})},"PopoverAnchor")),AS="PopoverPortal",[jk,Tk]=CS(AS,{forceMount:void 0}),kk=ts(n=>{const{__scopePopover:t,forceMount:s,children:r,container:o}=n,l=lo(AS,t);return h.jsx(jk,{scope:t,forceMount:s,children:h.jsx(Ks,{present:s||l.open,children:h.jsx(id,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),vl="PopoverContent",Nk=x.forwardRef(ts(function(t,s){const r=Tk(vl,t.__scopePopover),{forceMount:o=r.forceMount,...l}=t,u=lo(vl,t.__scopePopover);return h.jsx(Ks,{present:o||u.open,children:u.modal?h.jsx(Rk,{...l,ref:s}):h.jsx(Dk,{...l,ref:s})})},"PopoverContent")),Ok=Xn("PopoverContent.RemoveScroll"),Rk=x.forwardRef(ts(function(t,s){const r=lo(vl,t.__scopePopover),o=x.useRef(null),l=We(s,o),u=x.useRef(!1),{nodes:d,registry:m}=rd();return x.useEffect(()=>{const p=o.current;if(p)return jl(p)},[]),h.jsx(so,{as:Ok,allowPinchZoom:!0,shards:x.useMemo(()=>[o,...d.map(p=>({current:p}))],[o,d]),children:h.jsx(jS,{...t,ref:l,branchNodes:d,branchRegistry:m,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(t.onCloseAutoFocus,p=>{p.preventDefault(),u.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Ae(t.onPointerDownOutside,p=>{const b=p.detail.originalEvent,v=b.button===0&&b.ctrlKey===!0,y=b.button===2||v;u.current=y},{checkForDefaultPrevented:!1}),onFocusOutside:Ae(t.onFocusOutside,p=>p.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Dk=x.forwardRef(ts(function(t,s){const r=lo(vl,t.__scopePopover),o=x.useRef(!1),l=x.useRef(!1);return h.jsx(jS,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(o.current||r.triggerRef.current?.focus(),u.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;r.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"PopoverContentNonModal")),jS=x.forwardRef(ts(function(t,s){const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:b,onInteractOutside:v,"aria-describedby":y,branchNodes:E,branchRegistry:_,...T}=t,S=lo(vl,r),C=Gp(r),[j,k]=x.useState(null),A=We(s,k);return Cp(j),ao(),h.jsx(sd,{registry:_,children:h.jsx(ad,{asChild:!0,loop:!0,trapped:o,branches:E,onMountAutoFocus:l,onUnmountAutoFocus:u,children:h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:v,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:b,onDismiss:()=>S.onOpenChange(!1),deferPointerDownOutside:!0,children:h.jsx(Bp,{"data-state":TS(S.open),role:"dialog",id:S.contentId,"aria-labelledby":S.titlePresent?S.titleId:void 0,"aria-describedby":S.descriptionPresent?kS(y,S.descriptionId):y,...C,...T,ref:A,style:{...T.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function TS(n){return n?"open":"closed"}ts(TS,"getState");function kS(...n){const t=new Set;for(const s of n)if(typeof s=="string")for(const r of String(s).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}ts(kS,"concatAriaDescribedby");var Mk=Object.defineProperty,Xe=(n,t)=>Mk(n,"name",{value:t,configurable:!0}),Xb={ItemAligned:"item-aligned",Popper:"popper"},zk={RTL:"rtl"},Lk=[" ","Enter","ArrowUp","ArrowDown"],Uk=[" ","Enter"],Qi="Select",[vd,yd,Bk]=ed(Qi),[Zr,$8]=Qn(Qi,[Bk,oo]),Fp=oo(),[Ik,Qs]=Zr(Qi),[Hk,Vk]=Zr(Qi);function NS(n){const{__scopeSelect:t,children:s,open:r,defaultOpen:o,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:b,autoComplete:v,disabled:y,required:E,form:_,internal_do_not_use_render:T}=n,S=Fp(t),[C,j]=x.useState(null),[k,A]=x.useState(null),[R,O]=x.useState(!1),M=td(p),[z,L]=jr({prop:r,defaultProp:o??!1,onChange:l,caller:Qi}),[V,q]=jr({prop:u,defaultProp:d,onChange:m,caller:Qi}),Y=x.useRef(null),X=x.useRef(V);x.useEffect(()=>{const G=_?C?.ownerDocument.getElementById(_):C?.form;if(G instanceof HTMLFormElement){const te=Xe(()=>q(X.current),"reset");return G.addEventListener("reset",te),()=>G.removeEventListener("reset",te)}},[_,C,q]);const ee=C?!!_||!!C.closest("form"):!0,[re,U]=x.useState(new Set),$=Cn(),W=Array.from(re).map(G=>G.props.value).join(";"),J=x.useCallback(G=>{U(te=>new Set(te).add(G))},[]),Q=x.useCallback(G=>{U(te=>{const de=new Set(te);return de.delete(G),de})},[]),pe={required:E,trigger:C,onTriggerChange:j,valueNode:k,onValueNodeChange:A,valueNodeHasChildren:R,onValueNodeHasChildrenChange:O,contentId:$,value:V,onValueChange:q,open:z,onOpenChange:L,dir:M,triggerPointerDownPosRef:Y,disabled:y,name:b,autoComplete:v,form:_,nativeOptions:re,nativeSelectKey:W,isFormControl:ee};return h.jsx(Lp,{...S,children:h.jsx(Ik,{scope:t,...pe,children:h.jsx(vd.Provider,{scope:t,children:h.jsx(Hk,{scope:t,onNativeOptionAdd:J,onNativeOptionRemove:Q,children:MS(T)?T(pe):s})})})})}Xe(NS,"SelectProvider");var qk=Xe(n=>{const{__scopeSelect:t,children:s,...r}=n;return h.jsx(NS,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:o})=>h.jsxs(h.Fragment,{children:[s,o?h.jsx(g6,{__scopeSelect:t}):null]})})},"Select"),$k="SelectTrigger",Pk=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,disabled:o=!1,...l}=t,u=Fp(r),d=Qs($k,r),m=d.disabled||o,p=We(s,d.onTriggerChange),b=yd(r),v=x.useRef("touch"),[y,E,_]=Yp(S=>{const C=b().filter(A=>!A.disabled),j=C.find(A=>A.value===d.value),k=Kp(C,S,j);k!==void 0&&d.onValueChange(k.value)}),T=Xe(S=>{m||(d.onOpenChange(!0),_()),S&&(d.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})},"handleOpen");return h.jsx(Up,{asChild:!0,...u,children:h.jsx(ut.button,{type:"button",role:"combobox","aria-controls":d.open?d.contentId:void 0,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":kl(d.value)?"":void 0,...l,ref:p,onClick:Ae(l.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&T(S)}),onPointerDown:Ae(l.onPointerDown,S=>{v.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(T(S),S.preventDefault())}),onKeyDown:Ae(l.onKeyDown,S=>{const C=y.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&E(S.key),!(C&&S.key===" ")&&Lk.includes(S.key)&&(T(),S.preventDefault())})})})},"SelectTrigger")),Gk="SelectValue",Fk=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,className:o,style:l,children:u,placeholder:d="",...m}=t,p=Qs(Gk,r),{onValueNodeHasChildrenChange:b}=p,v=u!==void 0,y=We(s,p.onValueNodeChange);Ct(()=>{b(v)},[b,v]);const E=kl(p.value);return h.jsx(ut.span,{...m,asChild:E?!1:m.asChild,ref:y,style:{pointerEvents:"none"},children:h.jsx(x.Fragment,{children:E?d:u},E?"placeholder":"value")})},"SelectValue")),Zk=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,children:o,...l}=t;return h.jsx(ut.span,{"aria-hidden":!0,...l,ref:s,children:o||"▼"})},"SelectIcon")),Yk="SelectPortal",[Kk,Xk]=Zr(Yk,{forceMount:void 0}),Qk=Xe(n=>{const{__scopeSelect:t,forceMount:s,...r}=n;return h.jsx(Kk,{scope:n.__scopeSelect,forceMount:s,children:h.jsx(id,{asChild:!0,...r})})},"SelectPortal"),Nr="SelectContent",Wk=x.forwardRef(Xe(function(t,s){const r=Xk(Nr,t.__scopeSelect),{forceMount:o=r.forceMount,...l}=t,u=Qs(Nr,t.__scopeSelect),[d,m]=x.useState();return Ct(()=>{m(new DocumentFragment)},[]),h.jsx(Ks,{present:o||u.open,children:({present:p})=>p?h.jsx(t6,{...l,ref:s}):h.jsx(Jk,{...l,fragment:d})})},"SelectContent")),Jk=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,children:o,fragment:l}=t;return l?qr.createPortal(h.jsx(OS,{scope:r,children:h.jsx(vd.Slot,{scope:r,children:h.jsx("div",{ref:s,children:o})})}),l):null},"SelectContentFragment")),Zn=10,[OS,Yr]=Zr(Nr),e6=Xn("SelectContent.RemoveScroll"),t6=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r}=t,{position:o=Xb.ItemAligned,onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:m,sideOffset:p,align:b,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:_,sticky:T,hideWhenDetached:S,avoidCollisions:C,...j}=t,k=Qs(Nr,r),[A,R]=x.useState(null),[O,M]=x.useState(null),z=We(s,R),[L,V]=x.useState(null),[q,Y]=x.useState(null),X=yd(r),[ee,re]=x.useState(!1),U=x.useRef(!1);x.useEffect(()=>{if(A)return jl(A)},[A]),ao();const $=x.useCallback(me=>{const[he,...De]=X().map(He=>He.ref.current),[Oe]=De.slice(-1),Me=document.activeElement;for(const He of me)if(He===Me||(He?.scrollIntoView({block:"nearest"}),He===he&&O&&(O.scrollTop=0),He===Oe&&O&&(O.scrollTop=O.scrollHeight),He?.focus(),document.activeElement!==Me))return},[X,O]),W=x.useCallback(()=>$([L,A]),[$,L,A]);x.useEffect(()=>{ee&&W()},[ee,W]);const{onOpenChange:J,triggerPointerDownPosRef:Q}=k;x.useEffect(()=>{if(A){let me={x:0,y:0};const he=Xe(Oe=>{me={x:Math.abs(Math.round(Oe.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(Oe.pageY)-(Q.current?.y??0))}},"handlePointerMove"),De=Xe(Oe=>{me.x<=10&&me.y<=10?Oe.preventDefault():Oe.composedPath().includes(A)||J(!1),document.removeEventListener("pointermove",he),Q.current=null},"handlePointerUp");return Q.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",De,{capture:!0})}}},[A,J,Q]),x.useEffect(()=>{const me=Xe(()=>J(!1),"close");return window.addEventListener("blur",me),window.addEventListener("resize",me),()=>{window.removeEventListener("blur",me),window.removeEventListener("resize",me)}},[J]);const[pe,G]=Yp(me=>{const he=X().filter(Me=>!Me.disabled),De=he.find(Me=>Me.ref.current===document.activeElement),Oe=Kp(he,me,De);Oe&&setTimeout(()=>Oe.ref.current?.focus())}),te=x.useCallback((me,he,De)=>{const Oe=!U.current&&!De;(k.value!==void 0&&k.value===he||Oe)&&(V(me),Oe&&(U.current=!0))},[k.value]),de=x.useCallback(()=>A?.focus(),[A]),ce=x.useCallback((me,he,De)=>{const Oe=!U.current&&!De;(k.value!==void 0&&k.value===he||Oe)&&Y(me)},[k.value]),ie=o===Xb.Popper?Qb:n6,we=ie===Qb?{side:m,sideOffset:p,align:b,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:_,sticky:T,hideWhenDetached:S,avoidCollisions:C}:{};return h.jsx(OS,{scope:r,content:A,viewport:O,onViewportChange:M,itemRefCallback:te,selectedItem:L,onItemLeave:de,itemTextRefCallback:ce,focusSelectedItem:W,selectedItemText:q,position:o,isPositioned:ee,searchRef:pe,children:h.jsx(so,{as:e6,allowPinchZoom:!0,children:h.jsx(ad,{asChild:!0,trapped:k.open,onMountAutoFocus:me=>{me.preventDefault()},onUnmountAutoFocus:Ae(l,me=>{k.trigger?.focus({preventScroll:!0}),me.preventDefault()}),children:h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:me=>me.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:h.jsx(ie,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:me=>me.preventDefault(),...j,...we,onPlaced:()=>re(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ae(j.onKeyDown,me=>{const he=me.ctrlKey||me.altKey||me.metaKey;if(me.key==="Tab"&&me.preventDefault(),!he&&me.key.length===1&&G(me.key),["ArrowUp","ArrowDown","Home","End"].includes(me.key)){let Oe=X().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(me.key)&&(Oe=Oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(me.key)){const Me=me.target,He=Oe.indexOf(Me);Oe=Oe.slice(He+1)}setTimeout(()=>$(Oe)),me.preventDefault()}})})})})})})},"SelectContentImpl")),n6=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,onPlaced:o,...l}=t,u=Qs(Nr,r),d=Yr(Nr,r),[m,p]=x.useState(null),[b,v]=x.useState(null),y=We(s,v),E=yd(r),_=x.useRef(!1),T=x.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:j,focusSelectedItem:k}=d,A=x.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&b&&S&&C&&j){const z=u.trigger.getBoundingClientRect(),L=b.getBoundingClientRect(),V=u.valueNode.getBoundingClientRect(),q=j.getBoundingClientRect();if(u.dir!==zk.RTL){const Me=q.left-L.left,He=V.left-Me,ze=z.left-He,ht=z.width+ze,qn=Math.max(ht,L.width),se=window.innerWidth-Zn,Re=Fm(He,[Zn,Math.max(Zn,se-qn)]);m.style.minWidth=ht+"px",m.style.left=Re+"px"}else{const Me=L.right-q.right,He=window.innerWidth-V.right-Me,ze=window.innerWidth-z.right-He,ht=z.width+ze,qn=Math.max(ht,L.width),se=window.innerWidth-Zn,Re=Fm(He,[Zn,Math.max(Zn,se-qn)]);m.style.minWidth=ht+"px",m.style.right=Re+"px"}const Y=E(),X=window.innerHeight-Zn*2,ee=S.scrollHeight,re=window.getComputedStyle(b),U=parseInt(re.borderTopWidth,10),$=parseInt(re.paddingTop,10),W=parseInt(re.borderBottomWidth,10),J=parseInt(re.paddingBottom,10),Q=U+$+ee+J+W,pe=Math.min(C.offsetHeight*5,Q),G=window.getComputedStyle(S),te=parseInt(G.paddingTop,10),de=parseInt(G.paddingBottom,10),ce=z.top+z.height/2-Zn,ie=X-ce,we=C.offsetHeight/2,me=C.offsetTop+we,he=U+$+me,De=Q-he;if(he<=ce){const Me=Y.length>0&&C===Y[Y.length-1].ref.current;m.style.bottom="0px";const He=b.clientHeight-S.offsetTop-S.offsetHeight,ze=Math.max(ie,we+(Me?de:0)+He+W),ht=he+ze;m.style.height=ht+"px"}else{const Me=Y.length>0&&C===Y[0].ref.current;m.style.top="0px";const ze=Math.max(ce,U+S.offsetTop+(Me?te:0)+we)+De;m.style.height=ze+"px",S.scrollTop=he-ce+S.offsetTop}m.style.margin=`${Zn}px 0`,m.style.minHeight=pe+"px",m.style.maxHeight=X+"px",o?.(),requestAnimationFrame(()=>_.current=!0)}},[E,u.trigger,u.valueNode,m,b,S,C,j,u.dir,o]);Ct(()=>A(),[A]);const[R,O]=x.useState();Ct(()=>{b&&O(window.getComputedStyle(b).zIndex)},[b]);const M=x.useCallback(z=>{z&&T.current===!0&&(A(),k?.(),T.current=!1)},[A,k]);return h.jsx(a6,{scope:r,contentWrapper:m,shouldExpandOnScrollRef:_,onScrollButtonChange:M,children:h.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:h.jsx(ut.div,{...l,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),Qb=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,align:o="start",collisionPadding:l=Zn,...u}=t,d=Fp(r);return h.jsx(Bp,{...d,...u,ref:s,align:o,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[a6,Zp]=Zr(Nr,{}),Wb="SelectViewport",s6=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,nonce:o,...l}=t,u=Yr(Wb,r),d=Zp(Wb,r),m=We(s,u.onViewportChange),p=x.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),h.jsx(vd.Slot,{scope:r,children:h.jsx(ut.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ae(l.onScroll,b=>{const v=b.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:E}=d;if(E?.current&&y){const _=Math.abs(p.current-v.scrollTop);if(_>0){const T=window.innerHeight-Zn*2,S=parseFloat(y.style.minHeight),C=parseFloat(y.style.height),j=Math.max(S,C);if(j<T){const k=j+_,A=Math.min(T,k),R=k-A;y.style.height=A+"px",y.style.bottom==="0px"&&(v.scrollTop=R>0?R:0,y.style.justifyContent="flex-end")}}}p.current=v.scrollTop})})})]})},"SelectViewport")),r6="SelectGroup",[i6,P8]=Zr(r6),o6=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,...o}=t,l=Cn();return h.jsx(i6,{scope:r,id:l,children:h.jsx(ut.div,{role:"group","aria-labelledby":l,...o,ref:s})})},"SelectGroup")),Zm="SelectItem",[l6,RS]=Zr(Zm),c6=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,value:o,disabled:l=!1,textValue:u,...d}=t,m=Qs(Zm,r),p=Yr(Zm,r),b=m.value===o,[v,y]=x.useState(u??""),[E,_]=x.useState(!1),T=In(A=>p.itemRefCallback?.(A,o,l)),S=We(s,T),C=Cn(),j=x.useRef("touch"),k=Xe(()=>{m.onValueChange(o),m.onOpenChange(!1)},"handleSelect");return h.jsx(l6,{scope:r,value:o,disabled:l,textId:C,isSelected:b,onItemTextChange:x.useCallback(A=>{y(R=>R||(A?.textContent??"").trim())},[]),children:h.jsx(vd.ItemSlot,{scope:r,value:o,disabled:l,textValue:v,children:h.jsx(ut.div,{role:"option","aria-labelledby":C,"data-highlighted":E?"":void 0,"aria-selected":b&&E,"data-state":b?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:S,onFocus:Ae(d.onFocus,()=>_(!0)),onBlur:Ae(d.onBlur,()=>_(!1)),onClick:Ae(d.onClick,()=>{l||j.current!=="mouse"&&k()}),onPointerUp:Ae(d.onPointerUp,()=>{l||j.current==="mouse"&&k()}),onPointerDown:Ae(d.onPointerDown,A=>{j.current=A.pointerType}),onPointerMove:Ae(d.onPointerMove,A=>{j.current=A.pointerType,l?p.onItemLeave?.():j.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(d.onPointerLeave,A=>{A.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:Ae(d.onKeyDown,A=>{l||A.target!==A.currentTarget||p.searchRef?.current!==""&&A.key===" "||(Uk.includes(A.key)&&k(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),ru="SelectItemText",u6=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,className:o,style:l,...u}=t,d=Qs(ru,r),m=Yr(ru,r),p=RS(ru,r),b=Vk(ru,r),[v,y]=x.useState(null),E=In(k=>m.itemTextRefCallback?.(k,p.value,p.disabled)),_=We(s,y,p.onItemTextChange,E),T=v?.textContent,S=x.useMemo(()=>h.jsx("option",{value:p.value,disabled:p.disabled,children:T},p.value),[p.disabled,p.value,T]),{onNativeOptionAdd:C,onNativeOptionRemove:j}=b;return Ct(()=>(C(S),()=>j(S)),[C,j,S]),h.jsxs(h.Fragment,{children:[h.jsx(ut.span,{id:p.textId,...u,ref:_}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren&&!kl(d.value)?qr.createPortal(u.children,d.valueNode):null]})},"SelectItemText")),d6="SelectItemIndicator",f6=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,...o}=t;return RS(d6,r).isSelected?h.jsx(ut.span,{"aria-hidden":!0,...o,ref:s}):null},"SelectItemIndicator")),Jb="SelectScrollUpButton",h6=x.forwardRef(Xe(function(t,s){const r=Yr(Jb,t.__scopeSelect),o=Zp(Jb,t.__scopeSelect),[l,u]=x.useState(!1),d=We(s,o.onScrollButtonChange);return Ct(()=>{if(r.viewport&&r.isPositioned){let m=function(){const b=p.scrollTop>0;u(b)};Xe(m,"handleScroll");const p=r.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),l?h.jsx(DS,{...t,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=r;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),ex="SelectScrollDownButton",m6=x.forwardRef(Xe(function(t,s){const r=Yr(ex,t.__scopeSelect),o=Zp(ex,t.__scopeSelect),[l,u]=x.useState(!1),d=We(s,o.onScrollButtonChange);return Ct(()=>{if(r.viewport&&r.isPositioned){let m=function(){const b=p.scrollHeight-p.clientHeight,v=Math.ceil(p.scrollTop)<b;u(v)};Xe(m,"handleScroll");const p=r.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),l?h.jsx(DS,{...t,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=r;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),DS=x.forwardRef(Xe(function(t,s){const{__scopeSelect:r,onAutoScroll:o,...l}=t,u=Yr("SelectScrollButton",r),d=x.useRef(null),m=yd(r),p=x.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return x.useEffect(()=>()=>p(),[p]),Ct(()=>{m().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),h.jsx(ut.div,{"aria-hidden":!0,...l,ref:s,style:{flexShrink:0,...l.style},onPointerDown:Ae(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(o,50))}),onPointerMove:Ae(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(o,50))}),onPointerLeave:Ae(l.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),p6="SelectBubbleInput",g6=x.forwardRef(Xe(function({__scopeSelect:t,...s},r){const o=Qs(p6,t),{value:l,onValueChange:u,required:d,disabled:m,name:p,autoComplete:b,form:v}=o,{nativeOptions:y,nativeSelectKey:E}=o,_=x.useRef(null),T=We(r,_),S=l??"",C=_S(S),j=Array.from(y).some(k=>(k.props.value??"")==="");return x.useEffect(()=>{const k=_.current;if(!k)return;const A=window.HTMLSelectElement.prototype,O=Object.getOwnPropertyDescriptor(A,"value").set;if(C!==S&&O){const M=new Event("change",{bubbles:!0});O.call(k,S),k.dispatchEvent(M)}},[C,S]),h.jsxs(ut.select,{"aria-hidden":!0,required:d,tabIndex:-1,name:p,autoComplete:b,disabled:m,form:v,onChange:k=>u(k.target.value),...s,style:{...yj,...s.style},ref:T,defaultValue:S,children:[kl(l)&&!j?h.jsx("option",{value:""}):null,Array.from(y)]},E)},"SelectBubbleInput"));function MS(n){return typeof n=="function"}Xe(MS,"isFunction");function kl(n){return n===""||n===void 0}Xe(kl,"shouldShowPlaceholder");function Yp(n){const t=In(n),s=x.useRef(""),r=x.useRef(0),o=x.useCallback(u=>{const d=s.current+u;t(d),Xe((function m(p){s.current=p,window.clearTimeout(r.current),p!==""&&(r.current=window.setTimeout(()=>m(""),1e3))}),"updateSearch")(d)},[t]),l=x.useCallback(()=>{s.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[s,o,l]}Xe(Yp,"useTypeaheadSearch");function Kp(n,t,s){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=s?n.indexOf(s):-1;let u=zS(n,Math.max(l,0));o.length===1&&(u=u.filter(p=>p!==s));const m=u.find(p=>p.textValue.toLowerCase().startsWith(o.toLowerCase()));return m!==s?m:void 0}Xe(Kp,"findNextItem");function zS(n,t){return n.map((s,r)=>n[(t+r)%n.length])}Xe(zS,"wrapArray");const tx=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,nx=_1,Xp=(n,t)=>s=>{var r;if(t?.variants==null)return nx(n,s?.class,s?.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(p=>{const b=s?.[p],v=l?.[p];if(b===null)return null;const y=tx(b)||tx(v);return o[p][y]}),d=s&&Object.entries(s).reduce((p,b)=>{let[v,y]=b;return y===void 0||(p[v]=y),p},{}),m=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((p,b)=>{let{class:v,className:y,...E}=b;return Object.entries(E).every(_=>{let[T,S]=_;return Array.isArray(S)?S.includes({...l,...d}[T]):{...l,...d}[T]===S})?[...p,v,y]:p},[]);return nx(n,u,m,s?.class,s?.className)},v6=Xp("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function yl({className:n,variant:t="default",size:s="default",asChild:r=!1,...o}){const l=r?cj:"button";return h.jsx(l,{"data-slot":"button","data-variant":t,"data-size":s,className:qe(v6({variant:t,size:s,className:n})),...o})}function y6({...n}){return h.jsx(Z4,{"data-slot":"alert-dialog",...n})}function b6({...n}){return h.jsx(Y4,{"data-slot":"alert-dialog-portal",...n})}function x6({className:n,...t}){return h.jsx(K4,{"data-slot":"alert-dialog-overlay",className:qe("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",n),...t})}function w6({className:n,size:t="default",...s}){return h.jsxs(b6,{children:[h.jsx(x6,{}),h.jsx(J4,{"data-slot":"alert-dialog-content","data-size":t,className:qe("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",n),...s})]})}function S6({className:n,...t}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:qe("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",n),...t})}function E6({className:n,...t}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:qe("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",n),...t})}function _6({className:n,...t}){return h.jsx(e3,{"data-slot":"alert-dialog-title",className:qe("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",n),...t})}function C6({className:n,...t}){return h.jsx(t3,{"data-slot":"alert-dialog-description",className:qe("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),...t})}function A6({className:n,variant:t="default",size:s="default",...r}){return h.jsx(yl,{variant:t,size:s,asChild:!0,children:h.jsx(n3,{"data-slot":"alert-dialog-action",className:qe(n),...r})})}function j6({className:n,variant:t="outline",size:s="default",...r}){return h.jsx(yl,{variant:t,size:s,asChild:!0,children:h.jsx(s3,{"data-slot":"alert-dialog-cancel",className:qe(n),...r})})}/**
|
|
51
|
+
* @license lucide-react v1.53.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const T6=n=>n?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
56
|
+
* @license lucide-react v1.53.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/function k6(n,t,s=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:T6(n),size:24,node:t,...s.length>0?{aliases:s}:{}}}/**
|
|
61
|
+
* @license lucide-react v1.53.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const N6=n=>{let t="",s=!1;for(const r of n){if(r==="-"||r==="_"||r<=" "){s=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=s?r.toUpperCase():r,s=!1}return t};/**
|
|
66
|
+
* @license lucide-react v1.53.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const O6=n=>{const t=N6(n);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
71
|
+
* @license lucide-react v1.53.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const Ym=(...n)=>n.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim();/**
|
|
76
|
+
* @license lucide-react v1.53.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const wr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
81
|
+
* @license lucide-react v1.53.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/function am(n){return n!=null}function R6(n,t={}){const s=t.attributeNames??{},r=y=>s[y]??y,o=n.size??n.width??wr.width,l=n.size??n.height??wr.height,u=n.aliases?.filter(y=>typeof y=="string"&&y.trim()!=="").map(y=>`lucide-${y}`)??[],d=[...n.name?[`lucide-${n.name}`]:[],...u],m=t.className?.split(" ").filter(Boolean)??[],p=t.includeDefaultClasses===!1?Ym(...m):Ym("lucide",...d,...m),b=t.absoluteStrokeWidth?Number(t.strokeWidth??wr["stroke-width"])*Number(n.size??n.width??wr.width)/Number(t.size??t.width??wr.width):t.strokeWidth??wr["stroke-width"];return["svg",{...Object.entries(wr).reduce((y,[E,_])=>(y[r(E)]=_,y),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&am(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&am(t.width)&&{[r("width")]:t.width},..."height"in t&&am(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:b,...p&&{[r("class")]:p},[r("viewBox")]:`0 0 ${o} ${l}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},n.node.map(y=>{const[E,_,T]=y,S=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",..._}:_;return T?[E,S,T]:[E,S]})]}/**
|
|
86
|
+
* @license lucide-react v1.53.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/function D6(n,t={}){return R6(n,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
91
|
+
* @license lucide-react v1.53.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const M6=n=>{for(const t in n)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},z6=x.createContext({}),L6=()=>x.useContext(z6),U6=x.forwardRef(({color:n,size:t,width:s,height:r,strokeWidth:o,absoluteStrokeWidth:l,nonScalingStroke:u,className:d="",children:m,iconNode:p=[],icon:b={node:p,aliases:[],size:24},...v},y)=>{const{size:E=24,strokeWidth:_=2,absoluteStrokeWidth:T=!1,nonScalingStroke:S=!1,color:C="currentColor",className:j=""}=L6()??{},k=!!m||M6(v),[A,R,O=[]]=D6(b,{color:n??C,width:s??t??E,height:r??t??E,strokeWidth:o??_,absoluteStrokeWidth:l??T,nonScalingStroke:u??S,className:Ym(j,d),hasA11yProp:k,attributes:v});return x.createElement(A,{ref:y,...R},[...O.map(([M,z])=>x.createElement(M,z)),...Array.isArray(m)?m:[m]])});/**
|
|
96
|
+
* @license lucide-react v1.53.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/function Nl(n,t=[],s=[]){const r=typeof n=="string"?k6(n,t,s):n,o=x.forwardRef(({className:l,...u},d)=>x.createElement(U6,{ref:d,icon:r,className:l,...u}));return r.name&&(o.displayName=O6(r.name)),o}/**
|
|
101
|
+
* @license lucide-react v1.53.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const LS={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};LS.node;const US=Nl(LS);/**
|
|
106
|
+
* @license lucide-react v1.53.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const BS={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};BS.node;const IS=Nl(BS);/**
|
|
111
|
+
* @license lucide-react v1.53.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const HS={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};HS.node;const B6=Nl(HS);/**
|
|
116
|
+
* @license lucide-react v1.53.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const VS={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};VS.node;const I6=Nl(VS);/**
|
|
121
|
+
* @license lucide-react v1.53.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const qS={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};qS.node;const H6=Nl(qS);function $S({...n}){return h.jsx(Tw,{"data-slot":"dialog",...n})}function V6({...n}){return h.jsx(Ow,{"data-slot":"dialog-portal",...n})}function q6({className:n,...t}){return h.jsx(Rw,{"data-slot":"dialog-overlay",className:qe("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",n),...t})}function PS({className:n,children:t,showCloseButton:s=!0,...r}){return h.jsxs(V6,{children:[h.jsx(q6,{}),h.jsxs(Dw,{"data-slot":"dialog-content",className:qe("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",n),...r,children:[t,s&&h.jsx(kp,{"data-slot":"dialog-close",asChild:!0,children:h.jsxs(yl,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[h.jsx(H6,{}),h.jsx("span",{className:"sr-only",children:"关闭弹窗"})]})})]})]})}function GS({className:n,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:qe("flex flex-col gap-2",n),...t})}function FS({className:n,...t}){return h.jsx(zw,{"data-slot":"dialog-title",className:qe("text-base leading-none font-medium",n),...t})}function ZS({className:n,...t}){return h.jsx(Lw,{"data-slot":"dialog-description",className:qe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),...t})}function $6({className:n,type:t,...s}){return h.jsx("input",{type:t,"data-slot":"input",className:qe("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),...s})}function P6({className:n,...t}){return h.jsx(vk,{"data-slot":"label",className:qe("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...t})}function Qp({className:n,...t}){return h.jsx("div",{"data-slot":"field-group",className:qe("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",n),...t})}const G6=Xp("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function ku({className:n,orientation:t="vertical",...s}){return h.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:qe(G6({orientation:t}),n),...s})}function Nu({className:n,...t}){return h.jsx(P6,{"data-slot":"field-label",className:qe("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",n),...t})}const YS=x.createContext(null);function co(){const n=x.useContext(YS);if(!n)throw new Error("缺少弹窗容器");return{choose:(t,s)=>n({kind:"choice",text:t,choices:s}),confirm:t=>n({kind:"confirm",text:t}).then(s=>s!==null),prompt:(t,s="")=>n({kind:"prompt",text:t,initial:s}),alert:t=>n({kind:"alert",text:t})}}function F6({children:n}){const[t,s]=x.useState(null),[r,o]=x.useState(""),l=x.useRef(null),u=x.useCallback(m=>l.current?Promise.resolve(null):(o(m.initial??""),s(m),new Promise(p=>{l.current=p})),[]);function d(m){const p=l.current;l.current=null,s(null),p?.(m)}return x.useEffect(()=>()=>{l.current?.(null),l.current=null},[]),h.jsxs(YS.Provider,{value:u,children:[n,t?.kind==="confirm"||t?.kind==="choice"?h.jsx(y6,{open:!0,onOpenChange:m=>{m||d(null)},children:h.jsxs(w6,{children:[h.jsxs(S6,{children:[h.jsx(_6,{children:"确认操作"}),h.jsx(C6,{children:t.text})]}),h.jsxs(E6,{children:[h.jsx(j6,{onClick:()=>d(null),children:"取消"}),(t.choices??[{value:"confirmed",label:"确认",destructive:!0}]).map(m=>h.jsx(A6,{variant:m.destructive?"destructive":"default",onClick:()=>d(m.value),children:m.label},m.value))]})]})}):t&&h.jsx($S,{open:!0,onOpenChange:m=>{m||d(null)},children:h.jsxs(PS,{children:[h.jsxs(GS,{children:[h.jsx(FS,{children:t.kind==="prompt"?t.text:"上下文用量"}),h.jsx(ZS,{className:t.kind==="prompt"?"sr-only":void 0,children:t.kind==="prompt"?"填写后保存,取消不会修改。":t.text})]}),h.jsx("form",{onSubmit:m=>{m.preventDefault(),d(r.trim())},children:h.jsxs(Qp,{children:[t.kind==="prompt"&&h.jsxs(ku,{children:[h.jsx(Nu,{htmlFor:"dialog-value",children:t.text}),h.jsx($6,{id:"dialog-value",autoFocus:!0,value:r,onChange:m=>o(m.target.value),required:!0})]}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(yl,{variant:"outline",type:"button",onClick:()=>d(null),children:"取消"}),h.jsx(yl,{type:"submit",disabled:t.kind==="prompt"&&!r.trim(),children:t.kind==="prompt"?"保存":"知道了"})]})]})})]})})]})}var sm={exports:{}},rl={},rm={exports:{}},im={};/**
|
|
126
|
+
* @license React
|
|
127
|
+
* scheduler.production.js
|
|
128
|
+
*
|
|
129
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the MIT license found in the
|
|
132
|
+
* LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/var ax;function Z6(){return ax||(ax=1,(function(n){function t(U,$){var W=U.length;U.push($);e:for(;0<W;){var J=W-1>>>1,Q=U[J];if(0<o(Q,$))U[J]=$,U[W]=Q,W=J;else break e}}function s(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var $=U[0],W=U.pop();if(W!==$){U[0]=W;e:for(var J=0,Q=U.length,pe=Q>>>1;J<pe;){var G=2*(J+1)-1,te=U[G],de=G+1,ce=U[de];if(0>o(te,W))de<Q&&0>o(ce,te)?(U[J]=ce,U[de]=W,J=de):(U[J]=te,U[G]=W,J=G);else if(de<Q&&0>o(ce,W))U[J]=ce,U[de]=W,J=de;else break e}}return $}function o(U,$){var W=U.sortIndex-$.sortIndex;return W!==0?W:U.id-$.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();n.unstable_now=function(){return u.now()-d}}var m=[],p=[],b=1,v=null,y=3,E=!1,_=!1,T=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function A(U){for(var $=s(p);$!==null;){if($.callback===null)r(p);else if($.startTime<=U)r(p),$.sortIndex=$.expirationTime,t(m,$);else break;$=s(p)}}function R(U){if(T=!1,A(U),!_)if(s(m)!==null)_=!0,O||(O=!0,Y());else{var $=s(p);$!==null&&re(R,$.startTime-U)}}var O=!1,M=-1,z=5,L=-1;function V(){return S?!0:!(n.unstable_now()-L<z)}function q(){if(S=!1,O){var U=n.unstable_now();L=U;var $=!0;try{e:{_=!1,T&&(T=!1,j(M),M=-1),E=!0;var W=y;try{t:{for(A(U),v=s(m);v!==null&&!(v.expirationTime>U&&V());){var J=v.callback;if(typeof J=="function"){v.callback=null,y=v.priorityLevel;var Q=J(v.expirationTime<=U);if(U=n.unstable_now(),typeof Q=="function"){v.callback=Q,A(U),$=!0;break t}v===s(m)&&r(m),A(U)}else r(m);v=s(m)}if(v!==null)$=!0;else{var pe=s(p);pe!==null&&re(R,pe.startTime-U),$=!1}}break e}finally{v=null,y=W,E=!1}$=void 0}}finally{$?Y():O=!1}}}var Y;if(typeof k=="function")Y=function(){k(q)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,ee=X.port2;X.port1.onmessage=q,Y=function(){ee.postMessage(null)}}else Y=function(){C(q,0)};function re(U,$){M=C(function(){U(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<U?Math.floor(1e3/U):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_next=function(U){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var W=y;y=$;try{return U()}finally{y=W}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(U,$){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var W=y;y=U;try{return $()}finally{y=W}},n.unstable_scheduleCallback=function(U,$,W){var J=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?J+W:J):W=J,U){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=W+Q,U={id:b++,callback:$,priorityLevel:U,startTime:W,expirationTime:Q,sortIndex:-1},W>J?(U.sortIndex=W,t(p,U),s(m)===null&&U===s(p)&&(T?(j(M),M=-1):T=!0,re(R,W-J))):(U.sortIndex=Q,t(m,U),_||E||(_=!0,O||(O=!0,Y()))),U},n.unstable_shouldYield=V,n.unstable_wrapCallback=function(U){var $=y;return function(){var W=y;y=$;try{return U.apply(this,arguments)}finally{y=W}}}})(im)),im}var sx;function Y6(){return sx||(sx=1,rm.exports=Z6()),rm.exports}/**
|
|
134
|
+
* @license React
|
|
135
|
+
* react-dom-client.production.js
|
|
136
|
+
*
|
|
137
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the MIT license found in the
|
|
140
|
+
* LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/var rx;function K6(){if(rx)return rl;rx=1;var n=Y6(),t=w1(),s=I1();function r(e){var a="https://react.dev/errors/"+e;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var a=e,i=e;if(e.alternate)for(;a.return;)a=a.return;else{e=a;do a=e,(a.flags&4098)!==0&&(i=a.return),e=a.return;while(e)}return a.tag===3?i:null}function u(e){if(e.tag===13){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function d(e){if(e.tag===31){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function m(e){if(l(e)!==e)throw Error(r(188))}function p(e){var a=e.alternate;if(!a){if(a=l(e),a===null)throw Error(r(188));return a!==e?null:e}for(var i=e,c=a;;){var f=i.return;if(f===null)break;var g=f.alternate;if(g===null){if(c=f.return,c!==null){i=c;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===i)return m(f),e;if(g===c)return m(f),a;g=g.sibling}throw Error(r(188))}if(i.return!==c.return)i=f,c=g;else{for(var w=!1,N=f.child;N;){if(N===i){w=!0,i=f,c=g;break}if(N===c){w=!0,c=f,i=g;break}N=N.sibling}if(!w){for(N=g.child;N;){if(N===i){w=!0,i=g,c=f;break}if(N===c){w=!0,c=g,i=f;break}N=N.sibling}if(!w)throw Error(r(189))}}if(i.alternate!==c)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:a}function b(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(a=b(e),a!==null)return a;e=e.sibling}return null}var v=Object.assign,y=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),k=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case C:return"Profiler";case S:return"StrictMode";case R:return"Suspense";case O:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case k:return e.displayName||"Context";case j:return(e._context.displayName||"Context")+".Consumer";case A:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return a=e.displayName||null,a!==null?a:ee(e.type)||"Memo";case z:a=e._payload,e=e._init;try{return ee(e(a))}catch{}}return null}var re=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},J=[],Q=-1;function pe(e){return{current:e}}function G(e){0>Q||(e.current=J[Q],J[Q]=null,Q--)}function te(e,a){Q++,J[Q]=e.current,e.current=a}var de=pe(null),ce=pe(null),ie=pe(null),we=pe(null);function me(e,a){switch(te(ie,a),te(ce,e),te(de,null),a.nodeType){case 9:case 11:e=(e=a.documentElement)&&(e=e.namespaceURI)?I0(e):0;break;default:if(e=a.tagName,a=a.namespaceURI)a=I0(a),e=H0(a,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(de),te(de,e)}function he(){G(de),G(ce),G(ie)}function De(e){e.memoizedState!==null&&te(we,e);var a=de.current,i=H0(a,e.type);a!==i&&(te(ce,e),te(de,i))}function Oe(e){ce.current===e&&(G(de),G(ce)),we.current===e&&(G(we),el._currentValue=W)}var Me,He;function ze(e){if(Me===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);Me=a&&a[1]||"",He=-1<i.stack.indexOf(`
|
|
142
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
143
|
+
`+Me+e+He}var ht=!1;function qn(e,a){if(!e||ht)return"";ht=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ne){var K=ne}Reflect.construct(e,[],le)}else{try{le.call()}catch(ne){K=ne}e.call(le.prototype)}}else{try{throw Error()}catch(ne){K=ne}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ne){if(ne&&K&&typeof ne.stack=="string")return[ne.stack,K.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=c.DetermineComponentFrameRoot(),w=g[0],N=g[1];if(w&&N){var B=w.split(`
|
|
144
|
+
`),Z=N.split(`
|
|
145
|
+
`);for(f=c=0;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;for(;f<Z.length&&!Z[f].includes("DetermineComponentFrameRoot");)f++;if(c===B.length||f===Z.length)for(c=B.length-1,f=Z.length-1;1<=c&&0<=f&&B[c]!==Z[f];)f--;for(;1<=c&&0<=f;c--,f--)if(B[c]!==Z[f]){if(c!==1||f!==1)do if(c--,f--,0>f||B[c]!==Z[f]){var ae=`
|
|
146
|
+
`+B[c].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=c&&0<=f);break}}}finally{ht=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ze(i):""}function se(e,a){switch(e.tag){case 26:case 27:case 5:return ze(e.type);case 16:return ze("Lazy");case 13:return e.child!==a&&a!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return qn(e.type,!1);case 11:return qn(e.type.render,!1);case 1:return qn(e.type,!0);case 31:return ze("Activity");default:return""}}function Re(e){try{var a="",i=null;do a+=se(e,i),i=e,e=e.return;while(e);return a}catch(c){return`
|
|
147
|
+
Error generating stack: `+c.message+`
|
|
148
|
+
`+c.stack}}var $e=Object.prototype.hasOwnProperty,Je=n.unstable_scheduleCallback,gt=n.unstable_cancelCallback,er=n.unstable_shouldYield,$t=n.unstable_requestPaint,At=n.unstable_now,kd=n.unstable_getCurrentPriorityLevel,vg=n.unstable_ImmediatePriority,yg=n.unstable_UserBlockingPriority,Dl=n.unstable_NormalPriority,VE=n.unstable_LowPriority,bg=n.unstable_IdlePriority,qE=n.log,$E=n.unstable_setDisableYieldValue,fo=null,gn=null;function ns(e){if(typeof qE=="function"&&$E(e),gn&&typeof gn.setStrictMode=="function")try{gn.setStrictMode(fo,e)}catch{}}var vn=Math.clz32?Math.clz32:FE,PE=Math.log,GE=Math.LN2;function FE(e){return e>>>=0,e===0?32:31-(PE(e)/GE|0)|0}var Ml=256,zl=262144,Ll=4194304;function tr(e){var a=e&42;if(a!==0)return a;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ul(e,a,i){var c=e.pendingLanes;if(c===0)return 0;var f=0,g=e.suspendedLanes,w=e.pingedLanes;e=e.warmLanes;var N=c&134217727;return N!==0?(c=N&~g,c!==0?f=tr(c):(w&=N,w!==0?f=tr(w):i||(i=N&~e,i!==0&&(f=tr(i))))):(N=c&~g,N!==0?f=tr(N):w!==0?f=tr(w):i||(i=c&~e,i!==0&&(f=tr(i)))),f===0?0:a!==0&&a!==f&&(a&g)===0&&(g=f&-f,i=a&-a,g>=i||g===32&&(i&4194048)!==0)?a:f}function ho(e,a){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&a)===0}function ZE(e,a){switch(e){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xg(){var e=Ll;return Ll<<=1,(Ll&62914560)===0&&(Ll=4194304),e}function Nd(e){for(var a=[],i=0;31>i;i++)a.push(e);return a}function mo(e,a){e.pendingLanes|=a,a!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function YE(e,a,i,c,f,g){var w=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var N=e.entanglements,B=e.expirationTimes,Z=e.hiddenUpdates;for(i=w&~i;0<i;){var ae=31-vn(i),le=1<<ae;N[ae]=0,B[ae]=-1;var K=Z[ae];if(K!==null)for(Z[ae]=null,ae=0;ae<K.length;ae++){var ne=K[ae];ne!==null&&(ne.lane&=-536870913)}i&=~le}c!==0&&wg(e,c,0),g!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=g&~(w&~a))}function wg(e,a,i){e.pendingLanes|=a,e.suspendedLanes&=~a;var c=31-vn(a);e.entangledLanes|=a,e.entanglements[c]=e.entanglements[c]|1073741824|i&261930}function Sg(e,a){var i=e.entangledLanes|=a;for(e=e.entanglements;i;){var c=31-vn(i),f=1<<c;f&a|e[c]&a&&(e[c]|=a),i&=~f}}function Eg(e,a){var i=a&-a;return i=(i&42)!==0?1:Od(i),(i&(e.suspendedLanes|a))!==0?0:i}function Od(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Rd(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _g(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:cb(e.type))}function Cg(e,a){var i=$.p;try{return $.p=e,a()}finally{$.p=i}}var as=Math.random().toString(36).slice(2),Pt="__reactFiber$"+as,rn="__reactProps$"+as,Xr="__reactContainer$"+as,Dd="__reactEvents$"+as,KE="__reactListeners$"+as,XE="__reactHandles$"+as,Ag="__reactResources$"+as,po="__reactMarker$"+as;function Md(e){delete e[Pt],delete e[rn],delete e[Dd],delete e[KE],delete e[XE]}function Qr(e){var a=e[Pt];if(a)return a;for(var i=e.parentNode;i;){if(a=i[Xr]||i[Pt]){if(i=a.alternate,a.child!==null||i!==null&&i.child!==null)for(e=Z0(e);e!==null;){if(i=e[Pt])return i;e=Z0(e)}return a}e=i,i=e.parentNode}return null}function Wr(e){if(e=e[Pt]||e[Xr]){var a=e.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return e}return null}function go(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e.stateNode;throw Error(r(33))}function Jr(e){var a=e[Ag];return a||(a=e[Ag]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ut(e){e[po]=!0}var jg=new Set,Tg={};function nr(e,a){ei(e,a),ei(e+"Capture",a)}function ei(e,a){for(Tg[e]=a,e=0;e<a.length;e++)jg.add(a[e])}var QE=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),kg={},Ng={};function WE(e){return $e.call(Ng,e)?!0:$e.call(kg,e)?!1:QE.test(e)?Ng[e]=!0:(kg[e]=!0,!1)}function Bl(e,a,i){if(WE(a))if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){e.removeAttribute(a);return}}e.setAttribute(a,""+i)}}function Il(e,a,i){if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttribute(a,""+i)}}function xa(e,a,i,c){if(c===null)e.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(a,i,""+c)}}function An(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Og(e){var a=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function JE(e,a,i){var c=Object.getOwnPropertyDescriptor(e.constructor.prototype,a);if(!e.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var f=c.get,g=c.set;return Object.defineProperty(e,a,{configurable:!0,get:function(){return f.call(this)},set:function(w){i=""+w,g.call(this,w)}}),Object.defineProperty(e,a,{enumerable:c.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){e._valueTracker=null,delete e[a]}}}}function zd(e){if(!e._valueTracker){var a=Og(e)?"checked":"value";e._valueTracker=JE(e,a,""+e[a])}}function Rg(e){if(!e)return!1;var a=e._valueTracker;if(!a)return!0;var i=a.getValue(),c="";return e&&(c=Og(e)?e.checked?"true":"false":e.value),e=c,e!==i?(a.setValue(e),!0):!1}function Hl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var e_=/[\n"\\]/g;function jn(e){return e.replace(e_,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Ld(e,a,i,c,f,g,w,N){e.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.type=w:e.removeAttribute("type"),a!=null?w==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+An(a)):e.value!==""+An(a)&&(e.value=""+An(a)):w!=="submit"&&w!=="reset"||e.removeAttribute("value"),a!=null?Ud(e,w,An(a)):i!=null?Ud(e,w,An(i)):c!=null&&e.removeAttribute("value"),f==null&&g!=null&&(e.defaultChecked=!!g),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+An(N):e.removeAttribute("name")}function Dg(e,a,i,c,f,g,w,N){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),a!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){zd(e);return}i=i!=null?""+An(i):"",a=a!=null?""+An(a):i,N||a===e.value||(e.value=a),e.defaultValue=a}c=c??f,c=typeof c!="function"&&typeof c!="symbol"&&!!c,e.checked=N?e.checked:!!c,e.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.name=w),zd(e)}function Ud(e,a,i){a==="number"&&Hl(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function ti(e,a,i,c){if(e=e.options,a){a={};for(var f=0;f<i.length;f++)a["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=a.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&c&&(e[i].defaultSelected=!0)}else{for(i=""+An(i),a=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,c&&(e[f].defaultSelected=!0);return}a!==null||e[f].disabled||(a=e[f])}a!==null&&(a.selected=!0)}}function Mg(e,a,i){if(a!=null&&(a=""+An(a),a!==e.value&&(e.value=a),i==null)){e.defaultValue!==a&&(e.defaultValue=a);return}e.defaultValue=i!=null?""+An(i):""}function zg(e,a,i,c){if(a==null){if(c!=null){if(i!=null)throw Error(r(92));if(re(c)){if(1<c.length)throw Error(r(93));c=c[0]}i=c}i==null&&(i=""),a=i}i=An(a),e.defaultValue=i,c=e.textContent,c===i&&c!==""&&c!==null&&(e.value=c),zd(e)}function ni(e,a){if(a){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=a;return}}e.textContent=a}var t_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Lg(e,a,i){var c=a.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?c?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="":c?e.setProperty(a,i):typeof i!="number"||i===0||t_.has(a)?a==="float"?e.cssFloat=i:e[a]=(""+i).trim():e[a]=i+"px"}function Ug(e,a,i){if(a!=null&&typeof a!="object")throw Error(r(62));if(e=e.style,i!=null){for(var c in i)!i.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?e.setProperty(c,""):c==="float"?e.cssFloat="":e[c]="");for(var f in a)c=a[f],a.hasOwnProperty(f)&&i[f]!==c&&Lg(e,f,c)}else for(var g in a)a.hasOwnProperty(g)&&Lg(e,g,a[g])}function Bd(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var n_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),a_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Vl(e){return a_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function wa(){}var Id=null;function Hd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ai=null,si=null;function Bg(e){var a=Wr(e);if(a&&(e=a.stateNode)){var i=e[rn]||null;e:switch(e=a.stateNode,a.type){case"input":if(Ld(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),a=i.name,i.type==="radio"&&a!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+jn(""+a)+'"][type="radio"]'),a=0;a<i.length;a++){var c=i[a];if(c!==e&&c.form===e.form){var f=c[rn]||null;if(!f)throw Error(r(90));Ld(c,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(a=0;a<i.length;a++)c=i[a],c.form===e.form&&Rg(c)}break e;case"textarea":Mg(e,i.value,i.defaultValue);break e;case"select":a=i.value,a!=null&&ti(e,!!i.multiple,a,!1)}}}var Vd=!1;function Ig(e,a,i){if(Vd)return e(a,i);Vd=!0;try{var c=e(a);return c}finally{if(Vd=!1,(ai!==null||si!==null)&&(Tc(),ai&&(a=ai,e=si,si=ai=null,Bg(a),e)))for(a=0;a<e.length;a++)Bg(e[a])}}function vo(e,a){var i=e.stateNode;if(i===null)return null;var c=i[rn]||null;if(c===null)return null;i=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(e=e.type,c=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!c;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,a,typeof i));return i}var Sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qd=!1;if(Sa)try{var yo={};Object.defineProperty(yo,"passive",{get:function(){qd=!0}}),window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{qd=!1}var ss=null,$d=null,ql=null;function Hg(){if(ql)return ql;var e,a=$d,i=a.length,c,f="value"in ss?ss.value:ss.textContent,g=f.length;for(e=0;e<i&&a[e]===f[e];e++);var w=i-e;for(c=1;c<=w&&a[i-c]===f[g-c];c++);return ql=f.slice(e,1<c?1-c:void 0)}function $l(e){var a=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&a===13&&(e=13)):e=a,e===10&&(e=13),32<=e||e===13?e:0}function Pl(){return!0}function Vg(){return!1}function on(e){function a(i,c,f,g,w){this._reactName=i,this._targetInst=f,this.type=c,this.nativeEvent=g,this.target=w,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(g):g[N]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Pl:Vg,this.isPropagationStopped=Vg,this}return v(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Pl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Pl)},persist:function(){},isPersistent:Pl}),a}var ar={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gl=on(ar),bo=v({},ar,{view:0,detail:0}),s_=on(bo),Pd,Gd,xo,Fl=v({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xo&&(xo&&e.type==="mousemove"?(Pd=e.screenX-xo.screenX,Gd=e.screenY-xo.screenY):Gd=Pd=0,xo=e),Pd)},movementY:function(e){return"movementY"in e?e.movementY:Gd}}),qg=on(Fl),r_=v({},Fl,{dataTransfer:0}),i_=on(r_),o_=v({},bo,{relatedTarget:0}),Fd=on(o_),l_=v({},ar,{animationName:0,elapsedTime:0,pseudoElement:0}),c_=on(l_),u_=v({},ar,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),d_=on(u_),f_=v({},ar,{data:0}),$g=on(f_),h_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},m_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},p_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function g_(e){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(e):(e=p_[e])?!!a[e]:!1}function Zd(){return g_}var v_=v({},bo,{key:function(e){if(e.key){var a=h_[e.key]||e.key;if(a!=="Unidentified")return a}return e.type==="keypress"?(e=$l(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?m_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zd,charCode:function(e){return e.type==="keypress"?$l(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$l(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),y_=on(v_),b_=v({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pg=on(b_),x_=v({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zd}),w_=on(x_),S_=v({},ar,{propertyName:0,elapsedTime:0,pseudoElement:0}),E_=on(S_),__=v({},Fl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),C_=on(__),A_=v({},ar,{newState:0,oldState:0}),j_=on(A_),T_=[9,13,27,32],Yd=Sa&&"CompositionEvent"in window,wo=null;Sa&&"documentMode"in document&&(wo=document.documentMode);var k_=Sa&&"TextEvent"in window&&!wo,Gg=Sa&&(!Yd||wo&&8<wo&&11>=wo),Fg=" ",Zg=!1;function Yg(e,a){switch(e){case"keyup":return T_.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ri=!1;function N_(e,a){switch(e){case"compositionend":return Kg(a);case"keypress":return a.which!==32?null:(Zg=!0,Fg);case"textInput":return e=a.data,e===Fg&&Zg?null:e;default:return null}}function O_(e,a){if(ri)return e==="compositionend"||!Yd&&Yg(e,a)?(e=Hg(),ql=$d=ss=null,ri=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Gg&&a.locale!=="ko"?null:a.data;default:return null}}var R_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xg(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a==="input"?!!R_[e.type]:a==="textarea"}function Qg(e,a,i,c){ai?si?si.push(c):si=[c]:ai=c,a=zc(a,"onChange"),0<a.length&&(i=new Gl("onChange","change",null,i,c),e.push({event:i,listeners:a}))}var So=null,Eo=null;function D_(e){D0(e,0)}function Zl(e){var a=go(e);if(Rg(a))return e}function Wg(e,a){if(e==="change")return a}var Jg=!1;if(Sa){var Kd;if(Sa){var Xd="oninput"in document;if(!Xd){var ev=document.createElement("div");ev.setAttribute("oninput","return;"),Xd=typeof ev.oninput=="function"}Kd=Xd}else Kd=!1;Jg=Kd&&(!document.documentMode||9<document.documentMode)}function tv(){So&&(So.detachEvent("onpropertychange",nv),Eo=So=null)}function nv(e){if(e.propertyName==="value"&&Zl(Eo)){var a=[];Qg(a,Eo,e,Hd(e)),Ig(D_,a)}}function M_(e,a,i){e==="focusin"?(tv(),So=a,Eo=i,So.attachEvent("onpropertychange",nv)):e==="focusout"&&tv()}function z_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zl(Eo)}function L_(e,a){if(e==="click")return Zl(a)}function U_(e,a){if(e==="input"||e==="change")return Zl(a)}function B_(e,a){return e===a&&(e!==0||1/e===1/a)||e!==e&&a!==a}var yn=typeof Object.is=="function"?Object.is:B_;function _o(e,a){if(yn(e,a))return!0;if(typeof e!="object"||e===null||typeof a!="object"||a===null)return!1;var i=Object.keys(e),c=Object.keys(a);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var f=i[c];if(!$e.call(a,f)||!yn(e[f],a[f]))return!1}return!0}function av(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sv(e,a){var i=av(e);e=0;for(var c;i;){if(i.nodeType===3){if(c=e+i.textContent.length,e<=a&&c>=a)return{node:i,offset:a-e};e=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=av(i)}}function rv(e,a){return e&&a?e===a?!0:e&&e.nodeType===3?!1:a&&a.nodeType===3?rv(e,a.parentNode):"contains"in e?e.contains(a):e.compareDocumentPosition?!!(e.compareDocumentPosition(a)&16):!1:!1}function iv(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var a=Hl(e.document);a instanceof e.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)e=a.contentWindow;else break;a=Hl(e.document)}return a}function Qd(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a&&(a==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||a==="textarea"||e.contentEditable==="true")}var I_=Sa&&"documentMode"in document&&11>=document.documentMode,ii=null,Wd=null,Co=null,Jd=!1;function ov(e,a,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Jd||ii==null||ii!==Hl(c)||(c=ii,"selectionStart"in c&&Qd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Co&&_o(Co,c)||(Co=c,c=zc(Wd,"onSelect"),0<c.length&&(a=new Gl("onSelect","select",null,a,i),e.push({event:a,listeners:c}),a.target=ii)))}function sr(e,a){var i={};return i[e.toLowerCase()]=a.toLowerCase(),i["Webkit"+e]="webkit"+a,i["Moz"+e]="moz"+a,i}var oi={animationend:sr("Animation","AnimationEnd"),animationiteration:sr("Animation","AnimationIteration"),animationstart:sr("Animation","AnimationStart"),transitionrun:sr("Transition","TransitionRun"),transitionstart:sr("Transition","TransitionStart"),transitioncancel:sr("Transition","TransitionCancel"),transitionend:sr("Transition","TransitionEnd")},ef={},lv={};Sa&&(lv=document.createElement("div").style,"AnimationEvent"in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),"TransitionEvent"in window||delete oi.transitionend.transition);function rr(e){if(ef[e])return ef[e];if(!oi[e])return e;var a=oi[e],i;for(i in a)if(a.hasOwnProperty(i)&&i in lv)return ef[e]=a[i];return e}var cv=rr("animationend"),uv=rr("animationiteration"),dv=rr("animationstart"),H_=rr("transitionrun"),V_=rr("transitionstart"),q_=rr("transitioncancel"),fv=rr("transitionend"),hv=new Map,tf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");tf.push("scrollEnd");function $n(e,a){hv.set(e,a),nr(a,[e])}var Yl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Tn=[],li=0,nf=0;function Kl(){for(var e=li,a=nf=li=0;a<e;){var i=Tn[a];Tn[a++]=null;var c=Tn[a];Tn[a++]=null;var f=Tn[a];Tn[a++]=null;var g=Tn[a];if(Tn[a++]=null,c!==null&&f!==null){var w=c.pending;w===null?f.next=f:(f.next=w.next,w.next=f),c.pending=f}g!==0&&mv(i,f,g)}}function Xl(e,a,i,c){Tn[li++]=e,Tn[li++]=a,Tn[li++]=i,Tn[li++]=c,nf|=c,e.lanes|=c,e=e.alternate,e!==null&&(e.lanes|=c)}function af(e,a,i,c){return Xl(e,a,i,c),Ql(e)}function ir(e,a){return Xl(e,null,null,a),Ql(e)}function mv(e,a,i){e.lanes|=i;var c=e.alternate;c!==null&&(c.lanes|=i);for(var f=!1,g=e.return;g!==null;)g.childLanes|=i,c=g.alternate,c!==null&&(c.childLanes|=i),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(f=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,f&&a!==null&&(f=31-vn(i),e=g.hiddenUpdates,c=e[f],c===null?e[f]=[a]:c.push(a),a.lane=i|536870912),g):null}function Ql(e){if(50<Zo)throw Zo=0,hh=null,Error(r(185));for(var a=e.return;a!==null;)e=a,a=e.return;return e.tag===3?e.stateNode:null}var ci={};function $_(e,a,i,c){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(e,a,i,c){return new $_(e,a,i,c)}function sf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ea(e,a){var i=e.alternate;return i===null?(i=bn(e.tag,a,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=a,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,a=e.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function pv(e,a){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=a,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,a=i.dependencies,e.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),e}function Wl(e,a,i,c,f,g){var w=0;if(c=e,typeof e=="function")sf(e)&&(w=1);else if(typeof e=="string")w=YC(e,i,de.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=bn(31,i,a,f),e.elementType=L,e.lanes=g,e;case T:return or(i.children,f,g,a);case S:w=8,f|=24;break;case C:return e=bn(12,i,a,f|2),e.elementType=C,e.lanes=g,e;case R:return e=bn(13,i,a,f),e.elementType=R,e.lanes=g,e;case O:return e=bn(19,i,a,f),e.elementType=O,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k:w=10;break e;case j:w=9;break e;case A:w=11;break e;case M:w=14;break e;case z:w=16,c=null;break e}w=29,i=Error(r(130,e===null?"null":typeof e,"")),c=null}return a=bn(w,i,a,f),a.elementType=e,a.type=c,a.lanes=g,a}function or(e,a,i,c){return e=bn(7,e,c,a),e.lanes=i,e}function rf(e,a,i){return e=bn(6,e,null,a),e.lanes=i,e}function gv(e){var a=bn(18,null,null,0);return a.stateNode=e,a}function of(e,a,i){return a=bn(4,e.children!==null?e.children:[],e.key,a),a.lanes=i,a.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},a}var vv=new WeakMap;function kn(e,a){if(typeof e=="object"&&e!==null){var i=vv.get(e);return i!==void 0?i:(a={value:e,source:a,stack:Re(a)},vv.set(e,a),a)}return{value:e,source:a,stack:Re(a)}}var ui=[],di=0,Jl=null,Ao=0,Nn=[],On=0,rs=null,na=1,aa="";function _a(e,a){ui[di++]=Ao,ui[di++]=Jl,Jl=e,Ao=a}function yv(e,a,i){Nn[On++]=na,Nn[On++]=aa,Nn[On++]=rs,rs=e;var c=na;e=aa;var f=32-vn(c)-1;c&=~(1<<f),i+=1;var g=32-vn(a)+f;if(30<g){var w=f-f%5;g=(c&(1<<w)-1).toString(32),c>>=w,f-=w,na=1<<32-vn(a)+f|i<<f|c,aa=g+e}else na=1<<g|i<<f|c,aa=e}function lf(e){e.return!==null&&(_a(e,1),yv(e,1,0))}function cf(e){for(;e===Jl;)Jl=ui[--di],ui[di]=null,Ao=ui[--di],ui[di]=null;for(;e===rs;)rs=Nn[--On],Nn[On]=null,aa=Nn[--On],Nn[On]=null,na=Nn[--On],Nn[On]=null}function bv(e,a){Nn[On++]=na,Nn[On++]=aa,Nn[On++]=rs,na=a.id,aa=a.overflow,rs=e}var Gt=null,mt=null,Ke=!1,is=null,Rn=!1,uf=Error(r(519));function os(e){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jo(kn(a,e)),uf}function xv(e){var a=e.stateNode,i=e.type,c=e.memoizedProps;switch(a[Pt]=e,a[rn]=c,i){case"dialog":Ge("cancel",a),Ge("close",a);break;case"iframe":case"object":case"embed":Ge("load",a);break;case"video":case"audio":for(i=0;i<Ko.length;i++)Ge(Ko[i],a);break;case"source":Ge("error",a);break;case"img":case"image":case"link":Ge("error",a),Ge("load",a);break;case"details":Ge("toggle",a);break;case"input":Ge("invalid",a),Dg(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ge("invalid",a);break;case"textarea":Ge("invalid",a),zg(a,c.value,c.defaultValue,c.children)}i=c.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||a.textContent===""+i||c.suppressHydrationWarning===!0||U0(a.textContent,i)?(c.popover!=null&&(Ge("beforetoggle",a),Ge("toggle",a)),c.onScroll!=null&&Ge("scroll",a),c.onScrollEnd!=null&&Ge("scrollend",a),c.onClick!=null&&(a.onclick=wa),a=!0):a=!1,a||os(e,!0)}function wv(e){for(Gt=e.return;Gt;)switch(Gt.tag){case 5:case 31:case 13:Rn=!1;return;case 27:case 3:Rn=!0;return;default:Gt=Gt.return}}function fi(e){if(e!==Gt)return!1;if(!Ke)return wv(e),Ke=!0,!1;var a=e.tag,i;if((i=a!==3&&a!==27)&&((i=a===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Th(e.type,e.memoizedProps)),i=!i),i&&mt&&os(e),wv(e),a===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));mt=F0(e)}else if(a===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));mt=F0(e)}else a===27?(a=mt,ws(e.type)?(e=Dh,Dh=null,mt=e):mt=a):mt=Gt?Mn(e.stateNode.nextSibling):null;return!0}function lr(){mt=Gt=null,Ke=!1}function df(){var e=is;return e!==null&&(dn===null?dn=e:dn.push.apply(dn,e),is=null),e}function jo(e){is===null?is=[e]:is.push(e)}var ff=pe(null),cr=null,Ca=null;function ls(e,a,i){te(ff,a._currentValue),a._currentValue=i}function Aa(e){e._currentValue=ff.current,G(ff)}function hf(e,a,i){for(;e!==null;){var c=e.alternate;if((e.childLanes&a)!==a?(e.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),e===i)break;e=e.return}}function mf(e,a,i,c){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var g=f.dependencies;if(g!==null){var w=f.child;g=g.firstContext;e:for(;g!==null;){var N=g;g=f;for(var B=0;B<a.length;B++)if(N.context===a[B]){g.lanes|=i,N=g.alternate,N!==null&&(N.lanes|=i),hf(g.return,i,e),c||(w=null);break e}g=N.next}}else if(f.tag===18){if(w=f.return,w===null)throw Error(r(341));w.lanes|=i,g=w.alternate,g!==null&&(g.lanes|=i),hf(w,i,e),w=null}else w=f.child;if(w!==null)w.return=f;else for(w=f;w!==null;){if(w===e){w=null;break}if(f=w.sibling,f!==null){f.return=w.return,w=f;break}w=w.return}f=w}}function hi(e,a,i,c){e=null;for(var f=a,g=!1;f!==null;){if(!g){if((f.flags&524288)!==0)g=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var w=f.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var N=f.type;yn(f.pendingProps.value,w.value)||(e!==null?e.push(N):e=[N])}}else if(f===we.current){if(w=f.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(el):e=[el])}f=f.return}e!==null&&mf(a,e,i,c),a.flags|=262144}function ec(e){for(e=e.firstContext;e!==null;){if(!yn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ur(e){cr=e,Ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return Sv(cr,e)}function tc(e,a){return cr===null&&ur(e),Sv(e,a)}function Sv(e,a){var i=a._currentValue;if(a={context:a,memoizedValue:i,next:null},Ca===null){if(e===null)throw Error(r(308));Ca=a,e.dependencies={lanes:0,firstContext:a},e.flags|=524288}else Ca=Ca.next=a;return i}var P_=typeof AbortController<"u"?AbortController:function(){var e=[],a=this.signal={aborted:!1,addEventListener:function(i,c){e.push(c)}};this.abort=function(){a.aborted=!0,e.forEach(function(i){return i()})}},G_=n.unstable_scheduleCallback,F_=n.unstable_NormalPriority,jt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pf(){return{controller:new P_,data:new Map,refCount:0}}function To(e){e.refCount--,e.refCount===0&&G_(F_,function(){e.controller.abort()})}var ko=null,gf=0,mi=0,pi=null;function Z_(e,a){if(ko===null){var i=ko=[];gf=0,mi=bh(),pi={status:"pending",value:void 0,then:function(c){i.push(c)}}}return gf++,a.then(Ev,Ev),a}function Ev(){if(--gf===0&&ko!==null){pi!==null&&(pi.status="fulfilled");var e=ko;ko=null,mi=0,pi=null;for(var a=0;a<e.length;a++)(0,e[a])()}}function Y_(e,a){var i=[],c={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){c.status="fulfilled",c.value=a;for(var f=0;f<i.length;f++)(0,i[f])(a)},function(f){for(c.status="rejected",c.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),c}var _v=U.S;U.S=function(e,a){o0=At(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&Z_(e,a),_v!==null&&_v(e,a)};var dr=pe(null);function vf(){var e=dr.current;return e!==null?e:dt.pooledCache}function nc(e,a){a===null?te(dr,dr.current):te(dr,a.pool)}function Cv(){var e=vf();return e===null?null:{parent:jt._currentValue,pool:e}}var gi=Error(r(460)),yf=Error(r(474)),ac=Error(r(542)),sc={then:function(){}};function Av(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jv(e,a,i){switch(i=e[i],i===void 0?e.push(a):i!==a&&(a.then(wa,wa),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,kv(e),e;default:if(typeof a.status=="string")a.then(wa,wa);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=a,e.status="pending",e.then(function(c){if(a.status==="pending"){var f=a;f.status="fulfilled",f.value=c}},function(c){if(a.status==="pending"){var f=a;f.status="rejected",f.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,kv(e),e}throw hr=a,gi}}function fr(e){try{var a=e._init;return a(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(hr=i,gi):i}}var hr=null;function Tv(){if(hr===null)throw Error(r(459));var e=hr;return hr=null,e}function kv(e){if(e===gi||e===ac)throw Error(r(483))}var vi=null,No=0;function rc(e){var a=No;return No+=1,vi===null&&(vi=[]),jv(vi,e,a)}function Oo(e,a){a=a.props.ref,e.ref=a!==void 0?a:null}function ic(e,a){throw a.$$typeof===y?Error(r(525)):(e=Object.prototype.toString.call(a),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":e)))}function Nv(e){function a(P,H){if(e){var F=P.deletions;F===null?(P.deletions=[H],P.flags|=16):F.push(H)}}function i(P,H){if(!e)return null;for(;H!==null;)a(P,H),H=H.sibling;return null}function c(P){for(var H=new Map;P!==null;)P.key!==null?H.set(P.key,P):H.set(P.index,P),P=P.sibling;return H}function f(P,H){return P=Ea(P,H),P.index=0,P.sibling=null,P}function g(P,H,F){return P.index=F,e?(F=P.alternate,F!==null?(F=F.index,F<H?(P.flags|=67108866,H):F):(P.flags|=67108866,H)):(P.flags|=1048576,H)}function w(P){return e&&P.alternate===null&&(P.flags|=67108866),P}function N(P,H,F,oe){return H===null||H.tag!==6?(H=rf(F,P.mode,oe),H.return=P,H):(H=f(H,F),H.return=P,H)}function B(P,H,F,oe){var Ce=F.type;return Ce===T?ae(P,H,F.props.children,oe,F.key):H!==null&&(H.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===z&&fr(Ce)===H.type)?(H=f(H,F.props),Oo(H,F),H.return=P,H):(H=Wl(F.type,F.key,F.props,null,P.mode,oe),Oo(H,F),H.return=P,H)}function Z(P,H,F,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==F.containerInfo||H.stateNode.implementation!==F.implementation?(H=of(F,P.mode,oe),H.return=P,H):(H=f(H,F.children||[]),H.return=P,H)}function ae(P,H,F,oe,Ce){return H===null||H.tag!==7?(H=or(F,P.mode,oe,Ce),H.return=P,H):(H=f(H,F),H.return=P,H)}function le(P,H,F){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=rf(""+H,P.mode,F),H.return=P,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case E:return F=Wl(H.type,H.key,H.props,null,P.mode,F),Oo(F,H),F.return=P,F;case _:return H=of(H,P.mode,F),H.return=P,H;case z:return H=fr(H),le(P,H,F)}if(re(H)||Y(H))return H=or(H,P.mode,F,null),H.return=P,H;if(typeof H.then=="function")return le(P,rc(H),F);if(H.$$typeof===k)return le(P,tc(P,H),F);ic(P,H)}return null}function K(P,H,F,oe){var Ce=H!==null?H.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Ce!==null?null:N(P,H,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case E:return F.key===Ce?B(P,H,F,oe):null;case _:return F.key===Ce?Z(P,H,F,oe):null;case z:return F=fr(F),K(P,H,F,oe)}if(re(F)||Y(F))return Ce!==null?null:ae(P,H,F,oe,null);if(typeof F.then=="function")return K(P,H,rc(F),oe);if(F.$$typeof===k)return K(P,H,tc(P,F),oe);ic(P,F)}return null}function ne(P,H,F,oe,Ce){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return P=P.get(F)||null,N(H,P,""+oe,Ce);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case E:return P=P.get(oe.key===null?F:oe.key)||null,B(H,P,oe,Ce);case _:return P=P.get(oe.key===null?F:oe.key)||null,Z(H,P,oe,Ce);case z:return oe=fr(oe),ne(P,H,F,oe,Ce)}if(re(oe)||Y(oe))return P=P.get(F)||null,ae(H,P,oe,Ce,null);if(typeof oe.then=="function")return ne(P,H,F,rc(oe),Ce);if(oe.$$typeof===k)return ne(P,H,F,tc(H,oe),Ce);ic(H,oe)}return null}function xe(P,H,F,oe){for(var Ce=null,tt=null,Se=H,Ue=H=0,Ze=null;Se!==null&&Ue<F.length;Ue++){Se.index>Ue?(Ze=Se,Se=null):Ze=Se.sibling;var nt=K(P,Se,F[Ue],oe);if(nt===null){Se===null&&(Se=Ze);break}e&&Se&&nt.alternate===null&&a(P,Se),H=g(nt,H,Ue),tt===null?Ce=nt:tt.sibling=nt,tt=nt,Se=Ze}if(Ue===F.length)return i(P,Se),Ke&&_a(P,Ue),Ce;if(Se===null){for(;Ue<F.length;Ue++)Se=le(P,F[Ue],oe),Se!==null&&(H=g(Se,H,Ue),tt===null?Ce=Se:tt.sibling=Se,tt=Se);return Ke&&_a(P,Ue),Ce}for(Se=c(Se);Ue<F.length;Ue++)Ze=ne(Se,P,Ue,F[Ue],oe),Ze!==null&&(e&&Ze.alternate!==null&&Se.delete(Ze.key===null?Ue:Ze.key),H=g(Ze,H,Ue),tt===null?Ce=Ze:tt.sibling=Ze,tt=Ze);return e&&Se.forEach(function(As){return a(P,As)}),Ke&&_a(P,Ue),Ce}function je(P,H,F,oe){if(F==null)throw Error(r(151));for(var Ce=null,tt=null,Se=H,Ue=H=0,Ze=null,nt=F.next();Se!==null&&!nt.done;Ue++,nt=F.next()){Se.index>Ue?(Ze=Se,Se=null):Ze=Se.sibling;var As=K(P,Se,nt.value,oe);if(As===null){Se===null&&(Se=Ze);break}e&&Se&&As.alternate===null&&a(P,Se),H=g(As,H,Ue),tt===null?Ce=As:tt.sibling=As,tt=As,Se=Ze}if(nt.done)return i(P,Se),Ke&&_a(P,Ue),Ce;if(Se===null){for(;!nt.done;Ue++,nt=F.next())nt=le(P,nt.value,oe),nt!==null&&(H=g(nt,H,Ue),tt===null?Ce=nt:tt.sibling=nt,tt=nt);return Ke&&_a(P,Ue),Ce}for(Se=c(Se);!nt.done;Ue++,nt=F.next())nt=ne(Se,P,Ue,nt.value,oe),nt!==null&&(e&&nt.alternate!==null&&Se.delete(nt.key===null?Ue:nt.key),H=g(nt,H,Ue),tt===null?Ce=nt:tt.sibling=nt,tt=nt);return e&&Se.forEach(function(rA){return a(P,rA)}),Ke&&_a(P,Ue),Ce}function ct(P,H,F,oe){if(typeof F=="object"&&F!==null&&F.type===T&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case E:e:{for(var Ce=F.key;H!==null;){if(H.key===Ce){if(Ce=F.type,Ce===T){if(H.tag===7){i(P,H.sibling),oe=f(H,F.props.children),oe.return=P,P=oe;break e}}else if(H.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===z&&fr(Ce)===H.type){i(P,H.sibling),oe=f(H,F.props),Oo(oe,F),oe.return=P,P=oe;break e}i(P,H);break}else a(P,H);H=H.sibling}F.type===T?(oe=or(F.props.children,P.mode,oe,F.key),oe.return=P,P=oe):(oe=Wl(F.type,F.key,F.props,null,P.mode,oe),Oo(oe,F),oe.return=P,P=oe)}return w(P);case _:e:{for(Ce=F.key;H!==null;){if(H.key===Ce)if(H.tag===4&&H.stateNode.containerInfo===F.containerInfo&&H.stateNode.implementation===F.implementation){i(P,H.sibling),oe=f(H,F.children||[]),oe.return=P,P=oe;break e}else{i(P,H);break}else a(P,H);H=H.sibling}oe=of(F,P.mode,oe),oe.return=P,P=oe}return w(P);case z:return F=fr(F),ct(P,H,F,oe)}if(re(F))return xe(P,H,F,oe);if(Y(F)){if(Ce=Y(F),typeof Ce!="function")throw Error(r(150));return F=Ce.call(F),je(P,H,F,oe)}if(typeof F.then=="function")return ct(P,H,rc(F),oe);if(F.$$typeof===k)return ct(P,H,tc(P,F),oe);ic(P,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,H!==null&&H.tag===6?(i(P,H.sibling),oe=f(H,F),oe.return=P,P=oe):(i(P,H),oe=rf(F,P.mode,oe),oe.return=P,P=oe),w(P)):i(P,H)}return function(P,H,F,oe){try{No=0;var Ce=ct(P,H,F,oe);return vi=null,Ce}catch(Se){if(Se===gi||Se===ac)throw Se;var tt=bn(29,Se,null,P.mode);return tt.lanes=oe,tt.return=P,tt}finally{}}}var mr=Nv(!0),Ov=Nv(!1),cs=!1;function bf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xf(e,a){e=e.updateQueue,a.updateQueue===e&&(a.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function us(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ds(e,a,i){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(st&2)!==0){var f=c.pending;return f===null?a.next=a:(a.next=f.next,f.next=a),c.pending=a,a=Ql(e),mv(e,null,i),a}return Xl(e,c,a,i),Ql(e)}function Ro(e,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var c=a.lanes;c&=e.pendingLanes,i|=c,a.lanes=i,Sg(e,i)}}function wf(e,a){var i=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var f=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?f=g=w:g=g.next=w,i=i.next}while(i!==null);g===null?f=g=a:g=g.next=a}else f=g=a;i={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=a:e.next=a,i.lastBaseUpdate=a}var Sf=!1;function Do(){if(Sf){var e=pi;if(e!==null)throw e}}function Mo(e,a,i,c){Sf=!1;var f=e.updateQueue;cs=!1;var g=f.firstBaseUpdate,w=f.lastBaseUpdate,N=f.shared.pending;if(N!==null){f.shared.pending=null;var B=N,Z=B.next;B.next=null,w===null?g=Z:w.next=Z,w=B;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,N=ae.lastBaseUpdate,N!==w&&(N===null?ae.firstBaseUpdate=Z:N.next=Z,ae.lastBaseUpdate=B))}if(g!==null){var le=f.baseState;w=0,ae=Z=B=null,N=g;do{var K=N.lane&-536870913,ne=K!==N.lane;if(ne?(Fe&K)===K:(c&K)===K){K!==0&&K===mi&&(Sf=!0),ae!==null&&(ae=ae.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var xe=e,je=N;K=a;var ct=i;switch(je.tag){case 1:if(xe=je.payload,typeof xe=="function"){le=xe.call(ct,le,K);break e}le=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=je.payload,K=typeof xe=="function"?xe.call(ct,le,K):xe,K==null)break e;le=v({},le,K);break e;case 2:cs=!0}}K=N.callback,K!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=f.callbacks,ne===null?f.callbacks=[K]:ne.push(K))}else ne={lane:K,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ae===null?(Z=ae=ne,B=le):ae=ae.next=ne,w|=K;if(N=N.next,N===null){if(N=f.shared.pending,N===null)break;ne=N,N=ne.next,ne.next=null,f.lastBaseUpdate=ne,f.shared.pending=null}}while(!0);ae===null&&(B=le),f.baseState=B,f.firstBaseUpdate=Z,f.lastBaseUpdate=ae,g===null&&(f.shared.lanes=0),gs|=w,e.lanes=w,e.memoizedState=le}}function Rv(e,a){if(typeof e!="function")throw Error(r(191,e));e.call(a)}function Dv(e,a){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Rv(i[e],a)}var yi=pe(null),oc=pe(0);function Mv(e,a){e=za,te(oc,e),te(yi,a),za=e|a.baseLanes}function Ef(){te(oc,za),te(yi,yi.current)}function _f(){za=oc.current,G(yi),G(oc)}var xn=pe(null),Dn=null;function fs(e){var a=e.alternate;te(wt,wt.current&1),te(xn,e),Dn===null&&(a===null||yi.current!==null||a.memoizedState!==null)&&(Dn=e)}function Cf(e){te(wt,wt.current),te(xn,e),Dn===null&&(Dn=e)}function zv(e){e.tag===22?(te(wt,wt.current),te(xn,e),Dn===null&&(Dn=e)):hs()}function hs(){te(wt,wt.current),te(xn,xn.current)}function wn(e){G(xn),Dn===e&&(Dn=null),G(wt)}var wt=pe(0);function lc(e){for(var a=e;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Oh(i)||Rh(i)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var ja=0,Le=null,ot=null,Tt=null,cc=!1,bi=!1,pr=!1,uc=0,zo=0,xi=null,K_=0;function bt(){throw Error(r(321))}function Af(e,a){if(a===null)return!1;for(var i=0;i<a.length&&i<e.length;i++)if(!yn(e[i],a[i]))return!1;return!0}function jf(e,a,i,c,f,g){return ja=g,Le=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,U.H=e===null||e.memoizedState===null?yy:qf,pr=!1,g=i(c,f),pr=!1,bi&&(g=Uv(a,i,c,f)),Lv(e),g}function Lv(e){U.H=Bo;var a=ot!==null&&ot.next!==null;if(ja=0,Tt=ot=Le=null,cc=!1,zo=0,xi=null,a)throw Error(r(300));e===null||kt||(e=e.dependencies,e!==null&&ec(e)&&(kt=!0))}function Uv(e,a,i,c){Le=e;var f=0;do{if(bi&&(xi=null),zo=0,bi=!1,25<=f)throw Error(r(301));if(f+=1,Tt=ot=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}U.H=by,g=a(i,c)}while(bi);return g}function X_(){var e=U.H,a=e.useState()[0];return a=typeof a.then=="function"?Lo(a):a,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(Le.flags|=1024),a}function Tf(){var e=uc!==0;return uc=0,e}function kf(e,a,i){a.updateQueue=e.updateQueue,a.flags&=-2053,e.lanes&=~i}function Nf(e){if(cc){for(e=e.memoizedState;e!==null;){var a=e.queue;a!==null&&(a.pending=null),e=e.next}cc=!1}ja=0,Tt=ot=Le=null,bi=!1,zo=uc=0,xi=null}function nn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Le.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function St(){if(ot===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var a=Tt===null?Le.memoizedState:Tt.next;if(a!==null)Tt=a,ot=e;else{if(e===null)throw Le.alternate===null?Error(r(467)):Error(r(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Tt===null?Le.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function dc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var a=zo;return zo+=1,xi===null&&(xi=[]),e=jv(xi,e,a),a=Le,(Tt===null?a.memoizedState:Tt.next)===null&&(a=a.alternate,U.H=a===null||a.memoizedState===null?yy:qf),e}function fc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Lo(e);if(e.$$typeof===k)return Ft(e)}throw Error(r(438,String(e)))}function Of(e){var a=null,i=Le.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var c=Le.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(f){return f.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=dc(),Le.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(e),c=0;c<e;c++)i[c]=V;return a.index++,i}function Ta(e,a){return typeof a=="function"?a(e):a}function hc(e){var a=St();return Rf(a,ot,e)}function Rf(e,a,i){var c=e.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=e.baseQueue,g=c.pending;if(g!==null){if(f!==null){var w=f.next;f.next=g.next,g.next=w}a.baseQueue=f=g,c.pending=null}if(g=e.baseState,f===null)e.memoizedState=g;else{a=f.next;var N=w=null,B=null,Z=a,ae=!1;do{var le=Z.lane&-536870913;if(le!==Z.lane?(Fe&le)===le:(ja&le)===le){var K=Z.revertLane;if(K===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),le===mi&&(ae=!0);else if((ja&K)===K){Z=Z.next,K===mi&&(ae=!0);continue}else le={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},B===null?(N=B=le,w=g):B=B.next=le,Le.lanes|=K,gs|=K;le=Z.action,pr&&i(g,le),g=Z.hasEagerState?Z.eagerState:i(g,le)}else K={lane:le,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},B===null?(N=B=K,w=g):B=B.next=K,Le.lanes|=le,gs|=le;Z=Z.next}while(Z!==null&&Z!==a);if(B===null?w=g:B.next=N,!yn(g,e.memoizedState)&&(kt=!0,ae&&(i=pi,i!==null)))throw i;e.memoizedState=g,e.baseState=w,e.baseQueue=B,c.lastRenderedState=g}return f===null&&(c.lanes=0),[e.memoizedState,c.dispatch]}function Df(e){var a=St(),i=a.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=i.dispatch,f=i.pending,g=a.memoizedState;if(f!==null){i.pending=null;var w=f=f.next;do g=e(g,w.action),w=w.next;while(w!==f);yn(g,a.memoizedState)||(kt=!0),a.memoizedState=g,a.baseQueue===null&&(a.baseState=g),i.lastRenderedState=g}return[g,c]}function Bv(e,a,i){var c=Le,f=St(),g=Ke;if(g){if(i===void 0)throw Error(r(407));i=i()}else i=a();var w=!yn((ot||f).memoizedState,i);if(w&&(f.memoizedState=i,kt=!0),f=f.queue,Lf(Vv.bind(null,c,f,e),[e]),f.getSnapshot!==a||w||Tt!==null&&Tt.memoizedState.tag&1){if(c.flags|=2048,wi(9,{destroy:void 0},Hv.bind(null,c,f,i,a),null),dt===null)throw Error(r(349));g||(ja&127)!==0||Iv(c,a,i)}return i}function Iv(e,a,i){e.flags|=16384,e={getSnapshot:a,value:i},a=Le.updateQueue,a===null?(a=dc(),Le.updateQueue=a,a.stores=[e]):(i=a.stores,i===null?a.stores=[e]:i.push(e))}function Hv(e,a,i,c){a.value=i,a.getSnapshot=c,qv(a)&&$v(e)}function Vv(e,a,i){return i(function(){qv(a)&&$v(e)})}function qv(e){var a=e.getSnapshot;e=e.value;try{var i=a();return!yn(e,i)}catch{return!0}}function $v(e){var a=ir(e,2);a!==null&&fn(a,e,2)}function Mf(e){var a=nn();if(typeof e=="function"){var i=e;if(e=i(),pr){ns(!0);try{i()}finally{ns(!1)}}}return a.memoizedState=a.baseState=e,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:e},a}function Pv(e,a,i,c){return e.baseState=i,Rf(e,ot,typeof c=="function"?c:Ta)}function Q_(e,a,i,c,f){if(gc(e))throw Error(r(485));if(e=a.action,e!==null){var g={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){g.listeners.push(w)}};U.T!==null?i(!0):g.isTransition=!1,c(g),i=a.pending,i===null?(g.next=a.pending=g,Gv(a,g)):(g.next=i.next,a.pending=i.next=g)}}function Gv(e,a){var i=a.action,c=a.payload,f=e.state;if(a.isTransition){var g=U.T,w={};U.T=w;try{var N=i(f,c),B=U.S;B!==null&&B(w,N),Fv(e,a,N)}catch(Z){zf(e,a,Z)}finally{g!==null&&w.types!==null&&(g.types=w.types),U.T=g}}else try{g=i(f,c),Fv(e,a,g)}catch(Z){zf(e,a,Z)}}function Fv(e,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(c){Zv(e,a,c)},function(c){return zf(e,a,c)}):Zv(e,a,i)}function Zv(e,a,i){a.status="fulfilled",a.value=i,Yv(a),e.state=i,a=e.pending,a!==null&&(i=a.next,i===a?e.pending=null:(i=i.next,a.next=i,Gv(e,i)))}function zf(e,a,i){var c=e.pending;if(e.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=i,Yv(a),a=a.next;while(a!==c)}e.action=null}function Yv(e){e=e.listeners;for(var a=0;a<e.length;a++)(0,e[a])()}function Kv(e,a){return a}function Xv(e,a){if(Ke){var i=dt.formState;if(i!==null){e:{var c=Le;if(Ke){if(mt){t:{for(var f=mt,g=Rn;f.nodeType!==8;){if(!g){f=null;break t}if(f=Mn(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){mt=Mn(f.nextSibling),c=f.data==="F!";break e}}os(c)}c=!1}c&&(a=i[0])}}return i=nn(),i.memoizedState=i.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kv,lastRenderedState:a},i.queue=c,i=py.bind(null,Le,c),c.dispatch=i,c=Mf(!1),g=Vf.bind(null,Le,!1,c.queue),c=nn(),f={state:a,dispatch:null,action:e,pending:null},c.queue=f,i=Q_.bind(null,Le,f,g,i),f.dispatch=i,c.memoizedState=e,[a,i,!1]}function Qv(e){var a=St();return Wv(a,ot,e)}function Wv(e,a,i){if(a=Rf(e,a,Kv)[0],e=hc(Ta)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=Lo(a)}catch(w){throw w===gi?ac:w}else c=a;a=St();var f=a.queue,g=f.dispatch;return i!==a.memoizedState&&(Le.flags|=2048,wi(9,{destroy:void 0},W_.bind(null,f,i),null)),[c,g,e]}function W_(e,a){e.action=a}function Jv(e){var a=St(),i=ot;if(i!==null)return Wv(a,i,e);St(),a=a.memoizedState,i=St();var c=i.queue.dispatch;return i.memoizedState=e,[a,c,!1]}function wi(e,a,i,c){return e={tag:e,create:i,deps:c,inst:a,next:null},a=Le.updateQueue,a===null&&(a=dc(),Le.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=e.next=e:(c=i.next,i.next=e,e.next=c,a.lastEffect=e),e}function ey(){return St().memoizedState}function mc(e,a,i,c){var f=nn();Le.flags|=e,f.memoizedState=wi(1|a,{destroy:void 0},i,c===void 0?null:c)}function pc(e,a,i,c){var f=St();c=c===void 0?null:c;var g=f.memoizedState.inst;ot!==null&&c!==null&&Af(c,ot.memoizedState.deps)?f.memoizedState=wi(a,g,i,c):(Le.flags|=e,f.memoizedState=wi(1|a,g,i,c))}function ty(e,a){mc(8390656,8,e,a)}function Lf(e,a){pc(2048,8,e,a)}function J_(e){Le.flags|=4;var a=Le.updateQueue;if(a===null)a=dc(),Le.updateQueue=a,a.events=[e];else{var i=a.events;i===null?a.events=[e]:i.push(e)}}function ny(e){var a=St().memoizedState;return J_({ref:a,nextImpl:e}),function(){if((st&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function ay(e,a){return pc(4,2,e,a)}function sy(e,a){return pc(4,4,e,a)}function ry(e,a){if(typeof a=="function"){e=e();var i=a(e);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return e=e(),a.current=e,function(){a.current=null}}function iy(e,a,i){i=i!=null?i.concat([e]):null,pc(4,4,ry.bind(null,a,e),i)}function Uf(){}function oy(e,a){var i=St();a=a===void 0?null:a;var c=i.memoizedState;return a!==null&&Af(a,c[1])?c[0]:(i.memoizedState=[e,a],e)}function ly(e,a){var i=St();a=a===void 0?null:a;var c=i.memoizedState;if(a!==null&&Af(a,c[1]))return c[0];if(c=e(),pr){ns(!0);try{e()}finally{ns(!1)}}return i.memoizedState=[c,a],c}function Bf(e,a,i){return i===void 0||(ja&1073741824)!==0&&(Fe&261930)===0?e.memoizedState=a:(e.memoizedState=i,e=c0(),Le.lanes|=e,gs|=e,i)}function cy(e,a,i,c){return yn(i,a)?i:yi.current!==null?(e=Bf(e,i,c),yn(e,a)||(kt=!0),e):(ja&42)===0||(ja&1073741824)!==0&&(Fe&261930)===0?(kt=!0,e.memoizedState=i):(e=c0(),Le.lanes|=e,gs|=e,a)}function uy(e,a,i,c,f){var g=$.p;$.p=g!==0&&8>g?g:8;var w=U.T,N={};U.T=N,Vf(e,!1,a,i);try{var B=f(),Z=U.S;if(Z!==null&&Z(N,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ae=Y_(B,c);Uo(e,a,ae,_n(e))}else Uo(e,a,c,_n(e))}catch(le){Uo(e,a,{then:function(){},status:"rejected",reason:le},_n())}finally{$.p=g,w!==null&&N.types!==null&&(w.types=N.types),U.T=w}}function eC(){}function If(e,a,i,c){if(e.tag!==5)throw Error(r(476));var f=dy(e).queue;uy(e,f,a,W,i===null?eC:function(){return fy(e),i(c)})}function dy(e){var a=e.memoizedState;if(a!==null)return a;a={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:W},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:i},next:null},e.memoizedState=a,e=e.alternate,e!==null&&(e.memoizedState=a),a}function fy(e){var a=dy(e);a.next===null&&(a=e.alternate.memoizedState),Uo(e,a.next.queue,{},_n())}function Hf(){return Ft(el)}function hy(){return St().memoizedState}function my(){return St().memoizedState}function tC(e){for(var a=e.return;a!==null;){switch(a.tag){case 24:case 3:var i=_n();e=us(i);var c=ds(a,e,i);c!==null&&(fn(c,a,i),Ro(c,a,i)),a={cache:pf()},e.payload=a;return}a=a.return}}function nC(e,a,i){var c=_n();i={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},gc(e)?gy(a,i):(i=af(e,a,i,c),i!==null&&(fn(i,e,c),vy(i,a,c)))}function py(e,a,i){var c=_n();Uo(e,a,i,c)}function Uo(e,a,i,c){var f={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(gc(e))gy(a,f);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=a.lastRenderedReducer,g!==null))try{var w=a.lastRenderedState,N=g(w,i);if(f.hasEagerState=!0,f.eagerState=N,yn(N,w))return Xl(e,a,f,0),dt===null&&Kl(),!1}catch{}finally{}if(i=af(e,a,f,c),i!==null)return fn(i,e,c),vy(i,a,c),!0}return!1}function Vf(e,a,i,c){if(c={lane:2,revertLane:bh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},gc(e)){if(a)throw Error(r(479))}else a=af(e,i,c,2),a!==null&&fn(a,e,2)}function gc(e){var a=e.alternate;return e===Le||a!==null&&a===Le}function gy(e,a){bi=cc=!0;var i=e.pending;i===null?a.next=a:(a.next=i.next,i.next=a),e.pending=a}function vy(e,a,i){if((i&4194048)!==0){var c=a.lanes;c&=e.pendingLanes,i|=c,a.lanes=i,Sg(e,i)}}var Bo={readContext:Ft,use:fc,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};Bo.useEffectEvent=bt;var yy={readContext:Ft,use:fc,useCallback:function(e,a){return nn().memoizedState=[e,a===void 0?null:a],e},useContext:Ft,useEffect:ty,useImperativeHandle:function(e,a,i){i=i!=null?i.concat([e]):null,mc(4194308,4,ry.bind(null,a,e),i)},useLayoutEffect:function(e,a){return mc(4194308,4,e,a)},useInsertionEffect:function(e,a){mc(4,2,e,a)},useMemo:function(e,a){var i=nn();a=a===void 0?null:a;var c=e();if(pr){ns(!0);try{e()}finally{ns(!1)}}return i.memoizedState=[c,a],c},useReducer:function(e,a,i){var c=nn();if(i!==void 0){var f=i(a);if(pr){ns(!0);try{i(a)}finally{ns(!1)}}}else f=a;return c.memoizedState=c.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},c.queue=e,e=e.dispatch=nC.bind(null,Le,e),[c.memoizedState,e]},useRef:function(e){var a=nn();return e={current:e},a.memoizedState=e},useState:function(e){e=Mf(e);var a=e.queue,i=py.bind(null,Le,a);return a.dispatch=i,[e.memoizedState,i]},useDebugValue:Uf,useDeferredValue:function(e,a){var i=nn();return Bf(i,e,a)},useTransition:function(){var e=Mf(!1);return e=uy.bind(null,Le,e.queue,!0,!1),nn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,a,i){var c=Le,f=nn();if(Ke){if(i===void 0)throw Error(r(407));i=i()}else{if(i=a(),dt===null)throw Error(r(349));(Fe&127)!==0||Iv(c,a,i)}f.memoizedState=i;var g={value:i,getSnapshot:a};return f.queue=g,ty(Vv.bind(null,c,g,e),[e]),c.flags|=2048,wi(9,{destroy:void 0},Hv.bind(null,c,g,i,a),null),i},useId:function(){var e=nn(),a=dt.identifierPrefix;if(Ke){var i=aa,c=na;i=(c&~(1<<32-vn(c)-1)).toString(32)+i,a="_"+a+"R_"+i,i=uc++,0<i&&(a+="H"+i.toString(32)),a+="_"}else i=K_++,a="_"+a+"r_"+i.toString(32)+"_";return e.memoizedState=a},useHostTransitionStatus:Hf,useFormState:Xv,useActionState:Xv,useOptimistic:function(e){var a=nn();a.memoizedState=a.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=Vf.bind(null,Le,!0,i),i.dispatch=a,[e,a]},useMemoCache:Of,useCacheRefresh:function(){return nn().memoizedState=tC.bind(null,Le)},useEffectEvent:function(e){var a=nn(),i={impl:e};return a.memoizedState=i,function(){if((st&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}},qf={readContext:Ft,use:fc,useCallback:oy,useContext:Ft,useEffect:Lf,useImperativeHandle:iy,useInsertionEffect:ay,useLayoutEffect:sy,useMemo:ly,useReducer:hc,useRef:ey,useState:function(){return hc(Ta)},useDebugValue:Uf,useDeferredValue:function(e,a){var i=St();return cy(i,ot.memoizedState,e,a)},useTransition:function(){var e=hc(Ta)[0],a=St().memoizedState;return[typeof e=="boolean"?e:Lo(e),a]},useSyncExternalStore:Bv,useId:hy,useHostTransitionStatus:Hf,useFormState:Qv,useActionState:Qv,useOptimistic:function(e,a){var i=St();return Pv(i,ot,e,a)},useMemoCache:Of,useCacheRefresh:my};qf.useEffectEvent=ny;var by={readContext:Ft,use:fc,useCallback:oy,useContext:Ft,useEffect:Lf,useImperativeHandle:iy,useInsertionEffect:ay,useLayoutEffect:sy,useMemo:ly,useReducer:Df,useRef:ey,useState:function(){return Df(Ta)},useDebugValue:Uf,useDeferredValue:function(e,a){var i=St();return ot===null?Bf(i,e,a):cy(i,ot.memoizedState,e,a)},useTransition:function(){var e=Df(Ta)[0],a=St().memoizedState;return[typeof e=="boolean"?e:Lo(e),a]},useSyncExternalStore:Bv,useId:hy,useHostTransitionStatus:Hf,useFormState:Jv,useActionState:Jv,useOptimistic:function(e,a){var i=St();return ot!==null?Pv(i,ot,e,a):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Of,useCacheRefresh:my};by.useEffectEvent=ny;function $f(e,a,i,c){a=e.memoizedState,i=i(c,a),i=i==null?a:v({},a,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Pf={enqueueSetState:function(e,a,i){e=e._reactInternals;var c=_n(),f=us(c);f.payload=a,i!=null&&(f.callback=i),a=ds(e,f,c),a!==null&&(fn(a,e,c),Ro(a,e,c))},enqueueReplaceState:function(e,a,i){e=e._reactInternals;var c=_n(),f=us(c);f.tag=1,f.payload=a,i!=null&&(f.callback=i),a=ds(e,f,c),a!==null&&(fn(a,e,c),Ro(a,e,c))},enqueueForceUpdate:function(e,a){e=e._reactInternals;var i=_n(),c=us(i);c.tag=2,a!=null&&(c.callback=a),a=ds(e,c,i),a!==null&&(fn(a,e,i),Ro(a,e,i))}};function xy(e,a,i,c,f,g,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(c,g,w):a.prototype&&a.prototype.isPureReactComponent?!_o(i,c)||!_o(f,g):!0}function wy(e,a,i,c){e=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,c),a.state!==e&&Pf.enqueueReplaceState(a,a.state,null)}function gr(e,a){var i=a;if("ref"in a){i={};for(var c in a)c!=="ref"&&(i[c]=a[c])}if(e=e.defaultProps){i===a&&(i=v({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}function Sy(e){Yl(e)}function Ey(e){console.error(e)}function _y(e){Yl(e)}function vc(e,a){try{var i=e.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function Cy(e,a,i){try{var c=e.onCaughtError;c(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Gf(e,a,i){return i=us(i),i.tag=3,i.payload={element:null},i.callback=function(){vc(e,a)},i}function Ay(e){return e=us(e),e.tag=3,e}function jy(e,a,i,c){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=c.value;e.payload=function(){return f(g)},e.callback=function(){Cy(a,i,c)}}var w=i.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(e.callback=function(){Cy(a,i,c),typeof f!="function"&&(vs===null?vs=new Set([this]):vs.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})})}function aC(e,a,i,c,f){if(i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=i.alternate,a!==null&&hi(a,i,f,!0),i=xn.current,i!==null){switch(i.tag){case 31:case 13:return Dn===null?kc():i.alternate===null&&xt===0&&(xt=3),i.flags&=-257,i.flags|=65536,i.lanes=f,c===sc?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([c]):a.add(c),gh(e,c,f)),!1;case 22:return i.flags|=65536,c===sc?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([c]):i.add(c)),gh(e,c,f)),!1}throw Error(r(435,i.tag))}return gh(e,c,f),kc(),!1}if(Ke)return a=xn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=f,c!==uf&&(e=Error(r(422),{cause:c}),jo(kn(e,i)))):(c!==uf&&(a=Error(r(423),{cause:c}),jo(kn(a,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,c=kn(c,i),f=Gf(e.stateNode,c,f),wf(e,f),xt!==4&&(xt=2)),!1;var g=Error(r(520),{cause:c});if(g=kn(g,i),Fo===null?Fo=[g]:Fo.push(g),xt!==4&&(xt=2),a===null)return!0;c=kn(c,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=Gf(i.stateNode,c,e),wf(i,e),!1;case 1:if(a=i.type,g=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(vs===null||!vs.has(g))))return i.flags|=65536,f&=-f,i.lanes|=f,f=Ay(f),jy(f,e,i,c),wf(i,f),!1}i=i.return}while(i!==null);return!1}var Ff=Error(r(461)),kt=!1;function Zt(e,a,i,c){a.child=e===null?Ov(a,null,i,c):mr(a,e.child,i,c)}function Ty(e,a,i,c,f){i=i.render;var g=a.ref;if("ref"in c){var w={};for(var N in c)N!=="ref"&&(w[N]=c[N])}else w=c;return ur(a),c=jf(e,a,i,w,g,f),N=Tf(),e!==null&&!kt?(kf(e,a,f),ka(e,a,f)):(Ke&&N&&lf(a),a.flags|=1,Zt(e,a,c,f),a.child)}function ky(e,a,i,c,f){if(e===null){var g=i.type;return typeof g=="function"&&!sf(g)&&g.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=g,Ny(e,a,g,c,f)):(e=Wl(i.type,null,c,a,a.mode,f),e.ref=a.ref,e.return=a,a.child=e)}if(g=e.child,!eh(e,f)){var w=g.memoizedProps;if(i=i.compare,i=i!==null?i:_o,i(w,c)&&e.ref===a.ref)return ka(e,a,f)}return a.flags|=1,e=Ea(g,c),e.ref=a.ref,e.return=a,a.child=e}function Ny(e,a,i,c,f){if(e!==null){var g=e.memoizedProps;if(_o(g,c)&&e.ref===a.ref)if(kt=!1,a.pendingProps=c=g,eh(e,f))(e.flags&131072)!==0&&(kt=!0);else return a.lanes=e.lanes,ka(e,a,f)}return Zf(e,a,i,c,f)}function Oy(e,a,i,c){var f=c.children,g=e!==null?e.memoizedState:null;if(e===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((a.flags&128)!==0){if(g=g!==null?g.baseLanes|i:i,e!==null){for(c=a.child=e.child,f=0;c!==null;)f=f|c.lanes|c.childLanes,c=c.sibling;c=f&~g}else c=0,a.child=null;return Ry(e,a,g,i,c)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},e!==null&&nc(a,g!==null?g.cachePool:null),g!==null?Mv(a,g):Ef(),zv(a);else return c=a.lanes=536870912,Ry(e,a,g!==null?g.baseLanes|i:i,i,c)}else g!==null?(nc(a,g.cachePool),Mv(a,g),hs(),a.memoizedState=null):(e!==null&&nc(a,null),Ef(),hs());return Zt(e,a,f,i),a.child}function Io(e,a){return e!==null&&e.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Ry(e,a,i,c,f){var g=vf();return g=g===null?null:{parent:jt._currentValue,pool:g},a.memoizedState={baseLanes:i,cachePool:g},e!==null&&nc(a,null),Ef(),zv(a),e!==null&&hi(e,a,c,!0),a.childLanes=f,null}function yc(e,a){return a=xc({mode:a.mode,children:a.children},e.mode),a.ref=e.ref,e.child=a,a.return=e,a}function Dy(e,a,i){return mr(a,e.child,null,i),e=yc(a,a.pendingProps),e.flags|=2,wn(a),a.memoizedState=null,e}function sC(e,a,i){var c=a.pendingProps,f=(a.flags&128)!==0;if(a.flags&=-129,e===null){if(Ke){if(c.mode==="hidden")return e=yc(a,c),a.lanes=536870912,Io(null,e);if(Cf(a),(e=mt)?(e=G0(e,Rn),e=e!==null&&e.data==="&"?e:null,e!==null&&(a.memoizedState={dehydrated:e,treeContext:rs!==null?{id:na,overflow:aa}:null,retryLane:536870912,hydrationErrors:null},i=gv(e),i.return=a,a.child=i,Gt=a,mt=null)):e=null,e===null)throw os(a);return a.lanes=536870912,null}return yc(a,c)}var g=e.memoizedState;if(g!==null){var w=g.dehydrated;if(Cf(a),f)if(a.flags&256)a.flags&=-257,a=Dy(e,a,i);else if(a.memoizedState!==null)a.child=e.child,a.flags|=128,a=null;else throw Error(r(558));else if(kt||hi(e,a,i,!1),f=(i&e.childLanes)!==0,kt||f){if(c=dt,c!==null&&(w=Eg(c,i),w!==0&&w!==g.retryLane))throw g.retryLane=w,ir(e,w),fn(c,e,w),Ff;kc(),a=Dy(e,a,i)}else e=g.treeContext,mt=Mn(w.nextSibling),Gt=a,Ke=!0,is=null,Rn=!1,e!==null&&bv(a,e),a=yc(a,c),a.flags|=4096;return a}return e=Ea(e.child,{mode:c.mode,children:c.children}),e.ref=a.ref,a.child=e,e.return=a,e}function bc(e,a){var i=a.ref;if(i===null)e!==null&&e.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(r(284));(e===null||e.ref!==i)&&(a.flags|=4194816)}}function Zf(e,a,i,c,f){return ur(a),i=jf(e,a,i,c,void 0,f),c=Tf(),e!==null&&!kt?(kf(e,a,f),ka(e,a,f)):(Ke&&c&&lf(a),a.flags|=1,Zt(e,a,i,f),a.child)}function My(e,a,i,c,f,g){return ur(a),a.updateQueue=null,i=Uv(a,c,i,f),Lv(e),c=Tf(),e!==null&&!kt?(kf(e,a,g),ka(e,a,g)):(Ke&&c&&lf(a),a.flags|=1,Zt(e,a,i,g),a.child)}function zy(e,a,i,c,f){if(ur(a),a.stateNode===null){var g=ci,w=i.contextType;typeof w=="object"&&w!==null&&(g=Ft(w)),g=new i(c,g),a.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Pf,a.stateNode=g,g._reactInternals=a,g=a.stateNode,g.props=c,g.state=a.memoizedState,g.refs={},bf(a),w=i.contextType,g.context=typeof w=="object"&&w!==null?Ft(w):ci,g.state=a.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&($f(a,i,w,c),g.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(w=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),w!==g.state&&Pf.enqueueReplaceState(g,g.state,null),Mo(a,c,g,f),Do(),g.state=a.memoizedState),typeof g.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(e===null){g=a.stateNode;var N=a.memoizedProps,B=gr(i,N);g.props=B;var Z=g.context,ae=i.contextType;w=ci,typeof ae=="object"&&ae!==null&&(w=Ft(ae));var le=i.getDerivedStateFromProps;ae=typeof le=="function"||typeof g.getSnapshotBeforeUpdate=="function",N=a.pendingProps!==N,ae||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(N||Z!==w)&&wy(a,g,c,w),cs=!1;var K=a.memoizedState;g.state=K,Mo(a,c,g,f),Do(),Z=a.memoizedState,N||K!==Z||cs?(typeof le=="function"&&($f(a,i,le,c),Z=a.memoizedState),(B=cs||xy(a,i,B,c,K,Z,w))?(ae||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(a.flags|=4194308)):(typeof g.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=Z),g.props=c,g.state=Z,g.context=w,c=B):(typeof g.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{g=a.stateNode,xf(e,a),w=a.memoizedProps,ae=gr(i,w),g.props=ae,le=a.pendingProps,K=g.context,Z=i.contextType,B=ci,typeof Z=="object"&&Z!==null&&(B=Ft(Z)),N=i.getDerivedStateFromProps,(Z=typeof N=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(w!==le||K!==B)&&wy(a,g,c,B),cs=!1,K=a.memoizedState,g.state=K,Mo(a,c,g,f),Do();var ne=a.memoizedState;w!==le||K!==ne||cs||e!==null&&e.dependencies!==null&&ec(e.dependencies)?(typeof N=="function"&&($f(a,i,N,c),ne=a.memoizedState),(ae=cs||xy(a,i,ae,c,K,ne,B)||e!==null&&e.dependencies!==null&&ec(e.dependencies))?(Z||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,ne,B),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,ne,B)),typeof g.componentDidUpdate=="function"&&(a.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof g.componentDidUpdate!="function"||w===e.memoizedProps&&K===e.memoizedState||(a.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&K===e.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=ne),g.props=c,g.state=ne,g.context=B,c=ae):(typeof g.componentDidUpdate!="function"||w===e.memoizedProps&&K===e.memoizedState||(a.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&K===e.memoizedState||(a.flags|=1024),c=!1)}return g=c,bc(e,a),c=(a.flags&128)!==0,g||c?(g=a.stateNode,i=c&&typeof i.getDerivedStateFromError!="function"?null:g.render(),a.flags|=1,e!==null&&c?(a.child=mr(a,e.child,null,f),a.child=mr(a,null,i,f)):Zt(e,a,i,f),a.memoizedState=g.state,e=a.child):e=ka(e,a,f),e}function Ly(e,a,i,c){return lr(),a.flags|=256,Zt(e,a,i,c),a.child}var Yf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kf(e){return{baseLanes:e,cachePool:Cv()}}function Xf(e,a,i){return e=e!==null?e.childLanes&~i:0,a&&(e|=En),e}function Uy(e,a,i){var c=a.pendingProps,f=!1,g=(a.flags&128)!==0,w;if((w=g)||(w=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),w&&(f=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,e===null){if(Ke){if(f?fs(a):hs(),(e=mt)?(e=G0(e,Rn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(a.memoizedState={dehydrated:e,treeContext:rs!==null?{id:na,overflow:aa}:null,retryLane:536870912,hydrationErrors:null},i=gv(e),i.return=a,a.child=i,Gt=a,mt=null)):e=null,e===null)throw os(a);return Rh(e)?a.lanes=32:a.lanes=536870912,null}var N=c.children;return c=c.fallback,f?(hs(),f=a.mode,N=xc({mode:"hidden",children:N},f),c=or(c,f,i,null),N.return=a,c.return=a,N.sibling=c,a.child=N,c=a.child,c.memoizedState=Kf(i),c.childLanes=Xf(e,w,i),a.memoizedState=Yf,Io(null,c)):(fs(a),Qf(a,N))}var B=e.memoizedState;if(B!==null&&(N=B.dehydrated,N!==null)){if(g)a.flags&256?(fs(a),a.flags&=-257,a=Wf(e,a,i)):a.memoizedState!==null?(hs(),a.child=e.child,a.flags|=128,a=null):(hs(),N=c.fallback,f=a.mode,c=xc({mode:"visible",children:c.children},f),N=or(N,f,i,null),N.flags|=2,c.return=a,N.return=a,c.sibling=N,a.child=c,mr(a,e.child,null,i),c=a.child,c.memoizedState=Kf(i),c.childLanes=Xf(e,w,i),a.memoizedState=Yf,a=Io(null,c));else if(fs(a),Rh(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var Z=w.dgst;w=Z,c=Error(r(419)),c.stack="",c.digest=w,jo({value:c,source:null,stack:null}),a=Wf(e,a,i)}else if(kt||hi(e,a,i,!1),w=(i&e.childLanes)!==0,kt||w){if(w=dt,w!==null&&(c=Eg(w,i),c!==0&&c!==B.retryLane))throw B.retryLane=c,ir(e,c),fn(w,e,c),Ff;Oh(N)||kc(),a=Wf(e,a,i)}else Oh(N)?(a.flags|=192,a.child=e.child,a=null):(e=B.treeContext,mt=Mn(N.nextSibling),Gt=a,Ke=!0,is=null,Rn=!1,e!==null&&bv(a,e),a=Qf(a,c.children),a.flags|=4096);return a}return f?(hs(),N=c.fallback,f=a.mode,B=e.child,Z=B.sibling,c=Ea(B,{mode:"hidden",children:c.children}),c.subtreeFlags=B.subtreeFlags&65011712,Z!==null?N=Ea(Z,N):(N=or(N,f,i,null),N.flags|=2),N.return=a,c.return=a,c.sibling=N,a.child=c,Io(null,c),c=a.child,N=e.child.memoizedState,N===null?N=Kf(i):(f=N.cachePool,f!==null?(B=jt._currentValue,f=f.parent!==B?{parent:B,pool:B}:f):f=Cv(),N={baseLanes:N.baseLanes|i,cachePool:f}),c.memoizedState=N,c.childLanes=Xf(e,w,i),a.memoizedState=Yf,Io(e.child,c)):(fs(a),i=e.child,e=i.sibling,i=Ea(i,{mode:"visible",children:c.children}),i.return=a,i.sibling=null,e!==null&&(w=a.deletions,w===null?(a.deletions=[e],a.flags|=16):w.push(e)),a.child=i,a.memoizedState=null,i)}function Qf(e,a){return a=xc({mode:"visible",children:a},e.mode),a.return=e,e.child=a}function xc(e,a){return e=bn(22,e,null,a),e.lanes=0,e}function Wf(e,a,i){return mr(a,e.child,null,i),e=Qf(a,a.pendingProps.children),e.flags|=2,a.memoizedState=null,e}function By(e,a,i){e.lanes|=a;var c=e.alternate;c!==null&&(c.lanes|=a),hf(e.return,a,i)}function Jf(e,a,i,c,f,g){var w=e.memoizedState;w===null?e.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:f,treeForkCount:g}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=i,w.tailMode=f,w.treeForkCount=g)}function Iy(e,a,i){var c=a.pendingProps,f=c.revealOrder,g=c.tail;c=c.children;var w=wt.current,N=(w&2)!==0;if(N?(w=w&1|2,a.flags|=128):w&=1,te(wt,w),Zt(e,a,c,i),c=Ke?Ao:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=a.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&By(e,i,a);else if(e.tag===19)By(e,i,a);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===a)break e;for(;e.sibling===null;){if(e.return===null||e.return===a)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(i=a.child,f=null;i!==null;)e=i.alternate,e!==null&&lc(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=a.child,a.child=null):(f=i.sibling,i.sibling=null),Jf(a,!1,f,i,g,c);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=a.child,a.child=null;f!==null;){if(e=f.alternate,e!==null&&lc(e)===null){a.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}Jf(a,!0,i,null,g,c);break;case"together":Jf(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function ka(e,a,i){if(e!==null&&(a.dependencies=e.dependencies),gs|=a.lanes,(i&a.childLanes)===0)if(e!==null){if(hi(e,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(e!==null&&a.child!==e.child)throw Error(r(153));if(a.child!==null){for(e=a.child,i=Ea(e,e.pendingProps),a.child=i,i.return=a;e.sibling!==null;)e=e.sibling,i=i.sibling=Ea(e,e.pendingProps),i.return=a;i.sibling=null}return a.child}function eh(e,a){return(e.lanes&a)!==0?!0:(e=e.dependencies,!!(e!==null&&ec(e)))}function rC(e,a,i){switch(a.tag){case 3:me(a,a.stateNode.containerInfo),ls(a,jt,e.memoizedState.cache),lr();break;case 27:case 5:De(a);break;case 4:me(a,a.stateNode.containerInfo);break;case 10:ls(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Cf(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?(fs(a),a.flags|=128,null):(i&a.child.childLanes)!==0?Uy(e,a,i):(fs(a),e=ka(e,a,i),e!==null?e.sibling:null);fs(a);break;case 19:var f=(e.flags&128)!==0;if(c=(i&a.childLanes)!==0,c||(hi(e,a,i,!1),c=(i&a.childLanes)!==0),f){if(c)return Iy(e,a,i);a.flags|=128}if(f=a.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),te(wt,wt.current),c)break;return null;case 22:return a.lanes=0,Oy(e,a,i,a.pendingProps);case 24:ls(a,jt,e.memoizedState.cache)}return ka(e,a,i)}function Hy(e,a,i){if(e!==null)if(e.memoizedProps!==a.pendingProps)kt=!0;else{if(!eh(e,i)&&(a.flags&128)===0)return kt=!1,rC(e,a,i);kt=(e.flags&131072)!==0}else kt=!1,Ke&&(a.flags&1048576)!==0&&yv(a,Ao,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(e=fr(a.elementType),a.type=e,typeof e=="function")sf(e)?(c=gr(e,c),a.tag=1,a=zy(null,a,e,c,i)):(a.tag=0,a=Zf(null,a,e,c,i));else{if(e!=null){var f=e.$$typeof;if(f===A){a.tag=11,a=Ty(null,a,e,c,i);break e}else if(f===M){a.tag=14,a=ky(null,a,e,c,i);break e}}throw a=ee(e)||e,Error(r(306,a,""))}}return a;case 0:return Zf(e,a,a.type,a.pendingProps,i);case 1:return c=a.type,f=gr(c,a.pendingProps),zy(e,a,c,f,i);case 3:e:{if(me(a,a.stateNode.containerInfo),e===null)throw Error(r(387));c=a.pendingProps;var g=a.memoizedState;f=g.element,xf(e,a),Mo(a,c,null,i);var w=a.memoizedState;if(c=w.cache,ls(a,jt,c),c!==g.cache&&mf(a,[jt],i,!0),Do(),c=w.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=g,a.memoizedState=g,a.flags&256){a=Ly(e,a,c,i);break e}else if(c!==f){f=kn(Error(r(424)),a),jo(f),a=Ly(e,a,c,i);break e}else{switch(e=a.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(mt=Mn(e.firstChild),Gt=a,Ke=!0,is=null,Rn=!0,i=Ov(a,null,c,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(lr(),c===f){a=ka(e,a,i);break e}Zt(e,a,c,i)}a=a.child}return a;case 26:return bc(e,a),e===null?(i=Q0(a.type,null,a.pendingProps,null))?a.memoizedState=i:Ke||(i=a.type,e=a.pendingProps,c=Lc(ie.current).createElement(i),c[Pt]=a,c[rn]=e,Yt(c,i,e),Ut(c),a.stateNode=c):a.memoizedState=Q0(a.type,e.memoizedProps,a.pendingProps,e.memoizedState),null;case 27:return De(a),e===null&&Ke&&(c=a.stateNode=Y0(a.type,a.pendingProps,ie.current),Gt=a,Rn=!0,f=mt,ws(a.type)?(Dh=f,mt=Mn(c.firstChild)):mt=f),Zt(e,a,a.pendingProps.children,i),bc(e,a),e===null&&(a.flags|=4194304),a.child;case 5:return e===null&&Ke&&((f=c=mt)&&(c=zC(c,a.type,a.pendingProps,Rn),c!==null?(a.stateNode=c,Gt=a,mt=Mn(c.firstChild),Rn=!1,f=!0):f=!1),f||os(a)),De(a),f=a.type,g=a.pendingProps,w=e!==null?e.memoizedProps:null,c=g.children,Th(f,g)?c=null:w!==null&&Th(f,w)&&(a.flags|=32),a.memoizedState!==null&&(f=jf(e,a,X_,null,null,i),el._currentValue=f),bc(e,a),Zt(e,a,c,i),a.child;case 6:return e===null&&Ke&&((e=i=mt)&&(i=LC(i,a.pendingProps,Rn),i!==null?(a.stateNode=i,Gt=a,mt=null,e=!0):e=!1),e||os(a)),null;case 13:return Uy(e,a,i);case 4:return me(a,a.stateNode.containerInfo),c=a.pendingProps,e===null?a.child=mr(a,null,c,i):Zt(e,a,c,i),a.child;case 11:return Ty(e,a,a.type,a.pendingProps,i);case 7:return Zt(e,a,a.pendingProps,i),a.child;case 8:return Zt(e,a,a.pendingProps.children,i),a.child;case 12:return Zt(e,a,a.pendingProps.children,i),a.child;case 10:return c=a.pendingProps,ls(a,a.type,c.value),Zt(e,a,c.children,i),a.child;case 9:return f=a.type._context,c=a.pendingProps.children,ur(a),f=Ft(f),c=c(f),a.flags|=1,Zt(e,a,c,i),a.child;case 14:return ky(e,a,a.type,a.pendingProps,i);case 15:return Ny(e,a,a.type,a.pendingProps,i);case 19:return Iy(e,a,i);case 31:return sC(e,a,i);case 22:return Oy(e,a,i,a.pendingProps);case 24:return ur(a),c=Ft(jt),e===null?(f=vf(),f===null&&(f=dt,g=pf(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=i),f=g),a.memoizedState={parent:c,cache:f},bf(a),ls(a,jt,f)):((e.lanes&i)!==0&&(xf(e,a),Mo(a,null,null,i),Do()),f=e.memoizedState,g=a.memoizedState,f.parent!==c?(f={parent:c,cache:c},a.memoizedState=f,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=f),ls(a,jt,c)):(c=g.cache,ls(a,jt,c),c!==f.cache&&mf(a,[jt],i,!0))),Zt(e,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Na(e){e.flags|=4}function th(e,a,i,c,f){if((a=(e.mode&32)!==0)&&(a=!1),a){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(h0())e.flags|=8192;else throw hr=sc,yf}else e.flags&=-16777217}function Vy(e,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!nb(a))if(h0())e.flags|=8192;else throw hr=sc,yf}function wc(e,a){a!==null&&(e.flags|=4),e.flags&16384&&(a=e.tag!==22?xg():536870912,e.lanes|=a,Ci|=a)}function Ho(e,a){if(!Ke)switch(e.tailMode){case"hidden":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?a||e.tail===null?e.tail=null:e.tail.sibling=null:c.sibling=null}}function pt(e){var a=e.alternate!==null&&e.alternate.child===e.child,i=0,c=0;if(a)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags&65011712,c|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=c,e.childLanes=i,a}function iC(e,a,i){var c=a.pendingProps;switch(cf(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(a),null;case 1:return pt(a),null;case 3:return i=a.stateNode,c=null,e!==null&&(c=e.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Aa(jt),he(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(fi(a)?Na(a):e===null||e.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,df())),pt(a),null;case 26:var f=a.type,g=a.memoizedState;return e===null?(Na(a),g!==null?(pt(a),Vy(a,g)):(pt(a),th(a,f,null,c,i))):g?g!==e.memoizedState?(Na(a),pt(a),Vy(a,g)):(pt(a),a.flags&=-16777217):(e=e.memoizedProps,e!==c&&Na(a),pt(a),th(a,f,e,c,i)),null;case 27:if(Oe(a),i=ie.current,f=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==c&&Na(a);else{if(!c){if(a.stateNode===null)throw Error(r(166));return pt(a),null}e=de.current,fi(a)?xv(a):(e=Y0(f,c,i),a.stateNode=e,Na(a))}return pt(a),null;case 5:if(Oe(a),f=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==c&&Na(a);else{if(!c){if(a.stateNode===null)throw Error(r(166));return pt(a),null}if(g=de.current,fi(a))xv(a);else{var w=Lc(ie.current);switch(g){case 1:g=w.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:g=w.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":g=w.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":g=w.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":g=w.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?w.createElement(f,{is:c.is}):w.createElement(f)}}g[Pt]=a,g[rn]=c;e:for(w=a.child;w!==null;){if(w.tag===5||w.tag===6)g.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===a)break e;for(;w.sibling===null;){if(w.return===null||w.return===a)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}a.stateNode=g;e:switch(Yt(g,f,c),f){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Na(a)}}return pt(a),th(a,a.type,e===null?null:e.memoizedProps,a.pendingProps,i),null;case 6:if(e&&a.stateNode!=null)e.memoizedProps!==c&&Na(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(r(166));if(e=ie.current,fi(a)){if(e=a.stateNode,i=a.memoizedProps,c=null,f=Gt,f!==null)switch(f.tag){case 27:case 5:c=f.memoizedProps}e[Pt]=a,e=!!(e.nodeValue===i||c!==null&&c.suppressHydrationWarning===!0||U0(e.nodeValue,i)),e||os(a,!0)}else e=Lc(e).createTextNode(c),e[Pt]=a,a.stateNode=e}return pt(a),null;case 31:if(i=a.memoizedState,e===null||e.memoizedState!==null){if(c=fi(a),i!==null){if(e===null){if(!c)throw Error(r(318));if(e=a.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Pt]=a}else lr(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),e=!1}else i=df(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return a.flags&256?(wn(a),a):(wn(a),null);if((a.flags&128)!==0)throw Error(r(558))}return pt(a),null;case 13:if(c=a.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=fi(a),c!==null&&c.dehydrated!==null){if(e===null){if(!f)throw Error(r(318));if(f=a.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Pt]=a}else lr(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),f=!1}else f=df(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return a.flags&256?(wn(a),a):(wn(a),null)}return wn(a),(a.flags&128)!==0?(a.lanes=i,a):(i=c!==null,e=e!==null&&e.memoizedState!==null,i&&(c=a.child,f=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(f=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==f&&(c.flags|=2048)),i!==e&&i&&(a.child.flags|=8192),wc(a,a.updateQueue),pt(a),null);case 4:return he(),e===null&&Eh(a.stateNode.containerInfo),pt(a),null;case 10:return Aa(a.type),pt(a),null;case 19:if(G(wt),c=a.memoizedState,c===null)return pt(a),null;if(f=(a.flags&128)!==0,g=c.rendering,g===null)if(f)Ho(c,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=a.child;e!==null;){if(g=lc(e),g!==null){for(a.flags|=128,Ho(c,!1),e=g.updateQueue,a.updateQueue=e,wc(a,e),a.subtreeFlags=0,e=i,i=a.child;i!==null;)pv(i,e),i=i.sibling;return te(wt,wt.current&1|2),Ke&&_a(a,c.treeForkCount),a.child}e=e.sibling}c.tail!==null&&At()>Ac&&(a.flags|=128,f=!0,Ho(c,!1),a.lanes=4194304)}else{if(!f)if(e=lc(g),e!==null){if(a.flags|=128,f=!0,e=e.updateQueue,a.updateQueue=e,wc(a,e),Ho(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Ke)return pt(a),null}else 2*At()-c.renderingStartTime>Ac&&i!==536870912&&(a.flags|=128,f=!0,Ho(c,!1),a.lanes=4194304);c.isBackwards?(g.sibling=a.child,a.child=g):(e=c.last,e!==null?e.sibling=g:a.child=g,c.last=g)}return c.tail!==null?(e=c.tail,c.rendering=e,c.tail=e.sibling,c.renderingStartTime=At(),e.sibling=null,i=wt.current,te(wt,f?i&1|2:i&1),Ke&&_a(a,c.treeForkCount),e):(pt(a),null);case 22:case 23:return wn(a),_f(),c=a.memoizedState!==null,e!==null?e.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(i&536870912)!==0&&(a.flags&128)===0&&(pt(a),a.subtreeFlags&6&&(a.flags|=8192)):pt(a),i=a.updateQueue,i!==null&&wc(a,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==i&&(a.flags|=2048),e!==null&&G(dr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Aa(jt),pt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function oC(e,a){switch(cf(a),a.tag){case 1:return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 3:return Aa(jt),he(),e=a.flags,(e&65536)!==0&&(e&128)===0?(a.flags=e&-65537|128,a):null;case 26:case 27:case 5:return Oe(a),null;case 31:if(a.memoizedState!==null){if(wn(a),a.alternate===null)throw Error(r(340));lr()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 13:if(wn(a),e=a.memoizedState,e!==null&&e.dehydrated!==null){if(a.alternate===null)throw Error(r(340));lr()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 19:return G(wt),null;case 4:return he(),null;case 10:return Aa(a.type),null;case 22:case 23:return wn(a),_f(),e!==null&&G(dr),e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 24:return Aa(jt),null;case 25:return null;default:return null}}function qy(e,a){switch(cf(a),a.tag){case 3:Aa(jt),he();break;case 26:case 27:case 5:Oe(a);break;case 4:he();break;case 31:a.memoizedState!==null&&wn(a);break;case 13:wn(a);break;case 19:G(wt);break;case 10:Aa(a.type);break;case 22:case 23:wn(a),_f(),e!==null&&G(dr);break;case 24:Aa(jt)}}function Vo(e,a){try{var i=a.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var f=c.next;i=f;do{if((i.tag&e)===e){c=void 0;var g=i.create,w=i.inst;c=g(),w.destroy=c}i=i.next}while(i!==f)}}catch(N){it(a,a.return,N)}}function ms(e,a,i){try{var c=a.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var g=f.next;c=g;do{if((c.tag&e)===e){var w=c.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,f=a;var B=i,Z=N;try{Z()}catch(ae){it(f,B,ae)}}}c=c.next}while(c!==g)}}catch(ae){it(a,a.return,ae)}}function $y(e){var a=e.updateQueue;if(a!==null){var i=e.stateNode;try{Dv(a,i)}catch(c){it(e,e.return,c)}}}function Py(e,a,i){i.props=gr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(c){it(e,a,c)}}function qo(e,a){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var c=e.stateNode;break;case 30:c=e.stateNode;break;default:c=e.stateNode}typeof i=="function"?e.refCleanup=i(c):i.current=c}}catch(f){it(e,a,f)}}function sa(e,a){var i=e.ref,c=e.refCleanup;if(i!==null)if(typeof c=="function")try{c()}catch(f){it(e,a,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){it(e,a,f)}else i.current=null}function Gy(e){var a=e.type,i=e.memoizedProps,c=e.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&c.focus();break e;case"img":i.src?c.src=i.src:i.srcSet&&(c.srcset=i.srcSet)}}catch(f){it(e,e.return,f)}}function nh(e,a,i){try{var c=e.stateNode;kC(c,e.type,i,a),c[rn]=a}catch(f){it(e,e.return,f)}}function Fy(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ws(e.type)||e.tag===4}function ah(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fy(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ws(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sh(e,a,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(e),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=wa));else if(c!==4&&(c===27&&ws(e.type)&&(i=e.stateNode,a=null),e=e.child,e!==null))for(sh(e,a,i),e=e.sibling;e!==null;)sh(e,a,i),e=e.sibling}function Sc(e,a,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,a?i.insertBefore(e,a):i.appendChild(e);else if(c!==4&&(c===27&&ws(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Sc(e,a,i),e=e.sibling;e!==null;)Sc(e,a,i),e=e.sibling}function Zy(e){var a=e.stateNode,i=e.memoizedProps;try{for(var c=e.type,f=a.attributes;f.length;)a.removeAttributeNode(f[0]);Yt(a,c,i),a[Pt]=e,a[rn]=i}catch(g){it(e,e.return,g)}}var Oa=!1,Nt=!1,rh=!1,Yy=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function lC(e,a){if(e=e.containerInfo,Ah=$c,e=iv(e),Qd(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var f=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break e}var w=0,N=-1,B=-1,Z=0,ae=0,le=e,K=null;t:for(;;){for(var ne;le!==i||f!==0&&le.nodeType!==3||(N=w+f),le!==g||c!==0&&le.nodeType!==3||(B=w+c),le.nodeType===3&&(w+=le.nodeValue.length),(ne=le.firstChild)!==null;)K=le,le=ne;for(;;){if(le===e)break t;if(K===i&&++Z===f&&(N=w),K===g&&++ae===c&&(B=w),(ne=le.nextSibling)!==null)break;le=K,K=le.parentNode}le=ne}i=N===-1||B===-1?null:{start:N,end:B}}else i=null}i=i||{start:0,end:0}}else i=null;for(jh={focusedElem:e,selectionRange:i},$c=!1,Bt=a;Bt!==null;)if(a=Bt,e=a.child,(a.subtreeFlags&1028)!==0&&e!==null)e.return=a,Bt=e;else for(;Bt!==null;){switch(a=Bt,g=a.alternate,e=a.flags,a.tag){case 0:if((e&4)!==0&&(e=a.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)f=e[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,i=a,f=g.memoizedProps,g=g.memoizedState,c=i.stateNode;try{var xe=gr(i.type,f);e=c.getSnapshotBeforeUpdate(xe,g),c.__reactInternalSnapshotBeforeUpdate=e}catch(je){it(i,i.return,je)}}break;case 3:if((e&1024)!==0){if(e=a.stateNode.containerInfo,i=e.nodeType,i===9)Nh(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=a.sibling,e!==null){e.return=a.return,Bt=e;break}Bt=a.return}}function Ky(e,a,i){var c=i.flags;switch(i.tag){case 0:case 11:case 15:Da(e,i),c&4&&Vo(5,i);break;case 1:if(Da(e,i),c&4)if(e=i.stateNode,a===null)try{e.componentDidMount()}catch(w){it(i,i.return,w)}else{var f=gr(i.type,a.memoizedProps);a=a.memoizedState;try{e.componentDidUpdate(f,a,e.__reactInternalSnapshotBeforeUpdate)}catch(w){it(i,i.return,w)}}c&64&&$y(i),c&512&&qo(i,i.return);break;case 3:if(Da(e,i),c&64&&(e=i.updateQueue,e!==null)){if(a=null,i.child!==null)switch(i.child.tag){case 27:case 5:a=i.child.stateNode;break;case 1:a=i.child.stateNode}try{Dv(e,a)}catch(w){it(i,i.return,w)}}break;case 27:a===null&&c&4&&Zy(i);case 26:case 5:Da(e,i),a===null&&c&4&&Gy(i),c&512&&qo(i,i.return);break;case 12:Da(e,i);break;case 31:Da(e,i),c&4&&Wy(e,i);break;case 13:Da(e,i),c&4&&Jy(e,i),c&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=vC.bind(null,i),UC(e,i))));break;case 22:if(c=i.memoizedState!==null||Oa,!c){a=a!==null&&a.memoizedState!==null||Nt,f=Oa;var g=Nt;Oa=c,(Nt=a)&&!g?Ma(e,i,(i.subtreeFlags&8772)!==0):Da(e,i),Oa=f,Nt=g}break;case 30:break;default:Da(e,i)}}function Xy(e){var a=e.alternate;a!==null&&(e.alternate=null,Xy(a)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(a=e.stateNode,a!==null&&Md(a)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var vt=null,ln=!1;function Ra(e,a,i){for(i=i.child;i!==null;)Qy(e,a,i),i=i.sibling}function Qy(e,a,i){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(fo,i)}catch{}switch(i.tag){case 26:Nt||sa(i,a),Ra(e,a,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Nt||sa(i,a);var c=vt,f=ln;ws(i.type)&&(vt=i.stateNode,ln=!1),Ra(e,a,i),Qo(i.stateNode),vt=c,ln=f;break;case 5:Nt||sa(i,a);case 6:if(c=vt,f=ln,vt=null,Ra(e,a,i),vt=c,ln=f,vt!==null)if(ln)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(i.stateNode)}catch(g){it(i,a,g)}else try{vt.removeChild(i.stateNode)}catch(g){it(i,a,g)}break;case 18:vt!==null&&(ln?(e=vt,$0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Di(e)):$0(vt,i.stateNode));break;case 4:c=vt,f=ln,vt=i.stateNode.containerInfo,ln=!0,Ra(e,a,i),vt=c,ln=f;break;case 0:case 11:case 14:case 15:ms(2,i,a),Nt||ms(4,i,a),Ra(e,a,i);break;case 1:Nt||(sa(i,a),c=i.stateNode,typeof c.componentWillUnmount=="function"&&Py(i,a,c)),Ra(e,a,i);break;case 21:Ra(e,a,i);break;case 22:Nt=(c=Nt)||i.memoizedState!==null,Ra(e,a,i),Nt=c;break;default:Ra(e,a,i)}}function Wy(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Di(e)}catch(i){it(a,a.return,i)}}}function Jy(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Di(e)}catch(i){it(a,a.return,i)}}function cC(e){switch(e.tag){case 31:case 13:case 19:var a=e.stateNode;return a===null&&(a=e.stateNode=new Yy),a;case 22:return e=e.stateNode,a=e._retryCache,a===null&&(a=e._retryCache=new Yy),a;default:throw Error(r(435,e.tag))}}function Ec(e,a){var i=cC(e);a.forEach(function(c){if(!i.has(c)){i.add(c);var f=yC.bind(null,e,c);c.then(f,f)}})}function cn(e,a){var i=a.deletions;if(i!==null)for(var c=0;c<i.length;c++){var f=i[c],g=e,w=a,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(ws(N.type)){vt=N.stateNode,ln=!1;break e}break;case 5:vt=N.stateNode,ln=!1;break e;case 3:case 4:vt=N.stateNode.containerInfo,ln=!0;break e}N=N.return}if(vt===null)throw Error(r(160));Qy(g,w,f),vt=null,ln=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)e0(a,e),a=a.sibling}var Pn=null;function e0(e,a){var i=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:cn(a,e),un(e),c&4&&(ms(3,e,e.return),Vo(3,e),ms(5,e,e.return));break;case 1:cn(a,e),un(e),c&512&&(Nt||i===null||sa(i,i.return)),c&64&&Oa&&(e=e.updateQueue,e!==null&&(c=e.callbacks,c!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?c:i.concat(c))));break;case 26:var f=Pn;if(cn(a,e),un(e),c&512&&(Nt||i===null||sa(i,i.return)),c&4){var g=i!==null?i.memoizedState:null;if(c=e.memoizedState,i===null)if(c===null)if(e.stateNode===null){e:{c=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(c){case"title":g=f.getElementsByTagName("title")[0],(!g||g[po]||g[Pt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(c),f.head.insertBefore(g,f.querySelector("head > title"))),Yt(g,c,i),g[Pt]=e,Ut(g),c=g;break e;case"link":var w=eb("link","href",f).get(c+(i.href||""));if(w){for(var N=0;N<w.length;N++)if(g=w[N],g.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&g.getAttribute("rel")===(i.rel==null?null:i.rel)&&g.getAttribute("title")===(i.title==null?null:i.title)&&g.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){w.splice(N,1);break t}}g=f.createElement(c),Yt(g,c,i),f.head.appendChild(g);break;case"meta":if(w=eb("meta","content",f).get(c+(i.content||""))){for(N=0;N<w.length;N++)if(g=w[N],g.getAttribute("content")===(i.content==null?null:""+i.content)&&g.getAttribute("name")===(i.name==null?null:i.name)&&g.getAttribute("property")===(i.property==null?null:i.property)&&g.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&g.getAttribute("charset")===(i.charSet==null?null:i.charSet)){w.splice(N,1);break t}}g=f.createElement(c),Yt(g,c,i),f.head.appendChild(g);break;default:throw Error(r(468,c))}g[Pt]=e,Ut(g),c=g}e.stateNode=c}else tb(f,e.type,e.stateNode);else e.stateNode=J0(f,c,e.memoizedProps);else g!==c?(g===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):g.count--,c===null?tb(f,e.type,e.stateNode):J0(f,c,e.memoizedProps)):c===null&&e.stateNode!==null&&nh(e,e.memoizedProps,i.memoizedProps)}break;case 27:cn(a,e),un(e),c&512&&(Nt||i===null||sa(i,i.return)),i!==null&&c&4&&nh(e,e.memoizedProps,i.memoizedProps);break;case 5:if(cn(a,e),un(e),c&512&&(Nt||i===null||sa(i,i.return)),e.flags&32){f=e.stateNode;try{ni(f,"")}catch(xe){it(e,e.return,xe)}}c&4&&e.stateNode!=null&&(f=e.memoizedProps,nh(e,f,i!==null?i.memoizedProps:f)),c&1024&&(rh=!0);break;case 6:if(cn(a,e),un(e),c&4){if(e.stateNode===null)throw Error(r(162));c=e.memoizedProps,i=e.stateNode;try{i.nodeValue=c}catch(xe){it(e,e.return,xe)}}break;case 3:if(Ic=null,f=Pn,Pn=Uc(a.containerInfo),cn(a,e),Pn=f,un(e),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Di(a.containerInfo)}catch(xe){it(e,e.return,xe)}rh&&(rh=!1,t0(e));break;case 4:c=Pn,Pn=Uc(e.stateNode.containerInfo),cn(a,e),un(e),Pn=c;break;case 12:cn(a,e),un(e);break;case 31:cn(a,e),un(e),c&4&&(c=e.updateQueue,c!==null&&(e.updateQueue=null,Ec(e,c)));break;case 13:cn(a,e),un(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Cc=At()),c&4&&(c=e.updateQueue,c!==null&&(e.updateQueue=null,Ec(e,c)));break;case 22:f=e.memoizedState!==null;var B=i!==null&&i.memoizedState!==null,Z=Oa,ae=Nt;if(Oa=Z||f,Nt=ae||B,cn(a,e),Nt=ae,Oa=Z,un(e),c&8192)e:for(a=e.stateNode,a._visibility=f?a._visibility&-2:a._visibility|1,f&&(i===null||B||Oa||Nt||vr(e)),i=null,a=e;;){if(a.tag===5||a.tag===26){if(i===null){B=i=a;try{if(g=B.stateNode,f)w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=B.stateNode;var le=B.memoizedProps.style,K=le!=null&&le.hasOwnProperty("display")?le.display:null;N.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(xe){it(B,B.return,xe)}}}else if(a.tag===6){if(i===null){B=a;try{B.stateNode.nodeValue=f?"":B.memoizedProps}catch(xe){it(B,B.return,xe)}}}else if(a.tag===18){if(i===null){B=a;try{var ne=B.stateNode;f?P0(ne,!0):P0(B.stateNode,!1)}catch(xe){it(B,B.return,xe)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===e)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=e.updateQueue,c!==null&&(i=c.retryQueue,i!==null&&(c.retryQueue=null,Ec(e,i))));break;case 19:cn(a,e),un(e),c&4&&(c=e.updateQueue,c!==null&&(e.updateQueue=null,Ec(e,c)));break;case 30:break;case 21:break;default:cn(a,e),un(e)}}function un(e){var a=e.flags;if(a&2){try{for(var i,c=e.return;c!==null;){if(Fy(c)){i=c;break}c=c.return}if(i==null)throw Error(r(160));switch(i.tag){case 27:var f=i.stateNode,g=ah(e);Sc(e,g,f);break;case 5:var w=i.stateNode;i.flags&32&&(ni(w,""),i.flags&=-33);var N=ah(e);Sc(e,N,w);break;case 3:case 4:var B=i.stateNode.containerInfo,Z=ah(e);sh(e,Z,B);break;default:throw Error(r(161))}}catch(ae){it(e,e.return,ae)}e.flags&=-3}a&4096&&(e.flags&=-4097)}function t0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var a=e;t0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),e=e.sibling}}function Da(e,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Ky(e,a.alternate,a),a=a.sibling}function vr(e){for(e=e.child;e!==null;){var a=e;switch(a.tag){case 0:case 11:case 14:case 15:ms(4,a,a.return),vr(a);break;case 1:sa(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&Py(a,a.return,i),vr(a);break;case 27:Qo(a.stateNode);case 26:case 5:sa(a,a.return),vr(a);break;case 22:a.memoizedState===null&&vr(a);break;case 30:vr(a);break;default:vr(a)}e=e.sibling}}function Ma(e,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,f=e,g=a,w=g.flags;switch(g.tag){case 0:case 11:case 15:Ma(f,g,i),Vo(4,g);break;case 1:if(Ma(f,g,i),c=g,f=c.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Z){it(c,c.return,Z)}if(c=g,f=c.updateQueue,f!==null){var N=c.stateNode;try{var B=f.shared.hiddenCallbacks;if(B!==null)for(f.shared.hiddenCallbacks=null,f=0;f<B.length;f++)Rv(B[f],N)}catch(Z){it(c,c.return,Z)}}i&&w&64&&$y(g),qo(g,g.return);break;case 27:Zy(g);case 26:case 5:Ma(f,g,i),i&&c===null&&w&4&&Gy(g),qo(g,g.return);break;case 12:Ma(f,g,i);break;case 31:Ma(f,g,i),i&&w&4&&Wy(f,g);break;case 13:Ma(f,g,i),i&&w&4&&Jy(f,g);break;case 22:g.memoizedState===null&&Ma(f,g,i),qo(g,g.return);break;case 30:break;default:Ma(f,g,i)}a=a.sibling}}function ih(e,a){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(e=a.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&To(i))}function oh(e,a){e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&To(e))}function Gn(e,a,i,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)n0(e,a,i,c),a=a.sibling}function n0(e,a,i,c){var f=a.flags;switch(a.tag){case 0:case 11:case 15:Gn(e,a,i,c),f&2048&&Vo(9,a);break;case 1:Gn(e,a,i,c);break;case 3:Gn(e,a,i,c),f&2048&&(e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&To(e)));break;case 12:if(f&2048){Gn(e,a,i,c),e=a.stateNode;try{var g=a.memoizedProps,w=g.id,N=g.onPostCommit;typeof N=="function"&&N(w,a.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(B){it(a,a.return,B)}}else Gn(e,a,i,c);break;case 31:Gn(e,a,i,c);break;case 13:Gn(e,a,i,c);break;case 23:break;case 22:g=a.stateNode,w=a.alternate,a.memoizedState!==null?g._visibility&2?Gn(e,a,i,c):$o(e,a):g._visibility&2?Gn(e,a,i,c):(g._visibility|=2,Si(e,a,i,c,(a.subtreeFlags&10256)!==0||!1)),f&2048&&ih(w,a);break;case 24:Gn(e,a,i,c),f&2048&&oh(a.alternate,a);break;default:Gn(e,a,i,c)}}function Si(e,a,i,c,f){for(f=f&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var g=e,w=a,N=i,B=c,Z=w.flags;switch(w.tag){case 0:case 11:case 15:Si(g,w,N,B,f),Vo(8,w);break;case 23:break;case 22:var ae=w.stateNode;w.memoizedState!==null?ae._visibility&2?Si(g,w,N,B,f):$o(g,w):(ae._visibility|=2,Si(g,w,N,B,f)),f&&Z&2048&&ih(w.alternate,w);break;case 24:Si(g,w,N,B,f),f&&Z&2048&&oh(w.alternate,w);break;default:Si(g,w,N,B,f)}a=a.sibling}}function $o(e,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=e,c=a,f=c.flags;switch(c.tag){case 22:$o(i,c),f&2048&&ih(c.alternate,c);break;case 24:$o(i,c),f&2048&&oh(c.alternate,c);break;default:$o(i,c)}a=a.sibling}}var Po=8192;function Ei(e,a,i){if(e.subtreeFlags&Po)for(e=e.child;e!==null;)a0(e,a,i),e=e.sibling}function a0(e,a,i){switch(e.tag){case 26:Ei(e,a,i),e.flags&Po&&e.memoizedState!==null&&KC(i,Pn,e.memoizedState,e.memoizedProps);break;case 5:Ei(e,a,i);break;case 3:case 4:var c=Pn;Pn=Uc(e.stateNode.containerInfo),Ei(e,a,i),Pn=c;break;case 22:e.memoizedState===null&&(c=e.alternate,c!==null&&c.memoizedState!==null?(c=Po,Po=16777216,Ei(e,a,i),Po=c):Ei(e,a,i));break;default:Ei(e,a,i)}}function s0(e){var a=e.alternate;if(a!==null&&(e=a.child,e!==null)){a.child=null;do a=e.sibling,e.sibling=null,e=a;while(e!==null)}}function Go(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var c=a[i];Bt=c,i0(c,e)}s0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)r0(e),e=e.sibling}function r0(e){switch(e.tag){case 0:case 11:case 15:Go(e),e.flags&2048&&ms(9,e,e.return);break;case 3:Go(e);break;case 12:Go(e);break;case 22:var a=e.stateNode;e.memoizedState!==null&&a._visibility&2&&(e.return===null||e.return.tag!==13)?(a._visibility&=-3,_c(e)):Go(e);break;default:Go(e)}}function _c(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var c=a[i];Bt=c,i0(c,e)}s0(e)}for(e=e.child;e!==null;){switch(a=e,a.tag){case 0:case 11:case 15:ms(8,a,a.return),_c(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,_c(a));break;default:_c(a)}e=e.sibling}}function i0(e,a){for(;Bt!==null;){var i=Bt;switch(i.tag){case 0:case 11:case 15:ms(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var c=i.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:To(i.memoizedState.cache)}if(c=i.child,c!==null)c.return=i,Bt=c;else e:for(i=e;Bt!==null;){c=Bt;var f=c.sibling,g=c.return;if(Xy(c),c===i){Bt=null;break e}if(f!==null){f.return=g,Bt=f;break e}Bt=g}}}var uC={getCacheForType:function(e){var a=Ft(jt),i=a.data.get(e);return i===void 0&&(i=e(),a.data.set(e,i)),i},cacheSignal:function(){return Ft(jt).controller.signal}},dC=typeof WeakMap=="function"?WeakMap:Map,st=0,dt=null,Pe=null,Fe=0,rt=0,Sn=null,ps=!1,_i=!1,lh=!1,za=0,xt=0,gs=0,yr=0,ch=0,En=0,Ci=0,Fo=null,dn=null,uh=!1,Cc=0,o0=0,Ac=1/0,jc=null,vs=null,Mt=0,ys=null,Ai=null,La=0,dh=0,fh=null,l0=null,Zo=0,hh=null;function _n(){return(st&2)!==0&&Fe!==0?Fe&-Fe:U.T!==null?bh():_g()}function c0(){if(En===0)if((Fe&536870912)===0||Ke){var e=zl;zl<<=1,(zl&3932160)===0&&(zl=262144),En=e}else En=536870912;return e=xn.current,e!==null&&(e.flags|=32),En}function fn(e,a,i){(e===dt&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(ji(e,0),bs(e,Fe,En,!1)),mo(e,i),((st&2)===0||e!==dt)&&(e===dt&&((st&2)===0&&(yr|=i),xt===4&&bs(e,Fe,En,!1)),ra(e))}function u0(e,a,i){if((st&6)!==0)throw Error(r(327));var c=!i&&(a&127)===0&&(a&e.expiredLanes)===0||ho(e,a),f=c?mC(e,a):ph(e,a,!0),g=c;do{if(f===0){_i&&!c&&bs(e,a,0,!1);break}else{if(i=e.current.alternate,g&&!fC(i)){f=ph(e,a,!1),g=!1;continue}if(f===2){if(g=a,e.errorRecoveryDisabledLanes&g)var w=0;else w=e.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){a=w;e:{var N=e;f=Fo;var B=N.current.memoizedState.isDehydrated;if(B&&(ji(N,w).flags|=256),w=ph(N,w,!1),w!==2){if(lh&&!B){N.errorRecoveryDisabledLanes|=g,yr|=g,f=4;break e}g=dn,dn=f,g!==null&&(dn===null?dn=g:dn.push.apply(dn,g))}f=w}if(g=!1,f!==2)continue}}if(f===1){ji(e,0),bs(e,a,0,!0);break}e:{switch(c=e,g=f,g){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:bs(c,a,En,!ps);break e;case 2:dn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(f=Cc+300-At(),10<f)){if(bs(c,a,En,!ps),Ul(c,0,!0)!==0)break e;La=a,c.timeoutHandle=V0(d0.bind(null,c,i,dn,jc,uh,a,En,yr,Ci,ps,g,"Throttled",-0,0),f);break e}d0(c,i,dn,jc,uh,a,En,yr,Ci,ps,g,null,-0,0)}}break}while(!0);ra(e)}function d0(e,a,i,c,f,g,w,N,B,Z,ae,le,K,ne){if(e.timeoutHandle=-1,le=a.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wa},a0(a,g,le);var xe=(g&62914560)===g?Cc-At():(g&4194048)===g?o0-At():0;if(xe=XC(le,xe),xe!==null){La=g,e.cancelPendingCommit=xe(b0.bind(null,e,a,g,i,c,f,w,N,B,ae,le,null,K,ne)),bs(e,g,w,!Z);return}}b0(e,a,g,i,c,f,w,N,B)}function fC(e){for(var a=e;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var c=0;c<i.length;c++){var f=i[c],g=f.getSnapshot;f=f.value;try{if(!yn(g(),f))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function bs(e,a,i,c){a&=~ch,a&=~yr,e.suspendedLanes|=a,e.pingedLanes&=~a,c&&(e.warmLanes|=a),c=e.expirationTimes;for(var f=a;0<f;){var g=31-vn(f),w=1<<g;c[g]=-1,f&=~w}i!==0&&wg(e,i,a)}function Tc(){return(st&6)===0?(Yo(0),!1):!0}function mh(){if(Pe!==null){if(rt===0)var e=Pe.return;else e=Pe,Ca=cr=null,Nf(e),vi=null,No=0,e=Pe;for(;e!==null;)qy(e.alternate,e),e=e.return;Pe=null}}function ji(e,a){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,RC(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),La=0,mh(),dt=e,Pe=i=Ea(e.current,null),Fe=a,rt=0,Sn=null,ps=!1,_i=ho(e,a),lh=!1,Ci=En=ch=yr=gs=xt=0,dn=Fo=null,uh=!1,(a&8)!==0&&(a|=a&32);var c=e.entangledLanes;if(c!==0)for(e=e.entanglements,c&=a;0<c;){var f=31-vn(c),g=1<<f;a|=e[f],c&=~g}return za=a,Kl(),i}function f0(e,a){Le=null,U.H=Bo,a===gi||a===ac?(a=Tv(),rt=3):a===yf?(a=Tv(),rt=4):rt=a===Ff?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Sn=a,Pe===null&&(xt=1,vc(e,kn(a,e.current)))}function h0(){var e=xn.current;return e===null?!0:(Fe&4194048)===Fe?Dn===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?e===Dn:!1}function m0(){var e=U.H;return U.H=Bo,e===null?Bo:e}function p0(){var e=U.A;return U.A=uC,e}function kc(){xt=4,ps||(Fe&4194048)!==Fe&&xn.current!==null||(_i=!0),(gs&134217727)===0&&(yr&134217727)===0||dt===null||bs(dt,Fe,En,!1)}function ph(e,a,i){var c=st;st|=2;var f=m0(),g=p0();(dt!==e||Fe!==a)&&(jc=null,ji(e,a)),a=!1;var w=xt;e:do try{if(rt!==0&&Pe!==null){var N=Pe,B=Sn;switch(rt){case 8:mh(),w=6;break e;case 3:case 2:case 9:case 6:xn.current===null&&(a=!0);var Z=rt;if(rt=0,Sn=null,Ti(e,N,B,Z),i&&_i){w=0;break e}break;default:Z=rt,rt=0,Sn=null,Ti(e,N,B,Z)}}hC(),w=xt;break}catch(ae){f0(e,ae)}while(!0);return a&&e.shellSuspendCounter++,Ca=cr=null,st=c,U.H=f,U.A=g,Pe===null&&(dt=null,Fe=0,Kl()),w}function hC(){for(;Pe!==null;)g0(Pe)}function mC(e,a){var i=st;st|=2;var c=m0(),f=p0();dt!==e||Fe!==a?(jc=null,Ac=At()+500,ji(e,a)):_i=ho(e,a);e:do try{if(rt!==0&&Pe!==null){a=Pe;var g=Sn;t:switch(rt){case 1:rt=0,Sn=null,Ti(e,a,g,1);break;case 2:case 9:if(Av(g)){rt=0,Sn=null,v0(a);break}a=function(){rt!==2&&rt!==9||dt!==e||(rt=7),ra(e)},g.then(a,a);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:Av(g)?(rt=0,Sn=null,v0(a)):(rt=0,Sn=null,Ti(e,a,g,7));break;case 5:var w=null;switch(Pe.tag){case 26:w=Pe.memoizedState;case 5:case 27:var N=Pe;if(w?nb(w):N.stateNode.complete){rt=0,Sn=null;var B=N.sibling;if(B!==null)Pe=B;else{var Z=N.return;Z!==null?(Pe=Z,Nc(Z)):Pe=null}break t}}rt=0,Sn=null,Ti(e,a,g,5);break;case 6:rt=0,Sn=null,Ti(e,a,g,6);break;case 8:mh(),xt=6;break e;default:throw Error(r(462))}}pC();break}catch(ae){f0(e,ae)}while(!0);return Ca=cr=null,U.H=c,U.A=f,st=i,Pe!==null?0:(dt=null,Fe=0,Kl(),xt)}function pC(){for(;Pe!==null&&!er();)g0(Pe)}function g0(e){var a=Hy(e.alternate,e,za);e.memoizedProps=e.pendingProps,a===null?Nc(e):Pe=a}function v0(e){var a=e,i=a.alternate;switch(a.tag){case 15:case 0:a=My(i,a,a.pendingProps,a.type,void 0,Fe);break;case 11:a=My(i,a,a.pendingProps,a.type.render,a.ref,Fe);break;case 5:Nf(a);default:qy(i,a),a=Pe=pv(a,za),a=Hy(i,a,za)}e.memoizedProps=e.pendingProps,a===null?Nc(e):Pe=a}function Ti(e,a,i,c){Ca=cr=null,Nf(a),vi=null,No=0;var f=a.return;try{if(aC(e,f,a,i,Fe)){xt=1,vc(e,kn(i,e.current)),Pe=null;return}}catch(g){if(f!==null)throw Pe=f,g;xt=1,vc(e,kn(i,e.current)),Pe=null;return}a.flags&32768?(Ke||c===1?e=!0:_i||(Fe&536870912)!==0?e=!1:(ps=e=!0,(c===2||c===9||c===3||c===6)&&(c=xn.current,c!==null&&c.tag===13&&(c.flags|=16384))),y0(a,e)):Nc(a)}function Nc(e){var a=e;do{if((a.flags&32768)!==0){y0(a,ps);return}e=a.return;var i=iC(a.alternate,a,za);if(i!==null){Pe=i;return}if(a=a.sibling,a!==null){Pe=a;return}Pe=a=e}while(a!==null);xt===0&&(xt=5)}function y0(e,a){do{var i=oC(e.alternate,e);if(i!==null){i.flags&=32767,Pe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=i}while(e!==null);xt=6,Pe=null}function b0(e,a,i,c,f,g,w,N,B){e.cancelPendingCommit=null;do Oc();while(Mt!==0);if((st&6)!==0)throw Error(r(327));if(a!==null){if(a===e.current)throw Error(r(177));if(g=a.lanes|a.childLanes,g|=nf,YE(e,i,g,w,N,B),e===dt&&(Pe=dt=null,Fe=0),Ai=a,ys=e,La=i,dh=g,fh=f,l0=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,bC(Dl,function(){return _0(),null})):(e.callbackNode=null,e.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=U.T,U.T=null,f=$.p,$.p=2,w=st,st|=4;try{lC(e,a,i)}finally{st=w,$.p=f,U.T=c}}Mt=1,x0(),w0(),S0()}}function x0(){if(Mt===1){Mt=0;var e=ys,a=Ai,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var c=$.p;$.p=2;var f=st;st|=4;try{e0(a,e);var g=jh,w=iv(e.containerInfo),N=g.focusedElem,B=g.selectionRange;if(w!==N&&N&&N.ownerDocument&&rv(N.ownerDocument.documentElement,N)){if(B!==null&&Qd(N)){var Z=B.start,ae=B.end;if(ae===void 0&&(ae=Z),"selectionStart"in N)N.selectionStart=Z,N.selectionEnd=Math.min(ae,N.value.length);else{var le=N.ownerDocument||document,K=le&&le.defaultView||window;if(K.getSelection){var ne=K.getSelection(),xe=N.textContent.length,je=Math.min(B.start,xe),ct=B.end===void 0?je:Math.min(B.end,xe);!ne.extend&&je>ct&&(w=ct,ct=je,je=w);var P=sv(N,je),H=sv(N,ct);if(P&&H&&(ne.rangeCount!==1||ne.anchorNode!==P.node||ne.anchorOffset!==P.offset||ne.focusNode!==H.node||ne.focusOffset!==H.offset)){var F=le.createRange();F.setStart(P.node,P.offset),ne.removeAllRanges(),je>ct?(ne.addRange(F),ne.extend(H.node,H.offset)):(F.setEnd(H.node,H.offset),ne.addRange(F))}}}}for(le=[],ne=N;ne=ne.parentNode;)ne.nodeType===1&&le.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<le.length;N++){var oe=le[N];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}$c=!!Ah,jh=Ah=null}finally{st=f,$.p=c,U.T=i}}e.current=a,Mt=2}}function w0(){if(Mt===2){Mt=0;var e=ys,a=Ai,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var c=$.p;$.p=2;var f=st;st|=4;try{Ky(e,a.alternate,a)}finally{st=f,$.p=c,U.T=i}}Mt=3}}function S0(){if(Mt===4||Mt===3){Mt=0,$t();var e=ys,a=Ai,i=La,c=l0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Mt=5:(Mt=0,Ai=ys=null,E0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(vs=null),Rd(i),a=a.stateNode,gn&&typeof gn.onCommitFiberRoot=="function")try{gn.onCommitFiberRoot(fo,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=U.T,f=$.p,$.p=2,U.T=null;try{for(var g=e.onRecoverableError,w=0;w<c.length;w++){var N=c[w];g(N.value,{componentStack:N.stack})}}finally{U.T=a,$.p=f}}(La&3)!==0&&Oc(),ra(e),f=e.pendingLanes,(i&261930)!==0&&(f&42)!==0?e===hh?Zo++:(Zo=0,hh=e):Zo=0,Yo(0)}}function E0(e,a){(e.pooledCacheLanes&=a)===0&&(a=e.pooledCache,a!=null&&(e.pooledCache=null,To(a)))}function Oc(){return x0(),w0(),S0(),_0()}function _0(){if(Mt!==5)return!1;var e=ys,a=dh;dh=0;var i=Rd(La),c=U.T,f=$.p;try{$.p=32>i?32:i,U.T=null,i=fh,fh=null;var g=ys,w=La;if(Mt=0,Ai=ys=null,La=0,(st&6)!==0)throw Error(r(331));var N=st;if(st|=4,r0(g.current),n0(g,g.current,w,i),st=N,Yo(0,!1),gn&&typeof gn.onPostCommitFiberRoot=="function")try{gn.onPostCommitFiberRoot(fo,g)}catch{}return!0}finally{$.p=f,U.T=c,E0(e,a)}}function C0(e,a,i){a=kn(i,a),a=Gf(e.stateNode,a,2),e=ds(e,a,2),e!==null&&(mo(e,2),ra(e))}function it(e,a,i){if(e.tag===3)C0(e,e,i);else for(;a!==null;){if(a.tag===3){C0(a,e,i);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(vs===null||!vs.has(c))){e=kn(i,e),i=Ay(2),c=ds(a,i,2),c!==null&&(jy(i,c,a,e),mo(c,2),ra(c));break}}a=a.return}}function gh(e,a,i){var c=e.pingCache;if(c===null){c=e.pingCache=new dC;var f=new Set;c.set(a,f)}else f=c.get(a),f===void 0&&(f=new Set,c.set(a,f));f.has(i)||(lh=!0,f.add(i),e=gC.bind(null,e,a,i),a.then(e,e))}function gC(e,a,i){var c=e.pingCache;c!==null&&c.delete(a),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,dt===e&&(Fe&i)===i&&(xt===4||xt===3&&(Fe&62914560)===Fe&&300>At()-Cc?(st&2)===0&&ji(e,0):ch|=i,Ci===Fe&&(Ci=0)),ra(e)}function A0(e,a){a===0&&(a=xg()),e=ir(e,a),e!==null&&(mo(e,a),ra(e))}function vC(e){var a=e.memoizedState,i=0;a!==null&&(i=a.retryLane),A0(e,i)}function yC(e,a){var i=0;switch(e.tag){case 31:case 13:var c=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:c=e.stateNode;break;case 22:c=e.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(a),A0(e,i)}function bC(e,a){return Je(e,a)}var Rc=null,ki=null,vh=!1,Dc=!1,yh=!1,xs=0;function ra(e){e!==ki&&e.next===null&&(ki===null?Rc=ki=e:ki=ki.next=e),Dc=!0,vh||(vh=!0,wC())}function Yo(e,a){if(!yh&&Dc){yh=!0;do for(var i=!1,c=Rc;c!==null;){if(e!==0){var f=c.pendingLanes;if(f===0)var g=0;else{var w=c.suspendedLanes,N=c.pingedLanes;g=(1<<31-vn(42|e)+1)-1,g&=f&~(w&~N),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,N0(c,g))}else g=Fe,g=Ul(c,c===dt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ho(c,g)||(i=!0,N0(c,g));c=c.next}while(i);yh=!1}}function xC(){j0()}function j0(){Dc=vh=!1;var e=0;xs!==0&&OC()&&(e=xs);for(var a=At(),i=null,c=Rc;c!==null;){var f=c.next,g=T0(c,a);g===0?(c.next=null,i===null?Rc=f:i.next=f,f===null&&(ki=i)):(i=c,(e!==0||(g&3)!==0)&&(Dc=!0)),c=f}Mt!==0&&Mt!==5||Yo(e),xs!==0&&(xs=0)}function T0(e,a){for(var i=e.suspendedLanes,c=e.pingedLanes,f=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var w=31-vn(g),N=1<<w,B=f[w];B===-1?((N&i)===0||(N&c)!==0)&&(f[w]=ZE(N,a)):B<=a&&(e.expiredLanes|=N),g&=~N}if(a=dt,i=Fe,i=Ul(e,e===a?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),c=e.callbackNode,i===0||e===a&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return c!==null&&c!==null&>(c),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ho(e,i)){if(a=i&-i,a===e.callbackPriority)return a;switch(c!==null&>(c),Rd(i)){case 2:case 8:i=yg;break;case 32:i=Dl;break;case 268435456:i=bg;break;default:i=Dl}return c=k0.bind(null,e),i=Je(i,c),e.callbackPriority=a,e.callbackNode=i,a}return c!==null&&c!==null&>(c),e.callbackPriority=2,e.callbackNode=null,2}function k0(e,a){if(Mt!==0&&Mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Oc()&&e.callbackNode!==i)return null;var c=Fe;return c=Ul(e,e===dt?c:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),c===0?null:(u0(e,c,a),T0(e,At()),e.callbackNode!=null&&e.callbackNode===i?k0.bind(null,e):null)}function N0(e,a){if(Oc())return null;u0(e,a,!0)}function wC(){DC(function(){(st&6)!==0?Je(vg,xC):j0()})}function bh(){if(xs===0){var e=mi;e===0&&(e=Ml,Ml<<=1,(Ml&261888)===0&&(Ml=256)),xs=e}return xs}function O0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Vl(""+e)}function R0(e,a){var i=a.ownerDocument.createElement("input");return i.name=a.name,i.value=a.value,e.id&&i.setAttribute("form",e.id),a.parentNode.insertBefore(i,a),e=new FormData(e),i.parentNode.removeChild(i),e}function SC(e,a,i,c,f){if(a==="submit"&&i&&i.stateNode===f){var g=O0((f[rn]||null).action),w=c.submitter;w&&(a=(a=w[rn]||null)?O0(a.formAction):w.getAttribute("formAction"),a!==null&&(g=a,w=null));var N=new Gl("action","action",null,c,f);e.push({event:N,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(xs!==0){var B=w?R0(f,w):new FormData(f);If(i,{pending:!0,data:B,method:f.method,action:g},null,B)}}else typeof g=="function"&&(N.preventDefault(),B=w?R0(f,w):new FormData(f),If(i,{pending:!0,data:B,method:f.method,action:g},g,B))},currentTarget:f}]})}}for(var xh=0;xh<tf.length;xh++){var wh=tf[xh],EC=wh.toLowerCase(),_C=wh[0].toUpperCase()+wh.slice(1);$n(EC,"on"+_C)}$n(cv,"onAnimationEnd"),$n(uv,"onAnimationIteration"),$n(dv,"onAnimationStart"),$n("dblclick","onDoubleClick"),$n("focusin","onFocus"),$n("focusout","onBlur"),$n(H_,"onTransitionRun"),$n(V_,"onTransitionStart"),$n(q_,"onTransitionCancel"),$n(fv,"onTransitionEnd"),ei("onMouseEnter",["mouseout","mouseover"]),ei("onMouseLeave",["mouseout","mouseover"]),ei("onPointerEnter",["pointerout","pointerover"]),ei("onPointerLeave",["pointerout","pointerover"]),nr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nr("onBeforeInput",["compositionend","keypress","textInput","paste"]),nr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ko="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),CC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ko));function D0(e,a){a=(a&4)!==0;for(var i=0;i<e.length;i++){var c=e[i],f=c.event;c=c.listeners;e:{var g=void 0;if(a)for(var w=c.length-1;0<=w;w--){var N=c[w],B=N.instance,Z=N.currentTarget;if(N=N.listener,B!==g&&f.isPropagationStopped())break e;g=N,f.currentTarget=Z;try{g(f)}catch(ae){Yl(ae)}f.currentTarget=null,g=B}else for(w=0;w<c.length;w++){if(N=c[w],B=N.instance,Z=N.currentTarget,N=N.listener,B!==g&&f.isPropagationStopped())break e;g=N,f.currentTarget=Z;try{g(f)}catch(ae){Yl(ae)}f.currentTarget=null,g=B}}}}function Ge(e,a){var i=a[Dd];i===void 0&&(i=a[Dd]=new Set);var c=e+"__bubble";i.has(c)||(M0(a,e,2,!1),i.add(c))}function Sh(e,a,i){var c=0;a&&(c|=4),M0(i,e,c,a)}var Mc="_reactListening"+Math.random().toString(36).slice(2);function Eh(e){if(!e[Mc]){e[Mc]=!0,jg.forEach(function(i){i!=="selectionchange"&&(CC.has(i)||Sh(i,!1,e),Sh(i,!0,e))});var a=e.nodeType===9?e:e.ownerDocument;a===null||a[Mc]||(a[Mc]=!0,Sh("selectionchange",!1,a))}}function M0(e,a,i,c){switch(cb(a)){case 2:var f=JC;break;case 8:f=eA;break;default:f=Bh}i=f.bind(null,a,i,e),f=void 0,!qd||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(f=!0),c?f!==void 0?e.addEventListener(a,i,{capture:!0,passive:f}):e.addEventListener(a,i,!0):f!==void 0?e.addEventListener(a,i,{passive:f}):e.addEventListener(a,i,!1)}function _h(e,a,i,c,f){var g=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var N=c.stateNode.containerInfo;if(N===f)break;if(w===4)for(w=c.return;w!==null;){var B=w.tag;if((B===3||B===4)&&w.stateNode.containerInfo===f)return;w=w.return}for(;N!==null;){if(w=Qr(N),w===null)return;if(B=w.tag,B===5||B===6||B===26||B===27){c=g=w;continue e}N=N.parentNode}}c=c.return}Ig(function(){var Z=g,ae=Hd(i),le=[];e:{var K=hv.get(e);if(K!==void 0){var ne=Gl,xe=e;switch(e){case"keypress":if($l(i)===0)break e;case"keydown":case"keyup":ne=y_;break;case"focusin":xe="focus",ne=Fd;break;case"focusout":xe="blur",ne=Fd;break;case"beforeblur":case"afterblur":ne=Fd;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=qg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=i_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=w_;break;case cv:case uv:case dv:ne=c_;break;case fv:ne=E_;break;case"scroll":case"scrollend":ne=s_;break;case"wheel":ne=C_;break;case"copy":case"cut":case"paste":ne=d_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Pg;break;case"toggle":case"beforetoggle":ne=j_}var je=(a&4)!==0,ct=!je&&(e==="scroll"||e==="scrollend"),P=je?K!==null?K+"Capture":null:K;je=[];for(var H=Z,F;H!==null;){var oe=H;if(F=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||F===null||P===null||(oe=vo(H,P),oe!=null&&je.push(Xo(H,oe,F))),ct)break;H=H.return}0<je.length&&(K=new ne(K,xe,null,i,ae),le.push({event:K,listeners:je}))}}if((a&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",K&&i!==Id&&(xe=i.relatedTarget||i.fromElement)&&(Qr(xe)||xe[Xr]))break e;if((ne||K)&&(K=ae.window===ae?ae:(K=ae.ownerDocument)?K.defaultView||K.parentWindow:window,ne?(xe=i.relatedTarget||i.toElement,ne=Z,xe=xe?Qr(xe):null,xe!==null&&(ct=l(xe),je=xe.tag,xe!==ct||je!==5&&je!==27&&je!==6)&&(xe=null)):(ne=null,xe=Z),ne!==xe)){if(je=qg,oe="onMouseLeave",P="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(je=Pg,oe="onPointerLeave",P="onPointerEnter",H="pointer"),ct=ne==null?K:go(ne),F=xe==null?K:go(xe),K=new je(oe,H+"leave",ne,i,ae),K.target=ct,K.relatedTarget=F,oe=null,Qr(ae)===Z&&(je=new je(P,H+"enter",xe,i,ae),je.target=F,je.relatedTarget=ct,oe=je),ct=oe,ne&&xe)t:{for(je=AC,P=ne,H=xe,F=0,oe=P;oe;oe=je(oe))F++;oe=0;for(var Ce=H;Ce;Ce=je(Ce))oe++;for(;0<F-oe;)P=je(P),F--;for(;0<oe-F;)H=je(H),oe--;for(;F--;){if(P===H||H!==null&&P===H.alternate){je=P;break t}P=je(P),H=je(H)}je=null}else je=null;ne!==null&&z0(le,K,ne,je,!1),xe!==null&&ct!==null&&z0(le,ct,xe,je,!0)}}e:{if(K=Z?go(Z):window,ne=K.nodeName&&K.nodeName.toLowerCase(),ne==="select"||ne==="input"&&K.type==="file")var tt=Wg;else if(Xg(K))if(Jg)tt=U_;else{tt=z_;var Se=M_}else ne=K.nodeName,!ne||ne.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?Z&&Bd(Z.elementType)&&(tt=Wg):tt=L_;if(tt&&(tt=tt(e,Z))){Qg(le,tt,i,ae);break e}Se&&Se(e,K,Z),e==="focusout"&&Z&&K.type==="number"&&Z.memoizedProps.value!=null&&Ud(K,"number",K.value)}switch(Se=Z?go(Z):window,e){case"focusin":(Xg(Se)||Se.contentEditable==="true")&&(ii=Se,Wd=Z,Co=null);break;case"focusout":Co=Wd=ii=null;break;case"mousedown":Jd=!0;break;case"contextmenu":case"mouseup":case"dragend":Jd=!1,ov(le,i,ae);break;case"selectionchange":if(I_)break;case"keydown":case"keyup":ov(le,i,ae)}var Ue;if(Yd)e:{switch(e){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else ri?Yg(e,i)&&(Ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ze="onCompositionStart");Ze&&(Gg&&i.locale!=="ko"&&(ri||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&ri&&(Ue=Hg()):(ss=ae,$d="value"in ss?ss.value:ss.textContent,ri=!0)),Se=zc(Z,Ze),0<Se.length&&(Ze=new $g(Ze,e,null,i,ae),le.push({event:Ze,listeners:Se}),Ue?Ze.data=Ue:(Ue=Kg(i),Ue!==null&&(Ze.data=Ue)))),(Ue=k_?N_(e,i):O_(e,i))&&(Ze=zc(Z,"onBeforeInput"),0<Ze.length&&(Se=new $g("onBeforeInput","beforeinput",null,i,ae),le.push({event:Se,listeners:Ze}),Se.data=Ue)),SC(le,e,Z,i,ae)}D0(le,a)})}function Xo(e,a,i){return{instance:e,listener:a,currentTarget:i}}function zc(e,a){for(var i=a+"Capture",c=[];e!==null;){var f=e,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=vo(e,i),f!=null&&c.unshift(Xo(e,f,g)),f=vo(e,a),f!=null&&c.push(Xo(e,f,g))),e.tag===3)return c;e=e.return}return[]}function AC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function z0(e,a,i,c,f){for(var g=a._reactName,w=[];i!==null&&i!==c;){var N=i,B=N.alternate,Z=N.stateNode;if(N=N.tag,B!==null&&B===c)break;N!==5&&N!==26&&N!==27||Z===null||(B=Z,f?(Z=vo(i,g),Z!=null&&w.unshift(Xo(i,Z,B))):f||(Z=vo(i,g),Z!=null&&w.push(Xo(i,Z,B)))),i=i.return}w.length!==0&&e.push({event:a,listeners:w})}var jC=/\r\n?/g,TC=/\u0000|\uFFFD/g;function L0(e){return(typeof e=="string"?e:""+e).replace(jC,`
|
|
149
|
+
`).replace(TC,"")}function U0(e,a){return a=L0(a),L0(e)===a}function lt(e,a,i,c,f,g){switch(i){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||ni(e,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&ni(e,""+c);break;case"className":Il(e,"class",c);break;case"tabIndex":Il(e,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Il(e,i,c);break;case"style":Ug(e,c,g);break;case"data":if(a!=="object"){Il(e,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||i!=="href")){e.removeAttribute(i);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){e.removeAttribute(i);break}c=Vl(""+c),e.setAttribute(i,c);break;case"action":case"formAction":if(typeof c=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(i==="formAction"?(a!=="input"&<(e,a,"name",f.name,f,null),lt(e,a,"formEncType",f.formEncType,f,null),lt(e,a,"formMethod",f.formMethod,f,null),lt(e,a,"formTarget",f.formTarget,f,null)):(lt(e,a,"encType",f.encType,f,null),lt(e,a,"method",f.method,f,null),lt(e,a,"target",f.target,f,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){e.removeAttribute(i);break}c=Vl(""+c),e.setAttribute(i,c);break;case"onClick":c!=null&&(e.onclick=wa);break;case"onScroll":c!=null&&Ge("scroll",e);break;case"onScrollEnd":c!=null&&Ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(i=c.__html,i!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=i}}break;case"multiple":e.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":e.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){e.removeAttribute("xlink:href");break}i=Vl(""+c),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(i,""+c):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":c===!0?e.setAttribute(i,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(i,c):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?e.setAttribute(i,c):e.removeAttribute(i);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?e.removeAttribute(i):e.setAttribute(i,c);break;case"popover":Ge("beforetoggle",e),Ge("toggle",e),Bl(e,"popover",c);break;case"xlinkActuate":xa(e,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":xa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":xa(e,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":xa(e,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":xa(e,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":xa(e,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":xa(e,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":xa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":xa(e,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Bl(e,"is",c);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=n_.get(i)||i,Bl(e,i,c))}}function Ch(e,a,i,c,f,g){switch(i){case"style":Ug(e,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(i=c.__html,i!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=i}}break;case"children":typeof c=="string"?ni(e,c):(typeof c=="number"||typeof c=="bigint")&&ni(e,""+c);break;case"onScroll":c!=null&&Ge("scroll",e);break;case"onScrollEnd":c!=null&&Ge("scrollend",e);break;case"onClick":c!=null&&(e.onclick=wa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Tg.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),a=i.slice(2,f?i.length-7:void 0),g=e[rn]||null,g=g!=null?g[i]:null,typeof g=="function"&&e.removeEventListener(a,g,f),typeof c=="function")){typeof g!="function"&&g!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(a,c,f);break e}i in e?e[i]=c:c===!0?e.setAttribute(i,""):Bl(e,i,c)}}}function Yt(e,a,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",e),Ge("load",e);var c=!1,f=!1,g;for(g in i)if(i.hasOwnProperty(g)){var w=i[g];if(w!=null)switch(g){case"src":c=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:lt(e,a,g,w,i,null)}}f&<(e,a,"srcSet",i.srcSet,i,null),c&<(e,a,"src",i.src,i,null);return;case"input":Ge("invalid",e);var N=g=w=f=null,B=null,Z=null;for(c in i)if(i.hasOwnProperty(c)){var ae=i[c];if(ae!=null)switch(c){case"name":f=ae;break;case"type":w=ae;break;case"checked":B=ae;break;case"defaultChecked":Z=ae;break;case"value":g=ae;break;case"defaultValue":N=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,a));break;default:lt(e,a,c,ae,i,null)}}Dg(e,g,N,B,Z,w,f,!1);return;case"select":Ge("invalid",e),c=w=g=null;for(f in i)if(i.hasOwnProperty(f)&&(N=i[f],N!=null))switch(f){case"value":g=N;break;case"defaultValue":w=N;break;case"multiple":c=N;default:lt(e,a,f,N,i,null)}a=g,i=w,e.multiple=!!c,a!=null?ti(e,!!c,a,!1):i!=null&&ti(e,!!c,i,!0);return;case"textarea":Ge("invalid",e),g=f=c=null;for(w in i)if(i.hasOwnProperty(w)&&(N=i[w],N!=null))switch(w){case"value":c=N;break;case"defaultValue":f=N;break;case"children":g=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:lt(e,a,w,N,i,null)}zg(e,c,f,g);return;case"option":for(B in i)if(i.hasOwnProperty(B)&&(c=i[B],c!=null))switch(B){case"selected":e.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:lt(e,a,B,c,i,null)}return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(c=0;c<Ko.length;c++)Ge(Ko[c],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Z in i)if(i.hasOwnProperty(Z)&&(c=i[Z],c!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:lt(e,a,Z,c,i,null)}return;default:if(Bd(a)){for(ae in i)i.hasOwnProperty(ae)&&(c=i[ae],c!==void 0&&Ch(e,a,ae,c,i,void 0));return}}for(N in i)i.hasOwnProperty(N)&&(c=i[N],c!=null&<(e,a,N,c,i,null))}function kC(e,a,i,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,w=null,N=null,B=null,Z=null,ae=null;for(ne in i){var le=i[ne];if(i.hasOwnProperty(ne)&&le!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":B=le;default:c.hasOwnProperty(ne)||lt(e,a,ne,null,c,le)}}for(var K in c){var ne=c[K];if(le=i[K],c.hasOwnProperty(K)&&(ne!=null||le!=null))switch(K){case"type":g=ne;break;case"name":f=ne;break;case"checked":Z=ne;break;case"defaultChecked":ae=ne;break;case"value":w=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,a));break;default:ne!==le&<(e,a,K,ne,c,le)}}Ld(e,w,N,B,Z,ae,g,f);return;case"select":ne=w=N=K=null;for(g in i)if(B=i[g],i.hasOwnProperty(g)&&B!=null)switch(g){case"value":break;case"multiple":ne=B;default:c.hasOwnProperty(g)||lt(e,a,g,null,c,B)}for(f in c)if(g=c[f],B=i[f],c.hasOwnProperty(f)&&(g!=null||B!=null))switch(f){case"value":K=g;break;case"defaultValue":N=g;break;case"multiple":w=g;default:g!==B&<(e,a,f,g,c,B)}a=N,i=w,c=ne,K!=null?ti(e,!!i,K,!1):!!c!=!!i&&(a!=null?ti(e,!!i,a,!0):ti(e,!!i,i?[]:"",!1));return;case"textarea":ne=K=null;for(N in i)if(f=i[N],i.hasOwnProperty(N)&&f!=null&&!c.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:lt(e,a,N,null,c,f)}for(w in c)if(f=c[w],g=i[w],c.hasOwnProperty(w)&&(f!=null||g!=null))switch(w){case"value":K=f;break;case"defaultValue":ne=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==g&<(e,a,w,f,c,g)}Mg(e,K,ne);return;case"option":for(var xe in i)if(K=i[xe],i.hasOwnProperty(xe)&&K!=null&&!c.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:lt(e,a,xe,null,c,K)}for(B in c)if(K=c[B],ne=i[B],c.hasOwnProperty(B)&&K!==ne&&(K!=null||ne!=null))switch(B){case"selected":e.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:lt(e,a,B,K,c,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in i)K=i[je],i.hasOwnProperty(je)&&K!=null&&!c.hasOwnProperty(je)&<(e,a,je,null,c,K);for(Z in c)if(K=c[Z],ne=i[Z],c.hasOwnProperty(Z)&&K!==ne&&(K!=null||ne!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,a));break;default:lt(e,a,Z,K,c,ne)}return;default:if(Bd(a)){for(var ct in i)K=i[ct],i.hasOwnProperty(ct)&&K!==void 0&&!c.hasOwnProperty(ct)&&Ch(e,a,ct,void 0,c,K);for(ae in c)K=c[ae],ne=i[ae],!c.hasOwnProperty(ae)||K===ne||K===void 0&&ne===void 0||Ch(e,a,ae,K,c,ne);return}}for(var P in i)K=i[P],i.hasOwnProperty(P)&&K!=null&&!c.hasOwnProperty(P)&<(e,a,P,null,c,K);for(le in c)K=c[le],ne=i[le],!c.hasOwnProperty(le)||K===ne||K==null&&ne==null||lt(e,a,le,K,c,ne)}function B0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function NC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,a=0,i=performance.getEntriesByType("resource"),c=0;c<i.length;c++){var f=i[c],g=f.transferSize,w=f.initiatorType,N=f.duration;if(g&&N&&B0(w)){for(w=0,N=f.responseEnd,c+=1;c<i.length;c++){var B=i[c],Z=B.startTime;if(Z>N)break;var ae=B.transferSize,le=B.initiatorType;ae&&B0(le)&&(B=B.responseEnd,w+=ae*(B<N?1:(N-Z)/(B-Z)))}if(--c,a+=8*(g+w)/(f.duration/1e3),e++,10<e)break}}if(0<e)return a/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ah=null,jh=null;function Lc(e){return e.nodeType===9?e:e.ownerDocument}function I0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function H0(e,a){if(e===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&a==="foreignObject"?0:e}function Th(e,a){return e==="textarea"||e==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var kh=null;function OC(){var e=window.event;return e&&e.type==="popstate"?e===kh?!1:(kh=e,!0):(kh=null,!1)}var V0=typeof setTimeout=="function"?setTimeout:void 0,RC=typeof clearTimeout=="function"?clearTimeout:void 0,q0=typeof Promise=="function"?Promise:void 0,DC=typeof queueMicrotask=="function"?queueMicrotask:typeof q0<"u"?function(e){return q0.resolve(null).then(e).catch(MC)}:V0;function MC(e){setTimeout(function(){throw e})}function ws(e){return e==="head"}function $0(e,a){var i=a,c=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(c===0){e.removeChild(f),Di(a);return}c--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")c++;else if(i==="html")Qo(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Qo(i);for(var g=i.firstChild;g;){var w=g.nextSibling,N=g.nodeName;g[po]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&g.rel.toLowerCase()==="stylesheet"||i.removeChild(g),g=w}}else i==="body"&&Qo(e.ownerDocument.body);i=f}while(i);Di(a)}function P0(e,a){var i=e;e=0;do{var c=i.nextSibling;if(i.nodeType===1?a?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(a?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),c&&c.nodeType===8)if(i=c.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=c}while(i)}function Nh(e){var a=e.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var i=a;switch(a=a.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Nh(i),Md(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function zC(e,a,i,c){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(c){if(!e[po])switch(a){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(a==="input"&&e.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=Mn(e.nextSibling),e===null)break}return null}function LC(e,a,i){if(a==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Mn(e.nextSibling),e===null))return null;return e}function G0(e,a){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Mn(e.nextSibling),e===null))return null;return e}function Oh(e){return e.data==="$?"||e.data==="$~"}function Rh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function UC(e,a){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=a;else if(e.data!=="$?"||i.readyState!=="loading")a();else{var c=function(){a(),i.removeEventListener("DOMContentLoaded",c)};i.addEventListener("DOMContentLoaded",c),e._reactRetry=c}}function Mn(e){for(;e!=null;e=e.nextSibling){var a=e.nodeType;if(a===1||a===3)break;if(a===8){if(a=e.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return e}var Dh=null;function F0(e){e=e.nextSibling;for(var a=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(a===0)return Mn(e.nextSibling);a--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||a++}e=e.nextSibling}return null}function Z0(e){e=e.previousSibling;for(var a=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(a===0)return e;a--}else i!=="/$"&&i!=="/&"||a++}e=e.previousSibling}return null}function Y0(e,a,i){switch(a=Lc(i),e){case"html":if(e=a.documentElement,!e)throw Error(r(452));return e;case"head":if(e=a.head,!e)throw Error(r(453));return e;case"body":if(e=a.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Qo(e){for(var a=e.attributes;a.length;)e.removeAttributeNode(a[0]);Md(e)}var zn=new Map,K0=new Set;function Uc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ua=$.d;$.d={f:BC,r:IC,D:HC,C:VC,L:qC,m:$C,X:GC,S:PC,M:FC};function BC(){var e=Ua.f(),a=Tc();return e||a}function IC(e){var a=Wr(e);a!==null&&a.tag===5&&a.type==="form"?fy(a):Ua.r(e)}var Ni=typeof document>"u"?null:document;function X0(e,a,i){var c=Ni;if(c&&typeof a=="string"&&a){var f=jn(a);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),K0.has(f)||(K0.add(f),e={rel:e,crossOrigin:i,href:a},c.querySelector(f)===null&&(a=c.createElement("link"),Yt(a,"link",e),Ut(a),c.head.appendChild(a)))}}function HC(e){Ua.D(e),X0("dns-prefetch",e,null)}function VC(e,a){Ua.C(e,a),X0("preconnect",e,a)}function qC(e,a,i){Ua.L(e,a,i);var c=Ni;if(c&&e&&a){var f='link[rel="preload"][as="'+jn(a)+'"]';a==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+jn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+jn(i.imageSizes)+'"]')):f+='[href="'+jn(e)+'"]';var g=f;switch(a){case"style":g=Oi(e);break;case"script":g=Ri(e)}zn.has(g)||(e=v({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:e,as:a},i),zn.set(g,e),c.querySelector(f)!==null||a==="style"&&c.querySelector(Wo(g))||a==="script"&&c.querySelector(Jo(g))||(a=c.createElement("link"),Yt(a,"link",e),Ut(a),c.head.appendChild(a)))}}function $C(e,a){Ua.m(e,a);var i=Ni;if(i&&e){var c=a&&typeof a.as=="string"?a.as:"script",f='link[rel="modulepreload"][as="'+jn(c)+'"][href="'+jn(e)+'"]',g=f;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Ri(e)}if(!zn.has(g)&&(e=v({rel:"modulepreload",href:e},a),zn.set(g,e),i.querySelector(f)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Jo(g)))return}c=i.createElement("link"),Yt(c,"link",e),Ut(c),i.head.appendChild(c)}}}function PC(e,a,i){Ua.S(e,a,i);var c=Ni;if(c&&e){var f=Jr(c).hoistableStyles,g=Oi(e);a=a||"default";var w=f.get(g);if(!w){var N={loading:0,preload:null};if(w=c.querySelector(Wo(g)))N.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":a},i),(i=zn.get(g))&&Mh(e,i);var B=w=c.createElement("link");Ut(B),Yt(B,"link",e),B._p=new Promise(function(Z,ae){B.onload=Z,B.onerror=ae}),B.addEventListener("load",function(){N.loading|=1}),B.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Bc(w,a,c)}w={type:"stylesheet",instance:w,count:1,state:N},f.set(g,w)}}}function GC(e,a){Ua.X(e,a);var i=Ni;if(i&&e){var c=Jr(i).hoistableScripts,f=Ri(e),g=c.get(f);g||(g=i.querySelector(Jo(f)),g||(e=v({src:e,async:!0},a),(a=zn.get(f))&&zh(e,a),g=i.createElement("script"),Ut(g),Yt(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(f,g))}}function FC(e,a){Ua.M(e,a);var i=Ni;if(i&&e){var c=Jr(i).hoistableScripts,f=Ri(e),g=c.get(f);g||(g=i.querySelector(Jo(f)),g||(e=v({src:e,async:!0,type:"module"},a),(a=zn.get(f))&&zh(e,a),g=i.createElement("script"),Ut(g),Yt(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(f,g))}}function Q0(e,a,i,c){var f=(f=ie.current)?Uc(f):null;if(!f)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=Oi(i.href),i=Jr(f).hoistableStyles,c=i.get(a),c||(c={type:"style",instance:null,count:0,state:null},i.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Oi(i.href);var g=Jr(f).hoistableStyles,w=g.get(e);if(w||(f=f.ownerDocument||f,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,w),(g=f.querySelector(Wo(e)))&&!g._p&&(w.instance=g,w.state.loading=5),zn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},zn.set(e,i),g||ZC(f,e,i,w.state))),a&&c===null)throw Error(r(528,""));return w}if(a&&c!==null)throw Error(r(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ri(i),i=Jr(f).hoistableScripts,c=i.get(a),c||(c={type:"script",instance:null,count:0,state:null},i.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Oi(e){return'href="'+jn(e)+'"'}function Wo(e){return'link[rel="stylesheet"]['+e+"]"}function W0(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function ZC(e,a,i,c){e.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=e.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),Yt(a,"link",i),Ut(a),e.head.appendChild(a))}function Ri(e){return'[src="'+jn(e)+'"]'}function Jo(e){return"script[async]"+e}function J0(e,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var c=e.querySelector('style[data-href~="'+jn(i.href)+'"]');if(c)return a.instance=c,Ut(c),c;var f=v({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return c=(e.ownerDocument||e).createElement("style"),Ut(c),Yt(c,"style",f),Bc(c,i.precedence,e),a.instance=c;case"stylesheet":f=Oi(i.href);var g=e.querySelector(Wo(f));if(g)return a.state.loading|=4,a.instance=g,Ut(g),g;c=W0(i),(f=zn.get(f))&&Mh(c,f),g=(e.ownerDocument||e).createElement("link"),Ut(g);var w=g;return w._p=new Promise(function(N,B){w.onload=N,w.onerror=B}),Yt(g,"link",c),a.state.loading|=4,Bc(g,i.precedence,e),a.instance=g;case"script":return g=Ri(i.src),(f=e.querySelector(Jo(g)))?(a.instance=f,Ut(f),f):(c=i,(f=zn.get(g))&&(c=v({},i),zh(c,f)),e=e.ownerDocument||e,f=e.createElement("script"),Ut(f),Yt(f,"link",c),e.head.appendChild(f),a.instance=f);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Bc(c,i.precedence,e));return a.instance}function Bc(e,a,i){for(var c=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=c.length?c[c.length-1]:null,g=f,w=0;w<c.length;w++){var N=c[w];if(N.dataset.precedence===a)g=N;else if(g!==f)break}g?g.parentNode.insertBefore(e,g.nextSibling):(a=i.nodeType===9?i.head:i,a.insertBefore(e,a.firstChild))}function Mh(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.title==null&&(e.title=a.title)}function zh(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.integrity==null&&(e.integrity=a.integrity)}var Ic=null;function eb(e,a,i){if(Ic===null){var c=new Map,f=Ic=new Map;f.set(i,c)}else f=Ic,c=f.get(i),c||(c=new Map,f.set(i,c));if(c.has(e))return c;for(c.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var g=i[f];if(!(g[po]||g[Pt]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var w=g.getAttribute(a)||"";w=e+w;var N=c.get(w);N?N.push(g):c.set(w,[g])}}return c}function tb(e,a,i){e=e.ownerDocument||e,e.head.insertBefore(i,a==="title"?e.querySelector("head > title"):null)}function YC(e,a,i){if(i===1||a.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return e=a.disabled,typeof a.precedence=="string"&&e==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function nb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function KC(e,a,i,c){if(i.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Oi(c.href),g=a.querySelector(Wo(f));if(g){a=g._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(e.count++,e=Hc.bind(e),a.then(e,e)),i.state.loading|=4,i.instance=g,Ut(g);return}g=a.ownerDocument||a,c=W0(c),(f=zn.get(f))&&Mh(c,f),g=g.createElement("link"),Ut(g);var w=g;w._p=new Promise(function(N,B){w.onload=N,w.onerror=B}),Yt(g,"link",c),i.instance=g}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Hc.bind(e),a.addEventListener("load",i),a.addEventListener("error",i))}}var Lh=0;function XC(e,a){return e.stylesheets&&e.count===0&&qc(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var c=setTimeout(function(){if(e.stylesheets&&qc(e,e.stylesheets),e.unsuspend){var g=e.unsuspend;e.unsuspend=null,g()}},6e4+a);0<e.imgBytes&&Lh===0&&(Lh=62500*NC());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qc(e,e.stylesheets),e.unsuspend)){var g=e.unsuspend;e.unsuspend=null,g()}},(e.imgBytes>Lh?50:800)+a);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(c),clearTimeout(f)}}:null}function Hc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vc=null;function qc(e,a){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vc=new Map,a.forEach(QC,e),Vc=null,Hc.call(e))}function QC(e,a){if(!(a.state.loading&4)){var i=Vc.get(e);if(i)var c=i.get(null);else{i=new Map,Vc.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var w=f[g];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(i.set(w.dataset.precedence,w),c=w)}c&&i.set(null,c)}f=a.instance,w=f.getAttribute("data-precedence"),g=i.get(w)||c,g===c&&i.set(null,f),i.set(w,f),this.count++,c=Hc.bind(this),f.addEventListener("load",c),f.addEventListener("error",c),g?g.parentNode.insertBefore(f,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),a.state.loading|=4}}var el={$$typeof:k,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function WC(e,a,i,c,f,g,w,N,B){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Nd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nd(0),this.hiddenUpdates=Nd(null),this.identifierPrefix=c,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function ab(e,a,i,c,f,g,w,N,B,Z,ae,le){return e=new WC(e,a,i,w,B,Z,ae,le,N),a=1,g===!0&&(a|=24),g=bn(3,null,null,a),e.current=g,g.stateNode=e,a=pf(),a.refCount++,e.pooledCache=a,a.refCount++,g.memoizedState={element:c,isDehydrated:i,cache:a},bf(g),e}function sb(e){return e?(e=ci,e):ci}function rb(e,a,i,c,f,g){f=sb(f),c.context===null?c.context=f:c.pendingContext=f,c=us(a),c.payload={element:i},g=g===void 0?null:g,g!==null&&(c.callback=g),i=ds(e,c,a),i!==null&&(fn(i,e,a),Ro(i,e,a))}function ib(e,a){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<a?i:a}}function Uh(e,a){ib(e,a),(e=e.alternate)&&ib(e,a)}function ob(e){if(e.tag===13||e.tag===31){var a=ir(e,67108864);a!==null&&fn(a,e,67108864),Uh(e,67108864)}}function lb(e){if(e.tag===13||e.tag===31){var a=_n();a=Od(a);var i=ir(e,a);i!==null&&fn(i,e,a),Uh(e,a)}}var $c=!0;function JC(e,a,i,c){var f=U.T;U.T=null;var g=$.p;try{$.p=2,Bh(e,a,i,c)}finally{$.p=g,U.T=f}}function eA(e,a,i,c){var f=U.T;U.T=null;var g=$.p;try{$.p=8,Bh(e,a,i,c)}finally{$.p=g,U.T=f}}function Bh(e,a,i,c){if($c){var f=Ih(c);if(f===null)_h(e,a,c,Pc,i),ub(e,c);else if(nA(f,e,a,i,c))c.stopPropagation();else if(ub(e,c),a&4&&-1<tA.indexOf(e)){for(;f!==null;){var g=Wr(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var w=tr(g.pendingLanes);if(w!==0){var N=g;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var B=1<<31-vn(w);N.entanglements[1]|=B,w&=~B}ra(g),(st&6)===0&&(Ac=At()+500,Yo(0))}}break;case 31:case 13:N=ir(g,2),N!==null&&fn(N,g,2),Tc(),Uh(g,2)}if(g=Ih(c),g===null&&_h(e,a,c,Pc,i),g===f)break;f=g}f!==null&&c.stopPropagation()}else _h(e,a,c,null,i)}}function Ih(e){return e=Hd(e),Hh(e)}var Pc=null;function Hh(e){if(Pc=null,e=Qr(e),e!==null){var a=l(e);if(a===null)e=null;else{var i=a.tag;if(i===13){if(e=u(a),e!==null)return e;e=null}else if(i===31){if(e=d(a),e!==null)return e;e=null}else if(i===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;e=null}else a!==e&&(e=null)}}return Pc=e,null}function cb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(kd()){case vg:return 2;case yg:return 8;case Dl:case VE:return 32;case bg:return 268435456;default:return 32}default:return 32}}var Vh=!1,Ss=null,Es=null,_s=null,tl=new Map,nl=new Map,Cs=[],tA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ub(e,a){switch(e){case"focusin":case"focusout":Ss=null;break;case"dragenter":case"dragleave":Es=null;break;case"mouseover":case"mouseout":_s=null;break;case"pointerover":case"pointerout":tl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":nl.delete(a.pointerId)}}function al(e,a,i,c,f,g){return e===null||e.nativeEvent!==g?(e={blockedOn:a,domEventName:i,eventSystemFlags:c,nativeEvent:g,targetContainers:[f]},a!==null&&(a=Wr(a),a!==null&&ob(a)),e):(e.eventSystemFlags|=c,a=e.targetContainers,f!==null&&a.indexOf(f)===-1&&a.push(f),e)}function nA(e,a,i,c,f){switch(a){case"focusin":return Ss=al(Ss,e,a,i,c,f),!0;case"dragenter":return Es=al(Es,e,a,i,c,f),!0;case"mouseover":return _s=al(_s,e,a,i,c,f),!0;case"pointerover":var g=f.pointerId;return tl.set(g,al(tl.get(g)||null,e,a,i,c,f)),!0;case"gotpointercapture":return g=f.pointerId,nl.set(g,al(nl.get(g)||null,e,a,i,c,f)),!0}return!1}function db(e){var a=Qr(e.target);if(a!==null){var i=l(a);if(i!==null){if(a=i.tag,a===13){if(a=u(i),a!==null){e.blockedOn=a,Cg(e.priority,function(){lb(i)});return}}else if(a===31){if(a=d(i),a!==null){e.blockedOn=a,Cg(e.priority,function(){lb(i)});return}}else if(a===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gc(e){if(e.blockedOn!==null)return!1;for(var a=e.targetContainers;0<a.length;){var i=Ih(e.nativeEvent);if(i===null){i=e.nativeEvent;var c=new i.constructor(i.type,i);Id=c,i.target.dispatchEvent(c),Id=null}else return a=Wr(i),a!==null&&ob(a),e.blockedOn=i,!1;a.shift()}return!0}function fb(e,a,i){Gc(e)&&i.delete(a)}function aA(){Vh=!1,Ss!==null&&Gc(Ss)&&(Ss=null),Es!==null&&Gc(Es)&&(Es=null),_s!==null&&Gc(_s)&&(_s=null),tl.forEach(fb),nl.forEach(fb)}function Fc(e,a){e.blockedOn===a&&(e.blockedOn=null,Vh||(Vh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,aA)))}var Zc=null;function hb(e){Zc!==e&&(Zc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Zc===e&&(Zc=null);for(var a=0;a<e.length;a+=3){var i=e[a],c=e[a+1],f=e[a+2];if(typeof c!="function"){if(Hh(c||i)===null)continue;break}var g=Wr(i);g!==null&&(e.splice(a,3),a-=3,If(g,{pending:!0,data:f,method:i.method,action:c},c,f))}}))}function Di(e){function a(B){return Fc(B,e)}Ss!==null&&Fc(Ss,e),Es!==null&&Fc(Es,e),_s!==null&&Fc(_s,e),tl.forEach(a),nl.forEach(a);for(var i=0;i<Cs.length;i++){var c=Cs[i];c.blockedOn===e&&(c.blockedOn=null)}for(;0<Cs.length&&(i=Cs[0],i.blockedOn===null);)db(i),i.blockedOn===null&&Cs.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(c=0;c<i.length;c+=3){var f=i[c],g=i[c+1],w=f[rn]||null;if(typeof g=="function")w||hb(i);else if(w){var N=null;if(g&&g.hasAttribute("formAction")){if(f=g,w=g[rn]||null)N=w.formAction;else if(Hh(f)!==null)continue}else N=w.action;typeof N=="function"?i[c+1]=N:(i.splice(c,3),c-=3),hb(i)}}}function mb(){function e(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(w){return f=w})},focusReset:"manual",scroll:"manual"})}function a(){f!==null&&(f(),f=null),c||setTimeout(i,20)}function i(){if(!c&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(i,100),function(){c=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),f!==null&&(f(),f=null)}}}function qh(e){this._internalRoot=e}Yc.prototype.render=qh.prototype.render=function(e){var a=this._internalRoot;if(a===null)throw Error(r(409));var i=a.current,c=_n();rb(i,c,e,a,null,null)},Yc.prototype.unmount=qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var a=e.containerInfo;rb(e.current,2,null,e,null,null),Tc(),a[Xr]=null}};function Yc(e){this._internalRoot=e}Yc.prototype.unstable_scheduleHydration=function(e){if(e){var a=_g();e={blockedOn:null,target:e,priority:a};for(var i=0;i<Cs.length&&a!==0&&a<Cs[i].priority;i++);Cs.splice(i,0,e),i===0&&db(e)}};var pb=t.version;if(pb!=="19.2.3")throw Error(r(527,pb,"19.2.3"));$.findDOMNode=function(e){var a=e._reactInternals;if(a===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=p(a),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var sA={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kc.isDisabled&&Kc.supportsFiber)try{fo=Kc.inject(sA),gn=Kc}catch{}}return rl.createRoot=function(e,a){if(!o(e))throw Error(r(299));var i=!1,c="",f=Sy,g=Ey,w=_y;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError)),a=ab(e,1,!1,null,null,i,c,null,f,g,w,mb),e[Xr]=a.current,Eh(e),new qh(a)},rl.hydrateRoot=function(e,a,i){if(!o(e))throw Error(r(299));var c=!1,f="",g=Sy,w=Ey,N=_y,B=null;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError),i.formState!==void 0&&(B=i.formState)),a=ab(e,1,!0,a,i??null,c,f,B,g,w,N,mb),a.context=sb(null),i=a.current,c=_n(),c=Od(c),f=us(c),f.callback=null,ds(i,f,c),i=c,a.current.lanes=i,mo(a,i),ra(a),e[Xr]=a.current,Eh(e),new Yc(a)},rl.version="19.2.3",rl}var ix;function X6(){if(ix)return sm.exports;ix=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),sm.exports=K6(),sm.exports}var Q6=X6();const W6="modulepreload",J6=function(n){return"/"+n},ox={},Km=function(t,s,r){let o=Promise.resolve();if(s&&s.length>0){let u=function(p){return Promise.all(p.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),m=d?.nonce||d?.getAttribute("nonce");o=u(s.map(p=>{if(p=J6(p),p in ox)return;ox[p]=!0;const b=p.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const y=document.createElement("link");if(y.rel=b?"stylesheet":W6,b||(y.as="script"),y.crossOrigin="",y.href=p,m&&y.setAttribute("nonce",m),document.head.appendChild(y),b)return new Promise((E,_)=>{y.addEventListener("load",E),y.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${p}`)))})}))}function l(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return o.then(u=>{for(const d of u||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})},KS=window.__LINKSHELL_CONFIG__,qs=KS?.deployment==="self-hosted"?"self-hosted":"official",Er="wss://gateway.itool.tech",eN=window.location.origin.replace(/^http/,"ws"),tN=qs==="self-hosted"?KS?.gatewayUrl||eN:Er;function om(n){let t;try{t=new URL(n.trim())}catch{throw new Error("请输入完整的网关地址,例如 wss://gateway.example.com")}if(!["wss:","ws:"].includes(t.protocol))throw new Error("网关地址需要以 wss:// 开头");if(t.username||t.password||t.search||t.hash)throw new Error("网关地址不能包含账号、密码、查询参数或片段");if(t.pathname!=="/"&&t.pathname!=="/v2/connect")throw new Error("请输入网关根地址,不需要附加路径");if(t.protocol==="ws:"&&(window.location.protocol==="https:"||!["localhost","127.0.0.1","[::1]"].includes(t.hostname)))throw new Error("请使用 wss:// 安全连接;ws:// 仅限本地 HTTP 开发环境");return t.origin}function nN({...n}){return h.jsx(qk,{"data-slot":"select",...n})}function aN({className:n,...t}){return h.jsx(o6,{"data-slot":"select-group",className:qe("scroll-my-1 p-1",n),...t})}function sN({...n}){return h.jsx(Fk,{"data-slot":"select-value",...n})}function rN({className:n,size:t="default",children:s,...r}){return h.jsxs(Pk,{"data-slot":"select-trigger","data-size":t,className:qe("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-10 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...r,children:[s,h.jsx(Zk,{asChild:!0,children:h.jsx(IS,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function iN({className:n,children:t,position:s="item-aligned",align:r="center",...o}){return h.jsx(Qk,{children:h.jsxs(Wk,{"data-slot":"select-content","data-align-trigger":s==="item-aligned",className:qe("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:s,align:r,...o,children:[h.jsx(lN,{}),h.jsx(s6,{"data-position":s,className:qe("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",s==="popper"&&""),children:t}),h.jsx(cN,{})]})})}function oN({className:n,children:t,...s}){return h.jsxs(c6,{"data-slot":"select-item",className:qe("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-2 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),...s,children:[h.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:h.jsx(f6,{children:h.jsx(US,{className:"pointer-events-none"})})}),h.jsx(u6,{children:t})]})}function lN({className:n,...t}){return h.jsx(h6,{"data-slot":"select-scroll-up-button",className:qe("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),...t,children:h.jsx(B6,{})})}function cN({className:n,...t}){return h.jsx(m6,{"data-slot":"select-scroll-down-button",className:qe("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),...t,children:h.jsx(IS,{})})}function bd({value:n,onValueChange:t,options:s,label:r,placeholder:o="请选择",disabled:l,id:u}){return h.jsxs(nN,{value:s.some(d=>d.value===n)?`item:${n}`:"",onValueChange:d=>t(d.slice(5)),disabled:l||!s.length,children:[h.jsx(rN,{id:u,"aria-label":r,className:"w-full min-w-0",children:h.jsx(sN,{placeholder:o})}),h.jsx(iN,{position:"popper",align:"start",className:"max-w-[calc(100vw-2rem)]",children:h.jsx(aN,{children:s.map(d=>h.jsx(oN,{value:`item:${d.value}`,disabled:d.disabled,children:d.label},d.value))})})]})}const lx=n=>{let t;const s=new Set,r=(p,b)=>{const v=typeof p=="function"?p(t):p;if(!Object.is(v,t)){const y=t;t=b??(typeof v!="object"||v===null)?v:Object.assign({},t,v),s.forEach(E=>E(t,y))}},o=()=>t,d={setState:r,getState:o,getInitialState:()=>m,subscribe:p=>(s.add(p),()=>s.delete(p))},m=t=n(r,o,d);return d},XS=(n=>n?lx(n):lx),uN=n=>n;function xd(n,t=uN){const s=cl.useSyncExternalStore(n.subscribe,cl.useCallback(()=>t(n.getState()),[n,t]),cl.useCallback(()=>t(n.getInitialState()),[n,t]));return cl.useDebugValue(s),s}const cx="/assets/mark-CUOqBxI3.png",dN={grid:"M3 3h7v7H3z M14 3h7v7h-7z M3 14h7v7H3z M14 14h7v7h-7z",plus:"M12 5v14 M5 12h14",search:"M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15 M16 16l5 5",computer:"M3 4h18v13H3z M8 21h8 M12 17v4",chevron:"m9 5 7 7-7 7",down:"m6 9 6 6 6-6",arrow:"M5 12h14 m-6-6 6 6-6 6",folder:"M3 7V4h6l3 3h9v13H3z",clock:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20 M12 6v6l4 2",check:"m5 12 4 4L19 6",close:"m6 6 12 12 M6 18 18 6",settings:"M4 7h16 M4 17h16 M8 4v6 M16 14v6",shield:"m12 3 8 3v6c0 5-8 9-8 9s-8-4-8-9V6z m-4 9 3 3 5-6",terminal:"m4 5 7 7-7 7 M13 19h7",file:"M14 2H4v20h16V8z M14 2v6h6 M8 13h8 M8 17h6",branch:"M6 3v12a4 4 0 0 0 4 4h3 M6 7h8a4 4 0 0 0 4-4 M3 18h6v4H3z M15 1h6v4h-6z",panel:"M3 4h18v16H3z M15 4v16",send:"M12 20V4 m-7 7 7-7 7 7",attach:"m8 12 6-6a3 3 0 0 1 4 4l-8 8a5 5 0 0 1-7-7l9-9 M6 14l8-8",stop:"M6 6h12v12H6z",globe:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20 M2 12h20 M12 2c-6 6-6 14 0 20 M12 2c6 6 6 14 0 20",server:"M3 3h18v7H3z M3 14h18v7H3z M7 6v1 M7 17v1 M12 6h5 M12 17h5",logout:"M10 3H4v18h6 M10 12h12 m-5-5 5 5-5 5",menu:"M4 6h16 M4 12h16 M4 18h16",moon:"M20 15A9 9 0 0 1 9 4a9 9 0 1 0 11 11"};function _t({name:n,size:t=18,style:s}){return h.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:s,children:h.jsx("path",{d:dN[n]})})}function Yi(n){return{sessionId:n,lastSeq:0,startSeq:0,items:[],index:{},permissions:[],config:[],commands:[],state:"idle",turnActive:!1}}function Xt(n,t){const s=n.index[t.id];if(s===void 0)return{...n,items:[...n.items,t],index:{...n.index,[t.id]:n.items.length}};const r=n.items.slice();return r[s]=t,{...n,items:r}}function Un(n,t,s){const r=n.index[t],o=r===void 0?void 0:n.items[r];return o&&o.kind===s?o:void 0}function ux(n,t){return t.type==="text"?n+t.text:n}function bu(n,t){let s;return n.items.forEach((r,o)=>{(r.kind==="agent"||r.kind==="thought")&&r.streaming&&(s??=n.items.slice(),s[o]=r.kind==="thought"?{...r,streaming:!1,endedTs:r.endedTs??t}:{...r,streaming:!1})}),s?{...n,items:s}:n}function Ou(n,t){const s=bu(n,t);let r;return s.items.forEach((o,l)=>{if(o.kind!=="tool"||!o.sub)return;const u=Ou(o.sub,t);u!==o.sub&&(r??=s.items.slice(),r[l]={...o,sub:u})}),r?{...s,items:r}:s}function fN(n){switch(n.sessionUpdate){case"agent_message_chunk":case"agent_thought_chunk":case"tool_call":case"tool_call_update":case"ls_message_done":case"ls_turn":return n.parentToolCallId;default:return}}function hN(n,t){return n.flatMap(s=>{const r=t.find(u=>u.id===s.id);if(!r)return[];const o=r.values.filter(Boolean).map(u=>s.options?.find(d=>d.value===u)?.label??u),l=[...s.secret&&o.length>0?["••••••"]:o,...r.other?[r.other]:[]];return l.length>0?[{question:s.header??s.text,answer:l.join(",")}]:[]})}function QS(n,t,s,r,o){if(!Un(n,t,"tool")){for(const m of n.items)if(!(m.kind!=="tool"||!m.sub||!Wp(m.sub,t)))return Xt(n,{...m,sub:QS(m.sub,t,s,r,o)})}const l=Un(n,t,"tool")??{kind:"tool",id:t,title:"Sub-agent",toolKind:"other",status:"in_progress",detail:{type:"subagent",action:"spawn"},content:[],output:"",ts:r},u={...s,parentToolCallId:void 0},d=Jp(l.sub??Yi(n.sessionId),u,r,o);return d===l.sub?n:Xt(n,{...l,sub:d})}function Wp(n,t){const s=Un(n,t,"tool");if(s)return s;for(const r of n.items){if(r.kind!=="tool"||!r.sub)continue;const o=Wp(r.sub,t);if(o)return o}}function Jp(n,t,s,r){const o=fN(t);if(o)return QS(n,o,t,s,r);switch(t.sessionUpdate){case"user_message_chunk":{const l=t.messageId??`user-${r}`,u=Un(n,l,"user"),d=u&&!u.pending?[...u.blocks,t.content]:[t.content];return Xt(n,{kind:"user",id:l,blocks:WS(d),ts:u?.ts??s})}case"agent_message_chunk":{const l=Un(n,t.messageId,"agent"),u=t.content.type==="text"?l?.attachments:[...l?.attachments??[],t.content];return Xt(n,{kind:"agent",id:t.messageId,text:ux(l?.text??"",t.content),attachments:u,streaming:!0,ts:l?.ts??s})}case"agent_thought_chunk":{const l=`thought:${t.messageId}`,u=Un(n,l,"thought");return Xt(n,{kind:"thought",id:l,text:ux(u?.text??"",t.content),streaming:!0,ts:u?.ts??s})}case"ls_message_done":{const l=t.role==="thought"?`thought:${t.messageId}`:t.messageId,u=Un(n,l,"agent");if(u)return Xt(n,{...u,streaming:!1});const d=Un(n,l,"thought");return d?Xt(n,{...d,streaming:!1,endedTs:d.endedTs??s}):n}case"tool_call":{const l=Un(n,t.toolCallId,"tool"),u=t.status==="completed"||t.status==="failed";return Xt(bu(n,s),{kind:"tool",id:t.toolCallId,title:t.title,toolKind:t.kind,status:t.status,rawInput:t.rawInput??l?.rawInput,rawOutput:l?.rawOutput,locations:t.locations??l?.locations,detail:t.detail??l?.detail,sub:l?.sub,content:t.content??l?.content??[],output:l?.output??"",ts:l?.ts??s,endedTs:u?s:l?.endedTs})}case"tool_call_update":{const u=Un(n,t.toolCallId,"tool")??{kind:"tool",id:t.toolCallId,title:t.title??"Tool",toolKind:"other",status:"in_progress",content:[],output:"",ts:s},d=t.status??u.status,m=d==="completed"||d==="failed";return Xt(n,{...u,title:t.title??u.title,detail:t.detail??u.detail,status:d,content:t.content?e2(u.content,t.content):u.content,output:t.appendOutput?u.output+t.appendOutput:u.output,rawOutput:t.rawOutput??u.rawOutput,endedTs:m?u.endedTs??s:u.endedTs,sub:m&&u.sub?Ou(u.sub,s):u.sub})}case"plan":{const l=n.planId??`plan-${r}`;return{...Xt(n,{kind:"plan",id:l,entries:t.entries,ts:Un(n,l,"plan")?.ts??s}),planId:l}}case"available_commands_update":return{...n,commands:t.availableCommands};case"ls_goal":return{...n,goal:t.goal};case"current_mode_update":return{...n,modeId:t.currentModeId,config:n.config.map(l=>l.category==="mode"?{...l,current:t.currentModeId}:l)};case"ls_config":return{...n,config:t.options,modeId:t.options.find(l=>l.category==="mode")?.current??n.modeId};case"session_info_update":return{...n,title:t.title??n.title};case"usage_update":return{...n,usage:{usedTokens:t.usedTokens,contextWindow:t.contextWindow}};case"ls_turn":if(t.state==="started")return{...n,turnActive:!0,state:"running",planId:void 0};{const u={...Ou(n,s),turnActive:!1,state:t.stopReason==="error"?"error":"idle",permissions:[]};return t.stopReason==="cancelled"?Xt(u,{kind:"turn-end",id:`turn-end-${r}`,stopReason:"cancelled",ts:s}):u}case"ls_status":return{...n,state:t.state};case"ls_permission":return n.permissions.some(l=>l.requestId===t.requestId)?n:{...bu(n,s),state:"waiting",permissions:[...n.permissions,{requestId:t.requestId,toolCallId:t.toolCallId,title:t.title,detail:t.detail,options:t.options,questions:t.questions,ts:s}]};case"ls_permission_resolved":{const l=n.permissions.find(p=>p.requestId===t.requestId);if(!l)return n;const u=l.options.find(p=>p.optionId===t.optionId),d=n.permissions.filter(p=>p.requestId!==t.requestId),m={...n,permissions:d,state:d.length>0?"waiting":n.turnActive?"running":n.state==="waiting"?"idle":n.state};return Xt(m,{kind:"permission-result",id:`perm-${t.requestId}`,title:l.title,detail:l.detail,optionName:u?.name,allowed:u?u.kind.startsWith("allow"):void 0,asked:l.questions?!0:void 0,answers:l.questions&&t.answers?hN(l.questions,t.answers):void 0,ts:s})}case"ls_driver":{if(n.driver===t.driver)return n;const l={...n,driver:t.driver};return n.driver===void 0?l:Xt(l,{kind:"driver",id:`driver-${r}`,driver:t.driver,ts:s})}case"ls_error":return Xt(bu(n,s),{kind:"error",id:`error-${r}`,code:t.code,message:t.message,hint:t.hint,ts:s});case"ls_notice":return Xt(n,{kind:"notice",id:`notice-${r}`,level:t.level,title:t.title,detail:t.detail,ts:s});default:return n}}function WS(n){const t=[];for(const s of n){const r=t[t.length-1];s.type==="text"&&r?.type==="text"?t[t.length-1]={type:"text",text:r.text+s.text}:t.push(s)}return t}function mN(n,t){if(t.seq<=n.lastSeq)return n;const s=Jp(n,t.update,t.ts,String(t.seq));return s===n?{...n,lastSeq:t.seq}:{...s,lastSeq:t.seq}}function lm(n,t){return t.reduce(mN,n)}function pN(n,t){if(n.lastSeq===0)return{...n,startSeq:t};if(n.lastSeq===t)return n;const s=n.items.filter(o=>o.kind==="user"&&(o.pending||o.failed)),r={};return s.forEach((o,l)=>{r[o.id]=l}),{...Yi(n.sessionId),startSeq:t,items:s,index:r}}const gN=new Set(["Tool","Sub-agent"]);function vN(n,t){if(n.kind==="agent"&&t.kind==="agent"){const s=[...n.attachments??[],...t.attachments??[]];return{...t,text:n.text+t.text,attachments:s.length?s:void 0,ts:n.ts}}return n.kind==="thought"&&t.kind==="thought"?{...t,text:n.text+t.text,ts:n.ts}:n.kind==="user"&&t.kind==="user"?{...t,blocks:WS([...n.blocks,...t.blocks]),ts:n.ts}:n.kind==="tool"&&t.kind==="tool"?{...t,title:gN.has(t.title)?n.title:t.title,toolKind:n.toolKind,rawInput:t.rawInput??n.rawInput,rawOutput:t.rawOutput??n.rawOutput,locations:t.locations??n.locations,detail:t.detail??n.detail,content:t.content.length?e2(n.content,t.content):n.content,output:n.output+t.output,sub:n.sub&&t.sub?JS(n.sub,t.sub):t.sub??n.sub,ts:n.ts,endedTs:t.endedTs??n.endedTs}:t}function JS(n,t){const s=[],r=new Set;for(const l of n.items){const u=t.index[l.id];u===void 0?s.push(l):(s.push(vN(l,t.items[u])),r.add(l.id))}for(const l of t.items)r.has(l.id)||s.push(l);const o={};return s.forEach((l,u)=>{o[l.id]=u}),{...t,items:s,index:o}}function yN(n,t,s){let r=Yi(n.sessionId);for(const o of t)r=Jp(r,o.update,o.ts,String(o.seq));return r=Ou(r,t[t.length-1]?.ts??0),{...JS(r,n),startSeq:s}}function iu(n,t,s,r=Date.now(),o=!1){return Xt(n,{kind:"user",id:`local-${t}`,blocks:s,ts:r,pending:!0,...o?{accepted:!0}:{}})}function dx(n,t){const s=Un(n,`local-${t}`,"user");return s&&s.pending?Xt(n,{...s,pending:!1,failed:!0}):n}function fx(n,t){const s=n.index[t];if(s===void 0)return n;const r=n.items.filter((l,u)=>u!==s),o={};return r.forEach((l,u)=>{o[l.id]=u}),{...n,items:r,index:o}}function e2(n,t){if(t.some(r=>r.type==="diff"))return t;const s=n.filter(r=>r.type==="diff");return s.length?[...s,...t]:t}var et;(function(n){n.assertEqual=o=>{};function t(o){}n.assertIs=t;function s(o){throw new Error}n.assertNever=s,n.arrayToEnum=o=>{const l={};for(const u of o)l[u]=u;return l},n.getValidEnumValues=o=>{const l=n.objectKeys(o).filter(d=>typeof o[o[d]]!="number"),u={};for(const d of l)u[d]=o[d];return n.objectValues(u)},n.objectValues=o=>n.objectKeys(o).map(function(l){return o[l]}),n.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const l=[];for(const u in o)Object.prototype.hasOwnProperty.call(o,u)&&l.push(u);return l},n.find=(o,l)=>{for(const u of o)if(l(u))return u},n.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,l=" | "){return o.map(u=>typeof u=="string"?`'${u}'`:u).join(l)}n.joinValues=r,n.jsonStringifyReplacer=(o,l)=>typeof l=="bigint"?l.toString():l})(et||(et={}));var hx;(function(n){n.mergeShapes=(t,s)=>({...t,...s})})(hx||(hx={}));const be=et.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zs=n=>{switch(typeof n){case"undefined":return be.undefined;case"string":return be.string;case"number":return Number.isNaN(n)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(n)?be.array:n===null?be.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?be.promise:typeof Map<"u"&&n instanceof Map?be.map:typeof Set<"u"&&n instanceof Set?be.set:typeof Date<"u"&&n instanceof Date?be.date:be.object;default:return be.unknown}},fe=et.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Qa extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){const s=t||function(l){return l.message},r={_errors:[]},o=l=>{for(const u of l.issues)if(u.code==="invalid_union")u.unionErrors.map(o);else if(u.code==="invalid_return_type")o(u.returnTypeError);else if(u.code==="invalid_arguments")o(u.argumentsError);else if(u.path.length===0)r._errors.push(s(u));else{let d=r,m=0;for(;m<u.path.length;){const p=u.path[m];m===u.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(s(u))):d[p]=d[p]||{_errors:[]},d=d[p],m++}}};return o(this),r}static assert(t){if(!(t instanceof Qa))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,et.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){const s={},r=[];for(const o of this.issues)if(o.path.length>0){const l=o.path[0];s[l]=s[l]||[],s[l].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:s}}get formErrors(){return this.flatten()}}Qa.create=n=>new Qa(n);const Xm=(n,t)=>{let s;switch(n.code){case fe.invalid_type:n.received===be.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case fe.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,et.jsonStringifyReplacer)}`;break;case fe.unrecognized_keys:s=`Unrecognized key(s) in object: ${et.joinValues(n.keys,", ")}`;break;case fe.invalid_union:s="Invalid input";break;case fe.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${et.joinValues(n.options)}`;break;case fe.invalid_enum_value:s=`Invalid enum value. Expected ${et.joinValues(n.options)}, received '${n.received}'`;break;case fe.invalid_arguments:s="Invalid function arguments";break;case fe.invalid_return_type:s="Invalid function return type";break;case fe.invalid_date:s="Invalid date";break;case fe.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:et.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case fe.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case fe.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case fe.custom:s="Invalid input";break;case fe.invalid_intersection_types:s="Intersection results could not be merged";break;case fe.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case fe.not_finite:s="Number must be finite";break;default:s=t.defaultError,et.assertNever(n)}return{message:s}};let bN=Xm;function xN(){return bN}const wN=n=>{const{data:t,path:s,errorMaps:r,issueData:o}=n,l=[...s,...o.path||[]],u={...o,path:l};if(o.message!==void 0)return{...o,path:l,message:o.message};let d="";const m=r.filter(p=>!!p).slice().reverse();for(const p of m)d=p(u,{data:t,defaultError:d}).message;return{...o,path:l,message:d}};function ge(n,t){const s=xN(),r=wN({issueData:t,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===Xm?void 0:Xm].filter(o=>!!o)});n.common.issues.push(r)}class sn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){const r=[];for(const o of s){if(o.status==="aborted")return ke;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,s){const r=[];for(const o of s){const l=await o.key,u=await o.value;r.push({key:l,value:u})}return sn.mergeObjectSync(t,r)}static mergeObjectSync(t,s){const r={};for(const o of s){const{key:l,value:u}=o;if(l.status==="aborted"||u.status==="aborted")return ke;l.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof u.value<"u"||o.alwaysSet)&&(r[l.value]=u.value)}return{status:t.value,value:r}}}const ke=Object.freeze({status:"aborted"}),ul=n=>({status:"dirty",value:n}),Vn=n=>({status:"valid",value:n}),mx=n=>n.status==="aborted",px=n=>n.status==="dirty",Wi=n=>n.status==="valid",Ru=n=>typeof Promise<"u"&&n instanceof Promise;var _e;(function(n){n.errToObj=t=>typeof t=="string"?{message:t}:t||{},n.toString=t=>typeof t=="string"?t:t?.message})(_e||(_e={}));class ya{constructor(t,s,r,o){this._cachedPath=[],this.parent=t,this.data=s,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gx=(n,t)=>{if(Wi(t))return{success:!0,data:t.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new Qa(n.common.issues);return this._error=s,this._error}}};function Ie(n){if(!n)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:o}=n;if(t&&(s||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(u,d)=>{const{message:m}=n;return u.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:m??r??d.defaultError}:u.code!=="invalid_type"?{message:d.defaultError}:{message:m??s??d.defaultError}},description:o}}class Ye{get description(){return this._def.description}_getType(t){return zs(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new sn,ctx:{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(Ru(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){const s=this._parse(t);return Promise.resolve(s)}parse(t,s){const r=this.safeParse(t,s);if(r.success)return r.data;throw r.error}safeParse(t,s){const r={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},o=this._parseSync({data:t,path:r.path,parent:r});return gx(r,o)}"~validate"(t){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:s});return Wi(r)?{value:r.value}:{issues:s.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(r=>Wi(r)?{value:r.value}:{issues:s.common.issues})}async parseAsync(t,s){const r=await this.safeParseAsync(t,s);if(r.success)return r.data;throw r.error}async safeParseAsync(t,s){const r={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},o=this._parse({data:t,path:r.path,parent:r}),l=await(Ru(o)?o:Promise.resolve(o));return gx(r,l)}refine(t,s){const r=o=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(o):s;return this._refinement((o,l)=>{const u=t(o),d=()=>l.addIssue({code:fe.custom,...r(o)});return typeof Promise<"u"&&u instanceof Promise?u.then(m=>m?!0:(d(),!1)):u?!0:(d(),!1)})}refinement(t,s){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof s=="function"?s(r,o):s),!1))}_refinement(t){return new Dr({schema:this,typeName:Ne.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return Za.create(this,this._def)}nullable(){return Mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ma.create(this)}promise(){return Bu.create(this,this._def)}or(t){return Mu.create([this,t],this._def)}and(t){return zu.create(this,t,this._def)}transform(t){return new Dr({...Ie(this._def),schema:this,typeName:Ne.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new Iu({...Ie(this._def),innerType:this,defaultValue:s,typeName:Ne.ZodDefault})}brand(){return new s2({typeName:Ne.ZodBranded,type:this,...Ie(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new Hu({...Ie(this._def),innerType:this,catchValue:s,typeName:Ne.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return tg.create(this,t)}readonly(){return Vu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SN=/^c[^\s-]{8,}$/i,EN=/^[0-9a-z]+$/,_N=/^[0-9A-HJKMNP-TV-Z]{26}$/i,CN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AN=/^[a-z0-9_-]{21}$/i,jN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,TN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,NN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let cm;const ON=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,RN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,DN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,MN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,t2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",UN=new RegExp(`^${t2}$`);function n2(n){let t="[0-5]\\d";n.precision?t=`${t}\\.\\d{${n.precision}}`:n.precision==null&&(t=`${t}(\\.\\d+)?`);const s=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function BN(n){return new RegExp(`^${n2(n)}$`)}function IN(n){let t=`${t2}T${n2(n)}`;const s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function HN(n,t){return!!((t==="v4"||!t)&&ON.test(n)||(t==="v6"||!t)&&DN.test(n))}function VN(n,t){if(!jN.test(n))return!1;try{const[s]=n.split(".");if(!s)return!1;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function qN(n,t){return!!((t==="v4"||!t)&&RN.test(n)||(t==="v6"||!t)&&MN.test(n))}class $a extends Ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==be.string){const l=this._getOrReturnCtx(t);return ge(l,{code:fe.invalid_type,expected:be.string,received:l.parsedType}),ke}const r=new sn;let o;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="max")t.data.length>l.value&&(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="length"){const u=t.data.length>l.value,d=t.data.length<l.value;(u||d)&&(o=this._getOrReturnCtx(t,o),u?ge(o,{code:fe.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ge(o,{code:fe.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")kN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"email",code:fe.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")cm||(cm=new RegExp(NN,"u")),cm.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"emoji",code:fe.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")CN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"uuid",code:fe.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")AN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"nanoid",code:fe.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")SN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"cuid",code:fe.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")EN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"cuid2",code:fe.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")_N.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"ulid",code:fe.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ge(o,{validation:"url",code:fe.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"regex",code:fe.invalid_string,message:l.message}),r.dirty())):l.kind==="trim"?t.data=t.data.trim():l.kind==="includes"?t.data.includes(l.value,l.position)||(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),r.dirty()):l.kind==="toLowerCase"?t.data=t.data.toLowerCase():l.kind==="toUpperCase"?t.data=t.data.toUpperCase():l.kind==="startsWith"?t.data.startsWith(l.value)||(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?IN(l).test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?UN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?BN(l).test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?TN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"duration",code:fe.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?HN(t.data,l.version)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"ip",code:fe.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?VN(t.data,l.alg)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"jwt",code:fe.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?qN(t.data,l.version)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"cidr",code:fe.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?zN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"base64",code:fe.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?LN.test(t.data)||(o=this._getOrReturnCtx(t,o),ge(o,{validation:"base64url",code:fe.invalid_string,message:l.message}),r.dirty()):et.assertNever(l);return{status:r.value,value:t.data}}_regex(t,s,r){return this.refinement(o=>t.test(o),{validation:s,code:fe.invalid_string,..._e.errToObj(r)})}_addCheck(t){return new $a({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._e.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._e.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._e.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._e.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._e.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._e.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._e.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._e.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._e.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._e.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._e.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._e.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._e.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,..._e.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,..._e.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",..._e.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,..._e.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,..._e.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,..._e.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,..._e.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,..._e.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,..._e.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,..._e.errToObj(s)})}nonempty(t){return this.min(1,_e.errToObj(t))}trim(){return new $a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $a({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}$a.create=n=>new $a({checks:[],typeName:Ne.ZodString,coerce:n?.coerce??!1,...Ie(n)});function $N(n,t){const s=(n.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=s>r?s:r,l=Number.parseInt(n.toFixed(o).replace(".","")),u=Number.parseInt(t.toFixed(o).replace(".",""));return l%u/10**o}class Ji extends Ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==be.number){const l=this._getOrReturnCtx(t);return ge(l,{code:fe.invalid_type,expected:be.number,received:l.parsedType}),ke}let r;const o=new sn;for(const l of this._def.checks)l.kind==="int"?et.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{code:fe.invalid_type,expected:"integer",received:"float",message:l.message}),o.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),ge(r,{code:fe.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),ge(r,{code:fe.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()):l.kind==="multipleOf"?$N(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),ge(r,{code:fe.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{code:fe.not_finite,message:l.message}),o.dirty()):et.assertNever(l);return{status:o.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,_e.toString(s))}gt(t,s){return this.setLimit("min",t,!1,_e.toString(s))}lte(t,s){return this.setLimit("max",t,!0,_e.toString(s))}lt(t,s){return this.setLimit("max",t,!1,_e.toString(s))}setLimit(t,s,r,o){return new Ji({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:_e.toString(o)}]})}_addCheck(t){return new Ji({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_e.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_e.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:_e.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_e.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_e.toString(t)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&et.isInteger(t.value))}get isFinite(){let t=null,s=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(s===null||r.value>s)&&(s=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(s)&&Number.isFinite(t)}}Ji.create=n=>new Ji({checks:[],typeName:Ne.ZodNumber,coerce:n?.coerce||!1,...Ie(n)});class bl extends Ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==be.bigint)return this._getInvalidInput(t);let r;const o=new sn;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),ge(r,{code:fe.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),ge(r,{code:fe.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ge(r,{code:fe.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()):et.assertNever(l);return{status:o.value,value:t.data}}_getInvalidInput(t){const s=this._getOrReturnCtx(t);return ge(s,{code:fe.invalid_type,expected:be.bigint,received:s.parsedType}),ke}gte(t,s){return this.setLimit("min",t,!0,_e.toString(s))}gt(t,s){return this.setLimit("min",t,!1,_e.toString(s))}lte(t,s){return this.setLimit("max",t,!0,_e.toString(s))}lt(t,s){return this.setLimit("max",t,!1,_e.toString(s))}setLimit(t,s,r,o){return new bl({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:_e.toString(o)}]})}_addCheck(t){return new bl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(s)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}bl.create=n=>new bl({checks:[],typeName:Ne.ZodBigInt,coerce:n?.coerce??!1,...Ie(n)});class Qm extends Ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==be.boolean){const r=this._getOrReturnCtx(t);return ge(r,{code:fe.invalid_type,expected:be.boolean,received:r.parsedType}),ke}return Vn(t.data)}}Qm.create=n=>new Qm({typeName:Ne.ZodBoolean,coerce:n?.coerce||!1,...Ie(n)});class Du extends Ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==be.date){const l=this._getOrReturnCtx(t);return ge(l,{code:fe.invalid_type,expected:be.date,received:l.parsedType}),ke}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return ge(l,{code:fe.invalid_date}),ke}const r=new sn;let o;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(o=this._getOrReturnCtx(t,o),ge(o,{code:fe.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):et.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Du({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:_e.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:_e.toString(s)})}get minDate(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}}Du.create=n=>new Du({checks:[],coerce:n?.coerce||!1,typeName:Ne.ZodDate,...Ie(n)});class vx extends Ye{_parse(t){if(this._getType(t)!==be.symbol){const r=this._getOrReturnCtx(t);return ge(r,{code:fe.invalid_type,expected:be.symbol,received:r.parsedType}),ke}return Vn(t.data)}}vx.create=n=>new vx({typeName:Ne.ZodSymbol,...Ie(n)});class Wm extends Ye{_parse(t){if(this._getType(t)!==be.undefined){const r=this._getOrReturnCtx(t);return ge(r,{code:fe.invalid_type,expected:be.undefined,received:r.parsedType}),ke}return Vn(t.data)}}Wm.create=n=>new Wm({typeName:Ne.ZodUndefined,...Ie(n)});class Jm extends Ye{_parse(t){if(this._getType(t)!==be.null){const r=this._getOrReturnCtx(t);return ge(r,{code:fe.invalid_type,expected:be.null,received:r.parsedType}),ke}return Vn(t.data)}}Jm.create=n=>new Jm({typeName:Ne.ZodNull,...Ie(n)});class yx extends Ye{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}yx.create=n=>new yx({typeName:Ne.ZodAny,...Ie(n)});class ep extends Ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}ep.create=n=>new ep({typeName:Ne.ZodUnknown,...Ie(n)});class $s extends Ye{_parse(t){const s=this._getOrReturnCtx(t);return ge(s,{code:fe.invalid_type,expected:be.never,received:s.parsedType}),ke}}$s.create=n=>new $s({typeName:Ne.ZodNever,...Ie(n)});class bx extends Ye{_parse(t){if(this._getType(t)!==be.undefined){const r=this._getOrReturnCtx(t);return ge(r,{code:fe.invalid_type,expected:be.void,received:r.parsedType}),ke}return Vn(t.data)}}bx.create=n=>new bx({typeName:Ne.ZodVoid,...Ie(n)});class ma extends Ye{_parse(t){const{ctx:s,status:r}=this._processInputParams(t),o=this._def;if(s.parsedType!==be.array)return ge(s,{code:fe.invalid_type,expected:be.array,received:s.parsedType}),ke;if(o.exactLength!==null){const u=s.data.length>o.exactLength.value,d=s.data.length<o.exactLength.value;(u||d)&&(ge(s,{code:u?fe.too_big:fe.too_small,minimum:d?o.exactLength.value:void 0,maximum:u?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&s.data.length<o.minLength.value&&(ge(s,{code:fe.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&s.data.length>o.maxLength.value&&(ge(s,{code:fe.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),s.common.async)return Promise.all([...s.data].map((u,d)=>o.type._parseAsync(new ya(s,u,s.path,d)))).then(u=>sn.mergeArray(r,u));const l=[...s.data].map((u,d)=>o.type._parseSync(new ya(s,u,s.path,d)));return sn.mergeArray(r,l)}get element(){return this._def.type}min(t,s){return new ma({...this._def,minLength:{value:t,message:_e.toString(s)}})}max(t,s){return new ma({...this._def,maxLength:{value:t,message:_e.toString(s)}})}length(t,s){return new ma({...this._def,exactLength:{value:t,message:_e.toString(s)}})}nonempty(t){return this.min(1,t)}}ma.create=(n,t)=>new ma({type:n,minLength:null,maxLength:null,exactLength:null,typeName:Ne.ZodArray,...Ie(t)});function $i(n){if(n instanceof Ot){const t={};for(const s in n.shape){const r=n.shape[s];t[s]=Za.create($i(r))}return new Ot({...n._def,shape:()=>t})}else return n instanceof ma?new ma({...n._def,type:$i(n.element)}):n instanceof Za?Za.create($i(n.unwrap())):n instanceof Mr?Mr.create($i(n.unwrap())):n instanceof Or?Or.create(n.items.map(t=>$i(t))):n}class Ot extends Ye{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),s=et.objectKeys(t);return this._cached={shape:t,keys:s},this._cached}_parse(t){if(this._getType(t)!==be.object){const p=this._getOrReturnCtx(t);return ge(p,{code:fe.invalid_type,expected:be.object,received:p.parsedType}),ke}const{status:r,ctx:o}=this._processInputParams(t),{shape:l,keys:u}=this._getCached(),d=[];if(!(this._def.catchall instanceof $s&&this._def.unknownKeys==="strip"))for(const p in o.data)u.includes(p)||d.push(p);const m=[];for(const p of u){const b=l[p],v=o.data[p];m.push({key:{status:"valid",value:p},value:b._parse(new ya(o,v,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof $s){const p=this._def.unknownKeys;if(p==="passthrough")for(const b of d)m.push({key:{status:"valid",value:b},value:{status:"valid",value:o.data[b]}});else if(p==="strict")d.length>0&&(ge(o,{code:fe.unrecognized_keys,keys:d}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const b of d){const v=o.data[b];m.push({key:{status:"valid",value:b},value:p._parse(new ya(o,v,o.path,b)),alwaysSet:b in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const b of m){const v=await b.key,y=await b.value;p.push({key:v,value:y,alwaysSet:b.alwaysSet})}return p}).then(p=>sn.mergeObjectSync(r,p)):sn.mergeObjectSync(r,m)}get shape(){return this._def.shape()}strict(t){return _e.errToObj,new Ot({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,r)=>{const o=this._def.errorMap?.(s,r).message??r.defaultError;return s.code==="unrecognized_keys"?{message:_e.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new Ot({...this._def,unknownKeys:"strip"})}passthrough(){return new Ot({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ot({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ot({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ne.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new Ot({...this._def,catchall:t})}pick(t){const s={};for(const r of et.objectKeys(t))t[r]&&this.shape[r]&&(s[r]=this.shape[r]);return new Ot({...this._def,shape:()=>s})}omit(t){const s={};for(const r of et.objectKeys(this.shape))t[r]||(s[r]=this.shape[r]);return new Ot({...this._def,shape:()=>s})}deepPartial(){return $i(this)}partial(t){const s={};for(const r of et.objectKeys(this.shape)){const o=this.shape[r];t&&!t[r]?s[r]=o:s[r]=o.optional()}return new Ot({...this._def,shape:()=>s})}required(t){const s={};for(const r of et.objectKeys(this.shape))if(t&&!t[r])s[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof Za;)l=l._def.innerType;s[r]=l}return new Ot({...this._def,shape:()=>s})}keyof(){return a2(et.objectKeys(this.shape))}}Ot.create=(n,t)=>new Ot({shape:()=>n,unknownKeys:"strip",catchall:$s.create(),typeName:Ne.ZodObject,...Ie(t)});Ot.strictCreate=(n,t)=>new Ot({shape:()=>n,unknownKeys:"strict",catchall:$s.create(),typeName:Ne.ZodObject,...Ie(t)});Ot.lazycreate=(n,t)=>new Ot({shape:n,unknownKeys:"strip",catchall:$s.create(),typeName:Ne.ZodObject,...Ie(t)});class Mu extends Ye{_parse(t){const{ctx:s}=this._processInputParams(t),r=this._def.options;function o(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return s.common.issues.push(...d.ctx.common.issues),d.result;const u=l.map(d=>new Qa(d.ctx.common.issues));return ge(s,{code:fe.invalid_union,unionErrors:u}),ke}if(s.common.async)return Promise.all(r.map(async l=>{const u={...s,common:{...s.common,issues:[]},parent:null};return{result:await l._parseAsync({data:s.data,path:s.path,parent:u}),ctx:u}})).then(o);{let l;const u=[];for(const m of r){const p={...s,common:{...s.common,issues:[]},parent:null},b=m._parseSync({data:s.data,path:s.path,parent:p});if(b.status==="valid")return b;b.status==="dirty"&&!l&&(l={result:b,ctx:p}),p.common.issues.length&&u.push(p.common.issues)}if(l)return s.common.issues.push(...l.ctx.common.issues),l.result;const d=u.map(m=>new Qa(m));return ge(s,{code:fe.invalid_union,unionErrors:d}),ke}}get options(){return this._def.options}}Mu.create=(n,t)=>new Mu({options:n,typeName:Ne.ZodUnion,...Ie(t)});const Va=n=>n instanceof np?Va(n.schema):n instanceof Dr?Va(n.innerType()):n instanceof Uu?[n.value]:n instanceof Rr?n.options:n instanceof ap?et.objectValues(n.enum):n instanceof Iu?Va(n._def.innerType):n instanceof Wm?[void 0]:n instanceof Jm?[null]:n instanceof Za?[void 0,...Va(n.unwrap())]:n instanceof Mr?[null,...Va(n.unwrap())]:n instanceof s2||n instanceof Vu?Va(n.unwrap()):n instanceof Hu?Va(n._def.innerType):[];class eg extends Ye{_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==be.object)return ge(s,{code:fe.invalid_type,expected:be.object,received:s.parsedType}),ke;const r=this.discriminator,o=s.data[r],l=this.optionsMap.get(o);return l?s.common.async?l._parseAsync({data:s.data,path:s.path,parent:s}):l._parseSync({data:s.data,path:s.path,parent:s}):(ge(s,{code:fe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ke)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,s,r){const o=new Map;for(const l of s){const u=Va(l.shape[t]);if(!u.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of u){if(o.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);o.set(d,l)}}return new eg({typeName:Ne.ZodDiscriminatedUnion,discriminator:t,options:s,optionsMap:o,...Ie(r)})}}function tp(n,t){const s=zs(n),r=zs(t);if(n===t)return{valid:!0,data:n};if(s===be.object&&r===be.object){const o=et.objectKeys(t),l=et.objectKeys(n).filter(d=>o.indexOf(d)!==-1),u={...n,...t};for(const d of l){const m=tp(n[d],t[d]);if(!m.valid)return{valid:!1};u[d]=m.data}return{valid:!0,data:u}}else if(s===be.array&&r===be.array){if(n.length!==t.length)return{valid:!1};const o=[];for(let l=0;l<n.length;l++){const u=n[l],d=t[l],m=tp(u,d);if(!m.valid)return{valid:!1};o.push(m.data)}return{valid:!0,data:o}}else return s===be.date&&r===be.date&&+n==+t?{valid:!0,data:n}:{valid:!1}}class zu extends Ye{_parse(t){const{status:s,ctx:r}=this._processInputParams(t),o=(l,u)=>{if(mx(l)||mx(u))return ke;const d=tp(l.value,u.value);return d.valid?((px(l)||px(u))&&s.dirty(),{status:s.value,value:d.data}):(ge(r,{code:fe.invalid_intersection_types}),ke)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([l,u])=>o(l,u)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}zu.create=(n,t,s)=>new zu({left:n,right:t,typeName:Ne.ZodIntersection,...Ie(s)});class Or extends Ye{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.array)return ge(r,{code:fe.invalid_type,expected:be.array,received:r.parsedType}),ke;if(r.data.length<this._def.items.length)return ge(r,{code:fe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&r.data.length>this._def.items.length&&(ge(r,{code:fe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const l=[...r.data].map((u,d)=>{const m=this._def.items[d]||this._def.rest;return m?m._parse(new ya(r,u,r.path,d)):null}).filter(u=>!!u);return r.common.async?Promise.all(l).then(u=>sn.mergeArray(s,u)):sn.mergeArray(s,l)}get items(){return this._def.items}rest(t){return new Or({...this._def,rest:t})}}Or.create=(n,t)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Or({items:n,typeName:Ne.ZodTuple,rest:null,...Ie(t)})};class Lu extends Ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.object)return ge(r,{code:fe.invalid_type,expected:be.object,received:r.parsedType}),ke;const o=[],l=this._def.keyType,u=this._def.valueType;for(const d in r.data)o.push({key:l._parse(new ya(r,d,r.path,d)),value:u._parse(new ya(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?sn.mergeObjectAsync(s,o):sn.mergeObjectSync(s,o)}get element(){return this._def.valueType}static create(t,s,r){return s instanceof Ye?new Lu({keyType:t,valueType:s,typeName:Ne.ZodRecord,...Ie(r)}):new Lu({keyType:$a.create(),valueType:t,typeName:Ne.ZodRecord,...Ie(s)})}}class xx extends Ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.map)return ge(r,{code:fe.invalid_type,expected:be.map,received:r.parsedType}),ke;const o=this._def.keyType,l=this._def.valueType,u=[...r.data.entries()].map(([d,m],p)=>({key:o._parse(new ya(r,d,r.path,[p,"key"])),value:l._parse(new ya(r,m,r.path,[p,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const m of u){const p=await m.key,b=await m.value;if(p.status==="aborted"||b.status==="aborted")return ke;(p.status==="dirty"||b.status==="dirty")&&s.dirty(),d.set(p.value,b.value)}return{status:s.value,value:d}})}else{const d=new Map;for(const m of u){const p=m.key,b=m.value;if(p.status==="aborted"||b.status==="aborted")return ke;(p.status==="dirty"||b.status==="dirty")&&s.dirty(),d.set(p.value,b.value)}return{status:s.value,value:d}}}}xx.create=(n,t,s)=>new xx({valueType:t,keyType:n,typeName:Ne.ZodMap,...Ie(s)});class xl extends Ye{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.set)return ge(r,{code:fe.invalid_type,expected:be.set,received:r.parsedType}),ke;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ge(r,{code:fe.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),s.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(ge(r,{code:fe.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),s.dirty());const l=this._def.valueType;function u(m){const p=new Set;for(const b of m){if(b.status==="aborted")return ke;b.status==="dirty"&&s.dirty(),p.add(b.value)}return{status:s.value,value:p}}const d=[...r.data.values()].map((m,p)=>l._parse(new ya(r,m,r.path,p)));return r.common.async?Promise.all(d).then(m=>u(m)):u(d)}min(t,s){return new xl({...this._def,minSize:{value:t,message:_e.toString(s)}})}max(t,s){return new xl({...this._def,maxSize:{value:t,message:_e.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}}xl.create=(n,t)=>new xl({valueType:n,minSize:null,maxSize:null,typeName:Ne.ZodSet,...Ie(t)});class np extends Ye{get schema(){return this._def.getter()}_parse(t){const{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}np.create=(n,t)=>new np({getter:n,typeName:Ne.ZodLazy,...Ie(t)});class Uu extends Ye{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return ge(s,{received:s.data,code:fe.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:t.data}}get value(){return this._def.value}}Uu.create=(n,t)=>new Uu({value:n,typeName:Ne.ZodLiteral,...Ie(t)});function a2(n,t){return new Rr({values:n,typeName:Ne.ZodEnum,...Ie(t)})}class Rr extends Ye{_parse(t){if(typeof t.data!="string"){const s=this._getOrReturnCtx(t),r=this._def.values;return ge(s,{expected:et.joinValues(r),received:s.parsedType,code:fe.invalid_type}),ke}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const s=this._getOrReturnCtx(t),r=this._def.values;return ge(s,{received:s.data,code:fe.invalid_enum_value,options:r}),ke}return Vn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const s of this._def.values)t[s]=s;return t}get Values(){const t={};for(const s of this._def.values)t[s]=s;return t}get Enum(){const t={};for(const s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return Rr.create(t,{...this._def,...s})}exclude(t,s=this._def){return Rr.create(this.options.filter(r=>!t.includes(r)),{...this._def,...s})}}Rr.create=a2;class ap extends Ye{_parse(t){const s=et.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==be.string&&r.parsedType!==be.number){const o=et.objectValues(s);return ge(r,{expected:et.joinValues(o),received:r.parsedType,code:fe.invalid_type}),ke}if(this._cache||(this._cache=new Set(et.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=et.objectValues(s);return ge(r,{received:r.data,code:fe.invalid_enum_value,options:o}),ke}return Vn(t.data)}get enum(){return this._def.values}}ap.create=(n,t)=>new ap({values:n,typeName:Ne.ZodNativeEnum,...Ie(t)});class Bu extends Ye{unwrap(){return this._def.type}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==be.promise&&s.common.async===!1)return ge(s,{code:fe.invalid_type,expected:be.promise,received:s.parsedType}),ke;const r=s.parsedType===be.promise?s.data:Promise.resolve(s.data);return Vn(r.then(o=>this._def.type.parseAsync(o,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Bu.create=(n,t)=>new Bu({type:n,typeName:Ne.ZodPromise,...Ie(t)});class Dr extends Ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:s,ctx:r}=this._processInputParams(t),o=this._def.effect||null,l={addIssue:u=>{ge(r,u),u.fatal?s.abort():s.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),o.type==="preprocess"){const u=o.transform(r.data,l);if(r.common.async)return Promise.resolve(u).then(async d=>{if(s.value==="aborted")return ke;const m=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return m.status==="aborted"?ke:m.status==="dirty"||s.value==="dirty"?ul(m.value):m});{if(s.value==="aborted")return ke;const d=this._def.schema._parseSync({data:u,path:r.path,parent:r});return d.status==="aborted"?ke:d.status==="dirty"||s.value==="dirty"?ul(d.value):d}}if(o.type==="refinement"){const u=d=>{const m=o.refinement(d,l);if(r.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?ke:(d.status==="dirty"&&s.dirty(),u(d.value),{status:s.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?ke:(d.status==="dirty"&&s.dirty(),u(d.value).then(()=>({status:s.value,value:d.value}))))}if(o.type==="transform")if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Wi(u))return ke;const d=o.transform(u.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>Wi(u)?Promise.resolve(o.transform(u.value,l)).then(d=>({status:s.value,value:d})):ke);et.assertNever(o)}}Dr.create=(n,t,s)=>new Dr({schema:n,typeName:Ne.ZodEffects,effect:t,...Ie(s)});Dr.createWithPreprocess=(n,t,s)=>new Dr({schema:t,effect:{type:"preprocess",transform:n},typeName:Ne.ZodEffects,...Ie(s)});class Za extends Ye{_parse(t){return this._getType(t)===be.undefined?Vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Za.create=(n,t)=>new Za({innerType:n,typeName:Ne.ZodOptional,...Ie(t)});class Mr extends Ye{_parse(t){return this._getType(t)===be.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mr.create=(n,t)=>new Mr({innerType:n,typeName:Ne.ZodNullable,...Ie(t)});class Iu extends Ye{_parse(t){const{ctx:s}=this._processInputParams(t);let r=s.data;return s.parsedType===be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}Iu.create=(n,t)=>new Iu({innerType:n,typeName:Ne.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ie(t)});class Hu extends Ye{_parse(t){const{ctx:s}=this._processInputParams(t),r={...s,common:{...s.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ru(o)?o.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Qa(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Hu.create=(n,t)=>new Hu({innerType:n,typeName:Ne.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ie(t)});class wx extends Ye{_parse(t){if(this._getType(t)!==be.nan){const r=this._getOrReturnCtx(t);return ge(r,{code:fe.invalid_type,expected:be.nan,received:r.parsedType}),ke}return{status:"valid",value:t.data}}}wx.create=n=>new wx({typeName:Ne.ZodNaN,...Ie(n)});class s2 extends Ye{_parse(t){const{ctx:s}=this._processInputParams(t),r=s.data;return this._def.type._parse({data:r,path:s.path,parent:s})}unwrap(){return this._def.type}}class tg extends Ye{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?ke:l.status==="dirty"?(s.dirty(),ul(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ke:o.status==="dirty"?(s.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,s){return new tg({in:t,out:s,typeName:Ne.ZodPipeline})}}class Vu extends Ye{_parse(t){const s=this._def.innerType._parse(t),r=o=>(Wi(o)&&(o.value=Object.freeze(o.value)),o);return Ru(s)?s.then(o=>r(o)):r(s)}unwrap(){return this._def.innerType}}Vu.create=(n,t)=>new Vu({innerType:n,typeName:Ne.ZodReadonly,...Ie(t)});var Ne;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(Ne||(Ne={}));const D=$a.create,ue=Ji.create,Te=Qm.create,Ps=ep.create;$s.create;const Be=ma.create,I=Ot.create,PN=Mu.create,Ws=eg.create;zu.create;Or.create;const um=Lu.create,Ee=Uu.create,Qe=Rr.create;Bu.create;Za.create;Mr.create;const GN=Qe(["running","paused","completed","failed","stopped"]),ng=Qe(["pending","running","paused","completed","failed","stopped","unknown"]),FN=I({id:D(),toolCallId:D().optional(),title:D(),state:ng,phaseId:D().optional(),model:D().optional(),tokens:ue().nonnegative().optional(),toolCalls:ue().int().nonnegative().optional(),durationMs:ue().nonnegative().optional(),startedAt:ue().optional(),endedAt:ue().optional(),result:D().optional()}),ZN=I({id:D(),title:D(),order:ue()}),r2=I({runId:D().optional(),name:D().optional(),state:GN.optional(),started:ue().int().nonnegative().optional(),completed:ue().int().nonnegative().optional(),tokens:ue().nonnegative().optional(),durationMs:ue().nonnegative().optional(),startedAt:ue().optional(),endedAt:ue().optional(),phases:Be(ZN).optional(),agents:Be(FN).optional()}),YN=Qe(["multi_client","handoff","remote","terminal"]),KN=I({interrupt:Te(),steer:Te(),permissions:Te(),images:Te(),fork:Te(),models:Te(),modes:Te()}),XN=I({state:Qe(["ok","missing","unknown"]),method:D().optional(),hint:D().optional()}),QN=I({id:D().min(1),label:D().min(1),tier:YN,installed:Te(),version:D().optional(),problem:D().optional(),auth:XN.optional(),capabilities:KN}),qu=Qe(["desktop","remote","none"]),i2=Qe(["idle","running","waiting","error","offline"]),o2=Qe(["read","edit","delete","move","search","execute","think","fetch","other"]),l2=I({optionId:D().min(1),name:D().min(1),kind:Qe(["allow_once","allow_always","reject_once","reject_always"])}),WN=I({kind:Qe(["thinking","responding","tool"]),title:D().optional(),toolKind:o2.optional()}),c2=I({id:D(),header:D().optional(),text:D(),kind:Qe(["choice","choices","text"]),options:Be(I({value:D(),label:D(),description:D().optional()})).optional(),other:Te().optional(),secret:Te().optional(),required:Te().optional()}),u2=I({id:D(),values:Be(D().max(2e4)).max(50),other:D().max(2e4).optional()}),JN=I({requestId:D(),toolCallId:D().optional(),title:D(),detail:D().optional(),options:Be(l2).min(1),questions:Be(c2).optional()}),e5=I({clientMessageId:D(),text:D(),images:ue().int().nonnegative()}),t5=I({toolCallId:D(),parentToolCallId:D().optional(),task:D(),agentType:D().optional(),running:Te(),failed:Te().optional(),startedAt:ue(),endedAt:ue().optional(),state:ng.optional(),workflow:r2.optional(),lastSeq:ue().int().nonnegative().optional()}),n5=Qe(["running","completed","failed","stopped","unknown"]),d2=I({id:D(),kind:Qe(["shell","monitor"]),toolCallId:D().optional(),title:D(),command:D().optional(),state:n5,startedAt:ue(),endedAt:ue().optional(),summary:D().optional(),exitCode:ue().int().optional(),output:Te().optional(),canStop:Te().optional(),lastSeq:ue().int().nonnegative().optional()}),Sr=I({id:D().min(1),agent:D().min(1),nativeId:D().min(1),title:D().optional(),preview:D().optional(),cwd:D(),state:i2,driver:qu.optional(),pendingPermissions:ue().int().nonnegative(),model:D().optional(),createdAt:ue(),updatedAt:ue(),lastSeq:ue().int().nonnegative(),archived:Te(),activity:WN.optional(),permission:JN.optional(),queue:Be(e5).optional(),worktree:I({branch:D(),source:D()}).optional(),subagents:I({total:ue().int(),running:ue().int()}).optional(),tasks:I({total:ue().int(),running:ue().int()}).optional()}),a5=I({root:D(),branch:D().optional(),head:D().optional(),dirty:Te()}),s5=I({path:D(),branch:D(),source:D(),createdAt:ue(),sessions:Be(D()),dirty:Te(),ahead:ue().int().nonnegative()}),r5=I({cwd:D(),name:D(),lastActiveAt:ue(),sessionCount:ue().int().nonnegative(),branch:D().optional()});I({machineId:D().min(1),hostname:D(),platform:D(),hostVersion:D(),home:D().optional(),agents:Be(QN),direct:I({iceServers:Be(D())}).optional()});const i5=I({port:ue().int().min(1).max(65535),process:D(),pid:ue().int().optional(),cwd:D().optional(),title:D().optional(),http:Te()}),xu=I({id:D(),title:D(),cwd:D(),cols:ue().int(),rows:ue().int(),createdAt:ue(),activeAt:ue(),command:D().optional(),exitCode:ue().int().nullable().optional(),interrupted:Te().optional()});I({url:D().optional(),status:Qe(["off","connecting","online","offline"]),error:I({code:D(),message:D()}).optional(),machine:I({id:D(),name:D()}).optional(),account:I({userId:D(),email:D().optional()}).optional(),devices:Be(I({id:D(),name:D(),pairedAt:ue(),online:Te()}))});const f2=I({objective:D(),status:Qe(["active","paused","blocked","usageLimited","budgetLimited","complete"]),tokenBudget:ue().nonnegative().nullable().optional(),tokensUsed:ue().nonnegative().optional(),timeUsedSeconds:ue().nonnegative().optional(),iterations:ue().int().nonnegative().optional(),lastReason:D().nullable().optional()}),o5=Ws("action",[I({action:Ee("get")}),I({action:Ee("set"),objective:D().trim().min(1).max(4e3),tokenBudget:ue().int().positive().max(Number.MAX_SAFE_INTEGER).optional()}),I({action:Ee("pause")}),I({action:Ee("resume")}),I({action:Ee("clear")})]),Ki=Ws("type",[I({type:Ee("text"),text:D()}),I({type:Ee("image"),mimeType:D(),data:D().optional(),uri:D().optional()}),I({type:Ee("resource_link"),uri:D(),name:D(),kind:Qe(["file","skill","agent"]).optional()})]),Sx=Qe(["pending","in_progress","completed","failed"]),Ex=Ws("type",[I({type:Ee("content"),content:Ki}),I({type:Ee("diff"),path:D(),oldText:D().nullable().optional(),newText:D()}),I({type:Ee("patch"),path:D(),change:Qe(["add","delete","update"]),movePath:D().optional(),diff:D()}),I({type:Ee("terminal"),terminalId:D()})]),l5=I({path:D(),line:ue().int().optional()}),_x=Ws("type",[I({type:Ee("mcp"),server:D(),tool:D()}),I({type:Ee("subagent"),action:Qe(["spawn","message","wait","stop","resume","list"]).default("spawn"),task:D().optional(),agentType:D().optional(),model:D().optional(),state:ng.optional(),workflow:r2.optional()}),I({type:Ee("skill"),name:D(),description:D().optional()}),I({type:Ee("web_search"),query:D().optional()}),I({type:Ee("image_generation"),prompt:D().optional()}),I({type:Ee("compaction")}),I({type:Ee("review"),phase:Qe(["started","finished"])}),I({type:Ee("question"),text:D(),more:ue().int().optional()})]),c5=I({content:D(),priority:Qe(["high","medium","low"]).default("medium"),status:Qe(["pending","in_progress","completed"])}),u5=Qe(["end_turn","cancelled","error","max_tokens","refusal"]),d5=I({id:D(),name:D(),category:Qe(["model","mode","effort","other"]).default("other"),current:D(),values:Be(I({value:D(),name:D(),description:D().optional()}))}),f5=Ws("sessionUpdate",[I({sessionUpdate:Ee("user_message_chunk"),messageId:D().optional(),content:Ki}),I({sessionUpdate:Ee("agent_message_chunk"),parentToolCallId:D().optional(),messageId:D(),content:Ki}),I({sessionUpdate:Ee("agent_thought_chunk"),parentToolCallId:D().optional(),messageId:D(),content:Ki}),I({sessionUpdate:Ee("tool_call"),toolCallId:D(),parentToolCallId:D().optional(),title:D(),kind:o2,status:Sx,rawInput:Ps().optional(),content:Be(Ex).optional(),locations:Be(l5).optional(),detail:_x.optional()}),I({sessionUpdate:Ee("tool_call_update"),toolCallId:D(),parentToolCallId:D().optional(),status:Sx.optional(),title:D().optional(),detail:_x.optional(),content:Be(Ex).optional(),appendOutput:D().optional(),rawOutput:Ps().optional()}),I({sessionUpdate:Ee("plan"),entries:Be(c5)}),I({sessionUpdate:Ee("ls_goal"),goal:f2.nullable()}),I({sessionUpdate:Ee("available_commands_update"),availableCommands:Be(I({name:D(),description:D(),hint:D().optional()}))}),I({sessionUpdate:Ee("current_mode_update"),currentModeId:D()}),I({sessionUpdate:Ee("session_info_update"),title:D().optional(),model:D().optional()}),I({sessionUpdate:Ee("usage_update"),usedTokens:ue().optional(),contextWindow:ue().optional()}),I({sessionUpdate:Ee("ls_message_done"),parentToolCallId:D().optional(),messageId:D(),role:Qe(["agent","thought","user"])}),I({sessionUpdate:Ee("ls_config"),options:Be(d5)}),I({sessionUpdate:Ee("ls_notice"),level:Qe(["info","warning"]),title:D(),detail:D().optional()}),I({sessionUpdate:Ee("ls_turn"),parentToolCallId:D().optional(),state:Qe(["started","ended"]),turnId:D().optional(),stopReason:u5.optional()}),I({sessionUpdate:Ee("ls_permission"),requestId:D(),toolCallId:D().optional(),title:D(),detail:D().optional(),options:Be(l2).min(1),questions:Be(c2).optional()}),I({sessionUpdate:Ee("ls_permission_resolved"),requestId:D(),optionId:D().optional(),answers:Be(u2).optional()}),I({sessionUpdate:Ee("ls_driver"),driver:qu,deviceId:D().optional()}),I({sessionUpdate:Ee("ls_status"),state:i2}),I({sessionUpdate:Ee("ls_task"),task:d2}),I({sessionUpdate:Ee("ls_error"),code:D(),message:D(),hint:D().optional()})]),Cx=I({sessionId:D(),seq:ue().int().positive(),ts:ue(),update:f5}),h5=PN([D(),ue()]),m5=I({code:ue().int(),message:D(),data:Ps().optional()});I({jsonrpc:Ee("2.0"),id:h5.optional(),method:D().optional(),params:Ps().optional(),result:Ps().optional(),error:m5.optional()});Qe(["invalid_params","not_found","agent_unavailable","not_supported","not_ready","busy","offline","internal"]);const p5=-32601,dl=-32e3;I({}).passthrough();const Ax=I({name:D(),path:D(),project:Te().optional(),file:Te().optional(),size:ue().int().optional()});I({limit:ue().int().positive().max(200).optional()}),I({projects:Be(r5)}),I({limit:ue().int().positive().max(200).optional(),before:ue().optional(),includeArchived:Te().optional()}),I({sessions:Be(Sr),nextBefore:ue().optional()}),I({agent:D().min(1),cwd:D().min(1),prompt:Be(Ki).optional(),clientMessageId:D().optional(),model:D().optional(),worktree:Te().optional()}),I({session:Sr}),I({sessionId:D().min(1),itemId:D().min(1).optional(),worktree:Te().optional()}),I({session:Sr}),I({sessionId:D().min(1),fromSeq:ue().int().nonnegative(),lazyImages:Te().optional()}),I({session:Sr,startSeq:ue().int().nonnegative().optional()}),I({sessionId:D().min(1),beforeSeq:ue().int().positive(),lazyImages:Te().optional()}),I({events:Be(Cx),startSeq:ue().int().nonnegative()}),I({sessionId:D().min(1)}),I({subagents:Be(t5)}),I({sessionId:D().min(1),toolCallId:D().min(1),lazyImages:Te().optional()}),I({events:Be(Cx)}),I({sessionId:D().min(1)}),I({tasks:Be(d2)}),I({sessionId:D().min(1),taskId:D().min(1),before:ue().int().nonnegative().optional(),limit:ue().int().positive().max(256*1024).optional()}),I({text:D(),start:ue().int().nonnegative(),size:ue().int().nonnegative()}),I({sessionId:D().min(1),taskId:D().min(1)}),I({sessionId:D().min(1),direct:Te().optional()}),I({port:ue().int().positive(),token:D()}),I({sessionId:D().min(1)}),I({sessionId:D().min(1),uri:D().min(1)}),I({mimeType:D(),data:D()}),I({sessionId:D().min(1)}),I({sessionId:D().min(1),clientMessageId:D().min(1),content:Be(Ki).min(1),whenBusy:Qe(["queue"]).optional()}),I({delivery:Qe(["started","steered","queued","duplicate"])}),I({sessionId:D().min(1)}),I({sessionId:D().min(1),requestId:D().min(1),optionId:D().min(1)}),I({sessionId:D().min(1),requestId:D().min(1),answers:Be(u2).max(50)}),I({sessionId:D(),change:o5}),I({goal:f2.nullable()}),I({sessionId:D().min(1),optionId:D().min(1),value:D().min(1)}),I({sessionId:D().min(1),clientMessageId:D().min(1).optional()}),I({sessionId:D().min(1),clientMessageIds:Be(D().min(1))}),I({sessionId:D().min(1),clientMessageId:D().min(1)}),I({removed:Te()}),I({sessionId:D().min(1),archived:Te()}),I({session:Sr}),I({sessionId:D().min(1),title:D().max(200)}),I({session:Sr}),I({sessionId:D().min(1),worktree:Qe(["keep","remove"]).optional()}),I({sessionId:D().min(1)}),I({driver:qu.optional()}),I({sessionId:D().min(1)}),I({driver:qu.optional()}),I({agent:D().min(1),sessionId:D().optional(),args:Be(D()).default([]),cwd:D().optional(),env:um(D()).optional()}),I({command:D(),args:Be(D()),env:um(D()).optional(),sessionId:D().optional()}),I({sessionId:D().min(1)}),I({sessionId:D().min(1)}),I({command:D(),args:Be(D()),env:um(D()).optional()}),I({link:D(),code:D(),expiresAt:ue(),gateway:D()}),I({deviceId:D().min(1)}),I({path:D().min(1)}),I({git:a5.optional()}),I({worktrees:Be(s5)}),I({path:D().min(1),force:Te().optional()}),I({path:D().optional(),hidden:Te().default(!1),files:Te().default(!1)}),I({path:D(),parent:D().optional(),home:D(),entries:Be(Ax),truncated:Te().optional()}),I({path:D().min(1),offset:ue().int().nonnegative().default(0),maxBytes:ue().int().min(1).max(2e6).default(512e3)}),I({path:D(),size:ue().int(),modifiedAt:ue(),kind:Qe(["text","image","binary"]),text:D().optional(),data:D().optional(),mimeType:D().optional(),truncated:Te(),nextOffset:ue().int().optional()}),I({dir:D().min(1),name:D().min(1).max(255),data:D().max(4e7)}),I({path:D(),size:ue().int()}),I({parent:D().min(1),name:D().min(1).max(255)}),I({path:D()}),I({query:D().min(1).max(200),limit:ue().int().min(1).max(200).default(60)}),I({entries:Be(Ax),truncated:Te()}),I({terminals:Be(xu)}),I({cwd:D().optional(),command:D().max(4e3).optional(),cols:ue().int().min(10).max(1e3).default(80),rows:ue().int().min(4).max(500).default(24)}),I({terminal:xu}),I({terminalId:D().min(1),fromSeq:ue().int().min(0).optional(),replayFormat:Ee("frames-v1").optional(),fromFrame:ue().int().min(0).optional()}),I({terminal:xu,replay:D(),reset:Te(),seq:ue().int(),recording:I({afterFrame:ue().int(),throughFrame:ue().int()}).optional()}),I({terminalId:D().min(1),afterFrame:ue().int().min(0),throughFrame:ue().int().min(0)}),I({frames:Be(I({frame:ue().int(),cols:ue().int(),rows:ue().int(),data:D()})),nextFrame:ue().int(),done:Te()}),I({terminalId:D().min(1)}),I({terminalId:D().min(1),data:D().max(1e6)}),I({terminalId:D().min(1),cols:ue().int().min(10).max(1e3),rows:ue().int().min(4).max(500)}),I({terminalId:D().min(1)}),I({ports:Be(i5)}),I({port:ue().int().min(1).max(65535),direct:Te().optional()}),I({streamId:D(),channel:ue().int().nonnegative().optional()}),I({sdp:D().min(1).max(2e5)}),I({sdp:D()}),I({port:ue().int(),token:D(),displays:Be(I({index:ue().int(),name:D()}))}),I({ask:Te().optional()}),I({supported:Te(),ffmpeg:Te(),recording:Te().nullable(),control:Te().nullable(),app:D().optional(),problem:D().optional()}),I({streamId:D().min(1),data:D().max(2e6)}),I({streamId:D().min(1)});I({sessionId:D(),startSeq:ue().int().nonnegative()}),I({session:Sr}),I({sessionId:D()}),I({sessionId:D()}),I({sessionId:D()}),I({sessionId:D(),line:D()}),I({device:I({id:D(),name:D()})}),I({terminalId:D(),seq:ue().int(),data:D(),frame:ue().int().optional(),cols:ue().int().optional(),rows:ue().int().optional()}),I({terminal:xu,closed:Te().optional()}),I({streamId:D(),data:D()}),I({streamId:D(),error:D().optional()});class ca extends Error{constructor(t,s,r){super(s),this.code=t,this.data=r,this.name="RpcError"}static app(t,s,r){return new ca(dl,s,{code:t,...r})}get appCode(){const t=this.data;return typeof t?.code=="string"?t.code:void 0}toObject(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}}const g5=Symbol("rpc.abandon");class v5{constructor(t){this.options=t}nextId=1;pending=new Map;closed=!1;request(t,s,r){if(this.closed)return Promise.reject(new ca(dl,`connection closed (${t})`));const o=this.nextId++;return new Promise((l,u)=>{const d={resolve:l,reject:u,method:t},m=r??this.options.requestTimeoutMs??3e4;m>0&&(d.timer=setTimeout(()=>{this.pending.delete(o),u(new ca(dl,`${t} timed out after ${m}ms`,{code:"timeout"}))},m)),this.pending.set(o,d),this.write({jsonrpc:"2.0",id:o,method:t,params:s??{}})})}notify(t,s){this.closed||this.write({jsonrpc:"2.0",method:t,params:s??{}})}receive(t){for(const s of t.split(`
|
|
150
|
+
`)){if(!s.trim())continue;let r;try{r=JSON.parse(s)}catch{continue}this.dispatch(r)}}close(t="connection closed"){if(!this.closed){this.closed=!0;for(const[s,r]of this.pending)r.timer&&clearTimeout(r.timer),r.reject(new ca(dl,`${t} (${r.method})`,{code:"closed"})),this.pending.delete(s)}}get isClosed(){return this.closed}dispatch(t){const s=t.id,r=typeof t.method=="string"?t.method:void 0;if(r===void 0){if(s===void 0)return;const l=this.pending.get(s);if(!l)return;this.pending.delete(s),l.timer&&clearTimeout(l.timer);const u=t.error;u?l.reject(new ca(u.code,u.message,u.data)):l.resolve(t.result);return}if(s===void 0){this.options.onNotification?.(r,t.params);return}const o=this.options.onRequest;if(!o){this.write({jsonrpc:"2.0",id:s,error:{code:p5,message:`no handler for ${r}`}});return}Promise.resolve().then(()=>o(r,t.params,s)).then(l=>{l!==g5&&this.write({jsonrpc:"2.0",id:s,result:l??{}})},l=>{const u=l instanceof ca?l:new ca(dl,l instanceof Error?l.message:String(l),{code:"internal"});this.write({jsonrpc:"2.0",id:s,error:u.toObject()})})}write(t){if(!this.closed)try{this.options.send(JSON.stringify(t))}catch{this.close("send failed")}}}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function sp(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in n&&n.BYTES_PER_ELEMENT===1}const $u=n=>n?`"${n}" `:"";function rp(n,t=""){if(typeof n!="boolean")throw new TypeError($u(t)+"expected boolean, got type="+typeof n);return n}function Xi(n,t=""){if(typeof n!="number")throw new TypeError($u(t)+"expected number, got "+typeof n);if(!Number.isSafeInteger(n)||n<0)throw new RangeError($u(t)+"expected integer >= 0, got "+n);return n}function qt(n,t,s=""){if(sp(n)&&(t===void 0||n.length===t))return n;t!==void 0&&Xi(t,"length");const r=sp(n),o=t!==void 0?` of length ${t}`:"",l=r?`length=${n.length}`:`type=${typeof n}`,u=$u(s)+"expected Uint8Array"+o+", got "+l;throw r?new RangeError(u):new TypeError(u)}const jx=(n,t)=>{if(n===null||typeof n!="object"||Array.isArray(n))throw new TypeError(t==="object"?"expected valid options object":`"${t}" expected object, got type=${typeof n}`)};function Tx(n,t=!0){if(n.destroyed)throw new Error("hash was destroyed");if(t&&n.finished)throw new Error("digest() was already called")}function y5(n,t){qt(n,void 0,"output");const s=t.outputLen;if(!(n.length>=s))throw new RangeError('"output" expected length >= '+s)}function Pa(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function pa(...n){for(let t=0;t<n.length;t++)n[t].fill(0)}function b5(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}const fa=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function x5(n){return n<<24&4278190080|n<<8&16711680|n>>>8&65280|n>>>24&255}function w5(n){for(let t=0;t<n.length;t++)n[t]=x5(n[t]);return n}const Yn=fa?n=>n:w5;function S5(n,t){return!n.byteLength||!t.byteLength?!1:n.buffer===t.buffer&&n.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<n.byteOffset+n.byteLength}function E5(n,t){if(S5(n,t)&&n.byteOffset<t.byteOffset)throw new Error("complex overlap of input and output is not supported")}function _5(n,t){return jx(n,"defaults"),jx(t,"opts"),Object.assign(n,t)}function C5(n,t){if(n=qt(n),t=qt(t),n.length!==t.length)return!1;let s=0;for(let r=0;r<n.length;r++)s|=n[r]^t[r];return s===0}function A5(n,t,s){const r=t,o=(()=>[]),l=(d,m)=>r(m,...o(d)).update(d).digest(),u=r(new Uint8Array(n),...o(new Uint8Array(0)));return l.outputLen=u.outputLen,l.blockLen=u.blockLen,l.create=(d,...m)=>r(d,...m),l}const j5=(n,t)=>{function s(r,...o){if(qt(r,void 0,"key"),n.nonceLength!==void 0){const v=o[0];qt(v,n.varSizeNonce?void 0:n.nonceLength,"nonce")}const l=n.tagLength,u=n.nonceLength!==void 0?1:0;if(!n.withAAD){for(let v=u;v<o.length;v++)if(sp(o[v]))throw new Error("AAD not supported")}n.withAAD&&o[u]!==void 0&&qt(o[u],void 0,"AAD");const d=t(r,...o),m=(v,y)=>{if(y!==void 0){if(v!==2)throw new Error("cipher output not supported");qt(y,void 0,"output")}};let p=!1;return{encrypt(v,y){if(p)throw new Error("cannot encrypt() twice with same key + nonce");return p=!0,qt(v,void 0,"data"),m(d.encrypt.length,y),d.encrypt(v,y)},decrypt(v,y){if(qt(v,void 0,"data"),l&&v.length<l)throw new Error('"ciphertext" expected length >= tagLength='+l);return m(d.decrypt.length,y),d.decrypt(v,y)}}}return Object.assign(s,n),s};function ip(n,t,s=!0){if(t===void 0)return new Uint8Array(n);if(qt(t,n,"output"),s&&!Pu(t))throw new Error("invalid output, must be aligned");return t}function T5(n,t,s){Xi(n),Xi(t),rp(s);const r=new Uint8Array(16),o=b5(r);return o.setBigUint64(0,BigInt(t),s),o.setBigUint64(8,BigInt(n),s),r}function Pu(n){return n.byteOffset%4===0}function Gu(n){return Uint8Array.from(qt(n))}const h2=n=>Uint8Array.from(n.split(""),t=>t.charCodeAt(0)),k5=Yn(Pa(h2("expand 16-byte k"))),N5=Yn(Pa(h2("expand 32-byte k")));function at(n,t){return n<<t|n>>>32-t}const il=64,O5=16,op=2**32-1,kx=Uint32Array.of();function R5(n,t,s,r,o,l,u,d){const m=o.length,p=new Uint8Array(il),b=Pa(p),v=fa&&Pu(o)&&Pu(l),y=v?Pa(o):kx,E=v?Pa(l):kx;if(!fa){for(let _=0;_<m;u++){if(n(t,s,r,b,u,d),Yn(b),u>=op)throw new Error("arx: counter overflow");const T=Math.min(il,m-_);for(let S=0,C;S<T;S++)C=_+S,l[C]=o[C]^p[S];_+=T}return}for(let _=0;_<m;u++){if(n(t,s,r,b,u,d),u>=op)throw new Error("arx: counter overflow");const T=Math.min(il,m-_);if(v&&T===il){const S=_/4;if(_%4!==0)throw new Error("arx: invalid block position");for(let C=0,j;C<O5;C++)j=S+C,E[j]=y[j]^b[C];_+=il;continue}for(let S=0,C;S<T;S++)C=_+S,l[C]=o[C]^p[S];_+=T}}function D5(n,t){const{allowShortKeys:s,extendNonceFn:r,counterLength:o,counterRight:l,rounds:u}=_5({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof n!="function")throw new Error("core must be a function");return Xi(o),Xi(u),rp(l),rp(s),(d,m,p,b,v=0)=>{qt(d,void 0,"key"),qt(m,void 0,"nonce"),qt(p,void 0,"data");const y=p.length,E=b!==void 0;if(b=ip(y,b,!1),E&&E5(p,b),Xi(v),v<0||v>=op)throw new Error("arx: counter overflow");const _=[];let T=d.length,S,C;if(T===32)_.push(S=Gu(d)),C=N5;else if(T===16&&s)S=new Uint8Array(32),S.set(d),S.set(d,16),C=k5,_.push(S);else throw qt(d,32,"arx key"),new Error("invalid key size");(!fa||!Pu(m))&&_.push(m=Gu(m));let j=Pa(S);if(r){if(m.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const R=m.subarray(0,16);if(fa)r(C,j,Pa(R),j);else{const O=Yn(Uint32Array.from(C));r(O,j,Pa(R),j),pa(O),Yn(j)}m=m.subarray(16)}else fa||Yn(j);const k=16-o;if(k!==m.length)throw new Error(`arx: nonce must be ${k} or 16 bytes`);if(k!==12){const R=new Uint8Array(12);R.set(m,l?0:12-m.length),m=R,_.push(m)}const A=Yn(Pa(m));try{return R5(n,C,j,A,p,b,v,u),b}finally{pa(..._)}}}function Kt(n,t){return n[t++]&255|(n[t++]&255)<<8}class M5{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;destroyed=!1;constructor(t){t=Gu(qt(t,32,"key"));const s=Kt(t,0),r=Kt(t,2),o=Kt(t,4),l=Kt(t,6),u=Kt(t,8),d=Kt(t,10),m=Kt(t,12),p=Kt(t,14);this.r[0]=s&8191,this.r[1]=(s>>>13|r<<3)&8191,this.r[2]=(r>>>10|o<<6)&7939,this.r[3]=(o>>>7|l<<9)&8191,this.r[4]=(l>>>4|u<<12)&255,this.r[5]=u>>>1&8190,this.r[6]=(u>>>14|d<<2)&8191,this.r[7]=(d>>>11|m<<5)&8065,this.r[8]=(m>>>8|p<<8)&8191,this.r[9]=p>>>5&127;for(let b=0;b<8;b++)this.pad[b]=Kt(t,16+2*b)}process(t,s,r=!1){const o=r?0:2048,{h:l,r:u}=this,d=u[0],m=u[1],p=u[2],b=u[3],v=u[4],y=u[5],E=u[6],_=u[7],T=u[8],S=u[9],C=Kt(t,s+0),j=Kt(t,s+2),k=Kt(t,s+4),A=Kt(t,s+6),R=Kt(t,s+8),O=Kt(t,s+10),M=Kt(t,s+12),z=Kt(t,s+14);let L=l[0]+(C&8191),V=l[1]+((C>>>13|j<<3)&8191),q=l[2]+((j>>>10|k<<6)&8191),Y=l[3]+((k>>>7|A<<9)&8191),X=l[4]+((A>>>4|R<<12)&8191),ee=l[5]+(R>>>1&8191),re=l[6]+((R>>>14|O<<2)&8191),U=l[7]+((O>>>11|M<<5)&8191),$=l[8]+((M>>>8|z<<8)&8191),W=l[9]+(z>>>5|o),J=0,Q=J+L*d+V*(5*S)+q*(5*T)+Y*(5*_)+X*(5*E);J=Q>>>13,Q&=8191,Q+=ee*(5*y)+re*(5*v)+U*(5*b)+$*(5*p)+W*(5*m),J+=Q>>>13,Q&=8191;let pe=J+L*m+V*d+q*(5*S)+Y*(5*T)+X*(5*_);J=pe>>>13,pe&=8191,pe+=ee*(5*E)+re*(5*y)+U*(5*v)+$*(5*b)+W*(5*p),J+=pe>>>13,pe&=8191;let G=J+L*p+V*m+q*d+Y*(5*S)+X*(5*T);J=G>>>13,G&=8191,G+=ee*(5*_)+re*(5*E)+U*(5*y)+$*(5*v)+W*(5*b),J+=G>>>13,G&=8191;let te=J+L*b+V*p+q*m+Y*d+X*(5*S);J=te>>>13,te&=8191,te+=ee*(5*T)+re*(5*_)+U*(5*E)+$*(5*y)+W*(5*v),J+=te>>>13,te&=8191;let de=J+L*v+V*b+q*p+Y*m+X*d;J=de>>>13,de&=8191,de+=ee*(5*S)+re*(5*T)+U*(5*_)+$*(5*E)+W*(5*y),J+=de>>>13,de&=8191;let ce=J+L*y+V*v+q*b+Y*p+X*m;J=ce>>>13,ce&=8191,ce+=ee*d+re*(5*S)+U*(5*T)+$*(5*_)+W*(5*E),J+=ce>>>13,ce&=8191;let ie=J+L*E+V*y+q*v+Y*b+X*p;J=ie>>>13,ie&=8191,ie+=ee*m+re*d+U*(5*S)+$*(5*T)+W*(5*_),J+=ie>>>13,ie&=8191;let we=J+L*_+V*E+q*y+Y*v+X*b;J=we>>>13,we&=8191,we+=ee*p+re*m+U*d+$*(5*S)+W*(5*T),J+=we>>>13,we&=8191;let me=J+L*T+V*_+q*E+Y*y+X*v;J=me>>>13,me&=8191,me+=ee*b+re*p+U*m+$*d+W*(5*S),J+=me>>>13,me&=8191;let he=J+L*S+V*T+q*_+Y*E+X*y;J=he>>>13,he&=8191,he+=ee*v+re*b+U*p+$*m+W*d,J+=he>>>13,he&=8191,J=(J<<2)+J|0,J=J+Q|0,Q=J&8191,J=J>>>13,pe+=J,l[0]=Q,l[1]=pe,l[2]=G,l[3]=te,l[4]=de,l[5]=ce,l[6]=ie,l[7]=we,l[8]=me,l[9]=he}finalize(){const{h:t,pad:s}=this,r=new Uint16Array(10);let o=t[1]>>>13;t[1]&=8191;for(let d=2;d<10;d++)t[d]+=o,o=t[d]>>>13,t[d]&=8191;t[0]+=o*5,o=t[0]>>>13,t[0]&=8191,t[1]+=o,o=t[1]>>>13,t[1]&=8191,t[2]+=o,r[0]=t[0]+5,o=r[0]>>>13,r[0]&=8191;for(let d=1;d<10;d++)r[d]=t[d]+o,o=r[d]>>>13,r[d]&=8191;r[9]-=8192;let l=(o^1)-1;for(let d=0;d<10;d++)r[d]&=l;l=~l;for(let d=0;d<10;d++)t[d]=t[d]&l|r[d];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let u=t[0]+s[0];t[0]=u&65535;for(let d=1;d<8;d++)u=(t[d]+s[d]|0)+(u>>>16)|0,t[d]=u&65535;pa(r)}update(t){Tx(this),qt(t),t=Gu(t);const{buffer:s,blockLen:r}=this,o=t.length;for(let l=0;l<o;){const u=Math.min(r-this.pos,o-l);if(u===r){for(;r<=o-l;l+=r)this.process(t,l);continue}s.set(t.subarray(l,l+u),this.pos),this.pos+=u,l+=u,this.pos===r&&(this.process(s,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,pa(this.h,this.r,this.buffer,this.pad)}digestInto(t){Tx(this),y5(t,this),this.finished=!0;const{buffer:s,h:r}=this;let{pos:o}=this;if(o){for(s[o++]=1;o<16;o++)s[o]=0;this.process(s,0,!0)}this.finalize();let l=0;for(let u=0;u<8;u++)t[l++]=r[u]>>>0,t[l++]=r[u]>>>8}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const r=t.slice(0,s);return this.destroy(),r}}const z5=A5(32,n=>new M5(n));function m2(n,t,s,r,o,l=20){let u=n[0],d=n[1],m=n[2],p=n[3],b=t[0],v=t[1],y=t[2],E=t[3],_=t[4],T=t[5],S=t[6],C=t[7],j=o,k=s[0],A=s[1],R=s[2],O=u,M=d,z=m,L=p,V=b,q=v,Y=y,X=E,ee=_,re=T,U=S,$=C,W=j,J=k,Q=A,pe=R;for(let te=0;te<l;te+=2)O=O+V|0,W=at(W^O,16),ee=ee+W|0,V=at(V^ee,12),O=O+V|0,W=at(W^O,8),ee=ee+W|0,V=at(V^ee,7),M=M+q|0,J=at(J^M,16),re=re+J|0,q=at(q^re,12),M=M+q|0,J=at(J^M,8),re=re+J|0,q=at(q^re,7),z=z+Y|0,Q=at(Q^z,16),U=U+Q|0,Y=at(Y^U,12),z=z+Y|0,Q=at(Q^z,8),U=U+Q|0,Y=at(Y^U,7),L=L+X|0,pe=at(pe^L,16),$=$+pe|0,X=at(X^$,12),L=L+X|0,pe=at(pe^L,8),$=$+pe|0,X=at(X^$,7),O=O+q|0,pe=at(pe^O,16),U=U+pe|0,q=at(q^U,12),O=O+q|0,pe=at(pe^O,8),U=U+pe|0,q=at(q^U,7),M=M+Y|0,W=at(W^M,16),$=$+W|0,Y=at(Y^$,12),M=M+Y|0,W=at(W^M,8),$=$+W|0,Y=at(Y^$,7),z=z+X|0,J=at(J^z,16),ee=ee+J|0,X=at(X^ee,12),z=z+X|0,J=at(J^z,8),ee=ee+J|0,X=at(X^ee,7),L=L+V|0,Q=at(Q^L,16),re=re+Q|0,V=at(V^re,12),L=L+V|0,Q=at(Q^L,8),re=re+Q|0,V=at(V^re,7);let G=0;r[G++]=u+O|0,r[G++]=d+M|0,r[G++]=m+z|0,r[G++]=p+L|0,r[G++]=b+V|0,r[G++]=v+q|0,r[G++]=y+Y|0,r[G++]=E+X|0,r[G++]=_+ee|0,r[G++]=T+re|0,r[G++]=S+U|0,r[G++]=C+$|0,r[G++]=j+W|0,r[G++]=k+J|0,r[G++]=A+Q|0,r[G++]=R+pe|0}function L5(n,t,s,r){const o=fa?n:Yn(n.slice(0,4)),l=fa?t:Yn(t.slice(0,8)),u=fa?s:Yn(s.slice(0,4)),d=new Uint32Array(16);m2(o,l,u.subarray(1),d,u[0]);let m=0;r[m++]=d[0]-o[0]|0,r[m++]=d[1]-o[1]|0,r[m++]=d[2]-o[2]|0,r[m++]=d[3]-o[3]|0,r[m++]=d[12]-u[0]|0,r[m++]=d[13]-u[1]|0,r[m++]=d[14]-u[2]|0,r[m++]=d[15]-u[3]|0,Yn(r),fa||pa(o,l,u),pa(d)}const U5=D5(m2,{counterRight:!1,counterLength:8,extendNonceFn:L5,allowShortKeys:!1}),B5=new Uint8Array(16),Nx=(n,t)=>{n.update(t);const s=t.length%16;s&&n.update(B5.subarray(s))},I5=new Uint8Array(32);function Ox(n,t,s,r,o){o!==void 0&&qt(o,void 0,"AAD");const l=n(t,s,I5),u=T5(r.length,o?o.length:0,!0),d=z5.create(l);o&&Nx(d,o),Nx(d,r),d.update(u);const m=d.digest();return pa(l,u),m}const H5=n=>(t,s,r)=>({encrypt(l,u){const d=l.length;u=ip(d+16,u,!1),u.set(l);const m=u.subarray(0,-16);n(t,s,m,m,1);const p=Ox(n,t,s,m,r);return u.set(p,d),pa(p),u},decrypt(l,u){u=ip(l.length-16,u,!1);const d=l.subarray(0,-16),m=l.subarray(-16),p=Ox(n,t,s,d,r);if(!C5(m,p))throw pa(p),new Error("invalid tag");return u.set(l.subarray(0,-16)),n(t,s,u,u,1),pa(p),u}}),Rx=j5({blockSize:64,nonceLength:24,tagLength:16,withAAD:!0},H5(U5)),Bi=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function wd(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function Fu(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function Js(n,...t){if(!wd(n))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(n.length))throw new Error("Uint8Array expected of length "+t+", got length="+n.length)}function ag(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Fu(n.outputLen),Fu(n.blockLen)}function Zu(n,t=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(t&&n.finished)throw new Error("Hash#digest() has already been called")}function V5(n,t){Js(n);const s=t.outputLen;if(n.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function zr(...n){for(let t=0;t<n.length;t++)n[t].fill(0)}function dm(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function oa(n,t){return n<<32-t|n>>>t}const p2=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",q5=Array.from({length:256},(n,t)=>t.toString(16).padStart(2,"0"));function sg(n){if(Js(n),p2)return n.toHex();let t="";for(let s=0;s<n.length;s++)t+=q5[n[s]];return t}const Ia={_0:48,_9:57,A:65,F:70,a:97,f:102};function Dx(n){if(n>=Ia._0&&n<=Ia._9)return n-Ia._0;if(n>=Ia.A&&n<=Ia.F)return n-(Ia.A-10);if(n>=Ia.a&&n<=Ia.f)return n-(Ia.a-10)}function g2(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);if(p2)return Uint8Array.fromHex(n);const t=n.length,s=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(s);for(let o=0,l=0;o<s;o++,l+=2){const u=Dx(n.charCodeAt(l)),d=Dx(n.charCodeAt(l+1));if(u===void 0||d===void 0){const m=n[l]+n[l+1];throw new Error('hex string expected, got non-hex character "'+m+'" at index '+l)}r[o]=u*16+d}return r}function $5(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}function wl(n){return typeof n=="string"&&(n=$5(n)),Js(n),n}function Mx(...n){let t=0;for(let r=0;r<n.length;r++){const o=n[r];Js(o),t+=o.length}const s=new Uint8Array(t);for(let r=0,o=0;r<n.length;r++){const l=n[r];s.set(l,o),o+=l.length}return s}class v2{}function y2(n){const t=r=>n().update(wl(r)).digest(),s=n();return t.outputLen=s.outputLen,t.blockLen=s.blockLen,t.create=()=>n(),t}function b2(n=32){if(Bi&&typeof Bi.getRandomValues=="function")return Bi.getRandomValues(new Uint8Array(n));if(Bi&&typeof Bi.randomBytes=="function")return Uint8Array.from(Bi.randomBytes(n));throw new Error("crypto.getRandomValues must be defined")}function P5(n,t,s,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(t,s,r);const o=BigInt(32),l=BigInt(4294967295),u=Number(s>>o&l),d=Number(s&l),m=r?4:0,p=r?0:4;n.setUint32(t+m,u,r),n.setUint32(t+p,d,r)}function G5(n,t,s){return n&t^~n&s}function F5(n,t,s){return n&t^n&s^t&s}class x2 extends v2{constructor(t,s,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=s,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=dm(this.buffer)}update(t){Zu(this),t=wl(t),Js(t);const{view:s,buffer:r,blockLen:o}=this,l=t.length;for(let u=0;u<l;){const d=Math.min(o-this.pos,l-u);if(d===o){const m=dm(t);for(;o<=l-u;u+=o)this.process(m,u);continue}r.set(t.subarray(u,u+d),this.pos),this.pos+=d,u+=d,this.pos===o&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Zu(this),V5(t,this),this.finished=!0;const{buffer:s,view:r,blockLen:o,isLE:l}=this;let{pos:u}=this;s[u++]=128,zr(this.buffer.subarray(u)),this.padOffset>o-u&&(this.process(r,0),u=0);for(let v=u;v<o;v++)s[v]=0;P5(r,o-8,BigInt(this.length*8),l),this.process(r,0);const d=dm(t),m=this.outputLen;if(m%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=m/4,b=this.get();if(p>b.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v<p;v++)d.setUint32(4*v,b[v],l)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const r=t.slice(0,s);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:s,buffer:r,length:o,finished:l,destroyed:u,pos:d}=this;return t.destroyed=u,t.finished=l,t.length=o,t.pos=d,o%s&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const Ts=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ou=BigInt(2**32-1),zx=BigInt(32);function Z5(n,t=!1){return t?{h:Number(n&ou),l:Number(n>>zx&ou)}:{h:Number(n>>zx&ou)|0,l:Number(n&ou)|0}}function Y5(n,t=!1){const s=n.length;let r=new Uint32Array(s),o=new Uint32Array(s);for(let l=0;l<s;l++){const{h:u,l:d}=Z5(n[l],t);[r[l],o[l]]=[u,d]}return[r,o]}const Lx=(n,t,s)=>n>>>s,Ux=(n,t,s)=>n<<32-s|t>>>s,Ii=(n,t,s)=>n>>>s|t<<32-s,Hi=(n,t,s)=>n<<32-s|t>>>s,lu=(n,t,s)=>n<<64-s|t>>>s-32,cu=(n,t,s)=>n>>>s-32|t<<64-s;function Ha(n,t,s,r){const o=(t>>>0)+(r>>>0);return{h:n+s+(o/2**32|0)|0,l:o|0}}const K5=(n,t,s)=>(n>>>0)+(t>>>0)+(s>>>0),X5=(n,t,s,r)=>t+s+r+(n/2**32|0)|0,Q5=(n,t,s,r)=>(n>>>0)+(t>>>0)+(s>>>0)+(r>>>0),W5=(n,t,s,r,o)=>t+s+r+o+(n/2**32|0)|0,J5=(n,t,s,r,o)=>(n>>>0)+(t>>>0)+(s>>>0)+(r>>>0)+(o>>>0),eO=(n,t,s,r,o,l)=>t+s+r+o+l+(n/2**32|0)|0,tO=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ks=new Uint32Array(64);class nO extends x2{constructor(t=32){super(64,t,8,!1),this.A=Ts[0]|0,this.B=Ts[1]|0,this.C=Ts[2]|0,this.D=Ts[3]|0,this.E=Ts[4]|0,this.F=Ts[5]|0,this.G=Ts[6]|0,this.H=Ts[7]|0}get(){const{A:t,B:s,C:r,D:o,E:l,F:u,G:d,H:m}=this;return[t,s,r,o,l,u,d,m]}set(t,s,r,o,l,u,d,m){this.A=t|0,this.B=s|0,this.C=r|0,this.D=o|0,this.E=l|0,this.F=u|0,this.G=d|0,this.H=m|0}process(t,s){for(let v=0;v<16;v++,s+=4)ks[v]=t.getUint32(s,!1);for(let v=16;v<64;v++){const y=ks[v-15],E=ks[v-2],_=oa(y,7)^oa(y,18)^y>>>3,T=oa(E,17)^oa(E,19)^E>>>10;ks[v]=T+ks[v-7]+_+ks[v-16]|0}let{A:r,B:o,C:l,D:u,E:d,F:m,G:p,H:b}=this;for(let v=0;v<64;v++){const y=oa(d,6)^oa(d,11)^oa(d,25),E=b+y+G5(d,m,p)+tO[v]+ks[v]|0,T=(oa(r,2)^oa(r,13)^oa(r,22))+F5(r,o,l)|0;b=p,p=m,m=d,d=u+E|0,u=l,l=o,o=r,r=E+T|0}r=r+this.A|0,o=o+this.B|0,l=l+this.C|0,u=u+this.D|0,d=d+this.E|0,m=m+this.F|0,p=p+this.G|0,b=b+this.H|0,this.set(r,o,l,u,d,m,p,b)}roundClean(){zr(ks)}destroy(){this.set(0,0,0,0,0,0,0,0),zr(this.buffer)}}const w2=Y5(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))),aO=w2[0],sO=w2[1],Ns=new Uint32Array(80),Os=new Uint32Array(80);class rO extends x2{constructor(t=64){super(128,t,16,!1),this.Ah=tn[0]|0,this.Al=tn[1]|0,this.Bh=tn[2]|0,this.Bl=tn[3]|0,this.Ch=tn[4]|0,this.Cl=tn[5]|0,this.Dh=tn[6]|0,this.Dl=tn[7]|0,this.Eh=tn[8]|0,this.El=tn[9]|0,this.Fh=tn[10]|0,this.Fl=tn[11]|0,this.Gh=tn[12]|0,this.Gl=tn[13]|0,this.Hh=tn[14]|0,this.Hl=tn[15]|0}get(){const{Ah:t,Al:s,Bh:r,Bl:o,Ch:l,Cl:u,Dh:d,Dl:m,Eh:p,El:b,Fh:v,Fl:y,Gh:E,Gl:_,Hh:T,Hl:S}=this;return[t,s,r,o,l,u,d,m,p,b,v,y,E,_,T,S]}set(t,s,r,o,l,u,d,m,p,b,v,y,E,_,T,S){this.Ah=t|0,this.Al=s|0,this.Bh=r|0,this.Bl=o|0,this.Ch=l|0,this.Cl=u|0,this.Dh=d|0,this.Dl=m|0,this.Eh=p|0,this.El=b|0,this.Fh=v|0,this.Fl=y|0,this.Gh=E|0,this.Gl=_|0,this.Hh=T|0,this.Hl=S|0}process(t,s){for(let k=0;k<16;k++,s+=4)Ns[k]=t.getUint32(s),Os[k]=t.getUint32(s+=4);for(let k=16;k<80;k++){const A=Ns[k-15]|0,R=Os[k-15]|0,O=Ii(A,R,1)^Ii(A,R,8)^Lx(A,R,7),M=Hi(A,R,1)^Hi(A,R,8)^Ux(A,R,7),z=Ns[k-2]|0,L=Os[k-2]|0,V=Ii(z,L,19)^lu(z,L,61)^Lx(z,L,6),q=Hi(z,L,19)^cu(z,L,61)^Ux(z,L,6),Y=Q5(M,q,Os[k-7],Os[k-16]),X=W5(Y,O,V,Ns[k-7],Ns[k-16]);Ns[k]=X|0,Os[k]=Y|0}let{Ah:r,Al:o,Bh:l,Bl:u,Ch:d,Cl:m,Dh:p,Dl:b,Eh:v,El:y,Fh:E,Fl:_,Gh:T,Gl:S,Hh:C,Hl:j}=this;for(let k=0;k<80;k++){const A=Ii(v,y,14)^Ii(v,y,18)^lu(v,y,41),R=Hi(v,y,14)^Hi(v,y,18)^cu(v,y,41),O=v&E^~v&T,M=y&_^~y&S,z=J5(j,R,M,sO[k],Os[k]),L=eO(z,C,A,O,aO[k],Ns[k]),V=z|0,q=Ii(r,o,28)^lu(r,o,34)^lu(r,o,39),Y=Hi(r,o,28)^cu(r,o,34)^cu(r,o,39),X=r&l^r&d^l&d,ee=o&u^o&m^u&m;C=T|0,j=S|0,T=E|0,S=_|0,E=v|0,_=y|0,{h:v,l:y}=Ha(p|0,b|0,L|0,V|0),p=d|0,b=m|0,d=l|0,m=u|0,l=r|0,u=o|0;const re=K5(V,Y,ee);r=X5(re,L,q,X),o=re|0}({h:r,l:o}=Ha(this.Ah|0,this.Al|0,r|0,o|0)),{h:l,l:u}=Ha(this.Bh|0,this.Bl|0,l|0,u|0),{h:d,l:m}=Ha(this.Ch|0,this.Cl|0,d|0,m|0),{h:p,l:b}=Ha(this.Dh|0,this.Dl|0,p|0,b|0),{h:v,l:y}=Ha(this.Eh|0,this.El|0,v|0,y|0),{h:E,l:_}=Ha(this.Fh|0,this.Fl|0,E|0,_|0),{h:T,l:S}=Ha(this.Gh|0,this.Gl|0,T|0,S|0),{h:C,l:j}=Ha(this.Hh|0,this.Hl|0,C|0,j|0),this.set(r,o,l,u,d,m,p,b,v,y,E,_,T,S,C,j)}roundClean(){zr(Ns,Os)}destroy(){zr(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Sl=y2(()=>new nO),iO=y2(()=>new rO);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rg=BigInt(0),lp=BigInt(1);function cp(n,t=""){if(typeof n!="boolean"){const s=t&&`"${t}"`;throw new Error(s+"expected boolean, got type="+typeof n)}return n}function wu(n,t,s=""){const r=wd(n),o=n?.length,l=t!==void 0;if(!r||l&&o!==t){const u=s&&`"${s}" `,d=l?` of length ${t}`:"",m=r?`length=${o}`:`type=${typeof n}`;throw new Error(u+"expected Uint8Array"+d+", got "+m)}return n}function S2(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?rg:BigInt("0x"+n)}function oO(n){return S2(sg(n))}function eo(n){return Js(n),S2(sg(Uint8Array.from(n).reverse()))}function E2(n,t){return g2(n.toString(16).padStart(t*2,"0"))}function _2(n,t){return E2(n,t).reverse()}function la(n,t,s){let r;if(typeof t=="string")try{r=g2(t)}catch(l){throw new Error(n+" must be hex string or Uint8Array, cause: "+l)}else if(wd(t))r=Uint8Array.from(t);else throw new Error(n+" must be hex string or Uint8Array");const o=r.length;if(typeof s=="number"&&o!==s)throw new Error(n+" of length "+s+" expected, got "+o);return r}function Bx(n){return Uint8Array.from(n)}const fm=n=>typeof n=="bigint"&&rg<=n;function lO(n,t,s){return fm(n)&&fm(t)&&fm(s)&&t<=n&&n<s}function Yu(n,t,s,r){if(!lO(t,s,r))throw new Error("expected valid "+n+": "+s+" <= n < "+r+", got "+t)}function cO(n){let t;for(t=0;n>rg;n>>=lp,t+=1);return t}const ig=n=>(lp<<BigInt(n))-lp;function Sd(n,t,s={}){if(!n||typeof n!="object")throw new Error("expected valid options object");function r(o,l,u){const d=n[o];if(u&&d===void 0)return;const m=typeof d;if(m!==l||d===null)throw new Error(`param "${o}" is invalid: expected ${l}, got ${m}`)}Object.entries(t).forEach(([o,l])=>r(o,l,!1)),Object.entries(s).forEach(([o,l])=>r(o,l,!0))}function Ix(n){const t=new WeakMap;return(s,...r)=>{const o=t.get(s);if(o!==void 0)return o;const l=n(s,...r);return t.set(s,l),l}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const hn=BigInt(0),an=BigInt(1),Ar=BigInt(2),C2=BigInt(3),A2=BigInt(4),j2=BigInt(5),uO=BigInt(7),T2=BigInt(8),dO=BigInt(9),k2=BigInt(16);function Et(n,t){const s=n%t;return s>=hn?s:t+s}function Fn(n,t,s){let r=n;for(;t-- >hn;)r*=r,r%=s;return r}function Hx(n,t){if(n===hn)throw new Error("invert: expected non-zero number");if(t<=hn)throw new Error("invert: expected positive modulus, got "+t);let s=Et(n,t),r=t,o=hn,l=an;for(;s!==hn;){const d=r/s,m=r%s,p=o-l*d;r=s,s=m,o=l,l=p}if(r!==an)throw new Error("invert: does not exist");return Et(o,t)}function og(n,t,s){if(!n.eql(n.sqr(t),s))throw new Error("Cannot find square root")}function N2(n,t){const s=(n.ORDER+an)/A2,r=n.pow(t,s);return og(n,r,t),r}function fO(n,t){const s=(n.ORDER-j2)/T2,r=n.mul(t,Ar),o=n.pow(r,s),l=n.mul(t,o),u=n.mul(n.mul(l,Ar),o),d=n.mul(l,n.sub(u,n.ONE));return og(n,d,t),d}function hO(n){const t=Ol(n),s=O2(n),r=s(t,t.neg(t.ONE)),o=s(t,r),l=s(t,t.neg(r)),u=(n+uO)/k2;return(d,m)=>{let p=d.pow(m,u),b=d.mul(p,r);const v=d.mul(p,o),y=d.mul(p,l),E=d.eql(d.sqr(b),m),_=d.eql(d.sqr(v),m);p=d.cmov(p,b,E),b=d.cmov(y,v,_);const T=d.eql(d.sqr(b),m),S=d.cmov(p,b,T);return og(d,S,m),S}}function O2(n){if(n<C2)throw new Error("sqrt is not defined for small field");let t=n-an,s=0;for(;t%Ar===hn;)t/=Ar,s++;let r=Ar;const o=Ol(n);for(;Vx(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(s===1)return N2;let l=o.pow(r,t);const u=(t+an)/Ar;return function(m,p){if(m.is0(p))return p;if(Vx(m,p)!==1)throw new Error("Cannot find square root");let b=s,v=m.mul(m.ONE,l),y=m.pow(p,t),E=m.pow(p,u);for(;!m.eql(y,m.ONE);){if(m.is0(y))return m.ZERO;let _=1,T=m.sqr(y);for(;!m.eql(T,m.ONE);)if(_++,T=m.sqr(T),_===b)throw new Error("Cannot find square root");const S=an<<BigInt(b-_-1),C=m.pow(v,S);b=_,v=m.sqr(C),y=m.mul(y,v),E=m.mul(E,C)}return E}}function mO(n){return n%A2===C2?N2:n%T2===j2?fO:n%k2===dO?hO(n):O2(n)}const pO=(n,t)=>(Et(n,t)&an)===an,gO=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function vO(n){const t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},s=gO.reduce((r,o)=>(r[o]="function",r),t);return Sd(n,s),n}function yO(n,t,s){if(s<hn)throw new Error("invalid exponent, negatives unsupported");if(s===hn)return n.ONE;if(s===an)return t;let r=n.ONE,o=t;for(;s>hn;)s&an&&(r=n.mul(r,o)),o=n.sqr(o),s>>=an;return r}function R2(n,t,s=!1){const r=new Array(t.length).fill(s?n.ZERO:void 0),o=t.reduce((u,d,m)=>n.is0(d)?u:(r[m]=u,n.mul(u,d)),n.ONE),l=n.inv(o);return t.reduceRight((u,d,m)=>n.is0(d)?u:(r[m]=n.mul(u,r[m]),n.mul(u,d)),l),r}function Vx(n,t){const s=(n.ORDER-an)/Ar,r=n.pow(t,s),o=n.eql(r,n.ONE),l=n.eql(r,n.ZERO),u=n.eql(r,n.neg(n.ONE));if(!o&&!l&&!u)throw new Error("invalid Legendre symbol result");return o?1:l?0:-1}function bO(n,t){t!==void 0&&Fu(t);const s=t!==void 0?t:n.toString(2).length,r=Math.ceil(s/8);return{nBitLength:s,nByteLength:r}}function Ol(n,t,s=!1,r={}){if(n<=hn)throw new Error("invalid field: expected ORDER > 0, got "+n);let o,l,u=!1,d;if(typeof t=="object"&&t!=null){if(r.sqrt||s)throw new Error("cannot specify opts in two arguments");const y=t;y.BITS&&(o=y.BITS),y.sqrt&&(l=y.sqrt),typeof y.isLE=="boolean"&&(s=y.isLE),typeof y.modFromBytes=="boolean"&&(u=y.modFromBytes),d=y.allowedLengths}else typeof t=="number"&&(o=t),r.sqrt&&(l=r.sqrt);const{nBitLength:m,nByteLength:p}=bO(n,o);if(p>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let b;const v=Object.freeze({ORDER:n,isLE:s,BITS:m,BYTES:p,MASK:ig(m),ZERO:hn,ONE:an,allowedLengths:d,create:y=>Et(y,n),isValid:y=>{if(typeof y!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof y);return hn<=y&&y<n},is0:y=>y===hn,isValidNot0:y=>!v.is0(y)&&v.isValid(y),isOdd:y=>(y&an)===an,neg:y=>Et(-y,n),eql:(y,E)=>y===E,sqr:y=>Et(y*y,n),add:(y,E)=>Et(y+E,n),sub:(y,E)=>Et(y-E,n),mul:(y,E)=>Et(y*E,n),pow:(y,E)=>yO(v,y,E),div:(y,E)=>Et(y*Hx(E,n),n),sqrN:y=>y*y,addN:(y,E)=>y+E,subN:(y,E)=>y-E,mulN:(y,E)=>y*E,inv:y=>Hx(y,n),sqrt:l||(y=>(b||(b=mO(n)),b(v,y))),toBytes:y=>s?_2(y,p):E2(y,p),fromBytes:(y,E=!0)=>{if(d){if(!d.includes(y.length)||y.length>p)throw new Error("Field.fromBytes: expected "+d+" bytes, got "+y.length);const T=new Uint8Array(p);T.set(y,s?0:T.length-y.length),y=T}if(y.length!==p)throw new Error("Field.fromBytes: expected "+p+" bytes, got "+y.length);let _=s?eo(y):oO(y);if(u&&(_=Et(_,n)),!E&&!v.isValid(_))throw new Error("invalid field element: outside of range 0..ORDER");return _},invertBatch:y=>R2(v,y),cmov:(y,E,_)=>_?E:y});return Object.freeze(v)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ku=BigInt(0),up=BigInt(1);function qx(n,t){const s=t.negate();return n?s:t}function uu(n,t){const s=R2(n.Fp,t.map(r=>r.Z));return t.map((r,o)=>n.fromAffine(r.toAffine(s[o])))}function D2(n,t){if(!Number.isSafeInteger(n)||n<=0||n>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+n)}function hm(n,t){D2(n,t);const s=Math.ceil(t/n)+1,r=2**(n-1),o=2**n,l=ig(n),u=BigInt(n);return{windows:s,windowSize:r,mask:l,maxNumber:o,shiftBy:u}}function $x(n,t,s){const{windowSize:r,mask:o,maxNumber:l,shiftBy:u}=s;let d=Number(n&o),m=n>>u;d>r&&(d-=l,m+=up);const p=t*r,b=p+Math.abs(d)-1,v=d===0,y=d<0,E=t%2!==0;return{nextN:m,offset:b,isZero:v,isNeg:y,isNegF:E,offsetF:p}}function xO(n,t){if(!Array.isArray(n))throw new Error("array expected");n.forEach((s,r)=>{if(!(s instanceof t))throw new Error("invalid point at index "+r)})}function wO(n,t){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((s,r)=>{if(!t.isValid(s))throw new Error("invalid scalar at index "+r)})}const mm=new WeakMap,M2=new WeakMap;function pm(n){return M2.get(n)||1}function Px(n){if(n!==Ku)throw new Error("invalid wNAF")}class SO{constructor(t,s){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=s}_unsafeLadder(t,s,r=this.ZERO){let o=t;for(;s>Ku;)s&up&&(r=r.add(o)),o=o.double(),s>>=up;return r}precomputeWindow(t,s){const{windows:r,windowSize:o}=hm(s,this.bits),l=[];let u=t,d=u;for(let m=0;m<r;m++){d=u,l.push(d);for(let p=1;p<o;p++)d=d.add(u),l.push(d);u=d.double()}return l}wNAF(t,s,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let o=this.ZERO,l=this.BASE;const u=hm(t,this.bits);for(let d=0;d<u.windows;d++){const{nextN:m,offset:p,isZero:b,isNeg:v,isNegF:y,offsetF:E}=$x(r,d,u);r=m,b?l=l.add(qx(y,s[E])):o=o.add(qx(v,s[p]))}return Px(r),{p:o,f:l}}wNAFUnsafe(t,s,r,o=this.ZERO){const l=hm(t,this.bits);for(let u=0;u<l.windows&&r!==Ku;u++){const{nextN:d,offset:m,isZero:p,isNeg:b}=$x(r,u,l);if(r=d,!p){const v=s[m];o=o.add(b?v.negate():v)}}return Px(r),o}getPrecomputes(t,s,r){let o=mm.get(s);return o||(o=this.precomputeWindow(s,t),t!==1&&(typeof r=="function"&&(o=r(o)),mm.set(s,o))),o}cached(t,s,r){const o=pm(t);return this.wNAF(o,this.getPrecomputes(o,t,r),s)}unsafe(t,s,r,o){const l=pm(t);return l===1?this._unsafeLadder(t,s,o):this.wNAFUnsafe(l,this.getPrecomputes(l,t,r),s,o)}createCache(t,s){D2(s,this.bits),M2.set(t,s),mm.delete(t)}hasCache(t){return pm(t)!==1}}function EO(n,t,s,r){xO(s,n),wO(r,t);const o=s.length,l=r.length;if(o!==l)throw new Error("arrays of points and scalars must have equal length");const u=n.ZERO,d=cO(BigInt(o));let m=1;d>12?m=d-3:d>4?m=d-2:d>0&&(m=2);const p=ig(m),b=new Array(Number(p)+1).fill(u),v=Math.floor((t.BITS-1)/m)*m;let y=u;for(let E=v;E>=0;E-=m){b.fill(u);for(let T=0;T<l;T++){const S=r[T],C=Number(S>>BigInt(E)&p);b[C]=b[C].add(s[T])}let _=u;for(let T=b.length-1,S=u;T>0;T--)S=S.add(b[T]),_=_.add(S);if(y=y.add(_),E!==0)for(let T=0;T<m;T++)y=y.double()}return y}function Gx(n,t,s){if(t){if(t.ORDER!==n)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return vO(t),t}else return Ol(n,{isLE:s})}function _O(n,t,s={},r){if(r===void 0&&(r=n==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${n} CURVE object`);for(const m of["p","n","h"]){const p=t[m];if(!(typeof p=="bigint"&&p>Ku))throw new Error(`CURVE.${m} must be positive bigint`)}const o=Gx(t.p,s.Fp,r),l=Gx(t.n,s.Fn,r),d=["Gx","Gy","a","d"];for(const m of d)if(!o.isValid(t[m]))throw new Error(`CURVE.${m} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:o,Fn:l}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rs=BigInt(0),It=BigInt(1),gm=BigInt(2),CO=BigInt(8);function AO(n,t,s,r){const o=n.sqr(s),l=n.sqr(r),u=n.add(n.mul(t.a,o),l),d=n.add(n.ONE,n.mul(t.d,n.mul(o,l)));return n.eql(u,d)}function jO(n,t={}){const s=_O("edwards",n,t,t.FpFnLE),{Fp:r,Fn:o}=s;let l=s.CURVE;const{h:u}=l;Sd(t,{},{uvRatio:"function"});const d=gm<<BigInt(o.BYTES*8)-It,m=S=>r.create(S),p=t.uvRatio||((S,C)=>{try{return{isValid:!0,value:r.sqrt(r.div(S,C))}}catch{return{isValid:!1,value:Rs}}});if(!AO(r,l,l.Gx,l.Gy))throw new Error("bad curve params: generator point");function b(S,C,j=!1){const k=j?It:Rs;return Yu("coordinate "+S,C,k,d),C}function v(S){if(!(S instanceof _))throw new Error("ExtendedPoint expected")}const y=Ix((S,C)=>{const{X:j,Y:k,Z:A}=S,R=S.is0();C==null&&(C=R?CO:r.inv(A));const O=m(j*C),M=m(k*C),z=r.mul(A,C);if(R)return{x:Rs,y:It};if(z!==It)throw new Error("invZ was invalid");return{x:O,y:M}}),E=Ix(S=>{const{a:C,d:j}=l;if(S.is0())throw new Error("bad point: ZERO");const{X:k,Y:A,Z:R,T:O}=S,M=m(k*k),z=m(A*A),L=m(R*R),V=m(L*L),q=m(M*C),Y=m(L*m(q+z)),X=m(V+m(j*m(M*z)));if(Y!==X)throw new Error("bad point: equation left != right (1)");const ee=m(k*A),re=m(R*O);if(ee!==re)throw new Error("bad point: equation left != right (2)");return!0});class _{constructor(C,j,k,A){this.X=b("x",C),this.Y=b("y",j),this.Z=b("z",k,!0),this.T=b("t",A),Object.freeze(this)}static CURVE(){return l}static fromAffine(C){if(C instanceof _)throw new Error("extended point not allowed");const{x:j,y:k}=C||{};return b("x",j),b("y",k),new _(j,k,It,m(j*k))}static fromBytes(C,j=!1){const k=r.BYTES,{a:A,d:R}=l;C=Bx(wu(C,k,"point")),cp(j,"zip215");const O=Bx(C),M=C[k-1];O[k-1]=M&-129;const z=eo(O),L=j?d:r.ORDER;Yu("point.y",z,Rs,L);const V=m(z*z),q=m(V-It),Y=m(R*V-A);let{isValid:X,value:ee}=p(q,Y);if(!X)throw new Error("bad point: invalid y coordinate");const re=(ee&It)===It,U=(M&128)!==0;if(!j&&ee===Rs&&U)throw new Error("bad point: x=0 and x_0=1");return U!==re&&(ee=m(-ee)),_.fromAffine({x:ee,y:z})}static fromHex(C,j=!1){return _.fromBytes(la("point",C),j)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(C=8,j=!0){return T.createCache(this,C),j||this.multiply(gm),this}assertValidity(){E(this)}equals(C){v(C);const{X:j,Y:k,Z:A}=this,{X:R,Y:O,Z:M}=C,z=m(j*M),L=m(R*A),V=m(k*M),q=m(O*A);return z===L&&V===q}is0(){return this.equals(_.ZERO)}negate(){return new _(m(-this.X),this.Y,this.Z,m(-this.T))}double(){const{a:C}=l,{X:j,Y:k,Z:A}=this,R=m(j*j),O=m(k*k),M=m(gm*m(A*A)),z=m(C*R),L=j+k,V=m(m(L*L)-R-O),q=z+O,Y=q-M,X=z-O,ee=m(V*Y),re=m(q*X),U=m(V*X),$=m(Y*q);return new _(ee,re,$,U)}add(C){v(C);const{a:j,d:k}=l,{X:A,Y:R,Z:O,T:M}=this,{X:z,Y:L,Z:V,T:q}=C,Y=m(A*z),X=m(R*L),ee=m(M*k*q),re=m(O*V),U=m((A+R)*(z+L)-Y-X),$=re-ee,W=re+ee,J=m(X-j*Y),Q=m(U*$),pe=m(W*J),G=m(U*J),te=m($*W);return new _(Q,pe,te,G)}subtract(C){return this.add(C.negate())}multiply(C){if(!o.isValidNot0(C))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:j,f:k}=T.cached(this,C,A=>uu(_,A));return uu(_,[j,k])[0]}multiplyUnsafe(C,j=_.ZERO){if(!o.isValid(C))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return C===Rs?_.ZERO:this.is0()||C===It?this:T.unsafe(this,C,k=>uu(_,k),j)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return T.unsafe(this,l.n).is0()}toAffine(C){return y(this,C)}clearCofactor(){return u===It?this:this.multiplyUnsafe(u)}toBytes(){const{x:C,y:j}=this.toAffine(),k=r.toBytes(j);return k[k.length-1]|=C&It?128:0,k}toHex(){return sg(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(C){return uu(_,C)}static msm(C,j){return EO(_,o,C,j)}_setWindowSize(C){this.precompute(C)}toRawBytes(){return this.toBytes()}}_.BASE=new _(l.Gx,l.Gy,It,m(l.Gx*l.Gy)),_.ZERO=new _(Rs,It,It,Rs),_.Fp=r,_.Fn=o;const T=new SO(_,o.BITS);return _.BASE.precompute(8),_}function TO(n,t,s={}){if(typeof t!="function")throw new Error('"hash" function param is required');Sd(s,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r}=s,{BASE:o,Fp:l,Fn:u}=n,d=s.randomBytes||b2,m=s.adjustScalarBytes||(L=>L),p=s.domain||((L,V,q)=>{if(cp(q,"phflag"),V.length||q)throw new Error("Contexts/pre-hash are not supported");return L});function b(L){return u.create(eo(L))}function v(L){const V=k.secretKey;L=la("private key",L,V);const q=la("hashed private key",t(L),2*V),Y=m(q.slice(0,V)),X=q.slice(V,2*V),ee=b(Y);return{head:Y,prefix:X,scalar:ee}}function y(L){const{head:V,prefix:q,scalar:Y}=v(L),X=o.multiply(Y),ee=X.toBytes();return{head:V,prefix:q,scalar:Y,point:X,pointBytes:ee}}function E(L){return y(L).pointBytes}function _(L=Uint8Array.of(),...V){const q=Mx(...V);return b(t(p(q,la("context",L),!!r)))}function T(L,V,q={}){L=la("message",L),r&&(L=r(L));const{prefix:Y,scalar:X,pointBytes:ee}=y(V),re=_(q.context,Y,L),U=o.multiply(re).toBytes(),$=_(q.context,U,ee,L),W=u.create(re+$*X);if(!u.isValid(W))throw new Error("sign failed: invalid s");const J=Mx(U,u.toBytes(W));return wu(J,k.signature,"result")}const S={zip215:!0};function C(L,V,q,Y=S){const{context:X,zip215:ee}=Y,re=k.signature;L=la("signature",L,re),V=la("message",V),q=la("publicKey",q,k.publicKey),ee!==void 0&&cp(ee,"zip215"),r&&(V=r(V));const U=re/2,$=L.subarray(0,U),W=eo(L.subarray(U,re));let J,Q,pe;try{J=n.fromBytes(q,ee),Q=n.fromBytes($,ee),pe=o.multiplyUnsafe(W)}catch{return!1}if(!ee&&J.isSmallOrder())return!1;const G=_(X,Q.toBytes(),J.toBytes(),V);return Q.add(J.multiplyUnsafe(G)).subtract(pe).clearCofactor().is0()}const j=l.BYTES,k={secretKey:j,publicKey:j,signature:2*j,seed:j};function A(L=d(k.seed)){return wu(L,k.seed,"seed")}function R(L){const V=z.randomSecretKey(L);return{secretKey:V,publicKey:E(V)}}function O(L){return wd(L)&&L.length===u.BYTES}function M(L,V){try{return!!n.fromBytes(L,V)}catch{return!1}}const z={getExtendedPublicKey:y,randomSecretKey:A,isValidSecretKey:O,isValidPublicKey:M,toMontgomery(L){const{y:V}=n.fromBytes(L),q=k.publicKey,Y=q===32;if(!Y&&q!==57)throw new Error("only defined for 25519 and 448");const X=Y?l.div(It+V,It-V):l.div(V-It,V+It);return l.toBytes(X)},toMontgomerySecret(L){const V=k.secretKey;wu(L,V);const q=t(L.subarray(0,V));return m(q).subarray(0,V)},randomPrivateKey:A,precompute(L=8,V=n.BASE){return V.precompute(L,!1)}};return Object.freeze({keygen:R,getPublicKey:E,sign:T,verify:C,utils:z,Point:n,lengths:k})}function kO(n){const t={a:n.a,d:n.d,p:n.Fp.ORDER,n:n.n,h:n.h,Gx:n.Gx,Gy:n.Gy},s=n.Fp,r=Ol(t.n,n.nBitLength,!0),o={Fp:s,Fn:r,uvRatio:n.uvRatio},l={randomBytes:n.randomBytes,adjustScalarBytes:n.adjustScalarBytes,domain:n.domain,prehash:n.prehash,mapToCurve:n.mapToCurve};return{CURVE:t,curveOpts:o,hash:n.hash,eddsaOpts:l}}function NO(n,t){const s=t.Point;return Object.assign({},t,{ExtendedPoint:s,CURVE:n,nBitLength:s.Fn.BITS,nByteLength:s.Fn.BYTES})}function OO(n){const{CURVE:t,curveOpts:s,hash:r,eddsaOpts:o}=kO(n),l=jO(t,s),u=TO(l,r,o);return NO(n,u)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ol=BigInt(0),Vi=BigInt(1),du=BigInt(2);function RO(n){return Sd(n,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...n})}function DO(n){const t=RO(n),{P:s,type:r,adjustScalarBytes:o,powPminus2:l,randomBytes:u}=t,d=r==="x25519";if(!d&&r!=="x448")throw new Error("invalid type");const m=u||b2,p=d?255:448,b=d?32:56,v=BigInt(d?9:5),y=BigInt(d?121665:39081),E=d?du**BigInt(254):du**BigInt(447),_=d?BigInt(8)*du**BigInt(251)-Vi:BigInt(4)*du**BigInt(445)-Vi,T=E+_+Vi,S=X=>Et(X,s),C=j(v);function j(X){return _2(S(X),b)}function k(X){const ee=la("u coordinate",X,b);return d&&(ee[31]&=127),S(eo(ee))}function A(X){return eo(o(la("scalar",X,b)))}function R(X,ee){const re=z(k(ee),A(X));if(re===ol)throw new Error("invalid private or public key received");return j(re)}function O(X){return R(X,C)}function M(X,ee,re){const U=S(X*(ee-re));return ee=S(ee-U),re=S(re+U),{x_2:ee,x_3:re}}function z(X,ee){Yu("u",X,ol,s),Yu("scalar",ee,E,T);const re=ee,U=X;let $=Vi,W=ol,J=X,Q=Vi,pe=ol;for(let te=BigInt(p-1);te>=ol;te--){const de=re>>te&Vi;pe^=de,{x_2:$,x_3:J}=M(pe,$,J),{x_2:W,x_3:Q}=M(pe,W,Q),pe=de;const ce=$+W,ie=S(ce*ce),we=$-W,me=S(we*we),he=ie-me,De=J+Q,Oe=J-Q,Me=S(Oe*ce),He=S(De*we),ze=Me+He,ht=Me-He;J=S(ze*ze),Q=S(U*S(ht*ht)),$=S(ie*me),W=S(he*(ie+S(y*he)))}({x_2:$,x_3:J}=M(pe,$,J)),{x_2:W,x_3:Q}=M(pe,W,Q);const G=l(W);return S($*G)}const L={secretKey:b,publicKey:b,seed:b},V=(X=m(b))=>(Js(X,L.seed),X);function q(X){const ee=V(X);return{secretKey:ee,publicKey:O(ee)}}return{keygen:q,getSharedSecret:(X,ee)=>R(X,ee),getPublicKey:X=>O(X),scalarMult:R,scalarMultBase:O,utils:{randomSecretKey:V,randomPrivateKey:V},GuBytes:C.slice(),lengths:L}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const MO=BigInt(1),Fx=BigInt(2),zO=BigInt(3),LO=BigInt(5),UO=BigInt(8),lg=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),z2={p:lg,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:UO,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function L2(n){const t=BigInt(10),s=BigInt(20),r=BigInt(40),o=BigInt(80),l=lg,d=n*n%l*n%l,m=Fn(d,Fx,l)*d%l,p=Fn(m,MO,l)*n%l,b=Fn(p,LO,l)*p%l,v=Fn(b,t,l)*b%l,y=Fn(v,s,l)*v%l,E=Fn(y,r,l)*y%l,_=Fn(E,o,l)*E%l,T=Fn(_,o,l)*E%l,S=Fn(T,t,l)*b%l;return{pow_p_5_8:Fn(S,Fx,l)*n%l,b2:d}}function U2(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}const Zx=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function BO(n,t){const s=lg,r=Et(t*t*t,s),o=Et(r*r*t,s),l=L2(n*o).pow_p_5_8;let u=Et(n*r*l,s);const d=Et(t*u*u,s),m=u,p=Et(u*Zx,s),b=d===n,v=d===Et(-n,s),y=d===Et(-n*Zx,s);return b&&(u=m),(v||y)&&(u=p),pO(u,s)&&(u=Et(-u,s)),{isValid:b||v,value:u}}const B2=Ol(z2.p,{isLE:!0}),IO={...z2,Fp:B2,hash:iO,adjustScalarBytes:U2,uvRatio:BO},cg=OO(IO),_r=(()=>{const n=B2.ORDER;return DO({P:n,type:"x25519",powPminus2:t=>{const{pow_p_5_8:s,b2:r}=L2(t);return Et(Fn(s,zO,n)*r,n)},adjustScalarBytes:U2})})();class I2 extends v2{constructor(t,s){super(),this.finished=!1,this.destroyed=!1,ag(t);const r=wl(s);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,l=new Uint8Array(o);l.set(r.length>o?t.create().update(r).digest():r);for(let u=0;u<l.length;u++)l[u]^=54;this.iHash.update(l),this.oHash=t.create();for(let u=0;u<l.length;u++)l[u]^=106;this.oHash.update(l),zr(l)}update(t){return Zu(this),this.iHash.update(t),this}digestInto(t){Zu(this),Js(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:s,iHash:r,finished:o,destroyed:l,blockLen:u,outputLen:d}=this;return t=t,t.finished=o,t.destroyed=l,t.blockLen=u,t.outputLen=d,t.oHash=s._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Ed=(n,t,s)=>new I2(n,t).update(s).digest();Ed.create=(n,t)=>new I2(n,t);function HO(n,t,s){return ag(n),s===void 0&&(s=new Uint8Array(n.outputLen)),Ed(n,wl(s),wl(t))}const vm=Uint8Array.from([0]),Yx=Uint8Array.of();function VO(n,t,s,r=32){ag(n),Fu(r);const o=n.outputLen;if(r>255*o)throw new Error("Length should be <= 255*HashLen");const l=Math.ceil(r/o);s===void 0&&(s=Yx);const u=new Uint8Array(l*o),d=Ed.create(n,t),m=d._cloneInto(),p=new Uint8Array(d.outputLen);for(let b=0;b<l;b++)vm[0]=b+1,m.update(b===0?Yx:p).update(s).update(vm).digestInto(p),u.set(p,o*b),d._cloneInto(m);return d.destroy(),m.destroy(),zr(p,vm),u.slice(0,r)}const qO=(n,t,s,r,o)=>VO(n,HO(n,t,s),r,o);function $O(n){const t=[];for(let s=0;s<n.length;s++){let r=n.charCodeAt(s);if(r>=55296&&r<=56319&&s+1<n.length){const o=n.charCodeAt(s+1);o>=56320&&o<=57343&&(r=65536+(r-55296<<10)+(o-56320),s++)}r<128?t.push(r):r<2048?t.push(192|r>>6,128|r&63):r<65536?t.push(224|r>>12,128|r>>6&63,128|r&63):t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}return Uint8Array.from(t)}function PO(n){let t="",s=[];const r=()=>{t+=String.fromCharCode(...s),s=[]};for(let o=0;o<n.length;){const l=n[o];let u;l<128?(u=l,o+=1):l>=240?(u=(l&7)<<18|(n[o+1]&63)<<12|(n[o+2]&63)<<6|n[o+3]&63,o+=4):l>=224?(u=(l&15)<<12|(n[o+1]&63)<<6|n[o+2]&63,o+=3):(u=(l&31)<<6|n[o+1]&63,o+=2),u>65535?(u-=65536,s.push(55296+(u>>10),56320+(u&1023))):s.push(u),s.length>8e3&&r()}return r(),t}const Lr={encode:$O},fl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",GO=new Map([...fl].map((n,t)=>[n,t]));function Kn(n){let t="";for(let s=0;s<n.length;s+=3){const r=n[s]<<16|(n[s+1]??0)<<8|(n[s+2]??0);t+=fl[r>>18&63]+fl[r>>12&63],s+1<n.length&&(t+=fl[r>>6&63]),s+2<n.length&&(t+=fl[r&63])}return t}function ha(n){const t=n.replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_"),s=new Uint8Array(Math.floor(t.length*3/4));let r=0,o=0,l=0;for(const u of t){const d=GO.get(u);if(d===void 0)throw new Error("invalid base64");o=o<<6|d,r+=6,r>=8&&(r-=8,s[l++]=o>>r&255)}return s.subarray(0,l)}function Kx(...n){const t=new Uint8Array(n.reduce((r,o)=>r+o.length,0));let s=0;for(const r of n)t.set(r,s),s+=r.length;return t}function Xu(n){const t=new Uint8Array(n);return globalThis.crypto.getRandomValues(t),t}function H2(n){return Kn(Sl(ha(n)).subarray(0,16))}function FO(){const n=Xu(32),t=Xu(32),s=Kn(cg.getPublicKey(n));return{id:H2(s),signKey:s,boxKey:Kn(_r.getPublicKey(t)),signSecret:Kn(n),boxSecret:Kn(t)}}function Qu(n){return{id:n.id,signKey:n.signKey,boxKey:n.boxKey}}function V2(n,t){return Kn(cg.sign(Lr.encode(t),ha(n.signSecret)))}function ZO(n,t,s){try{return cg.verify(ha(s),Lr.encode(t),ha(n))}catch{return!1}}function YO(n){return`linkshell-gateway-v2:${n}`}function q2(n,t){return Kn(Ed(Sl,ha(n),Lr.encode(`${t.id}.${t.boxKey}`)))}function KO(n){return Kn(Sl(Lr.encode(`linkshell-pair-code:${n}`)))}function XO(){const n=Xu(32);return{secret:n,public:Kn(_r.getPublicKey(n))}}function QO(n){const t=ha(n.local.boxSecret),s=ha(n.remoteBoxKey),r=ha(n.remoteEphemeral),o=_r.getSharedSecret(n.localEphemeral,r),l=_r.getSharedSecret(t,s),u=_r.getSharedSecret(n.localEphemeral,s),d=_r.getSharedSecret(t,r),m=u,p=d,b=_r.getPublicKey(n.localEphemeral),[v,y]=[b,r],[E,_]=[ha(n.local.boxKey),s],T=Kx(Lr.encode("linkshell/v2/channel"),v,y,E,_),S=qO(Sl,Kx(o,m,p,l),Sl(T),Lr.encode("linkshell/v2/keys"),64),C=S.subarray(0,32),j=S.subarray(32,64);return n.initiator?{send:C,receive:j}:{send:j,receive:C}}function Xx(n){const t=new Uint8Array(24),s=new DataView(t.buffer);return s.setUint32(16,Math.floor(n/2**32)),s.setUint32(20,n>>>0),t}class WO{constructor(t){this.keys=t}sent=0;received=0;seal(t){const s=++this.sent,r=Rx(this.keys.send,Xx(s)).encrypt(Lr.encode(t));return`${s}.${Kn(r)}`}open(t){const s=t.indexOf("."),r=Number(t.slice(0,s));if(!Number.isSafeInteger(r)||r<=this.received)throw new Error("replayed or out-of-order frame");const o=Rx(this.keys.receive,Xx(r)).decrypt(ha(t.slice(s+1)));return this.received=r,PO(o)}}const JO="/v2/connect",_d=I({id:D(),signKey:D(),boxKey:D()}),eR=Qe(["machine","device"]);_d.extend({name:D(),platform:D().optional(),online:Te(),via:Qe(["paired","account"])});_d.extend({name:D(),online:Te(),pairedAt:ue().optional()});Ws("t",[I({t:Ee("auth"),role:eR,identity:_d,signature:D(),name:D().max(120),platform:D().max(40).optional(),token:D().optional()}),I({t:Ee("req"),id:ue().int(),method:D(),params:Ps().optional()}),I({t:Ee("to"),to:D(),d:D().max(40*1024*1024)}),I({t:Ee("ping")})]);const tR=Ws("t",[I({t:Ee("challenge"),nonce:D()}),I({t:Ee("ready"),userId:D().optional(),email:D().optional()}),I({t:Ee("res"),id:ue().int(),result:Ps().optional(),error:I({code:D(),message:D()}).optional()}),I({t:Ee("event"),name:D(),data:Ps()}),I({t:Ee("from"),from:_d,via:Qe(["paired","account"]),d:D()}),I({t:Ee("undeliverable"),to:D(),reason:D()}),I({t:Ee("pong")}),I({t:Ee("error"),code:D(),message:D()})]),Qx="linkshell://pair?";function $2(n){const t=n.trim();if(!t.startsWith(Qx))return;const s=new URLSearchParams(t.slice(Qx.length)),r=s.get("g"),o=s.get("k"),l=s.get("s"),u=s.get("c");if(!(!r||!o||!l||!u||!/^(wss?|https?):\/\//.test(r)))return{gateway:r,signKey:o,secret:l,code:u}}const nR=Ws("k",[I({k:Ee("hello"),ch:D(),eph:D(),sig:D()}),I({k:Ee("welcome"),ch:D(),eph:D(),sig:D()}),I({k:Ee("data"),ch:D(),box:D()}),I({k:Ee("close"),ch:D(),reason:D().optional()}),I({k:Ee("refuse"),ch:D(),code:D(),message:D()})]);function Wx(n,t,s,r,o){return`linkshell-tunnel-v2:${n}:${t}:${s}:${r}:${o}`}function aR(n,t,s){const r=XO();return{hello:{k:"hello",ch:s,eph:r.public,sig:V2(n,Wx("hello",s,n.id,t.id,r.public))},accept(l){if(!ZO(t.signKey,Wx("welcome",s,t.id,n.id,l.eph),l.sig))throw new Error("the computer's key doesn't match: refusing to connect");return new WO(QO({initiator:!0,local:n,localEphemeral:r.secret,remoteBoxKey:t.boxKey,remoteEphemeral:l.eph}))}}}class fu extends Error{constructor(t,s){super(s),this.code=t}}const sR=1;class rR{constructor(t){this.options=t}socket;statusValue="offline";attempt=0;timer;nextId=1;pending=new Map;statusListeners=new Set;frameListeners=new Set;undeliverableListeners=new Set;eventListeners=new Map;waiters=new Set;account;lastError;get status(){return this.statusValue}get identity(){return Qu(this.options.identity)}onStatus(t){return this.statusListeners.add(t),()=>this.statusListeners.delete(t)}onFrame(t){return this.frameListeners.add(t),()=>this.frameListeners.delete(t)}onUndeliverable(t){return this.undeliverableListeners.add(t),()=>this.undeliverableListeners.delete(t)}on(t,s){let r=this.eventListeners.get(t);r||this.eventListeners.set(t,r=new Set);const o=s;return r.add(o),()=>r.delete(o)}start(){this.statusValue==="connecting"||this.statusValue==="online"||this.open()}stop(){this.setStatus("stopped"),clearTimeout(this.timer),this.socket?.close(1e3,"stopped"),this.socket=void 0,this.failPending("stopped");for(const t of this.waiters)t()}reconnectNow(){this.statusValue==="stopped"||this.statusValue==="online"||this.statusValue==="connecting"||(clearTimeout(this.timer),this.attempt=0,this.open())}reauthenticate(){if(this.statusValue==="stopped")return;clearTimeout(this.timer),this.attempt=0;const t=this.socket;this.socket=void 0,t?.close(1e3,"signing in again"),this.failPending("connection closed"),this.open()}waitOnline(t){return this.statusValue==="online"?Promise.resolve(!0):this.statusValue==="stopped"?Promise.resolve(!1):new Promise(s=>{const r=()=>{clearTimeout(o),this.waiters.delete(r),s(this.statusValue==="online")},o=setTimeout(r,t);this.waiters.add(r)})}async request(t,s,r){const o=r??this.options.requestTimeoutMs??2e4;if(!await this.waitOnline(o))throw new fu("offline","not connected to the gateway");const l=this.nextId++;return new Promise((u,d)=>{const m=setTimeout(()=>{this.pending.delete(l),d(new fu("timeout",`${t} timed out`))},o);this.pending.set(l,{resolve:u,reject:d,timer:m}),this.sendFrame({t:"req",id:l,method:t,params:s})})}send(t,s){return this.statusValue!=="online"?!1:this.sendFrame({t:"to",to:t,d:JSON.stringify(s)})}sendFrame(t){return!this.socket||this.socket.readyState!==sR?!1:(this.socket.send(JSON.stringify(t)),!0)}setStatus(t,s){if(s&&(this.lastError=s),t==="online"&&(this.lastError=void 0),!(this.statusValue===t&&!s)){this.statusValue=t;for(const r of this.statusListeners)r(t,s);if(t==="online"||t==="stopped")for(const r of this.waiters)r()}}failPending(t){for(const[s,r]of this.pending)clearTimeout(r.timer),r.reject(new fu("offline",t)),this.pending.delete(s)}open(){this.setStatus("connecting");let t;try{t=this.options.createSocket(this.options.url)}catch(r){this.scheduleReconnect({code:"connect_failed",message:r instanceof Error?r.message:String(r)});return}this.socket=t;let s;t.onmessage=r=>{let o;try{const l=tR.safeParse(JSON.parse(String(r.data)));if(!l.success)return;o=l.data}catch{return}switch(o.t){case"challenge":this.authenticate(o.nonce);return;case"ready":this.attempt=0,this.account=o.userId?{userId:o.userId,email:o.email}:void 0,this.setStatus("online");return;case"res":{const l=this.pending.get(o.id);if(!l)return;clearTimeout(l.timer),this.pending.delete(o.id),o.error?l.reject(new fu(o.error.code,o.error.message)):l.resolve(o.result);return}case"event":for(const l of this.eventListeners.get(o.name)??[])l(o.data);return;case"from":{let l;try{const u=nR.safeParse(JSON.parse(o.d));if(!u.success)return;l=u.data}catch{return}for(const u of this.frameListeners)u(o.from,o.via,l);return}case"undeliverable":for(const l of this.undeliverableListeners)l(o.to,o.reason);return;case"error":s={code:o.code,message:o.message};return;case"pong":return}},t.onerror=()=>{},t.onclose=r=>{if(this.socket===t&&(this.socket=void 0,this.failPending("connection closed"),this.statusValue!=="stopped")){if(r.code===4e3){this.setStatus("offline",{code:"replaced",message:"connected elsewhere with this identity"});return}this.scheduleReconnect(s??{code:"disconnected",message:r.reason||"connection lost"})}}}async authenticate(t){let s;try{s=await this.options.token?.()??void 0}catch{s=void 0}this.sendFrame({t:"auth",role:this.options.role,identity:Qu(this.options.identity),signature:V2(this.options.identity,YO(t)),name:this.options.name.slice(0,120),platform:this.options.platform,token:s})}scheduleReconnect(t){this.setStatus("offline",t);const s=this.options.minBackoffMs??500,r=this.options.maxBackoffMs??3e4,o=Math.min(r,s*2**this.attempt)*(.75+Math.random()*.5);this.attempt+=1,this.timer=setTimeout(()=>this.open(),o)}}const iR="linkshell-bulk",Jx=16*1024,P2=1,G2=2;function e1(n){const t=n.type==="data"?n.data:new TextEncoder().encode(n.error??""),s=new Uint8Array(5+t.length);return s[0]=n.type==="data"?P2:G2,new DataView(s.buffer).setUint32(1,n.stream),s.set(t,5),s}function oR(n){if(n.length<5)return;const t=new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(1),s=n.subarray(5);if(n[0]===P2)return{type:"data",stream:t,data:s};if(n[0]===G2)return{type:"close",stream:t,error:s.length?new TextDecoder().decode(s):void 0}}const t1=48*1024,lR=I({id:D().regex(/^[a-f0-9]{64}$/),target:D().max(1024),capturedAt:ue().finite().nonnegative(),width:ue().int().positive().max(2048),height:ue().int().positive().max(2048),mimeType:Ee("image/webp")});class cR{held=new Uint8Array(0);push(t){if(this.held.length+t.length>t1+4104)throw new Error("preview buffer too large");const s=new Uint8Array(this.held.length+t.length);s.set(this.held),s.set(t,this.held.length),this.held=s;const r=[];for(;this.held.length>=8;){const o=new DataView(this.held.buffer,this.held.byteOffset),l=o.getUint32(0),u=o.getUint32(4);if(l>4096||u>t1||!l||!u)throw new Error("invalid preview frame");const d=8+l+u;if(this.held.length<d)break;const m=lR.parse(JSON.parse(new TextDecoder().decode(this.held.subarray(8,8+l))));r.push({...m,bytes:this.held.slice(8+l,d)}),this.held=this.held.slice(d)}return r}}const uR=1;function dR(n){const t=globalThis.WebSocket;if(!t)throw new Error("No WebSocket implementation available");return new t(n)}class fR{constructor(t){this.options=t}socket;peer;statusValue="idle";attempt=0;reconnectTimer;heartbeatTimer;subscriptions=new Map;waiters=new Set;statusListeners=new Set;eventListeners=new Set;summaryListeners=new Set;onlineListeners=new Set;restoredListeners=new Set;notificationListeners=new Map;lastError;get status(){return this.statusValue}onStatus(t){return this.statusListeners.add(t),()=>this.statusListeners.delete(t)}onEvent(t){return this.eventListeners.add(t),()=>this.eventListeners.delete(t)}onSummary(t){return this.summaryListeners.add(t),()=>this.summaryListeners.delete(t)}on(t,s){let r=this.notificationListeners.get(t);r||this.notificationListeners.set(t,r=new Set);const o=s;return r.add(o),()=>r.delete(o)}onOnline(t){return this.onlineListeners.add(t),()=>this.onlineListeners.delete(t)}start(){this.statusValue==="connecting"||this.statusValue==="online"||this.open()}stop(){this.setStatus("stopped"),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.peer?.close("stopped"),this.socket?.close(),this.socket=void 0;for(const t of this.waiters)t()}reconnectNow(){this.statusValue!=="stopped"&&this.statusValue!=="online"&&(this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0,this.attempt=0,this.open())}async call(t,s,r){const o=r??this.options.requestTimeoutMs??3e4,l=Date.now()+o;if(await this.waitOnline(o),!this.peer||this.statusValue!=="online")throw ca.app("offline","Not connected to the computer",{code:"offline"});return this.peer.request(t,s,Math.max(1e3,l-Date.now()))}onRestored(t){return this.restoredListeners.add(t),()=>this.restoredListeners.delete(t)}subscribe(t,s){return this.subscriptions.set(t,{cursor:s}),this.statusValue!=="online"?Promise.resolve(void 0):this.sendSubscribe(t).then(r=>r?.session)}unsubscribe(t){this.subscriptions.delete(t)&&this.statusValue==="online"&&this.peer?.request("sessions.unsubscribe",{sessionId:t}).catch(()=>{})}setStatus(t,s){if(s!==void 0&&(this.lastError=s),this.statusValue!==t){this.statusValue=t;for(const r of this.statusListeners)r(t,s)}}waitOnline(t){return this.statusValue==="online"||this.statusValue==="stopped"?Promise.resolve():new Promise(s=>{const r=()=>{clearTimeout(o),this.waiters.delete(r),s()},o=setTimeout(r,t);this.waiters.add(r)})}open(){this.setStatus(this.attempt===0?"connecting":"reconnecting");let t;try{t=(this.options.createSocket??dR)(this.options.url)}catch(o){this.scheduleReconnect(o instanceof Error?o.message:String(o));return}this.socket=t;const s=new v5({send:o=>{t.readyState===uR&&t.send(o)},onNotification:(o,l)=>this.onNotification(o,l),requestTimeoutMs:this.options.requestTimeoutMs??3e4});this.peer=s,t.onmessage=o=>{const l=o.data;s.receive(typeof l=="string"?l:String(l))};let r;t.onopen=()=>void this.onOpen(t),t.onerror=o=>{const l=o?.message;typeof l=="string"&&l&&(r=l)},t.onclose=()=>{this.socket===t&&(s.close("connection closed"),this.socket=void 0,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.statusValue!=="stopped"&&this.scheduleReconnect(r??"连接已断开"))}}async onOpen(t){if(this.socket!==t)return;this.attempt=0,this.setStatus("online",""),await Promise.all([...this.subscriptions.keys()].map(r=>this.sendSubscribe(r).then(o=>{if(o?.session)for(const l of this.restoredListeners)l(o.session)})));for(const r of[...this.waiters])r();for(const r of this.onlineListeners)r();const s=this.options.heartbeatMs??25e3;s>0&&(this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>{this.socket!==t||this.statusValue!=="online"||this.peer?.request("machine.info",{},1e4).catch(()=>{this.socket===t&&t.close()})},s))}sendSubscribe(t){const s=this.subscriptions.get(t);return!s||!this.peer?Promise.resolve(void 0):this.peer.request("sessions.subscribe",{sessionId:t,fromSeq:s.cursor(),lazyImages:this.options.lazyImages}).catch(()=>{})}scheduleReconnect(t){if(this.statusValue==="stopped")return;this.setStatus("reconnecting",t);const s=this.options.minBackoffMs??500,r=this.options.maxBackoffMs??15e3,o=Math.min(r,s*2**this.attempt)*(.8+Math.random()*.4);this.attempt+=1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=void 0,this.open()},o)}onNotification(t,s){if(t==="session.event")for(const r of this.eventListeners)r(s);else if(t==="session.summary"){const r=s.session;if(r)for(const o of this.summaryListeners)o(r)}for(const r of this.notificationListeners.get(t)??[])r(s)}}function F2(n,t){return t.reduce((s,r)=>{const o=s[r.id];return o&&(o.lastSeq??0)>=(r.lastSeq??0)?s:{...s,[r.id]:r}},n)}function hR(n,t){return t.update.sessionUpdate==="ls_task"?F2(n,[{...t.update.task,lastSeq:t.seq}]):n}function dp(n,t){const s=n[t.toolCallId];return s&&s.lastSeq>=t.lastSeq?n:{...n,[t.toolCallId]:{...t,startedAt:t.workflow.startedAt??s?.startedAt??t.startedAt,workflow:{...s?.workflow,...t.workflow}}}}function mR(n,t){const s=t.update;if(s.sessionUpdate!=="tool_call"&&s.sessionUpdate!=="tool_call_update")return n;const r=n[s.toolCallId],o=s.detail?.type==="subagent"?s.detail:void 0;return o?.workflow?dp(n,{toolCallId:s.toolCallId,task:o.task??r?.task??s.title??"工作流",startedAt:r?.startedAt??t.ts,lastSeq:t.seq,workflow:o.workflow}):r&&!r.workflow.state&&s.status==="failed"?dp(n,{...r,lastSeq:t.seq,workflow:{...r.workflow,state:"failed",endedAt:t.ts}}):n}function pR(n,t){return t.reduce((s,r)=>r.workflow?dp(s,{toolCallId:r.toolCallId,task:r.task,startedAt:r.startedAt,lastSeq:r.lastSeq??0,workflow:r.workflow}):s,n)}function gR(n,t){const s=n??[];if(!t?.length)return s;const r=new Set(s.map(o=>o.clientMessageId));return[...s,...t.filter(o=>!r.has(o.clientMessageId))]}function fp(n,t){return`${n}
|
|
151
|
+
${t}`}function n1(n,t,s){const r=s.update;if(r.toolCallId===t)return{...s,update:{...s.update,parentToolCallId:void 0}};if(r.parentToolCallId&&(r.parentToolCallId===t||Wp(n,r.parentToolCallId)))return s}function vR(){const n=globalThis.crypto;return n?.randomUUID?n.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function yR(n){return n instanceof ca||n instanceof Error?n.message:String(n)}function bR(n,t={}){const s=t.newId??vR;let r=[],o;const l=()=>{if(o&&clearTimeout(o),o=void 0,r.length===0)return;const S=r;r=[],T.setState(C=>{let j=C.views,k=C.subagentViews,A=C.workflows,R=C.tasks;const O=new Map;for(const M of S){const z=R[M.sessionId]??{},L=hR(z,M);L!==z&&(R={...R,[M.sessionId]:L});const V=A[M.sessionId]??{},q=mR(V,M);q!==V&&(A={...A,[M.sessionId]:q});const Y=O.get(M.sessionId)??[];Y.push(M),O.set(M.sessionId,Y);const X=`${M.sessionId}
|
|
152
|
+
`;for(const[ee,re]of d)ee.startsWith(X)&&re.push(M);for(const[ee,re]of Object.entries(k)){if(!ee.startsWith(X))continue;const U=n1(re,ee.slice(X.length),M);if(!U)continue;const $=lm(re,[U]);$!==re&&(k={...k,[ee]:$})}}for(const[M,z]of O){const L=j[M];if(!L)continue;const V=lm(L,z);V!==L&&(j={...j,[M]:V})}return j===C.views&&k===C.subagentViews&&A===C.workflows&&R===C.tasks?C:{views:j,subagentViews:k,workflows:A,tasks:R}})},u=S=>{const C=S.id;T.getState().open[C]&&(l(),T.setState(j=>({sessions:{...j.sessions,[C]:S},ready:{...j.ready,[C]:!0}})),T.getState().loadTasks(C).catch(()=>{}))},d=new Map,m=new Map,p=(S,C)=>{m.set(S,C),m.size>50&&m.delete(m.keys().next().value)},b=new Map,v=new Map;let y=0;const E=S=>{b.delete(S),y-=v.get(S)??0,v.delete(S)};function _(S){T.setState(C=>{const j=k=>{if(!(S in k))return k;const A={...k};return delete A[S],A};return{sessions:j(C.sessions),views:j(C.views),open:j(C.open),ready:j(C.ready),loadingEarlier:j(C.loadingEarlier),queueing:j(C.queueing),subagents:j(C.subagents),workflows:j(C.workflows),tasks:j(C.tasks),subagentViews:Object.fromEntries(Object.entries(C.subagentViews).filter(([k])=>!k.startsWith(`${S}
|
|
153
|
+
`)))}})}const T=XS()((S,C)=>{const j=(A,R)=>S(O=>{const M=O.views[A]??Yi(A),z=R(M);return z===M?O:{views:{...O.views,[A]:z}}}),k=async(A,R=!1)=>{const O=C().outbox[A];if(!O)return"failed";try{const M=await n.call("sessions.prompt",{sessionId:O.sessionId,clientMessageId:A,content:O.content,whenBusy:R?void 0:"queue"});return M.delivery==="queued"&&p(A,O.content),S(z=>{const L={...z.outbox};return delete L[A],{outbox:L}}),M.delivery}catch{return j(O.sessionId,M=>dx(M,A)),"failed"}};return{status:n.status,sessions:{},sessionsLoaded:!1,projects:[],views:{},open:{},ready:{},loadingEarlier:{},subagents:{},workflows:{},tasks:{},subagentViews:{},outbox:{},queueing:{},connect(){n.start()},disconnect(){n.stop()},async refresh(){try{const[A,R,O]=await Promise.all([n.call("machine.info",{}),n.call("sessions.list",{limit:200}),n.call("projects.list",{limit:100})]);S(M=>{const z={...M.sessions};if(R.sessions.length<200){const L=new Set(R.sessions.map(V=>V.id));for(const[V,q]of Object.entries(z))!q.archived&&!L.has(V)&&delete z[V]}for(const L of R.sessions)z[L.id]=L;return{machine:A,sessions:z,projects:O.projects,sessionsLoaded:!0,sessionsError:void 0}})}catch(A){S({sessionsError:yR(A)})}},openSession(A){C().open[A]||(S(R=>({open:{...R.open,[A]:!0},views:R.views[A]?R.views:{...R.views,[A]:Yi(A)}})),n.subscribe(A,()=>C().views[A]?.lastSeq??0).then(R=>{R&&u(R)}))},closeSession(A){C().open[A]&&(n.unsubscribe(A),S(R=>{const O={...R.open};delete O[A];const M={...R.ready};return delete M[A],{open:O,ready:M}}))},async send(A,R,O){const M=s(),z=C().sessions[A],L=!O?.now&&(z?.state==="running"||z?.state==="waiting"||(z?.queue?.length??0)>0);if(S(q=>({outbox:{...q.outbox,[M]:{sessionId:A,content:R}}})),L){const q={clientMessageId:M,text:R.map(Y=>Y.type==="text"?Y.text:"").join("").trim(),images:R.filter(Y=>Y.type==="image").length,pending:!0};S(Y=>({queueing:{...Y.queueing,[A]:[...Y.queueing[A]??[],q]}}))}else j(A,q=>iu(q,M,R));const V=await k(M,O?.now);return L?(S(q=>{const Y=(q.queueing[A]??[]).filter(ee=>ee.clientMessageId!==M),X={...q.queueing};return Y.length>0?X[A]=Y:delete X[A],{queueing:X}}),(V==="started"||V==="steered"||V==="failed")&&(j(A,q=>q.index[`local-${M}`]===void 0?iu(q,M,R):q),V==="failed"&&j(A,q=>dx(q,M))),V):(V==="queued"&&j(A,q=>fx(q,`local-${M}`)),V)},async retry(A){const R=C().outbox[A];R&&(j(R.sessionId,O=>iu(O,A,R.content)),await k(A))},discard(A){const R=C().outbox[A];R&&(j(R.sessionId,O=>fx(O,`local-${A}`)),S(O=>{const M={...O.outbox};return delete M[A],{outbox:M}}))},async respond(A,R,O){await n.call("sessions.permission",{sessionId:A,requestId:R,optionId:O})},async answer(A,R,O){await n.call("sessions.answer",{sessionId:A,requestId:R,answers:O})},async cancel(A){await n.call("sessions.cancel",{sessionId:A})},async takeover(A){await n.call("sessions.takeover",{sessionId:A},6e4)},async release(A){await n.call("sessions.release",{sessionId:A})},async setConfig(A,R,O){await n.call("sessions.setConfig",{sessionId:A,optionId:R,value:O})},async unqueue(A,R){const{removed:O}=await n.call("sessions.unqueue",{sessionId:A,clientMessageId:R});return O&&m.delete(R),O},async takeQueued(A,R){const O=C().sessions[A]?.queue?.find(L=>L.clientMessageId===R),{removed:M}=await n.call("sessions.unqueue",{sessionId:A,clientMessageId:R});if(!M)return;const z=m.get(R)??(O?.text?[{type:"text",text:O.text}]:[]);return m.delete(R),z},async sendQueuedNow(A,R){const O=C().sessions[A]?.queue??[],M=R?O.find(L=>L.clientMessageId===R):O[0],z=M&&(m.get(M.clientMessageId)??(M.text?[{type:"text",text:M.text}]:[]));if(await n.call("sessions.sendQueued",{sessionId:A,clientMessageId:R},3e4),M&&z?.length){const L=M.clientMessageId;C().sessions[A]?.queue?.some(q=>q.clientMessageId===L)||j(A,q=>q.index[`local-${L}`]===void 0?iu(q,L,z,Date.now(),!0):q)}},async reorderQueue(A,R){await n.call("sessions.reorderQueue",{sessionId:A,clientMessageIds:R})},async archive(A,R){const{session:O}=await n.call("sessions.archive",{sessionId:A,archived:R});S(M=>({sessions:{...M.sessions,[O.id]:O}}))},async rename(A,R){const{session:O}=await n.call("sessions.rename",{sessionId:A,title:R});S(M=>({sessions:{...M.sessions,[O.id]:O}}))},async deleteSession(A,R){await n.call("sessions.delete",{sessionId:A,worktree:R},6e4),_(A)},async forkSession(A,R){const{session:O}=await n.call("sessions.fork",{sessionId:A,itemId:R?.itemId,worktree:R?.worktree},9e4);return S(M=>({sessions:{...M.sessions,[O.id]:O}})),C().openSession(O.id),O},async gitInfo(A){return(await n.call("git.info",{path:A})).git},async listWorktrees(){return(await n.call("worktrees.list",{})).worktrees},async removeWorktree(A,R){await n.call("worktrees.remove",{path:A,force:R},6e4)},async loadArchived(){const A=await n.call("sessions.list",{limit:200,includeArchived:!0});S(R=>{const O={...R.sessions};for(const M of A.sessions)O[M.id]=M;return{sessions:O}})},async loadEarlier(A){const R=C().views[A]?.startSeq??0;if(R===0||C().loadingEarlier[A])return!1;S(O=>({loadingEarlier:{...O.loadingEarlier,[A]:!0}}));try{const O=await n.call("sessions.history",{sessionId:A,beforeSeq:R+1,lazyImages:t.lazyImages});return l(),C().views[A]?.startSeq!==R?!1:(j(A,M=>yN(M,O.events,O.startSeq)),!0)}catch{return!1}finally{S(O=>{const M={...O.loadingEarlier};return delete M[A],{loadingEarlier:M}})}},async loadTasks(A){const{tasks:R}=await n.call("sessions.tasks",{sessionId:A});return l(),S(O=>({tasks:{...O.tasks,[A]:F2(O.tasks[A]??{},R)}})),R},loadTaskOutput:(A,R,O)=>n.call("sessions.taskOutput",{sessionId:A,taskId:R,before:O}),async stopTask(A,R){await n.call("sessions.stopTask",{sessionId:A,taskId:R}),await C().loadTasks(A)},async loadSubagents(A){const{subagents:R}=await n.call("sessions.subagents",{sessionId:A});return l(),S(O=>({subagents:{...O.subagents,[A]:R},workflows:{...O.workflows,[A]:pR(O.workflows[A]??{},R)}})),R},async openSubagent(A,R){const O=fp(A,R);if(d.has(O))return!1;const M=[];d.set(O,M);try{const{events:z}=await n.call("sessions.subagent",{sessionId:A,toolCallId:R,lazyImages:t.lazyImages},3e4);l();let L=Yi(A);for(const V of[...z,...M]){const q=n1(L,R,V);q&&(L=lm(L,[q]))}return S(V=>({subagentViews:{...V.subagentViews,[O]:L}})),!0}catch{return!1}finally{d.delete(O)}},closeSubagent(A,R){const O=fp(A,R);O in C().subagentViews&&S(M=>{const z={...M.subagentViews};return delete z[O],{subagentViews:z}})},loadImage(A,R){const O=`${A} ${R}`,M=b.get(O);if(M)return b.delete(O),b.set(O,M),M;const z=n.call("sessions.image",{sessionId:A,uri:R}).then(L=>{const V=`data:${L.mimeType};base64,${L.data}`;v.set(O,V.length),y+=V.length;const q=t.imageCacheChars??24*1024*1024;for(const Y of b.keys()){if(y<=q||Y===O)break;E(Y)}return V},L=>{throw E(O),L});return b.set(O,z),z},async createSession(A){const{session:R}=await n.call("sessions.create",{agent:A.agent,cwd:A.cwd,worktree:A.worktree},6e4);return S(O=>({sessions:{...O.sessions,[R.id]:R}})),C().openSession(R.id),A.prompt&&A.prompt.length>0&&await C().send(R.id,A.prompt),R}}});return n.onStatus((S,C)=>T.setState({status:S,statusDetail:C||void 0})),n.on("session.removed",({sessionId:S})=>_(S)),n.on("session.window",({sessionId:S,startSeq:C})=>{l(),T.setState(j=>{const k=j.views[S];if(!k)return j;const A=pN(k,C);return A===k?j:{views:{...j.views,[S]:A}}})}),n.onSummary(S=>T.setState(C=>({sessions:{...C.sessions,[S.id]:S}}))),n.onEvent(S=>{r.push(S),o??=setTimeout(l,16)}),n.onRestored(S=>u(S)),n.onOnline(()=>{T.getState().refresh()}),T}const a1=0,ym=1,hu=3,s1=15e3;class xR{constructor(t,s,r){this.relay=t,this.machine=r;const o=aR(s,r,this.ch);this.cleanup.push(t.onFrame((l,u,d)=>{if(!(l.id!==r.id||d.ch!==this.ch))switch(d.k){case"welcome":try{this.channel=o.accept(d)}catch(m){this.fail(m instanceof Error?m.message:String(m));return}clearTimeout(this.timer),this.readyState=ym,this.onopen?.({});return;case"data":{if(!this.channel)return;let m;try{m=this.channel.open(d.box)}catch{this.fail("the connection was tampered with");return}this.onmessage?.({data:m});return}case"refuse":this.fail(d.code==="not_paired"?"这台电脑不再信任这台设备,请重新配对":d.message,d.code);return;case"close":this.finish(1e3,d.reason??"closed");return;default:return}}),t.onUndeliverable((l,u)=>{l===r.id&&this.fail(u==="offline"?"电脑不在线":u==="not_allowed"?"没有权限连接这台电脑":u,u)}),t.onStatus(l=>{(l==="offline"||l==="stopped")&&this.fail("与网关的连接断开了")})),t.waitOnline(s1).then(l=>{if(this.readyState===a1){if(!l){this.fail(t.lastError?.message??"连不上网关");return}t.send(r.id,o.hello),this.timer=setTimeout(()=>this.fail("电脑没有响应"),s1)}})}readyState=a1;onopen=null;onclose=null;onerror=null;onmessage=null;ch=Kn(Xu(12));channel;cleanup=[];timer;send(t){this.readyState!==ym||!this.channel||this.relay.send(this.machine.id,{k:"data",ch:this.ch,box:this.channel.seal(t)})}close(){this.readyState!==hu&&(this.readyState===ym&&this.relay.send(this.machine.id,{k:"close",ch:this.ch}),this.finish(1e3,"closed"))}fail(t,s){this.readyState!==hu&&(this.onerror?.({message:t,code:s}),this.finish(4e3,t))}finish(t,s){if(this.readyState!==hu){this.readyState=hu,clearTimeout(this.timer);for(const r of this.cleanup.splice(0))r();this.onclose?.({code:t,reason:s})}}}async function wR(n,t,s){const{machine:r}=await n.request("pair.claim",{machineId:H2(s.signKey),proof:q2(s.secret,Qu(t))},4e4);if(r.signKey!==s.signKey)throw new Error("网关返回的电脑和二维码不一致,已拒绝");return r}async function SR(n,t,s){const r=s.replace(/\D/g,""),{machine:o}=await n.request("pair.claim",{code:r,proof:q2(KO(r),Qu(t))},4e4);return o}const r1={encode(n){let t="";for(let s=0;s<n.length;s+=32768)t+=String.fromCharCode(...n.subarray(s,s+32768));return btoa(t)},decode(n){const t=atob(n),s=new Uint8Array(t.length);for(let r=0;r<t.length;r++)s[r]=t.charCodeAt(r);return s}};class ER{constructor(t,s){this.link=t,this.options=s,t.on("proxy.data",({streamId:r,data:o})=>this.relayed.get(r)?.data(r1.decode(o))),t.on("proxy.closed",({streamId:r,error:o})=>{const l=this.relayed.get(r);this.relayed.delete(r),l?.closed(o)}),t.onStatus(r=>{if(r==="online")return;this.dropRelayed("连接已断开");const o=this.connection;this.dropDirect(),o?.close()}),t.onOnline(()=>this.connect()),t.status==="online"&&this.connect()}pathValue="relay";connection;attempt=0;retryTimer;stopped=!1;pathListeners=new Set;relayed=new Map;directed=new Map;early=new Map;get path(){return this.pathValue}onPath(t){return this.pathListeners.add(t),()=>this.pathListeners.delete(t)}connect(){if(this.stopped||!this.options.connector||this.connection||this.link.status!=="online")return;const t=this.options.iceServers();if(!t)return;this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=void 0;const s=this.options.connector(t);this.connection=s,this.setPath("connecting");let r=!1;const o=setTimeout(()=>!r&&this.lose(s),this.options.connectTimeoutMs??12e3);s.onMessage(l=>{const u=oR(l);u&&this.receive(u)}),s.onState(l=>{this.connection===s&&(l==="open"?(r=!0,clearTimeout(o),this.attempt=0,this.setPath("direct")):(clearTimeout(o),this.lose(s)))}),s.offer().then(l=>this.link.call("direct.offer",{sdp:l},2e4)).then(l=>s.accept(l.sdp)).catch(()=>{clearTimeout(o),this.lose(s)})}async open(t,s){const r=this.pathValue==="direct"?this.connection:void 0,o=await this.link.call("proxy.open",{port:t,direct:r?!0:void 0}),{streamId:l}=o;if(o.channel!==void 0&&r&&this.connection===r){const d=o.channel;this.directed.set(d,s);for(const p of this.early.get(d)??[])this.receive(p);this.early.delete(d);let m=!1;return{direct:!0,write:p=>{if(!(m||this.connection!==r))for(let b=0;b<p.length;b+=Jx)r.send(e1({type:"data",stream:d,data:p.subarray(b,b+Jx)}))},close:()=>{m||(m=!0,this.directed.delete(d)&&this.connection===r&&r.send(e1({type:"close",stream:d})))}}}if(o.channel!==void 0)throw new Error("直连中断了");this.relayed.set(l,s);let u=!1;return{direct:!1,write:d=>{u||this.link.call("proxy.write",{streamId:l,data:r1.encode(d)}).catch(()=>{this.relayed.delete(l)&&s.closed("发送失败")})},close:()=>{u||(u=!0,this.relayed.delete(l)&&this.link.call("proxy.close",{streamId:l}).catch(()=>{}))}}}start(){this.stopped=!1,this.connect()}stop(){this.stopped=!0,this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=void 0,this.dropRelayed();const t=this.connection;this.dropDirect(),t?.close()}receive(t){const s=this.directed.get(t.stream);if(!s){const r=this.early.get(t.stream)??[];r.length<64&&this.early.size<32&&this.early.set(t.stream,[...r,t]);return}t.type==="data"?s.data(t.data):(this.directed.delete(t.stream),s.closed(t.error))}setPath(t){if(this.pathValue!==t){this.pathValue=t;for(const s of this.pathListeners)s(t)}}lose(t){if(this.connection!==t||(this.dropDirect(),t.close(),this.stopped||this.link.status!=="online"))return;const s=this.options.retryMs??[5e3,2e4,6e4],r=s[Math.min(this.attempt,s.length-1)];this.attempt+=1,this.retryTimer=setTimeout(()=>{this.retryTimer=void 0,this.connect()},r)}dropDirect(){this.connection=void 0;const t=[...this.directed.values()];this.directed.clear(),this.early.clear(),this.setPath("relay");for(const s of t)s.closed("直连中断了")}dropRelayed(t){const s=[...this.relayed.values()];this.relayed.clear();for(const r of s)r.closed(t)}}class _R{constructor(t,s,r,o,l){this.link=t,this.streams=s,this.sessionId=r,this.onFrame=o,this.last=l,this.remove=[t.onStatus(u=>{u==="online"?this.open():this.drop()}),s.onPath(u=>{u==="direct"&&!this.stream?.direct&&this.open()})],t.status==="online"&&this.open()}stream;generation=0;stopped=!1;retry;remove;last;drop(){this.generation++,this.retry&&clearTimeout(this.retry),this.retry=void 0;const t=this.stream;this.stream=void 0,t?.close()}open(){if(this.stopped||this.link.status!=="online")return;this.drop();const t=this.generation,s=new cR,r=()=>{this.stopped||t!==this.generation||(this.drop(),this.retry=setTimeout(()=>this.open(),3e3))};this.link.call("sessions.preview",{sessionId:this.sessionId,direct:this.streams.path==="direct"}).then(async o=>{if(this.stopped||t!==this.generation)return;const l=await this.streams.open(o.port,{data:u=>{if(!(this.stopped||t!==this.generation))try{for(const d of s.push(u))this.last=d.id,this.onFrame(d),this.stream?.write(new TextEncoder().encode(`ack
|
|
154
|
+
`))}catch{r()}},closed:r});if(this.stopped||t!==this.generation){l.close();return}this.stream=l,l.write(new TextEncoder().encode(JSON.stringify({token:o.token,after:this.last,direct:l.direct})+`
|
|
155
|
+
`))}).catch(o=>{o?.code!==-32601&&r()})}close(){this.stopped=!0,this.drop();for(const t of this.remove)t()}}const CR="https://mkbeusztkzffnzjdwmqk.supabase.co",AR="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1rYmV1c3p0a3pmZm56amR3bXFrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjU5Nzc0NzgsImV4cCI6MjA4MTU1MzQ3OH0.2wlT6q6687Z5rpEYsdp01IQpNNl_XWv0IAfBgwPyDP0";let jR;function hl(){return jR??=dA(window.__LINKSHELL_CONFIG__?.account?.url??CR,window.__LINKSHELL_CONFIG__?.account?.anonKey??AR,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0,flowType:"pkce",storageKey:"linkshell.web.account.v2"}})}async function TR(){const n=hl().auth,{data:t,error:s}=await n.getSession();if(s)throw s;if(!t.session)return;if((t.session.expires_at??0)*1e3>Date.now()+12e4)return t.session.access_token;const r=await n.refreshSession();if(r.error)throw r.error;if(!r.data.session)throw new Error("登录已失效,请重新登录");return r.data.session.access_token}function Gs(n,t){try{return JSON.parse(localStorage.getItem(`linkshell.web.${n}`)??"null")??t}catch{return t}}function ua(n,t){localStorage.setItem(`linkshell.web.${n}`,JSON.stringify(t))}let kR;function NR(){return kR??=new Promise((n,t)=>{const s=indexedDB.open("linkshell.web.identity",1);s.onupgradeneeded=()=>s.result.createObjectStore("keys"),s.onerror=()=>t(new Error("无法保存浏览器设备身份,请允许此网站使用本地存储")),s.onsuccess=()=>{const r=s.result,o=r.transaction("keys","readwrite"),l=o.objectStore("keys"),u=l.get("device");let d;u.onsuccess=()=>{d=u.result??FO(),u.result||l.put(d,"device")},o.oncomplete=()=>{r.close(),n(d)},o.onerror=()=>{r.close(),t(new Error("设备身份保存失败"))}}})}const OR=n=>{const t=new RTCPeerConnection({iceServers:n.map(r=>({urls:r}))}),s=t.createDataChannel(iR,{ordered:!0});return s.binaryType="arraybuffer",{async offer(){if(await t.setLocalDescription(await t.createOffer()),t.iceGatheringState!=="complete"&&await new Promise(r=>{const o=()=>{clearTimeout(u),t.removeEventListener("icegatheringstatechange",l),r()},l=()=>{t.iceGatheringState==="complete"&&o()},u=setTimeout(o,2e3);t.addEventListener("icegatheringstatechange",l)}),!t.localDescription?.sdp)throw new Error("无法建立直连通道");return t.localDescription.sdp},accept:r=>t.setRemoteDescription({type:"answer",sdp:r}),send(r){s.send(r)},onState(r){s.addEventListener("open",()=>r("open")),s.addEventListener("close",()=>r("closed")),t.addEventListener("connectionstatechange",()=>{["failed","closed"].includes(t.connectionState)&&r("closed")})},onMessage(r){s.addEventListener("message",o=>{o.data instanceof ArrayBuffer&&r(new Uint8Array(o.data))})},close(){t.close()}}},RR=Gs("source",qs),Z2=qs==="self-hosted"?"self-hosted":RR,DR=Z2==="official"?Er:Gs("gateway",tN);class MR{state=XS(()=>({source:Z2,gateway:DR,computers:[],relayStatus:{},locked:!1,ready:!1}));identity;relays=new Map;paired=Gs("paired",[]);selected=Gs("selected","");releaseLock;starting;authUser;authSubscribed=!1;generation=0;channel=typeof BroadcastChannel<"u"?new BroadcastChannel("linkshell.web.owner"):void 0;constructor(){this.channel?.addEventListener("message",t=>{t.data==="yield"&&(this.stop(),this.state.setState({locked:!0}))}),window.addEventListener("pagehide",()=>this.stop()),window.addEventListener("pageshow",()=>{this.start()}),window.addEventListener("online",()=>this.reconnect()),document.addEventListener("visibilitychange",()=>{document.hidden||this.reconnect()})}report(t){this.state.setState({error:t instanceof Error?t.message:String(t)})}async start(){return this.releaseLock||this.starting?this.starting:(this.starting=this.acquire(!1).finally(()=>{this.starting=void 0}),this.starting)}async claim(){this.channel?.postMessage("yield"),await this.acquire(!0)}async acquire(t){if(!navigator.locks){this.report(new Error("此浏览器不支持设备连接锁,请使用最新版 Chrome、Edge、Safari 或 Firefox"));return}await new Promise((s,r)=>{navigator.locks.request("linkshell.web.connection",{ifAvailable:!t},async o=>{if(!o){this.state.setState({locked:!0,ready:!0}),s();return}await new Promise(l=>{this.releaseLock=l,this.state.setState({locked:!1}),this.boot().then(s,r)})}).catch(r)}).catch(s=>this.report(s))}async boot(){const t=++this.generation;if(this.identity=await NR(),t===this.generation){this.state.setState({computers:this.paired.map(s=>({...s,machine:{...s.machine,online:!1}})),ready:!0});for(const s of this.paired)this.relay(s.gateway);this.state.getState().source==="official"?await this.connectAccount():this.state.getState().gateway&&this.relay(om(this.state.getState().gateway))}}async connectAccount(){if(qs==="self-hosted")throw new Error("私有部署使用设备配对");const t=hl().auth,{data:s,error:r}=await t.getSession();if(r)throw r;this.authUser=s.session?.user.id,this.state.setState({account:s.session?.user.email,source:"official",gateway:Er}),this.authSubscribed||(this.authSubscribed=!0,t.onAuthStateChange((o,l)=>{const u=this.authUser!==l?.user.id;this.authUser=l?.user.id,this.state.setState({account:l?.user.email}),u&&this.releaseLock&&setTimeout(()=>{this.relays.get(Er)?.reauthenticate(),l&&this.relay(Er)},0)})),ua("source","official"),s.session&&this.relay(Er).reauthenticate()}relay(t){if(!this.identity||!this.releaseLock)throw new Error("请先在本标签页启用连接");const s=om(t),r=this.relays.get(s);if(r)return r;const o=s===Er&&qs!=="self-hosted",l=new rR({url:s+JO,identity:this.identity,role:"device",name:"LinkShell Web",platform:"web",token:o?async()=>{try{return await TR()}catch(u){throw this.report(u),u}}:void 0,createSocket:u=>{const d=new WebSocket(u),m=d.send.bind(d);return d.send=p=>{if(typeof p=="string"&&o&&this.authUser){const b=JSON.parse(p);if(b.t==="auth"&&!b.token){d.close(4001,"账号续期失败,正在重试");return}}m(p)},d}});return this.relays.set(s,l),l.onStatus((u,d)=>{this.state.setState(m=>({relayStatus:{...m.relayStatus,[s]:u},...d?{error:d.message}:{}})),u==="online"&&this.refresh(s).catch(m=>this.report(m))}),l.on("machines.changed",()=>{this.refresh(s).catch(u=>this.report(u))}),l.on("presence",({id:u,online:d})=>this.state.setState(m=>({computers:m.computers.map(p=>p.gateway===s&&p.machine.id===u?{...p,machine:{...p.machine,online:d}}:p)}))),l.start(),l}async refresh(t){const s=this.relays.get(t);if(!s)return;const{machines:r}=await s.request("machines.list",{}),o=r.map(u=>({gateway:t,machine:u,key:`${t}#${u.id}`}));this.state.setState(u=>({computers:[...u.computers.filter(d=>d.gateway!==t),...o]}));const l=this.state.getState();if(!l.connection){const u=l.computers.find(d=>d.key===this.selected)??l.computers.find(d=>d.machine.online);u&&this.select(u)}}select(t){if(!this.identity)throw new Error("设备身份尚未就绪");this.disconnect();const s=this.identity,r=this.relay(t.gateway),o=new fR({url:t.key,createSocket:()=>new xR(r,s,t.machine),lazyImages:!0}),l=bR(o,{lazyImages:!0}),u=new ER(o,{connector:OR,iceServers:()=>l.getState().machine?.direct?.iceServers});l.subscribe((d,m)=>{d.machine!==m.machine&&u.connect()}),this.state.setState({connection:{computer:t,link:o,store:l,streams:u},error:void 0}),this.selected=t.key,ua("selected",t.key),l.getState().connect(),u.start()}async pair(t,s){const r=s.trim().startsWith("linkshell:")?$2(s.trim()):void 0;if(s.trim().startsWith("linkshell:")&&!r)throw new Error("配对链接格式不正确");if(!r&&!/^\d{6}$/.test(s.trim()))throw new Error("请输入 6 位配对码");const o=om((r?.gateway??t).replace(/^http/,"ws")),l=this.relay(o),u=r?await wR(l,this.identity,r):await SR(l,this.identity,s.trim()),d={key:`${o}#${u.id}`,gateway:o,machine:u};this.paired=[...this.paired.filter(m=>m.key!==d.key),d],ua("paired",this.paired),ua("source","self-hosted"),ua("gateway",o),this.state.setState({source:"self-hosted",gateway:o}),await this.refresh(o),this.select(d)}async forget(t){await this.relay(t.gateway).request("machines.forget",{machineId:t.machine.id}),this.paired=this.paired.filter(s=>s.key!==t.key),ua("paired",this.paired),this.state.getState().connection?.computer.key===t.key&&this.disconnect(),this.state.setState(s=>({computers:s.computers.filter(r=>r.key!==t.key)}))}reconnect(){if(this.releaseLock){for(const t of this.relays.values())t.reconnectNow();this.state.getState().connection?.link.reconnectNow()}}disconnect(){const t=this.state.getState().connection;t?.streams.stop(),t?.store.getState().disconnect(),this.state.setState({connection:void 0})}stop(){this.generation++,this.disconnect();for(const t of this.relays.values())t.stop();this.relays.clear(),this.releaseLock?.(),this.releaseLock=void 0}}const Qt=new MR,zR={codex:{svg:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z" fill="#fff"></path><path d="M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z" fill="url(#lobe-icons-codex-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-codex-_R_0_" x1="12" x2="12" y1="3" y2="21"><stop stop-color="#B1A7FF"></stop><stop offset=".5" stop-color="#7A9DFF"></stop><stop offset="1" stop-color="#3941FF"></stop></linearGradient></defs></svg>',full:!0},gemini:{svg:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 4.391A4.391 4.391 0 014.391 0h15.217A4.391 4.391 0 0124 4.391v15.217A4.391 4.391 0 0119.608 24H4.391A4.391 4.391 0 010 19.608V4.391z" fill="url(#lobe-icons-gemini-cli-_R_0_)"></path><path clip-rule="evenodd" d="M19.74 1.444a2.816 2.816 0 012.816 2.816v15.48a2.816 2.816 0 01-2.816 2.816H4.26a2.816 2.816 0 01-2.816-2.816V4.26A2.816 2.816 0 014.26 1.444h15.48zM7.236 8.564l7.752 3.728-7.752 3.727v2.802l9.557-4.596v-3.866L7.236 5.763v2.801z" fill="#1E1E2E" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-cli-_R_0_" x1="24" x2="0" y1="6.587" y2="16.494"><stop stop-color="#EE4D5D"></stop><stop offset=".328" stop-color="#B381DD"></stop><stop offset=".476" stop-color="#207CFE"></stop></linearGradient></defs></svg>',full:!0},claude:{svg:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z" fill="#D97757" fill-rule="evenodd"></path></svg>',full:!1,bg:{light:"#F4F1EA",dark:"#2A2926"}},copilot:{svg:'<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>',full:!1,bg:{light:"#0D1117",dark:"#F0F3F6"},fg:{light:"#FFFFFF",dark:"#0D1117"}},grok:{svg:'<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"></path></svg>',full:!1,bg:{light:"#000000",dark:"#FFFFFF"},fg:{light:"#FFFFFF",dark:"#000000"}},opencode:{svg:'<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>',full:!1,bg:{light:"#131010",dark:"#F1ECEC"},fg:{light:"#F1ECEC",dark:"#131010"}},cursor:{svg:'<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"></path></svg>',full:!1,bg:{light:"#14120B",dark:"#EDECEC"},fg:{light:"#EDECEC",dark:"#14120B"}}},Y2=x.createContext(null);function Lt(){const n=x.useContext(Y2);if(!n)throw new Error("尚未连接电脑");return n}function yt(n){return xd(Lt().store,n)}function Jn(){return Lt().store.getState()}const K2=n=>n instanceof Error?n.message:String(n),Wu=n=>n.replace(/\/$/,"").split("/").pop()??n,Cr=n=>n.title||Wu(n.cwd)||"未命名会话",LR=n=>({idle:"已完成",waiting:"需要你",running:"进行中",error:"出错",offline:"离线",completed:"已完成",failed:"失败",stopped:"已停止",pending:"等待中",active:"进行中",paused:"已暂停",complete:"已完成",blocked:"待处理",usageLimited:"用量受限",budgetLimited:"预算已用完",unknown:"未知"})[n]??n;function Cd({agent:n}){const t=zR[n.toLowerCase()];return h.jsx("span",{className:`agent-mark ${n.toLowerCase()} ${t?.full?"full-mark":""}`,children:t?h.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(t.svg.replaceAll("currentColor",t.fg?.light??"#333"))}`,alt:n}):n.slice(0,1).toUpperCase()})}function Ur({state:n}){return h.jsxs("span",{className:`badge ${n==="idle"||n==="completed"?"done":n}`,children:[h.jsx("span",{className:"status-dot"}),LR(n)]})}function Dt({error:n}){return n?h.jsx("p",{role:"alert",className:"form-error",children:n}):null}function El({title:n,children:t,close:s,wide:r=!1,returnFocus:o}){return h.jsx($S,{open:!0,onOpenChange:l=>{l||s()},children:h.jsxs(PS,{onCloseAutoFocus:o?l=>{l.preventDefault(),o()}:void 0,className:qe("max-h-[85dvh] overflow-y-auto p-6 sm:max-w-xl",r&&"sm:max-w-5xl"),children:[h.jsxs(GS,{children:[h.jsx(FS,{children:n}),h.jsxs(ZS,{className:"sr-only",children:[n,"设置与操作"]})]}),t]})})}function Wt(){const[n,t]=x.useState(),[s,r]=x.useState(!1),o=x.useRef(!1);async function l(u){if(!o.current){o.current=!0,r(!0),t(void 0);try{return await u()}catch(d){t(K2(d))}finally{o.current=!1,r(!1)}}}return{error:n,busy:s,run:l,clear:()=>t(void 0)}}function ea(n,t,s=0){const[r,o]=x.useState({loading:!0}),[l,u]=x.useState(0),d=x.useRef(n);return d.current=n,x.useEffect(()=>{let m=!0,p=!1;const b=async()=>{if(!p){p=!0;try{const y=await d.current();m&&o({value:y,loading:!1})}catch(y){m&&o(E=>({...E,error:K2(y),loading:!1}))}finally{p=!1}}};o({loading:!0}),b();const v=s?setInterval(()=>void b(),s):void 0;return()=>{m=!1,clearInterval(v)}},[...t,l,s]),{...r,reload:()=>u(m=>m+1)}}function ba({loading:n,error:t}){return h.jsxs(h.Fragment,{children:[n&&h.jsx("p",{className:"muted loading-copy",role:"status",children:"正在加载…"}),h.jsx(Dt,{error:t})]})}function UR({found:n}){const t=x.useRef(null),[s,r]=x.useState(!1),[o,l]=x.useState(),u=x.useRef(n);u.current=n;function d(p){if(!$2(p)){l("这不是有效的 LinkShell 配对二维码");return}u.current(p),r(!1),l(void 0)}const m=x.useRef(d);return m.current=d,x.useEffect(()=>{if(!s||!t.current)return;let p=!1,b;return Km(()=>import("./qr-scanner.min-DLeCi9No.js"),__vite__mapDeps([0,1,2,3,4])).then(async({default:v})=>{p||!t.current||(b=new v(t.current,y=>m.current(y.data),{preferredCamera:"environment",returnDetailedScanResult:!0,highlightScanRegion:!0}),await b.start())}).catch(v=>{p||(l(v instanceof Error?v.message:"无法打开摄像头,请使用图片或配对码"),r(!1))}),()=>{p=!0,b?.destroy()}},[s]),h.jsxs("div",{className:"qr-scan",children:[h.jsxs("div",{className:"permission-buttons",children:[h.jsx("button",{className:"button secondary",type:"button",onClick:()=>r(!s),children:s?"关闭摄像头":"扫描二维码"}),h.jsxs("label",{className:"button secondary",children:["从图片识别",h.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:p=>{const b=p.target.files?.[0];p.target.value="",b&&Km(()=>import("./qr-scanner.min-DLeCi9No.js"),__vite__mapDeps([0,1,2,3,4])).then(v=>v.default.scanImage(b,{returnDetailedScanResult:!0})).then(v=>d(v.data),()=>l("没有识别到二维码,请换一张图片或输入配对码"))}})]})]}),s&&h.jsx("video",{ref:t,className:"qr-video",muted:!0,playsInline:!0}),h.jsx(Dt,{error:o})]})}function BR({close:n}){const t=xd(Qt.state),[s,r]=x.useState(t.source),[o,l]=x.useState(""),[u,d]=x.useState(""),[m,p]=x.useState(s==="self-hosted"?t.gateway:""),[b,v]=x.useState(""),y=Wt();return h.jsxs(El,{title:"连接你的电脑",close:n,children:[h.jsx("p",{className:"muted modal-subtitle",children:"电脑保持运行,网页即可继续你的会话。"}),qs==="official"&&h.jsxs("div",{className:"source-options",children:[h.jsxs("button",{className:`source-option ${s==="official"?"selected":""}`,"aria-pressed":s==="official",onClick:()=>r("official"),children:[h.jsx(_t,{name:"globe"}),h.jsx("strong",{children:"官方账号"}),h.jsx("span",{children:"同一 iTool 账号发现电脑"})]}),h.jsxs("button",{className:`source-option ${s==="self-hosted"?"selected":""}`,"aria-pressed":s==="self-hosted",onClick:()=>r("self-hosted"),children:[h.jsx(_t,{name:"server"}),h.jsx("strong",{children:"配对电脑"}),h.jsx("span",{children:"官方或自托管网关的配对码"})]})]}),s==="official"?h.jsxs("form",{className:"new-form",onSubmit:E=>{E.preventDefault(),y.run(async()=>{const _=await hl().auth.signInWithPassword({email:o.trim(),password:u});if(_.error)throw _.error;await Qt.connectAccount(),n()})},children:[t.account?h.jsx("div",{className:"private-note",children:h.jsxs("div",{children:[h.jsx("strong",{children:t.account}),h.jsx("p",{children:"电脑端运行 linkshell login,使用同一账号。电脑接入官方网关需要 Pro 订阅。"}),h.jsx("button",{type:"button",className:"text-button",onClick:()=>void y.run(async()=>{await Qt.connectAccount(),n()}),children:"刷新账号电脑"})]})}):h.jsxs(h.Fragment,{children:[h.jsx("label",{htmlFor:"email",children:"邮箱"}),h.jsx("input",{id:"email",type:"email",autoComplete:"username",value:o,onChange:E=>l(E.target.value),required:!0}),h.jsx("label",{htmlFor:"password",children:"密码"}),h.jsx("input",{id:"password",type:"password",autoComplete:"current-password",value:u,onChange:E=>d(E.target.value),required:!0}),h.jsx("button",{className:"button primary full",disabled:y.busy,children:"登录"}),h.jsx("div",{className:"form-columns",children:["github","google"].map(E=>h.jsx("button",{type:"button",className:"button secondary",disabled:y.busy,onClick:()=>void y.run(async()=>{const _=await hl().auth.signInWithOAuth({provider:E,options:{redirectTo:location.origin+location.pathname}});if(_.error)throw _.error}),children:E==="github"?"GitHub 登录":"Google 登录"},E))}),h.jsxs("p",{className:"field-hint",children:["登录状态自动续期。",h.jsx("a",{href:"https://itool.tech/zh/register",target:"_blank",rel:"noreferrer",children:"注册 iTool 账号 ↗"})]})]}),t.account&&h.jsx("button",{type:"button",className:"button secondary full",disabled:y.busy,onClick:()=>void y.run(async()=>{const E=await hl().auth.signOut({scope:"local"});if(E.error)throw E.error;Qt.disconnect()}),children:"退出本浏览器账号"})]}):h.jsxs("form",{className:"pairing-form",onSubmit:E=>{E.preventDefault(),y.run(async()=>{await Qt.pair(m,b),n()})},children:[h.jsx(UR,{found:v}),h.jsx("label",{htmlFor:"gateway",children:"网关地址"}),h.jsx("input",{id:"gateway",placeholder:"wss://gateway.example.com",value:m,onChange:E=>p(E.target.value),required:!b.startsWith("linkshell:")}),h.jsx("p",{className:"field-hint",children:"电脑需先连接同一个网关。"}),h.jsx("label",{htmlFor:"pairing",children:"配对码或配对链接"}),h.jsx("input",{id:"pairing",value:b,onChange:E=>v(E.target.value),placeholder:"6 位配对码,或粘贴 linkshell://pair 链接",required:!0}),h.jsxs("p",{className:"field-hint",children:["在电脑运行 ",h.jsx("code",{children:"linkshell pair"}),"。有效期 10 分钟,成功后此浏览器会记住设备。"]}),h.jsx("button",{className:"button primary full",disabled:y.busy||t.locked,children:"配对并连接"}),h.jsx("p",{className:"field-hint",children:"自托管不使用 iTool 登录凭证。清除网站数据后需要重新配对。"})]}),h.jsx(Dt,{error:y.error}),y.busy&&h.jsx("p",{className:"muted",role:"status",children:"正在连接…"})]})}function IR({...n}){return h.jsx(_k,{"data-slot":"popover",...n})}function HR({className:n,align:t="center",sideOffset:s=4,...r}){return h.jsx(kk,{children:h.jsx(Nk,{"data-slot":"popover-content",align:t,sideOffset:s,className:qe("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",n),...r})})}function VR({...n}){return h.jsx(Ak,{"data-slot":"popover-anchor",...n})}var i1=1,qR=.9,$R=.8,PR=.17,bm=.1,xm=.999,GR=.9999,FR=.99,ZR=/[\\\/_+.#"@\[\(\{&]/,YR=/[\\\/_+.#"@\[\(\{&]/g,KR=/[\s-]/,X2=/[\s-]/g;function hp(n,t,s,r,o,l,u){if(l===t.length)return o===n.length?i1:FR;var d=`${o},${l}`;if(u[d]!==void 0)return u[d];for(var m=r.charAt(l),p=s.indexOf(m,o),b=0,v,y,E,_;p>=0;)v=hp(n,t,s,r,p+1,l+1,u),v>b&&(p===o?v*=i1:ZR.test(n.charAt(p-1))?(v*=$R,E=n.slice(o,p-1).match(YR),E&&o>0&&(v*=Math.pow(xm,E.length))):KR.test(n.charAt(p-1))?(v*=qR,_=n.slice(o,p-1).match(X2),_&&o>0&&(v*=Math.pow(xm,_.length))):(v*=PR,o>0&&(v*=Math.pow(xm,p-o))),n.charAt(p)!==t.charAt(l)&&(v*=GR)),(v<bm&&s.charAt(p-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&s.charAt(p-1)!==r.charAt(l))&&(y=hp(n,t,s,r,p+1,l+2,u),y*bm>v&&(v=y*bm)),v>b&&(b=v),p=s.indexOf(m,p+1);return u[d]=b,b}function o1(n){return n.toLowerCase().replace(X2," ")}function XR(n,t,s){return n=s&&s.length>0?`${n+" "+s.join(" ")}`:n,hp(n,t,o1(n),o1(t),0,0,{})}function Is(n,t,{checkForDefaultPrevented:s=!0}={}){return function(o){if(n?.(o),s===!1||!o.defaultPrevented)return t?.(o)}}function l1(n,t){if(typeof n=="function")return n(t);n!=null&&(n.current=t)}function Br(...n){return t=>{let s=!1;const r=n.map(o=>{const l=l1(o,t);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():l1(n[o],null)}}}}function Kr(...n){return x.useCallback(Br(...n),n)}function QR(n,t){const s=x.createContext(t),r=l=>{const{children:u,...d}=l,m=x.useMemo(()=>d,Object.values(d));return h.jsx(s.Provider,{value:m,children:u})};r.displayName=n+"Provider";function o(l){const u=x.useContext(s);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${n}\``)}return[r,o]}function WR(n,t=[]){let s=[];function r(l,u){const d=x.createContext(u),m=s.length;s=[...s,u];const p=v=>{const{scope:y,children:E,..._}=v,T=y?.[n]?.[m]||d,S=x.useMemo(()=>_,Object.values(_));return h.jsx(T.Provider,{value:S,children:E})};p.displayName=l+"Provider";function b(v,y){const E=y?.[n]?.[m]||d,_=x.useContext(E);if(_)return _;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[p,b]}const o=()=>{const l=s.map(u=>x.createContext(u));return function(d){const m=d?.[n]||l;return x.useMemo(()=>({[`__scope${n}`]:{...d,[n]:m}}),[d,m])}};return o.scopeName=n,[r,JR(o,...t)]}function JR(...n){const t=n[0];if(n.length===1)return t;const s=()=>{const r=n.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=r.reduce((d,{useScope:m,scopeName:p})=>{const v=m(l)[`__scope${p}`];return{...d,...v}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return s.scopeName=t.scopeName,s}var _l=globalThis?.document?x.useLayoutEffect:()=>{},eD=Zs[" useId ".trim().toString()]||(()=>{}),tD=0;function Ya(n){const[t,s]=x.useState(eD());return _l(()=>{s(r=>r??String(tD++))},[n]),t?`radix-${t}`:""}var nD=Zs[" useInsertionEffect ".trim().toString()]||_l;function aD({prop:n,defaultProp:t,onChange:s=()=>{},caller:r}){const[o,l,u]=sD({defaultProp:t,onChange:s}),d=n!==void 0,m=d?n:o;{const b=x.useRef(n!==void 0);x.useEffect(()=>{const v=b.current;v!==d&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),b.current=d},[d,r])}const p=x.useCallback(b=>{if(d){const v=rD(b)?b(n):b;v!==n&&u.current?.(v)}else l(b)},[d,n,l,u]);return[m,p]}function sD({defaultProp:n,onChange:t}){const[s,r]=x.useState(n),o=x.useRef(s),l=x.useRef(t);return nD(()=>{l.current=t},[t]),x.useEffect(()=>{o.current!==s&&(l.current?.(s),o.current=s)},[s,o]),[s,r,l]}function rD(n){return typeof n=="function"}function Q2(n){const t=iD(n),s=x.forwardRef((r,o)=>{const{children:l,...u}=r,d=x.Children.toArray(l),m=d.find(lD);if(m){const p=m.props.children,b=d.map(v=>v===m?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:v);return h.jsx(t,{...u,ref:o,children:x.isValidElement(p)?x.cloneElement(p,void 0,b):null})}return h.jsx(t,{...u,ref:o,children:l})});return s.displayName=`${n}.Slot`,s}function iD(n){const t=x.forwardRef((s,r)=>{const{children:o,...l}=s;if(x.isValidElement(o)){const u=uD(o),d=cD(l,o.props);return o.type!==x.Fragment&&(d.ref=r?Br(r,u):u),x.cloneElement(o,d)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${n}.SlotClone`,t}var oD=Symbol("radix.slottable");function lD(n){return x.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===oD}function cD(n,t){const s={...t};for(const r in t){const o=n[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?s[r]=(...d)=>{const m=l(...d);return o(...d),m}:o&&(s[r]=o):r==="style"?s[r]={...o,...l}:r==="className"&&(s[r]=[o,l].filter(Boolean).join(" "))}return{...n,...s}}function uD(n){let t=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?n.ref:(t=Object.getOwnPropertyDescriptor(n,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}var dD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jt=dD.reduce((n,t)=>{const s=Q2(`Primitive.${t}`),r=x.forwardRef((o,l)=>{const{asChild:u,...d}=o,m=u?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(m,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...n,[t]:r}},{});function fD(n,t){n&&qr.flushSync(()=>n.dispatchEvent(t))}function Cl(n){const t=x.useRef(n);return x.useEffect(()=>{t.current=n}),x.useMemo(()=>(...s)=>t.current?.(...s),[])}function hD(n,t=globalThis?.document){const s=Cl(n);x.useEffect(()=>{const r=o=>{o.key==="Escape"&&s(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[s,t])}var mD="DismissableLayer",mp="dismissableLayer.update",pD="dismissableLayer.pointerDownOutside",gD="dismissableLayer.focusOutside",c1,W2=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),J2=x.forwardRef((n,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...m}=n,p=x.useContext(W2),[b,v]=x.useState(null),y=b?.ownerDocument??globalThis?.document,[,E]=x.useState({}),_=Kr(t,M=>v(M)),T=Array.from(p.layers),[S]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=T.indexOf(S),j=b?T.indexOf(b):-1,k=p.layersWithOutsidePointerEventsDisabled.size>0,A=j>=C,R=bD(M=>{const z=M.target,L=[...p.branches].some(V=>V.contains(z));!A||L||(o?.(M),u?.(M),M.defaultPrevented||d?.())},y),O=xD(M=>{const z=M.target;[...p.branches].some(V=>V.contains(z))||(l?.(M),u?.(M),M.defaultPrevented||d?.())},y);return hD(M=>{j===p.layers.size-1&&(r?.(M),!M.defaultPrevented&&d&&(M.preventDefault(),d()))},y),x.useEffect(()=>{if(b)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(c1=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(b)),p.layers.add(b),u1(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=c1)}},[b,y,s,p]),x.useEffect(()=>()=>{b&&(p.layers.delete(b),p.layersWithOutsidePointerEventsDisabled.delete(b),u1())},[b,p]),x.useEffect(()=>{const M=()=>E({});return document.addEventListener(mp,M),()=>document.removeEventListener(mp,M)},[]),h.jsx(Jt.div,{...m,ref:_,style:{pointerEvents:k?A?"auto":"none":void 0,...n.style},onFocusCapture:Is(n.onFocusCapture,O.onFocusCapture),onBlurCapture:Is(n.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Is(n.onPointerDownCapture,R.onPointerDownCapture)})});J2.displayName=mD;var vD="DismissableLayerBranch",yD=x.forwardRef((n,t)=>{const s=x.useContext(W2),r=x.useRef(null),o=Kr(t,r);return x.useEffect(()=>{const l=r.current;if(l)return s.branches.add(l),()=>{s.branches.delete(l)}},[s.branches]),h.jsx(Jt.div,{...n,ref:o})});yD.displayName=vD;function bD(n,t=globalThis?.document){const s=Cl(n),r=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let m=function(){eE(pD,s,p,{discrete:!0})};const p={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=m,t.addEventListener("click",o.current,{once:!0})):m()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",l),t.removeEventListener("click",o.current)}},[t,s]),{onPointerDownCapture:()=>r.current=!0}}function xD(n,t=globalThis?.document){const s=Cl(n),r=x.useRef(!1);return x.useEffect(()=>{const o=l=>{l.target&&!r.current&&eE(gD,s,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,s]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function u1(){const n=new CustomEvent(mp);document.dispatchEvent(n)}function eE(n,t,s,{discrete:r}){const o=s.originalEvent.target,l=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:s});t&&o.addEventListener(n,t,{once:!0}),r?fD(o,l):o.dispatchEvent(l)}var wm="focusScope.autoFocusOnMount",Sm="focusScope.autoFocusOnUnmount",d1={bubbles:!1,cancelable:!0},wD="FocusScope",tE=x.forwardRef((n,t)=>{const{loop:s=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=n,[d,m]=x.useState(null),p=Cl(o),b=Cl(l),v=x.useRef(null),y=Kr(t,T=>m(T)),E=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let T=function(k){if(E.paused||!d)return;const A=k.target;d.contains(A)?v.current=A:Ms(v.current,{select:!0})},S=function(k){if(E.paused||!d)return;const A=k.relatedTarget;A!==null&&(d.contains(A)||Ms(v.current,{select:!0}))},C=function(k){if(document.activeElement===document.body)for(const R of k)R.removedNodes.length>0&&Ms(d)};document.addEventListener("focusin",T),document.addEventListener("focusout",S);const j=new MutationObserver(C);return d&&j.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",S),j.disconnect()}}},[r,d,E.paused]),x.useEffect(()=>{if(d){h1.add(E);const T=document.activeElement;if(!d.contains(T)){const C=new CustomEvent(wm,d1);d.addEventListener(wm,p),d.dispatchEvent(C),C.defaultPrevented||(SD(jD(nE(d)),{select:!0}),document.activeElement===T&&Ms(d))}return()=>{d.removeEventListener(wm,p),setTimeout(()=>{const C=new CustomEvent(Sm,d1);d.addEventListener(Sm,b),d.dispatchEvent(C),C.defaultPrevented||Ms(T??document.body,{select:!0}),d.removeEventListener(Sm,b),h1.remove(E)},0)}}},[d,p,b,E]);const _=x.useCallback(T=>{if(!s&&!r||E.paused)return;const S=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,C=document.activeElement;if(S&&C){const j=T.currentTarget,[k,A]=ED(j);k&&A?!T.shiftKey&&C===A?(T.preventDefault(),s&&Ms(k,{select:!0})):T.shiftKey&&C===k&&(T.preventDefault(),s&&Ms(A,{select:!0})):C===j&&T.preventDefault()}},[s,r,E.paused]);return h.jsx(Jt.div,{tabIndex:-1,...u,ref:y,onKeyDown:_})});tE.displayName=wD;function SD(n,{select:t=!1}={}){const s=document.activeElement;for(const r of n)if(Ms(r,{select:t}),document.activeElement!==s)return}function ED(n){const t=nE(n),s=f1(t,n),r=f1(t.reverse(),n);return[s,r]}function nE(n){const t=[],s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function f1(n,t){for(const s of n)if(!_D(s,{upTo:t}))return s}function _D(n,{upTo:t}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(t!==void 0&&n===t)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function CD(n){return n instanceof HTMLInputElement&&"select"in n}function Ms(n,{select:t=!1}={}){if(n&&n.focus){const s=document.activeElement;n.focus({preventScroll:!0}),n!==s&&CD(n)&&t&&n.select()}}var h1=AD();function AD(){let n=[];return{add(t){const s=n[0];t!==s&&s?.pause(),n=m1(n,t),n.unshift(t)},remove(t){n=m1(n,t),n[0]?.resume()}}}function m1(n,t){const s=[...n],r=s.indexOf(t);return r!==-1&&s.splice(r,1),s}function jD(n){return n.filter(t=>t.tagName!=="A")}var TD="Portal",aE=x.forwardRef((n,t)=>{const{container:s,...r}=n,[o,l]=x.useState(!1);_l(()=>l(!0),[]);const u=s||o&&globalThis?.document?.body;return u?ij.createPortal(h.jsx(Jt.div,{...r,ref:t}),u):null});aE.displayName=TD;function kD(n,t){return x.useReducer((s,r)=>t[s][r]??s,n)}var Ad=n=>{const{present:t,children:s}=n,r=ND(t),o=typeof s=="function"?s({present:r.isPresent}):x.Children.only(s),l=Kr(r.ref,OD(o));return typeof s=="function"||r.isPresent?x.cloneElement(o,{ref:l}):null};Ad.displayName="Presence";function ND(n){const[t,s]=x.useState(),r=x.useRef(null),o=x.useRef(n),l=x.useRef("none"),u=n?"mounted":"unmounted",[d,m]=kD(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const p=mu(r.current);l.current=d==="mounted"?p:"none"},[d]),_l(()=>{const p=r.current,b=o.current;if(b!==n){const y=l.current,E=mu(p);n?m("MOUNT"):E==="none"||p?.display==="none"?m("UNMOUNT"):m(b&&y!==E?"ANIMATION_OUT":"UNMOUNT"),o.current=n}},[n,m]),_l(()=>{if(t){let p;const b=t.ownerDocument.defaultView??window,v=E=>{const T=mu(r.current).includes(CSS.escape(E.animationName));if(E.target===t&&T&&(m("ANIMATION_END"),!o.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",p=b.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},y=E=>{E.target===t&&(l.current=mu(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{b.clearTimeout(p),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:x.useCallback(p=>{r.current=p?getComputedStyle(p):null,s(p)},[])}}function mu(n){return n?.animationName||"none"}function OD(n){let t=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?n.ref:(t=Object.getOwnPropertyDescriptor(n,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}var Em=0;function RD(){x.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??p1()),document.body.insertAdjacentElement("beforeend",n[1]??p1()),Em++,()=>{Em===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Em--}},[])}function p1(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var jd="Dialog",[sE]=WR(jd),[DD,ta]=sE(jd),rE=n=>{const{__scopeDialog:t,children:s,open:r,defaultOpen:o,onOpenChange:l,modal:u=!0}=n,d=x.useRef(null),m=x.useRef(null),[p,b]=aD({prop:r,defaultProp:o??!1,onChange:l,caller:jd});return h.jsx(DD,{scope:t,triggerRef:d,contentRef:m,contentId:Ya(),titleId:Ya(),descriptionId:Ya(),open:p,onOpenChange:b,onOpenToggle:x.useCallback(()=>b(v=>!v),[b]),modal:u,children:s})};rE.displayName=jd;var iE="DialogTrigger",MD=x.forwardRef((n,t)=>{const{__scopeDialog:s,...r}=n,o=ta(iE,s),l=Kr(t,o.triggerRef);return h.jsx(Jt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":fg(o.open),...r,ref:l,onClick:Is(n.onClick,o.onOpenToggle)})});MD.displayName=iE;var ug="DialogPortal",[zD,oE]=sE(ug,{forceMount:void 0}),lE=n=>{const{__scopeDialog:t,forceMount:s,children:r,container:o}=n,l=ta(ug,t);return h.jsx(zD,{scope:t,forceMount:s,children:x.Children.map(r,u=>h.jsx(Ad,{present:s||l.open,children:h.jsx(aE,{asChild:!0,container:o,children:u})}))})};lE.displayName=ug;var Ju="DialogOverlay",cE=x.forwardRef((n,t)=>{const s=oE(Ju,n.__scopeDialog),{forceMount:r=s.forceMount,...o}=n,l=ta(Ju,n.__scopeDialog);return l.modal?h.jsx(Ad,{present:r||l.open,children:h.jsx(UD,{...o,ref:t})}):null});cE.displayName=Ju;var LD=Q2("DialogOverlay.RemoveScroll"),UD=x.forwardRef((n,t)=>{const{__scopeDialog:s,...r}=n,o=ta(Ju,s);return h.jsx(so,{as:LD,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(Jt.div,{"data-state":fg(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ir="DialogContent",uE=x.forwardRef((n,t)=>{const s=oE(Ir,n.__scopeDialog),{forceMount:r=s.forceMount,...o}=n,l=ta(Ir,n.__scopeDialog);return h.jsx(Ad,{present:r||l.open,children:l.modal?h.jsx(BD,{...o,ref:t}):h.jsx(ID,{...o,ref:t})})});uE.displayName=Ir;var BD=x.forwardRef((n,t)=>{const s=ta(Ir,n.__scopeDialog),r=x.useRef(null),o=Kr(t,s.contentRef,r);return x.useEffect(()=>{const l=r.current;if(l)return jl(l)},[]),h.jsx(dE,{...n,ref:o,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Is(n.onCloseAutoFocus,l=>{l.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Is(n.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:Is(n.onFocusOutside,l=>l.preventDefault())})}),ID=x.forwardRef((n,t)=>{const s=ta(Ir,n.__scopeDialog),r=x.useRef(!1),o=x.useRef(!1);return h.jsx(dE,{...n,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{n.onCloseAutoFocus?.(l),l.defaultPrevented||(r.current||s.triggerRef.current?.focus(),l.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:l=>{n.onInteractOutside?.(l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=l.target;s.triggerRef.current?.contains(u)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),dE=x.forwardRef((n,t)=>{const{__scopeDialog:s,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,...u}=n,d=ta(Ir,s),m=x.useRef(null),p=Kr(t,m);return RD(),h.jsxs(h.Fragment,{children:[h.jsx(tE,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:h.jsx(J2,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":fg(d.open),...u,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx($D,{titleId:d.titleId}),h.jsx(GD,{contentRef:m,descriptionId:d.descriptionId})]})]})}),dg="DialogTitle",HD=x.forwardRef((n,t)=>{const{__scopeDialog:s,...r}=n,o=ta(dg,s);return h.jsx(Jt.h2,{id:o.titleId,...r,ref:t})});HD.displayName=dg;var fE="DialogDescription",VD=x.forwardRef((n,t)=>{const{__scopeDialog:s,...r}=n,o=ta(fE,s);return h.jsx(Jt.p,{id:o.descriptionId,...r,ref:t})});VD.displayName=fE;var hE="DialogClose",qD=x.forwardRef((n,t)=>{const{__scopeDialog:s,...r}=n,o=ta(hE,s);return h.jsx(Jt.button,{type:"button",...r,ref:t,onClick:Is(n.onClick,()=>o.onOpenChange(!1))})});qD.displayName=hE;function fg(n){return n?"open":"closed"}var mE="DialogTitleWarning",[G8,pE]=QR(mE,{contentName:Ir,titleName:dg,docsSlug:"dialog"}),$D=({titleId:n})=>{const t=pE(mE),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
156
|
+
|
|
157
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
158
|
+
|
|
159
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{n&&(document.getElementById(n)||console.error(s))},[s,n]),null},PD="DialogDescriptionWarning",GD=({contentRef:n,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pE(PD).contentName}}.`;return x.useEffect(()=>{const o=n.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,n,t]),null},FD=rE,ZD=lE,YD=cE,KD=uE,ll='[cmdk-group=""]',_m='[cmdk-group-items=""]',XD='[cmdk-group-heading=""]',gE='[cmdk-item=""]',g1=`${gE}:not([aria-disabled="true"])`,pp="cmdk-item-select",Pi="data-value",QD=(n,t,s)=>XR(n,t,s),vE=x.createContext(void 0),Rl=()=>x.useContext(vE),yE=x.createContext(void 0),hg=()=>x.useContext(yE),bE=x.createContext(void 0),xE=x.forwardRef((n,t)=>{let s=Gi(()=>{var G,te;return{search:"",value:(te=(G=n.value)!=null?G:n.defaultValue)!=null?te:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Gi(()=>new Set),o=Gi(()=>new Map),l=Gi(()=>new Map),u=Gi(()=>new Set),d=wE(n),{label:m,children:p,value:b,onValueChange:v,filter:y,shouldFilter:E,loop:_,disablePointerSelection:T=!1,vimBindings:S=!0,...C}=n,j=Ya(),k=Ya(),A=Ya(),R=x.useRef(null),O=lM();Hr(()=>{if(b!==void 0){let G=b.trim();s.current.value=G,M.emit()}},[b]),Hr(()=>{O(6,X)},[]);let M=x.useMemo(()=>({subscribe:G=>(u.current.add(G),()=>u.current.delete(G)),snapshot:()=>s.current,setState:(G,te,de)=>{var ce,ie,we,me;if(!Object.is(s.current[G],te)){if(s.current[G]=te,G==="search")Y(),V(),O(1,q);else if(G==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let he=document.getElementById(A);he?he.focus():(ce=document.getElementById(j))==null||ce.focus()}if(O(7,()=>{var he;s.current.selectedItemId=(he=ee())==null?void 0:he.id,M.emit()}),de||O(5,X),((ie=d.current)==null?void 0:ie.value)!==void 0){let he=te??"";(me=(we=d.current).onValueChange)==null||me.call(we,he);return}}M.emit()}},emit:()=>{u.current.forEach(G=>G())}}),[]),z=x.useMemo(()=>({value:(G,te,de)=>{var ce;te!==((ce=l.current.get(G))==null?void 0:ce.value)&&(l.current.set(G,{value:te,keywords:de}),s.current.filtered.items.set(G,L(te,de)),O(2,()=>{V(),M.emit()}))},item:(G,te)=>(r.current.add(G),te&&(o.current.has(te)?o.current.get(te).add(G):o.current.set(te,new Set([G]))),O(3,()=>{Y(),V(),s.current.value||q(),M.emit()}),()=>{l.current.delete(G),r.current.delete(G),s.current.filtered.items.delete(G);let de=ee();O(4,()=>{Y(),de?.getAttribute("id")===G&&q(),M.emit()})}),group:G=>(o.current.has(G)||o.current.set(G,new Set),()=>{l.current.delete(G),o.current.delete(G)}),filter:()=>d.current.shouldFilter,label:m||n["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:j,inputId:A,labelId:k,listInnerRef:R}),[]);function L(G,te){var de,ce;let ie=(ce=(de=d.current)==null?void 0:de.filter)!=null?ce:QD;return G?ie(G,s.current.search,te):0}function V(){if(!s.current.search||d.current.shouldFilter===!1)return;let G=s.current.filtered.items,te=[];s.current.filtered.groups.forEach(ce=>{let ie=o.current.get(ce),we=0;ie.forEach(me=>{let he=G.get(me);we=Math.max(he,we)}),te.push([ce,we])});let de=R.current;re().sort((ce,ie)=>{var we,me;let he=ce.getAttribute("id"),De=ie.getAttribute("id");return((we=G.get(De))!=null?we:0)-((me=G.get(he))!=null?me:0)}).forEach(ce=>{let ie=ce.closest(_m);ie?ie.appendChild(ce.parentElement===ie?ce:ce.closest(`${_m} > *`)):de.appendChild(ce.parentElement===de?ce:ce.closest(`${_m} > *`))}),te.sort((ce,ie)=>ie[1]-ce[1]).forEach(ce=>{var ie;let we=(ie=R.current)==null?void 0:ie.querySelector(`${ll}[${Pi}="${encodeURIComponent(ce[0])}"]`);we?.parentElement.appendChild(we)})}function q(){let G=re().find(de=>de.getAttribute("aria-disabled")!=="true"),te=G?.getAttribute(Pi);M.setState("value",te||void 0)}function Y(){var G,te,de,ce;if(!s.current.search||d.current.shouldFilter===!1){s.current.filtered.count=r.current.size;return}s.current.filtered.groups=new Set;let ie=0;for(let we of r.current){let me=(te=(G=l.current.get(we))==null?void 0:G.value)!=null?te:"",he=(ce=(de=l.current.get(we))==null?void 0:de.keywords)!=null?ce:[],De=L(me,he);s.current.filtered.items.set(we,De),De>0&&ie++}for(let[we,me]of o.current)for(let he of me)if(s.current.filtered.items.get(he)>0){s.current.filtered.groups.add(we);break}s.current.filtered.count=ie}function X(){var G,te,de;let ce=ee();ce&&(((G=ce.parentElement)==null?void 0:G.firstChild)===ce&&((de=(te=ce.closest(ll))==null?void 0:te.querySelector(XD))==null||de.scrollIntoView({block:"nearest"})),ce.scrollIntoView({block:"nearest"}))}function ee(){var G;return(G=R.current)==null?void 0:G.querySelector(`${gE}[aria-selected="true"]`)}function re(){var G;return Array.from(((G=R.current)==null?void 0:G.querySelectorAll(g1))||[])}function U(G){let te=re()[G];te&&M.setState("value",te.getAttribute(Pi))}function $(G){var te;let de=ee(),ce=re(),ie=ce.findIndex(me=>me===de),we=ce[ie+G];(te=d.current)!=null&&te.loop&&(we=ie+G<0?ce[ce.length-1]:ie+G===ce.length?ce[0]:ce[ie+G]),we&&M.setState("value",we.getAttribute(Pi))}function W(G){let te=ee(),de=te?.closest(ll),ce;for(;de&&!ce;)de=G>0?iM(de,ll):oM(de,ll),ce=de?.querySelector(g1);ce?M.setState("value",ce.getAttribute(Pi)):$(G)}let J=()=>U(re().length-1),Q=G=>{G.preventDefault(),G.metaKey?J():G.altKey?W(1):$(1)},pe=G=>{G.preventDefault(),G.metaKey?U(0):G.altKey?W(-1):$(-1)};return x.createElement(Jt.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:G=>{var te;(te=C.onKeyDown)==null||te.call(C,G);let de=G.nativeEvent.isComposing||G.keyCode===229;if(!(G.defaultPrevented||de))switch(G.key){case"n":case"j":{S&&G.ctrlKey&&Q(G);break}case"ArrowDown":{Q(G);break}case"p":case"k":{S&&G.ctrlKey&&pe(G);break}case"ArrowUp":{pe(G);break}case"Home":{G.preventDefault(),U(0);break}case"End":{G.preventDefault(),J();break}case"Enter":{G.preventDefault();let ce=ee();if(ce){let ie=new Event(pp);ce.dispatchEvent(ie)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:uM},m),Td(n,G=>x.createElement(yE.Provider,{value:M},x.createElement(vE.Provider,{value:z},G))))}),WD=x.forwardRef((n,t)=>{var s,r;let o=Ya(),l=x.useRef(null),u=x.useContext(bE),d=Rl(),m=wE(n),p=(r=(s=m.current)==null?void 0:s.forceMount)!=null?r:u?.forceMount;Hr(()=>{if(!p)return d.item(o,u?.id)},[p]);let b=SE(o,l,[n.value,n.children,l],n.keywords),v=hg(),y=Fs(O=>O.value&&O.value===b.current),E=Fs(O=>p||d.filter()===!1?!0:O.search?O.filtered.items.get(o)>0:!0);x.useEffect(()=>{let O=l.current;if(!(!O||n.disabled))return O.addEventListener(pp,_),()=>O.removeEventListener(pp,_)},[E,n.onSelect,n.disabled]);function _(){var O,M;T(),(M=(O=m.current).onSelect)==null||M.call(O,b.current)}function T(){v.setState("value",b.current,!0)}if(!E)return null;let{disabled:S,value:C,onSelect:j,forceMount:k,keywords:A,...R}=n;return x.createElement(Jt.div,{ref:Br(l,t),...R,id:o,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!y,"data-disabled":!!S,"data-selected":!!y,onPointerMove:S||d.getDisablePointerSelection()?void 0:T,onClick:S?void 0:_},n.children)}),JD=x.forwardRef((n,t)=>{let{heading:s,children:r,forceMount:o,...l}=n,u=Ya(),d=x.useRef(null),m=x.useRef(null),p=Ya(),b=Rl(),v=Fs(E=>o||b.filter()===!1?!0:E.search?E.filtered.groups.has(u):!0);Hr(()=>b.group(u),[]),SE(u,d,[n.value,n.heading,m]);let y=x.useMemo(()=>({id:u,forceMount:o}),[o]);return x.createElement(Jt.div,{ref:Br(d,t),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},s&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:p},s),Td(n,E=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":s?p:void 0},x.createElement(bE.Provider,{value:y},E))))}),eM=x.forwardRef((n,t)=>{let{alwaysRender:s,...r}=n,o=x.useRef(null),l=Fs(u=>!u.search);return!s&&!l?null:x.createElement(Jt.div,{ref:Br(o,t),...r,"cmdk-separator":"",role:"separator"})}),tM=x.forwardRef((n,t)=>{let{onValueChange:s,...r}=n,o=n.value!=null,l=hg(),u=Fs(p=>p.search),d=Fs(p=>p.selectedItemId),m=Rl();return x.useEffect(()=>{n.value!=null&&l.setState("search",n.value)},[n.value]),x.createElement(Jt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":d,id:m.inputId,type:"text",value:o?n.value:u,onChange:p=>{o||l.setState("search",p.target.value),s?.(p.target.value)}})}),nM=x.forwardRef((n,t)=>{let{children:s,label:r="Suggestions",...o}=n,l=x.useRef(null),u=x.useRef(null),d=Fs(p=>p.selectedItemId),m=Rl();return x.useEffect(()=>{if(u.current&&l.current){let p=u.current,b=l.current,v,y=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let E=p.offsetHeight;b.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return y.observe(p),()=>{cancelAnimationFrame(v),y.unobserve(p)}}},[]),x.createElement(Jt.div,{ref:Br(l,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:m.listId},Td(n,p=>x.createElement("div",{ref:Br(u,m.listInnerRef),"cmdk-list-sizer":""},p)))}),aM=x.forwardRef((n,t)=>{let{open:s,onOpenChange:r,overlayClassName:o,contentClassName:l,container:u,...d}=n;return x.createElement(FD,{open:s,onOpenChange:r},x.createElement(ZD,{container:u},x.createElement(YD,{"cmdk-overlay":"",className:o}),x.createElement(KD,{"aria-label":n.label,"cmdk-dialog":"",className:l},x.createElement(xE,{ref:t,...d}))))}),sM=x.forwardRef((n,t)=>Fs(s=>s.filtered.count===0)?x.createElement(Jt.div,{ref:t,...n,"cmdk-empty":"",role:"presentation"}):null),rM=x.forwardRef((n,t)=>{let{progress:s,children:r,label:o="Loading...",...l}=n;return x.createElement(Jt.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Td(n,u=>x.createElement("div",{"aria-hidden":!0},u)))}),uo=Object.assign(xE,{List:nM,Item:WD,Input:tM,Group:JD,Separator:eM,Dialog:aM,Empty:sM,Loading:rM});function iM(n,t){let s=n.nextElementSibling;for(;s;){if(s.matches(t))return s;s=s.nextElementSibling}}function oM(n,t){let s=n.previousElementSibling;for(;s;){if(s.matches(t))return s;s=s.previousElementSibling}}function wE(n){let t=x.useRef(n);return Hr(()=>{t.current=n}),t}var Hr=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Gi(n){let t=x.useRef();return t.current===void 0&&(t.current=n()),t}function Fs(n){let t=hg(),s=()=>n(t.snapshot());return x.useSyncExternalStore(t.subscribe,s,s)}function SE(n,t,s,r=[]){let o=x.useRef(),l=Rl();return Hr(()=>{var u;let d=(()=>{var p;for(let b of s){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(p=b.current.textContent)==null?void 0:p.trim():o.current}})(),m=r.map(p=>p.trim());l.value(n,d,m),(u=t.current)==null||u.setAttribute(Pi,d),o.current=d}),o}var lM=()=>{let[n,t]=x.useState(),s=Gi(()=>new Map);return Hr(()=>{s.current.forEach(r=>r()),s.current=new Map},[n]),(r,o)=>{s.current.set(r,o),t({})}};function cM(n){let t=n.type;return typeof t=="function"?t(n.props):"render"in t?t.render(n.props):n}function Td({asChild:n,children:t},s){return n&&x.isValidElement(t)?x.cloneElement(cM(t),{ref:t.ref},s(t.props.children)):s(t)}var uM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function dM({className:n,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:qe("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",n),...t})}const fM=Xp("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function hM({className:n,align:t="inline-start",...s}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:qe(fM({align:t}),n),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...s})}function EE({className:n,...t}){return h.jsx(uo,{"data-slot":"command",className:qe("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",n),...t})}function mM({className:n,...t}){return h.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:h.jsxs(dM,{className:"h-10! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[h.jsx(uo.Input,{"data-slot":"command-input",className:qe("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),...t}),h.jsx(hM,{children:h.jsx(I6,{className:"size-4 shrink-0 opacity-50"})})]})})}function _E({className:n,...t}){return h.jsx(uo.List,{"data-slot":"command-list",className:qe("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",n),...t})}function CE({className:n,...t}){return h.jsx(uo.Empty,{"data-slot":"command-empty",className:qe("py-6 text-center text-sm",n),...t})}function AE({className:n,...t}){return h.jsx(uo.Group,{"data-slot":"command-group",className:qe("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",n),...t})}function jE({className:n,children:t,...s}){return h.jsxs(uo.Item,{"data-slot":"command-item",className:qe("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:*:[svg]:text-foreground",n),...s,children:[t,h.jsx(US,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function pM({...n}){return h.jsx(ik,{"data-slot":"dropdown-menu",...n})}function gM({...n}){return h.jsx(lk,{"data-slot":"dropdown-menu-trigger",...n})}function vM({className:n,align:t="start",sideOffset:s=4,...r}){return h.jsx(ck,{children:h.jsx(dk,{"data-slot":"dropdown-menu-content",sideOffset:s,align:t,className:qe("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",n),...r})})}function v1({...n}){return h.jsx(fk,{"data-slot":"dropdown-menu-group",...n})}function Ln({className:n,inset:t,variant:s="default",...r}){return h.jsx(hk,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":s,className:qe("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",n),...r})}function yM({className:n,...t}){return h.jsx(mk,{"data-slot":"dropdown-menu-separator",className:qe("-mx-1 my-1 h-px bg-border",n),...t})}const TE=[["goal","管理持续目标"],["plan","进入计划模式"],["compact","压缩上下文"],["context","查看上下文占用"],["usage","查看用量"],["review","审查改动"],["init","生成项目说明(CLAUDE.md / AGENTS.md)"],["security-review","安全审查"]],bM=new Set(["__remote-workflow","workflow-launch-exec"]);function xM(n){return/^\s*[//]([^\s//]*)$/.exec(n)?.[1]}function y1(n){const t=/^[//]([^\s//]+)(?:\s+([\s\S]*))?$/.exec(n.trim());return t?{name:t[1],args:t[2]?.trim()??""}:void 0}function wM(n){return n.replace(/^(\s*)//,"$1/")}function SM(n,t,s){const r=[...n==="codex"||n==="claude"?[{name:"tasks",description:"查看后台命令、输出与运行状态",action:"tasks"}]:[],{name:"help",description:"查看和搜索所有可用命令",action:"commands"},{name:"settings",description:"打开会话设置",action:"settings"},{name:"diff",description:"查看当前会话的文件改动",action:"changes"},{name:"new",description:"在当前项目新建会话",action:"new"},{name:"rename",description:"修改会话名称",action:"rename",hint:"名称"}];n==="codex"&&r.push({name:"skills",description:"搜索并选择技能命令",action:"commands"},{name:"config",description:"打开会话设置",action:"settings"},{name:"fork",description:"从当前会话分叉",action:"fork"},{name:"context",description:"查看上下文占用",action:"context"},{name:"clear",description:"在当前项目新建空白会话,保留原会话",action:"new"}),t.some(u=>u.name==="goal")&&r.push({name:"goal",description:"查看目标、进度与操作",action:"goal",hint:n==="codex"?"目标 / pause / resume / clear":"目标 / clear"});for(const u of s){const d=u.category==="model"?"model":u.category==="effort"?"effort":u.category==="mode"?"permissions":u.id;["model","effort","permissions","plan","fast"].includes(d)&&r.push({name:d,description:{model:"选择模型",effort:"调整推理强度",permissions:"调整权限模式",plan:"切换计划模式",fast:"切换快速模式"}[d],action:"settings",optionId:u.id,hint:u.values.map(m=>m.value).join(" / ")})}const o=s.find(u=>u.category==="mode");!r.some(u=>u.name==="plan")&&o?.values.some(u=>u.value==="plan")&&r.push({name:"plan",description:"进入计划模式",action:"settings",optionId:o.id,hint:"任务描述(可选)"}),o&&n==="codex"&&r.push({name:"approvals",description:"选择权限模式",action:"settings",optionId:o.id});const l=new Set(r.map(u=>u.name));return kE([...r,...t.filter(u=>!l.has(u.name))])}function kE(n){const t=new Set,s=n.filter(l=>!bM.has(l.name)&&!t.has(l.name)&&!!t.add(l.name)),r=TE.flatMap(([l])=>s.filter(u=>u.name===l).slice(0,1)),o=new Set(r.map(l=>l.name));return[...r,...s.filter(l=>!o.has(l.name))]}function NE(n){const t=TE.find(([r])=>r===n.name)?.[1],s=n.description.trim();return t&&(!s||!/[\u4e00-\u9fff]/.test(s))?t:s}function OE(n,t){const s=kE(n),r=t.trim().toLowerCase().replace(/^[//]/,"");if(!r)return s;const o=[],l=[],u=[];for(const d of s){const m=d.name.toLowerCase();m.startsWith(r)?o.push(d):m.includes(r)?l.push(d):NE(d).toLowerCase().includes(r)&&u.push(d)}return[...o,...l,...u]}function RE({permission:n,sessionId:t}){const s=Jn(),r=yt(d=>d.status==="online"),o=Wt(),[l,u]=x.useState({});return x.useEffect(()=>u({}),[n.requestId]),h.jsxs("section",{className:"approval-card",children:[h.jsxs("div",{className:"approval-heading",children:[h.jsx("span",{className:"approval-icon",children:h.jsx(_t,{name:"shield"})}),h.jsxs("div",{children:[h.jsx("strong",{children:n.title}),h.jsx("span",{children:n.questions?"请回答 Agent 的问题":"请确认是否允许此操作"})]})]}),n.detail&&h.jsx("pre",{children:n.detail}),n.questions&&h.jsxs("form",{onSubmit:d=>{d.preventDefault(),o.run(()=>s.answer(t,n.requestId,n.questions.map(m=>l[m.id]??{id:m.id,values:[]})))},children:[n.questions.map(d=>h.jsxs("fieldset",{className:"question-field",children:[h.jsxs("legend",{children:[d.header&&h.jsxs("small",{children:[d.header," · "]}),d.text]}),d.kind==="text"?h.jsx("input",{"aria-label":d.text,type:d.secret?"password":"text",autoComplete:"off",required:d.required,value:l[d.id]?.values[0]??"",onChange:m=>u(p=>({...p,[d.id]:{id:d.id,values:[m.target.value]}}))}):h.jsxs(h.Fragment,{children:[d.options?.map(m=>h.jsxs("label",{className:"choice-option",children:[h.jsx("input",{type:d.kind==="choices"?"checkbox":"radio",name:`${t}:${n.requestId}:${d.id}`,checked:l[d.id]?.values.includes(m.value)??!1,onChange:p=>{const b=p.target.checked;u(v=>({...v,[d.id]:{...v[d.id],id:d.id,values:d.kind==="choice"?[m.value]:b?[...v[d.id]?.values??[],m.value]:(v[d.id]?.values??[]).filter(y=>y!==m.value)}}))}}),h.jsxs("span",{children:[m.label,m.description&&h.jsx("small",{children:m.description})]})]},m.value)),d.other&&h.jsx("input",{"aria-label":`${d.text}:其他回答`,placeholder:"其他回答",value:l[d.id]?.other??"",onChange:m=>u(p=>({...p,[d.id]:{id:d.id,values:p[d.id]?.values??[],other:m.target.value}}))})]})]},d.id)),h.jsx("button",{className:"button primary",disabled:!r||o.busy||n.questions.some(d=>d.required&&!l[d.id]?.values.some(Boolean)&&!l[d.id]?.other?.trim()),children:"提交回答"})]}),h.jsx("div",{className:"permission-buttons",children:n.options.map(d=>h.jsx("button",{disabled:!r||o.busy,className:`button ${d.kind.startsWith("allow")?"primary":"secondary"}`,onClick:()=>void o.run(()=>s.respond(t,n.requestId,d.optionId)),children:d.name},d.optionId))}),h.jsx(Dt,{error:o.error})]})}function EM(n,t){let s=n.trim();if(!s||s.startsWith("#"))return;s=s.replace(/^file:\/\//,"");try{s=decodeURI(s)}catch{}let r;const o=/(?:#L(\d+)(?:-L?\d+)?|:(\d+)(?::\d+)?)$/.exec(s);if(o&&(r=Number(o[1]??o[2]),s=s.slice(0,o.index)),!/^[a-z][a-z0-9+.-]*:/i.test(s)){if(!s.startsWith("/")&&!s.startsWith("~")){if(!t)return;s=`${t.replace(/\/$/,"")}/${s.replace(/^\.\//,"")}`}return s?{path:s,...r&&r>0?{line:r}:{}}:void 0}}const DE=x.createContext(null);function gp({text:n}){const t=x.useContext(DE);return h.jsx("div",{className:"markdown",children:h.jsx(oA,{remarkPlugins:[lA],urlTransform:s=>s.startsWith("file://")?s:cA(s),components:{a:({href:s,children:r})=>{const o=s&&EM(s,t?.cwd);return h.jsx("a",{href:s,target:o?void 0:"_blank",rel:"noreferrer",onClick:l=>{o&&t&&(l.preventDefault(),t.open(o.path,o.line))},children:r})},img:({src:s,alt:r})=>h.jsxs("a",{href:typeof s=="string"?s:void 0,target:"_blank",rel:"noreferrer",children:[r||"查看图片"," ↗"]})},children:n})})}function _M({block:n,sessionId:t}){const s=Jn(),[r,o]=x.useState(n.data?`data:${n.mimeType};base64,${n.data}`:n.uri&&/^(data:image\/|https?:\/\/)/.test(n.uri)?n.uri:void 0),[l,u]=x.useState(),d=s.loadImage;return x.useEffect(()=>{let m=!0;return u(void 0),o(n.data?`data:${n.mimeType};base64,${n.data}`:n.uri&&/^(data:image\/|https?:\/\/)/.test(n.uri)?n.uri:void 0),n.uri?.startsWith("linkshell-event:")&&d(t,n.uri).then(p=>{m&&o(p)},()=>{m&&u("图片加载失败")}),()=>{m=!1}},[d,n.uri,n.data,n.mimeType,t]),r?h.jsx("a",{href:r,download:r.startsWith("data:")?"image":void 0,target:"_blank",rel:"noreferrer",children:h.jsx("img",{className:"message-image",src:r,alt:"会话图片",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>{o(void 0),u("图片加载失败")}})}):h.jsx("span",{className:"muted",children:l??"图片加载中…"})}function Cm({blocks:n,sessionId:t,onFile:s}){return h.jsx(h.Fragment,{children:n.map((r,o)=>r.type==="text"?h.jsx(gp,{text:r.text},o):r.type==="image"?h.jsx(_M,{block:r,sessionId:t},o):/^https?:\/\//.test(r.uri)?h.jsxs("a",{href:r.uri,target:"_blank",rel:"noreferrer",className:"resource-chip",children:[r.name," ↗"]},o):h.jsxs("button",{className:"resource-chip",onClick:()=>s(r.uri.replace(/^file:\/\//,"")),children:[r.kind==="skill"?"技能 · ":"文件 · ",r.name]},o))})}function ME({change:n}){return n.type==="diff"?h.jsxs("details",{className:"diff-block",open:!0,children:[h.jsx("summary",{children:n.path}),h.jsxs("div",{className:"before-after",children:[h.jsxs("div",{children:[h.jsx("small",{children:"修改前"}),h.jsx("pre",{children:n.oldText??"(新文件)"})]}),h.jsxs("div",{children:[h.jsx("small",{children:"修改后"}),h.jsx("pre",{children:n.newText})]})]})]}):h.jsxs("details",{className:"diff-block",open:!0,children:[h.jsxs("summary",{children:[n.path,n.movePath?` → ${n.movePath}`:""]}),h.jsx("pre",{children:n.diff.split(`
|
|
160
|
+
`).map((t,s)=>h.jsxs("span",{className:t.startsWith("+")?"diff-add-line":t.startsWith("-")?"diff-remove-line":"",children:[t,`
|
|
161
|
+
`]},s))})]})}function mg({items:n,sessionId:t,agent:s,onFile:r,onFork:o,onTerminal:l}){const u=Jn(),d=Wt(),m=x.useRef(null),[p,b]=x.useState(!1),v=p?n:n.slice(-180);return h.jsxs("div",{className:"live-timeline",children:[n.length>v.length&&h.jsxs("button",{className:"text-button",onClick:()=>b(!0),children:["显示本次已加载的更早消息(",n.length-v.length,")"]}),v.map(y=>y.kind==="turn-end"||y.kind==="driver"?h.jsx("p",{className:"timeline-divider",children:y.kind==="driver"?`会话控制:${y.driver==="desktop"?"电脑端":y.driver==="remote"?"远程端":"空闲"}`:y.stopReason==="cancelled"?"本轮已停止":y.stopReason==="error"?"本轮执行失败":"本轮结束"},y.id):y.kind==="user"?h.jsxs("article",{className:"user-message",children:[h.jsxs("span",{className:"message-label",children:["你"," ",h.jsxs("small",{children:[new Date(y.ts).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),y.pending?" · 发送中":""]})]}),h.jsx(Cm,{blocks:y.blocks,sessionId:t,onFile:r}),y.failed&&h.jsxs("div",{children:[h.jsx("span",{className:"form-error",children:"发送失败,草稿仍在"}),h.jsx("button",{className:"text-button",onClick:()=>void d.run(()=>u.retry(y.id)),children:"重试"}),h.jsx("button",{className:"text-button",onClick:()=>u.discard(y.id),children:"移除"})]}),o&&!y.pending&&h.jsx("button",{className:"message-fork",onClick:()=>o(y.id),children:"从这里分叉"})]},y.id):y.kind==="agent"?h.jsxs("article",{className:"assistant-message",children:[h.jsxs("div",{className:"message-author",children:[h.jsx(Cd,{agent:s}),h.jsx("strong",{children:s}),y.streaming&&h.jsx("span",{children:"正在回复…"})]}),h.jsx(gp,{text:y.text}),y.attachments&&h.jsx(Cm,{blocks:y.attachments,sessionId:t,onFile:r}),o&&!y.streaming&&h.jsx("button",{className:"message-fork",onClick:()=>o(y.id),children:"从这里分叉"})]},y.id):y.kind==="thought"?h.jsxs("details",{className:"thought-block",children:[h.jsx("summary",{children:y.streaming?"正在思考…":"思考过程"}),h.jsx(gp,{text:y.text})]},y.id):y.kind==="notice"||y.kind==="error"?h.jsxs("section",{className:`notice-card ${y.kind}`,children:[h.jsx("strong",{children:y.kind==="notice"?y.title:y.message}),h.jsx("pre",{children:y.kind==="notice"?y.detail:y.hint})]},y.id):y.kind==="plan"?h.jsxs("section",{className:"plan-card",children:[h.jsx("strong",{children:"执行计划"}),h.jsx("ul",{children:y.entries.map((E,_)=>h.jsxs("li",{children:[h.jsx("span",{children:E.status==="completed"?"✓":E.status==="in_progress"?"◉":"○"}),E.content]},_))})]},y.id):y.kind==="permission-result"?h.jsxs("details",{className:"notice-card",children:[h.jsxs("summary",{children:[y.asked?"已回答":y.allowed?"已允许":"已拒绝"," ·"," ",y.title]}),h.jsx("p",{children:y.optionName}),y.answers?.map((E,_)=>h.jsxs("p",{children:[E.question,":",E.answer]},_))]},y.id):h.jsxs("details",{className:`tool-record ${y.status}`,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"tool-state",children:y.status==="completed"?"✓":y.status==="failed"?"!":"◌"}),h.jsx("strong",{children:y.title}),h.jsx("small",{children:y.detail?.type==="mcp"?`MCP · ${y.detail.server}`:y.status==="in_progress"?"执行中":""})]}),y.detail?.type==="mcp"&&h.jsxs("p",{className:"muted",children:["服务:",y.detail.server," · 工具:",y.detail.tool]}),y.output&&h.jsx("pre",{className:"tool-output-text",children:y.output}),y.content.map((E,_)=>E.type==="content"?h.jsx(Cm,{blocks:[E.content],sessionId:t,onFile:r},_):E.type==="terminal"?h.jsx("button",{className:"text-button",onClick:()=>l?.(E.terminalId),children:"打开关联终端"},_):h.jsx(ME,{change:E},_)),y.locations?.map((E,_)=>h.jsxs("button",{className:"resource-chip",onClick:()=>r(E.path),children:[E.path,E.line?`:${E.line}`:""]},_)),y.rawInput!==void 0&&h.jsxs("details",{children:[h.jsx("summary",{children:"工具参数"}),h.jsx("pre",{children:JSON.stringify(y.rawInput,null,2)})]}),y.rawOutput!==void 0&&h.jsxs("details",{children:[h.jsx("summary",{children:"原始结果"}),h.jsx("pre",{children:JSON.stringify(y.rawOutput,null,2)})]}),y.sub&&h.jsx(mg,{items:y.sub.items,sessionId:t,agent:s,onFile:r,onTerminal:l})]},y.id)),h.jsx(Dt,{error:d.error}),h.jsx("div",{ref:m})]})}async function pg(n){if(n.size>30*1024*1024)throw new Error(`${n.name} 超过 30 MB`);return new Promise((t,s)=>{const r=new FileReader;r.onerror=()=>s(new Error("文件读取失败")),r.onload=()=>t(String(r.result).split(",")[1]??""),r.readAsDataURL(n)})}function zE({path:n,line:t}){const s=x.useRef(null),{link:r}=Lt(),o=Wt(),l=ea(()=>r.call("fs.read",{path:n}),[r,n]),[u,d]=x.useState(),m=l.value,p=u?.path===n?u:void 0;return x.useEffect(()=>{s.current?.scrollIntoView({block:"center"})},[n,t,m,p]),h.jsxs("div",{className:"file-reader",children:[h.jsx(ba,{...l}),h.jsx(Dt,{error:o.error}),m&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"reader-meta",children:[h.jsx("strong",{children:Wu(n)}),h.jsxs("span",{children:[Math.ceil(m.size/1024)," KB"]})]}),m.kind==="image"?h.jsx("img",{className:"file-image",src:`data:${m.mimeType};base64,${m.data}`,alt:Wu(n)}):m.kind==="text"?h.jsxs(h.Fragment,{children:[h.jsx("pre",{className:"source-code",children:t?((m.text??"")+(p?.text??"")).split(`
|
|
162
|
+
`).map((b,v)=>h.jsxs("span",{ref:v+1===t?s:void 0,className:v+1===t?"file-highlight-line":void 0,children:[b,`
|
|
163
|
+
`]},v)):h.jsxs(h.Fragment,{children:[m.text,p?.text]})}),(p?p.next:m.nextOffset)!==void 0&&h.jsx("button",{className:"button secondary",disabled:o.busy,onClick:()=>void o.run(async()=>{const b=await r.call("fs.read",{path:n,offset:p?p.next:m.nextOffset});d({path:n,text:(p?.text??"")+(b.text??""),next:b.nextOffset})}),children:"加载下一部分"})]}):h.jsx("p",{className:"muted",children:"二进制文件 · App 和网页都不直接显示内容。"})]})]})}function gg({start:n,onPick:t,directoriesOnly:s=!1}){const r=co(),{link:o}=Lt(),[l,u]=x.useState(n),[d,m]=x.useState(!1),[p,b]=x.useState(),[v,y]=x.useState(""),E=Wt(),_=ea(()=>o.call("fs.list",{path:l,hidden:d,files:!s}),[o,l,d]),[T,S]=x.useState(),C=v&&T?T.entries:_.value?.entries??[];return h.jsxs("div",{className:"file-browser",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("button",{className:"button secondary",disabled:!_.value?.parent,onClick:()=>{b(void 0),u(_.value?.parent),y("")},children:"上一级"}),h.jsx("span",{className:"path-label",children:_.value?.path??l??"主目录"}),h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:d,onChange:j=>m(j.target.checked)}),"隐藏文件"]})]}),h.jsxs("form",{className:"inline-form",onSubmit:j=>{j.preventDefault(),v.trim()&&E.run(async()=>S(await o.call("fs.search",{query:v.trim()})))},children:[h.jsx("input",{"aria-label":"搜索远程目录",placeholder:"搜索目录",value:v,onChange:j=>{y(j.target.value),j.target.value||S(void 0)}}),h.jsx("button",{className:"button secondary",disabled:E.busy,children:"搜索"})]}),h.jsx(ba,{..._}),h.jsx(Dt,{error:E.error}),h.jsxs("div",{className:"file-browser-layout",children:[h.jsxs("div",{className:"remote-file-list",children:[C.map(j=>h.jsxs("button",{className:p===j.path?"selected":"",onClick:()=>{j.file?b(j.path):(u(j.path),y(""),b(void 0))},children:[h.jsx(_t,{name:j.file?"file":"folder",size:17}),h.jsx("span",{children:j.name}),j.size!==void 0&&h.jsxs("small",{children:[Math.ceil(j.size/1024)," KB"]})]},j.path)),!_.loading&&C.length===0&&h.jsx("p",{className:"muted",children:"此目录为空"}),(_.value?.truncated||T?.truncated)&&h.jsx("p",{className:"muted",children:"结果较多,请缩小搜索范围。"})]}),p&&h.jsx(zE,{path:p},p)]}),s?h.jsx("button",{className:"button primary",disabled:!_.value,onClick:()=>{_.value&&t?.(_.value.path)},children:"选择此目录"}):h.jsxs("div",{className:"file-actions",children:[h.jsxs("label",{className:"button secondary",children:["上传文件",h.jsx("input",{type:"file",multiple:!0,hidden:!0,disabled:E.busy||!_.value,onChange:j=>{const k=Array.from(j.target.files??[]);j.target.value="",E.run(async()=>{for(const A of k)await o.call("fs.upload",{dir:_.value.path,name:A.name,data:await pg(A)},18e4);_.reload()})}})]}),h.jsx("button",{className:"button secondary",disabled:E.busy||!_.value,onClick:async()=>{const j=await r.prompt("新目录名称");j?.trim()&&E.run(async()=>{await o.call("fs.mkdir",{parent:_.value.path,name:j.trim()}),_.reload()})},children:"新建目录"}),h.jsx("button",{className:"text-button",onClick:_.reload,children:"刷新"})]})]})}function CM({commands:n,choose:t,close:s,returnFocus:r}){const[o,l]=x.useState(""),u=OE(n,o);return h.jsx(El,{title:"命令与技能",close:s,returnFocus:r,children:h.jsxs(EE,{shouldFilter:!1,children:[h.jsx(mM,{"aria-label":"搜索命令",placeholder:"搜索命令或 Skills",value:o,onValueChange:l}),h.jsxs(_E,{children:[h.jsx(CE,{children:n.length?"没有匹配的命令":"Agent 尚未报告命令,连接或接管后会自动更新。"}),h.jsx(AE,{children:u.map(d=>h.jsx(jE,{value:d.name,onSelect:()=>t(d),children:h.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[h.jsxs("strong",{children:["/",d.name,d.hint&&h.jsxs("small",{children:[" ",d.hint]})]}),h.jsx("span",{className:"text-muted-foreground",children:NE(d)})]})},d.name))})]})]})})}function AM({session:n,view:t}){const s=Jn(),r=yt(l=>l.status==="online"),o=Wt();return h.jsxs("div",{className:"settings-panel",children:[h.jsx("h3",{children:"会话设置"}),h.jsxs("p",{className:"muted",children:[n.agent," · ",n.cwd]}),h.jsx(Qp,{children:t?.config.map(l=>h.jsxs(ku,{"data-disabled":!r||o.busy,children:[h.jsx(Nu,{htmlFor:`config-${l.id}`,children:l.name}),h.jsx(bd,{id:`config-${l.id}`,label:l.name,value:l.current,disabled:!r||o.busy,onValueChange:u=>void o.run(()=>s.setConfig(n.id,l.id,u)),options:l.values.map(u=>({value:u.value,label:u.name+(u.description?` · ${u.description}`:"")}))})]},l.id))}),!t?.config.length&&h.jsx("p",{className:"muted",children:"当前 Agent 尚未提供可调整的配置。"}),h.jsx(Dt,{error:o.error})]})}function jM({view:n}){const t=n?.items.flatMap(s=>s.kind==="tool"&&s.status!=="failed"?s.content.filter(r=>r.type==="diff"||r.type==="patch"):[])??[];return h.jsxs("section",{children:[h.jsx("h3",{children:"文件变更"}),h.jsx("p",{className:"muted",children:"来自已加载的会话记录;加载更早历史可查看更多变更。"}),t.map((s,r)=>(s.type==="diff"||s.type==="patch")&&h.jsx(ME,{change:s},r)),!t.length&&h.jsx("p",{className:"muted",children:"当前没有已报告的文件变更。"})]})}function TM({session:n,view:t}){const s=co(),{link:r}=Lt(),o=Jn(),l=yt(R=>R.status==="online"),u=Wt(),d=n.agent==="codex",m=d&&n.driver==="desktop",p=u.busy||!l||m,b=ea(async()=>d&&l?r.call("sessions.goal",{sessionId:n.id,change:{action:"get"}}):{goal:null},[r,n.id,d,l]),v=t?.goal===void 0?b.value?.goal:t.goal,[y,E]=x.useState(""),[_,T]=x.useState(""),[S,C]=x.useState(!1),[j,k]=x.useState("");x.useEffect(()=>{S||(E(v?.objective??""),T(v?.tokenBudget?.toString()??""))},[v?.objective,v?.tokenBudget,S]);async function A(R){if(!p){if(d)await r.call("sessions.goal",{sessionId:n.id,change:R}),b.reload();else{const O=R.action==="set"?`/goal ${R.objective}`:R.action==="clear"?"/goal clear":"/goal";if(await o.send(n.id,[{type:"text",text:O}],{now:!0})==="failed")throw new Error("目标命令未发送成功,请重试");k("已发送目标命令,执行结果会显示在会话中。")}C(!1)}}return h.jsxs("section",{className:"settings-panel",children:[h.jsx("h3",{children:"持续目标"}),h.jsx(ba,{...b}),v&&h.jsxs("div",{className:"notice-card",children:[h.jsx(Ur,{state:v.status}),h.jsx("p",{children:v.objective}),h.jsxs("small",{children:["已用 ",v.tokensUsed??"—"," tokens",v.tokenBudget?` / ${v.tokenBudget}`:""," ·"," ",v.iterations??0," 轮"]}),v.lastReason&&h.jsx("p",{children:v.lastReason}),h.jsxs("div",{className:"permission-buttons",children:[d&&h.jsx("button",{className:"button secondary",disabled:p||["complete","budgetLimited"].includes(v.status),onClick:()=>void u.run(()=>A({action:v.status==="active"?"pause":"resume"})),children:v.status==="active"?"暂停":"继续"}),h.jsx("button",{className:"button secondary",disabled:p,onClick:async()=>{await s.confirm("清除当前持续目标?")&&u.run(()=>A({action:"clear"}))},children:"清除目标"})]})]}),h.jsx("form",{onSubmit:R=>{R.preventDefault(),u.run(()=>A({action:"set",objective:y.trim(),..._?{tokenBudget:Number(_)}:{}}))},children:h.jsxs(Qp,{children:[h.jsxs(ku,{children:[h.jsx(Nu,{htmlFor:"goal-objective",children:"目标"}),h.jsx("textarea",{id:"goal-objective",value:y,onChange:R=>{C(!0),E(R.target.value)},rows:4,required:!0,maxLength:d?4e3:void 0,placeholder:"你希望 Agent 持续完成什么?"})]}),d&&h.jsxs(ku,{children:[h.jsx(Nu,{htmlFor:"goal-budget",children:"Token 预算(可选)"}),h.jsx("input",{id:"goal-budget",type:"number",min:"1",step:"1",value:_,onChange:R=>{C(!0),T(R.target.value)}})]}),h.jsx("button",{className:"button primary",disabled:p||!y.trim(),children:v?"更新目标":"设置目标"})]})}),!d&&h.jsx("button",{className:"text-button",disabled:p,onClick:()=>void u.run(()=>A({action:"get"})),children:"查询当前目标"}),m&&h.jsx("p",{className:"muted",children:"会话由电脑端控制,请在电脑端修改目标。"}),j&&h.jsx("p",{role:"status",children:j}),h.jsx(Dt,{error:u.error})]})}function kM({session:n,onFile:t,onTerminal:s}){const r=Jn(),{store:o}=Lt(),l=yt(v=>v.tasks[n.id]),u=yt(v=>v.workflows[n.id]),d=Wt(),m=ea(async()=>({tasks:await r.loadTasks(n.id),subagents:await r.loadSubagents(n.id)}),[o,n.id],5e3),[p,b]=x.useState();return h.jsxs("section",{children:[h.jsx("h3",{children:"后台任务、子 Agent 与工作流"}),h.jsx(ba,{...m}),h.jsx(Dt,{error:d.error}),h.jsxs("div",{className:"activity-list",children:[(l?Object.values(l).sort((v,y)=>y.startedAt-v.startedAt):m.value?.tasks??[]).map(v=>h.jsxs("article",{children:[h.jsxs("button",{onClick:()=>{b({kind:"task",id:v.id})},children:[h.jsx(Ur,{state:v.state}),h.jsx("strong",{children:v.title}),h.jsx("small",{children:v.command})]}),v.state==="running"&&h.jsx("button",{className:"text-button",onClick:()=>void d.run(async()=>{await r.stopTask(n.id,v.id),m.reload()}),children:"停止任务"})]},v.id)),m.value?.subagents.map(v=>h.jsxs("article",{children:[h.jsxs("button",{onClick:()=>b({kind:"agent",id:v.toolCallId}),children:[h.jsx(Ur,{state:v.state??(v.running?"running":v.failed?"failed":"completed")}),h.jsx("strong",{children:v.task}),h.jsx("small",{children:v.agentType??(v.workflow?"工作流":"子 Agent")})]}),(u?.[v.toolCallId]?.workflow??v.workflow)&&h.jsx(b1,{workflow:u?.[v.toolCallId]?.workflow??v.workflow,open:y=>{b({kind:"agent",id:y})}})]},v.toolCallId)),Object.values(u??{}).filter(v=>!m.value?.subagents.some(y=>y.toolCallId===v.toolCallId)).map(v=>h.jsxs("article",{children:[h.jsx("strong",{children:v.task}),h.jsx(b1,{workflow:v.workflow,open:y=>b({kind:"agent",id:y})})]},v.toolCallId))]}),m.value&&!m.value.tasks.length&&!m.value.subagents.length&&!Object.keys(u??{}).length&&h.jsx("p",{className:"muted",children:"尚无后台任务或子 Agent。"}),p?.kind==="task"&&h.jsx(NM,{sessionId:n.id,taskId:p.id},p.id),p?.kind==="agent"&&h.jsx(OM,{session:n,id:p.id,onFile:t,onTerminal:s},p.id)]})}function NM({sessionId:n,taskId:t}){const s=Jn(),{store:r}=Lt(),o=yt(b=>b.tasks[n]?.[t]?.state==="running"),[l,u]=x.useState(),d=ea(()=>s.loadTaskOutput(n,t),[r,n,t],o&&!l?2e3:0),m=l??d.value,p=Wt();return h.jsxs("div",{className:"task-output",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("strong",{children:"任务输出"}),h.jsx("button",{className:"text-button",onClick:()=>{u(void 0),d.reload()},children:"刷新"})]}),h.jsx(ba,{loading:!m&&d.loading,error:d.error??p.error}),!!m?.start&&h.jsx("button",{className:"text-button",disabled:p.busy,onClick:()=>{u(m),p.run(async()=>{const b=await s.loadTaskOutput(n,t,m.start);u({...m,text:b.text+m.text,start:b.start})})},children:"加载更早输出"}),h.jsx("pre",{children:m?.text||(m?"没有可读的输出":"加载中…")})]})}function OM({session:n,id:t,onFile:s,onTerminal:r}){const{store:o}=Lt(),l=yt(y=>y.status==="online"),u=yt(y=>y.ready[n.id]),d=yt(y=>y.subagentViews[fp(n.id,t)]),[m,p]=x.useState(!1),[b,v]=x.useState(0);return x.useEffect(()=>{if(!l||!u)return;let y=!0;return p(!1),o.getState().openSubagent(n.id,t).then(E=>{y&&p(!E)}),()=>{y=!1,o.getState().closeSubagent(n.id,t)}},[o,n.id,t,l,u,b]),h.jsxs("div",{children:[h.jsx("h3",{children:"子 Agent 会话"}),d?h.jsx(mg,{items:d.items,sessionId:n.id,agent:n.agent,onFile:s,onTerminal:r}):m?h.jsxs("div",{role:"alert",children:[h.jsx("p",{children:"未能读取子 Agent 会话,它可能已关闭或暂时不可用。"}),h.jsx("button",{className:"text-button",onClick:()=>v(y=>y+1),children:"重试"})]}):h.jsx("p",{className:"muted",children:l?"正在加载…":"等待电脑重新连接…"})]})}function b1({workflow:n,open:t}){return h.jsxs("details",{className:"workflow-panel",children:[h.jsxs("summary",{children:[n.name??"工作流"," · ",n.completed??0," /"," ",n.started??n.agents?.length??0," 已完成"]}),h.jsxs("div",{className:"browser-toolbar",children:[n.state&&h.jsx(Ur,{state:n.state}),h.jsxs("small",{children:[n.tokens??0," tokens",n.durationMs!==void 0?` · ${Math.round(n.durationMs/1e3)} 秒`:""]})]}),n.phases?.map(s=>h.jsxs("div",{className:"workflow-phase",children:[s.order+1,". ",s.title]},s.id)),n.agents?.map(s=>h.jsxs("div",{className:"workflow-agent",children:[h.jsx(Ur,{state:s.state}),h.jsx("strong",{children:s.title}),h.jsxs("small",{children:[s.model??"",s.tokens!==void 0?` · ${s.tokens} tokens`:"",s.toolCalls!==void 0?` · ${s.toolCalls} 次工具调用`:""]}),s.result&&h.jsx("p",{children:s.result}),s.toolCallId&&h.jsx("button",{className:"text-button",onClick:()=>t(s.toolCallId),children:"查看会话"})]},s.id))]})}function RM(){const n=co(),t=Jn(),{store:s}=Lt(),r=Wt(),o=ea(()=>t.listWorktrees(),[s]);return h.jsxs("section",{children:[h.jsx("h2",{children:"工作目录与分支"}),h.jsx(ba,{...o}),h.jsx(Dt,{error:r.error}),o.value?.map(l=>h.jsxs("article",{className:"notice-card",children:[h.jsx("strong",{children:l.branch}),h.jsx("p",{children:l.path}),h.jsxs("p",{className:"muted",children:[l.sessions.length," 个会话 ·"," ",l.dirty?"有未提交改动":"工作区干净"," · ",l.ahead," ","个新提交"]}),h.jsx("button",{className:"button secondary",disabled:l.sessions.length>0||r.busy,onClick:async()=>{const u=l.dirty||l.ahead>0;await n.confirm(u?"此 worktree 有未提交改动或新提交。确定永久删除它及分支?":"移除此 worktree 及分支?")&&r.run(async()=>{await t.removeWorktree(l.path,u),o.reload()})},children:"移除 worktree"})]},l.path)),o.value?.length===0&&h.jsx("p",{className:"muted",children:"尚无由 LinkShell 创建的 worktree。"})]})}async function DM(n,t,s,r=()=>!0){await n.beginReplay(t.afterFrame===0);try{let o=t.afterFrame;for(;o<t.throughFrame;){if(!r())throw new Error("终端恢复已取消");const l=await s(o,t.throughFrame);if(!r())throw new Error("终端恢复已取消");if(l.nextFrame<=o||l.nextFrame>t.throughFrame||l.frames.length===0)throw new Error("终端回放数据不完整");for(const u of l.frames){if(u.frame!==o+1||u.cols<1||u.rows<1)throw new Error("终端回放顺序无效");await n.replay(u.data,u.cols,u.rows),o=u.frame}if(o!==l.nextFrame||l.done!==(o===t.throughFrame))throw new Error("终端回放范围不一致")}}finally{await n.endReplay()}}function vp(n,t){return t?new Promise(s=>n.write(t,s)):Promise.resolve()}async function MM(n,t,s,r){t.recording?await DM({beginReplay:async o=>{o&&n.reset()},replay:async(o,l,u)=>{n.resize(l,u),await vp(n,o)},endReplay:async()=>{}},t.recording,s,r):(t.reset&&n.reset(),n.resize(t.terminal.cols,t.terminal.rows),await vp(n,t.replay))}function LE({id:n}){const{link:t}=Lt(),s=x.useRef(null),r=x.useRef(null),o=x.useRef(null),l=x.useRef(!1),u=yt(j=>j.status==="online"),[d,m]=x.useState(!0),[p,b]=x.useState(0),[v,y]=x.useState(()=>Math.max(10,Math.min(24,Gs("terminalFontSize",13)))),E=Wt(),_=x.useRef(v);_.current=v;async function T(j){const k=r.current;if(!k||!l.current||!j.length)return;const R=(await t.call("terminals.list",{})).terminals.find(O=>O.id===n);if(!R||R.exitCode!=null||R.interrupted)throw new Error("终端已停止");for(const O of j){const M=await t.call("fs.upload",{dir:R.cwd,name:O.name,data:await pg(O)},18e4);if(r.current!==k)return;if(!l.current)throw new Error(`文件已上传到 ${M.path},请在终端恢复后粘贴路径。`);k.paste("'"+M.path.replaceAll("'",`'"'"'`)+"' ")}k.focus()}const[S,C]=x.useState();return x.useEffect(()=>{if(!s.current)return;const j=new fA({fontFamily:"Menlo, Consolas, monospace",fontSize:_.current,cursorBlink:!0,scrollback:1e4,theme:{background:"#17181d",foreground:"#e4e4ec",cursor:"#7d95ff"},allowProposedApi:!1}),k=new hA;j.loadAddon(k),r.current=j,o.current=k,j.open(s.current);const A=()=>{const te=getComputedStyle(document.documentElement);j.options.theme={background:te.getPropertyValue("--code").trim(),foreground:te.getPropertyValue("--codeText").trim(),cursor:te.getPropertyValue("--accent").trim()}};A();const R=new MutationObserver(A);R.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),k.fit();let O=!0,M=!1,z,L=0,V,q=Promise.resolve(),Y=0,X=!1;const ee=[],re=async te=>{te.seq<=(z??-1)||(te.cols&&te.rows&&(j.cols!==te.cols||j.rows!==te.rows)&&j.resize(te.cols,te.rows),await vp(j,te.data),O&&(V=te.frame,z=te.seq))},U=()=>{if(!O||t.status!=="online")return;M=!0,l.current=!1,m(!0);const te=++L;ee.length=0,Y=0,X=!1,q=q.catch(()=>{}).then(async()=>{if(!(!O||L!==te))try{const de=await t.call("terminals.attach",{terminalId:n,fromSeq:z,replayFormat:"frames-v1",fromFrame:V});if(!O||L!==te||(await MM(j,de,(ce,ie)=>t.call("terminals.replay",{terminalId:n,afterFrame:ce,throughFrame:ie}),()=>O&&L===te),!O||L!==te))return;if(z=de.seq,V=de.recording?.throughFrame,X){U();return}for(;ee.length&&O&&L===te;){const ce=ee.shift();Y-=ce.data.length,await re(ce)}if(!O||L!==te)return;M=!1,C(void 0),k.fit(),await t.call("terminals.resize",{terminalId:n,cols:Math.max(10,j.cols),rows:Math.max(4,j.rows)})}catch(de){O&&L===te&&(M=!1,z=void 0,V=void 0,C(de instanceof Error?de.message:String(de)))}})},$=t.on("terminal.output",te=>{te.terminalId===n&&(M?X||(Y+=te.data.length,Y>4*1024*1024?(ee.length=0,X=!0):ee.push(te)):q=q.then(()=>O?re(te):void 0).catch(()=>U()))}),W=j.onData(te=>{if(!M){if(t.status!=="online"){C("连接已断开,输入未发送");return}t.call("terminals.input",{terminalId:n,data:te}).catch(de=>{O&&C(String(de))})}}),J=t.onOnline(U),Q=t.onStatus(te=>{te!=="online"&&(L++,M=!0,l.current=!1,m(!0))});let pe;const G=new ResizeObserver(()=>{clearTimeout(pe),pe=setTimeout(()=>{!O||M||(k.fit(),t.status==="online"&&t.call("terminals.resize",{terminalId:n,cols:Math.max(10,j.cols),rows:Math.max(4,j.rows)}).catch(()=>{}))},120)});return G.observe(s.current),U(),()=>{O=!1,L++,clearTimeout(pe),G.disconnect(),R.disconnect(),$(),J(),Q(),W.dispose(),r.current=null,o.current=null,l.current=!1,j.dispose(),t.status==="online"&&t.call("terminals.detach",{terminalId:n}).catch(()=>{})}},[t,n,p]),x.useEffect(()=>{const j=r.current;j&&(j.options.fontSize=v,ua("terminalFontSize",v),l.current&&(o.current?.fit(),t.call("terminals.resize",{terminalId:n,cols:Math.max(10,j.cols),rows:Math.max(4,j.rows)}).catch(()=>{})))},[v,t,n]),h.jsxs("div",{className:"terminal-live",onDragOver:j=>j.preventDefault(),onDrop:j=>{j.preventDefault(),E.run(()=>T(Array.from(j.dataTransfer.files)))},onPaste:j=>{j.clipboardData.files.length&&(j.preventDefault(),E.run(()=>T(Array.from(j.clipboardData.files))))},children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("button",{className:"text-button","aria-label":"缩小终端字号",disabled:v<=10,onClick:()=>y(j=>j-1),children:"A−"}),h.jsxs("span",{children:[v,"px"]}),h.jsx("button",{className:"text-button","aria-label":"放大终端字号",disabled:v>=24,onClick:()=>y(j=>j+1),children:"A+"}),h.jsxs("label",{className:"text-button",children:["上传文件",h.jsx("input",{type:"file",multiple:!0,hidden:!0,disabled:E.busy||d||!u,onChange:j=>{const k=Array.from(j.target.files??[]);j.target.value="",E.run(()=>T(k))}})]}),d&&h.jsx("span",{role:"status",children:"正在恢复终端…"}),S&&h.jsx("button",{className:"text-button",onClick:()=>b(j=>j+1),children:"重新连接终端"})]}),h.jsx(Dt,{error:S??E.error}),h.jsx("div",{className:"xterm-mount",ref:s})]})}function UE({cwd:n,selected:t,onSelect:s}){const r=co(),{link:o}=Lt(),l=ea(()=>o.call("terminals.list",{}),[o],5e3),u=Wt(),[d,m]=x.useState(n??""),[p,b]=x.useState(""),v=yt(y=>y.status==="online");return h.jsxs("section",{className:"terminals-page",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("h2",{children:"终端"}),h.jsx("input",{"aria-label":"终端工作目录",placeholder:"工作目录(默认主目录)",value:d,onChange:y=>m(y.target.value)}),h.jsx("input",{"aria-label":"终端启动命令",placeholder:"启动命令(可选)",value:p,onChange:y=>b(y.target.value)}),h.jsx("button",{className:"button primary",disabled:u.busy||!v,onClick:()=>void u.run(async()=>{const y=await o.call("terminals.create",{cwd:d||void 0,command:p.trim()||void 0});s(y.terminal.id),l.reload()}),children:"新建终端"})]}),h.jsx(ba,{...l}),h.jsx(Dt,{error:u.error}),h.jsx("div",{className:"terminal-tabs",children:l.value?.terminals.map(y=>h.jsxs("div",{className:y.id===t?"selected":"",children:[h.jsxs("button",{onClick:()=>s(y.id),children:[y.title,h.jsx("small",{children:y.exitCode!=null?`已退出 ${y.exitCode}`:y.interrupted?"已中断":y.cwd})]}),(y.exitCode!=null||y.interrupted)&&h.jsx("button",{className:"text-button",disabled:u.busy||!v,onClick:()=>void u.run(async()=>{const E=await o.call("terminals.create",{cwd:y.cwd,command:y.command});s(E.terminal.id),l.reload()}),children:"重新运行"}),h.jsx("button",{"aria-label":`关闭终端 ${y.title}`,onClick:async()=>{await r.confirm("关闭这个终端?其中运行的进程会结束。")&&u.run(async()=>{await o.call("terminals.close",{terminalId:y.id}),y.id===t&&s(void 0),l.reload()})},children:"×"})]},y.id))}),t?h.jsx(LE,{id:t},t):h.jsx("p",{className:"muted",children:"选择一个终端,或新建 Shell。"})]})}const to=n=>{const t=new Uint8Array(n.reduce((r,o)=>r+o.length,0));let s=0;for(const r of n)t.set(r,s),s+=r.length;return t},Su=new TextEncoder;function BE(n,t=!1){const s=new TextDecoder("latin1").decode(n),r=s.indexOf(`\r
|
|
164
|
+
\r
|
|
165
|
+
`);if(r<0)throw new Error("HTTP 响应头不完整");const o=s.slice(0,r).split(`\r
|
|
166
|
+
`),l=Number(o.shift()?.split(" ")[1]);if(!Number.isFinite(l))throw new Error("无效的 HTTP 响应");const u=o.map(p=>{const b=p.indexOf(":");return[p.slice(0,b).toLowerCase(),p.slice(b+1).trim()]});let d=n.slice(r+4);if(t||[204,205,304].includes(l))return{status:l,headers:u,body:new Uint8Array};if(u.some(([p,b])=>p==="transfer-encoding"&&/chunked/i.test(b))){const p=[];let b=0;for(;b<d.length;){let v=b;for(;v<d.length-1&&!(d[v]===13&&d[v+1]===10);)v++;const y=parseInt(new TextDecoder().decode(d.slice(b,v)).split(";")[0],16);if(!Number.isFinite(y)||y<0||v+2+y>d.length)throw new Error("HTTP 分块响应不完整");if(y===0)return{status:l,headers:u,body:to(p)};p.push(d.slice(v+2,v+2+y)),b=v+2+y+2}throw new Error("HTTP 分块响应未结束")}const m=u.find(([p])=>p==="content-length");if(m&&!t&&d.length<Number(m[1]))throw new Error("HTTP 响应被截断");return m&&(d=d.slice(0,Number(m[1]))),{status:l,headers:u,body:d}}async function zM(n,t,s,r="GET",o=[],l=new Uint8Array){if(!s.startsWith("/")||/[\r\n]/.test(s)||!/^[A-Z]+$/.test(r))throw new Error("无效的预览请求");return new Promise((u,d)=>{const m=[];let p=0,b,v=!1;const y=_=>{if(!v){if(v=!0,clearTimeout(E),b?.close(),_){d(new Error(_));return}try{u(BE(to(m),r==="HEAD"))}catch(T){d(T)}}},E=setTimeout(()=>y("预览请求超时"),6e4);n.open(t,{data(_){if(p+=_.length,p>32*1024*1024)return y("单次预览响应超过 32 MB");m.push(_)},closed:y}).then(_=>{if(v)return _.close();b=_;const T=o.filter(([C,j])=>!/[\r\n]/.test(C+j)&&!/^(host|connection|content-length|transfer-encoding|accept-encoding|origin|referer)$/i.test(C)),S=`${r} ${s} HTTP/1.1\r
|
|
167
|
+
Host: 127.0.0.1:${t}\r
|
|
168
|
+
Connection: close\r
|
|
169
|
+
Accept-Encoding: identity\r
|
|
170
|
+
Content-Length: ${l.length}\r
|
|
171
|
+
${T.map(([C,j])=>`${C}: ${j}\r
|
|
172
|
+
`).join("")}\r
|
|
173
|
+
`;b.write(Su.encode(S)),l.length&&b.write(l)},_=>y(String(_)))})}function x1(n,t){const s=n.length<126?2:n.length<65536?4:10,r=new Uint8Array(s+4+n.length);r[0]=128|t,r[1]=128|(s===2?n.length:s===4?126:127);const o=new DataView(r.buffer);s===4&&o.setUint16(2,n.length),s===10&&o.setBigUint64(2,BigInt(n.length));const l=crypto.getRandomValues(new Uint8Array(4));r.set(l,s);for(let u=0;u<n.length;u++)r[s+4+u]=n[u]^l[u%4];return r}class LM{buffer=new Uint8Array;fragments=[];opcode=0;push(t){this.buffer=to([this.buffer,t]);const s=[];for(;this.buffer.length>=2;){const r=this.buffer[0],o=this.buffer[1],l=r&15;let u=o&127,d=2;if(u===126){if(this.buffer.length<4)break;u=new DataView(this.buffer.buffer).getUint16(2),d=4}if(u===127){if(this.buffer.length<10)break;const v=new DataView(this.buffer.buffer).getBigUint64(2);if(v>BigInt(32*1024*1024))throw new Error("WebSocket 帧过大");u=Number(v),d=10}const m=(o&128)!==0,p=d+(m?4:0)+u;if(this.buffer.length<p)break;const b=this.buffer.slice(d+(m?4:0),p);if(m)for(let v=0;v<b.length;v++)b[v]^=this.buffer[d+v%4];if(this.buffer=this.buffer.slice(p),l>=8){s.push({opcode:l,bytes:b});continue}if(l!==0&&(this.opcode=l,this.fragments=[]),this.fragments.push(b),this.fragments.reduce((v,y)=>v+y.length,0)>32*1024*1024)throw new Error("WebSocket 消息过大");(r&128)!==0&&(s.push({opcode:this.opcode,bytes:to(this.fragments)}),this.fragments=[])}return s}}async function IE(n,t,s,r,o=[]){if(!s.startsWith("/")||/[\r\n]/.test(s)||o.some(S=>!/^[\w.!#$%&'*+\-^`|~]+$/.test(S)))throw new Error("无效的 WebSocket 地址");const l=btoa(String.fromCharCode(...crypto.getRandomValues(new Uint8Array(16)))),u=await crypto.subtle.digest("SHA-1",Su.encode(l+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11")),d=btoa(String.fromCharCode(...new Uint8Array(u)));let m,p=!0,b=new Uint8Array,v=!1;const y=new LM,E=S=>{v||(v=!0,clearTimeout(_),m?.close(),r.close(S))},_=setTimeout(()=>E("WebSocket 握手超时"),15e3),T=await n.open(t,{data(S){try{if(p){b=to([b,S]);const C=new TextDecoder().decode(b),j=C.indexOf(`\r
|
|
174
|
+
\r
|
|
175
|
+
`);if(j<0){b.length>32768&&E("无效的 WebSocket 响应");return}const k=C.slice(0,j);if(!/^HTTP\/1\.[01] 101\b/.test(k)||!k.toLowerCase().includes(`sec-websocket-accept: ${d}`.toLowerCase()))return E("WebSocket 握手被拒绝");p=!1,clearTimeout(_),S=b.slice(j+4),b=new Uint8Array,r.open()}for(const C of y.push(S)){if(C.opcode===8){E();break}C.opcode===9&&m?.write(x1(C.bytes,10)),C.opcode===1&&r.data(new TextDecoder().decode(C.bytes)),C.opcode===2&&r.data(C.bytes.slice().buffer)}}catch(C){E(String(C))}},closed:E});return v?T.close():(m=T,m.write(Su.encode(`GET ${s} HTTP/1.1\r
|
|
176
|
+
Host: 127.0.0.1:${t}\r
|
|
177
|
+
Upgrade: websocket\r
|
|
178
|
+
Connection: Upgrade\r
|
|
179
|
+
Sec-WebSocket-Key: ${l}\r
|
|
180
|
+
Sec-WebSocket-Version: 13\r
|
|
181
|
+
Origin: http://127.0.0.1:${t}\r
|
|
182
|
+
${o.length?`Sec-WebSocket-Protocol: ${o.join(", ")}\r
|
|
183
|
+
`:""}\r
|
|
184
|
+
`))),{send(S){!v&&!p&&m?.write(x1(typeof S=="string"?Su.encode(S):new Uint8Array(S),typeof S=="string"?1:2))},close:E}}function UM({sessionId:n}){const{link:t,streams:s}=Lt(),[r,o]=x.useState();return x.useEffect(()=>{let l;const u=new _R(t,s,n,d=>{l&&URL.revokeObjectURL(l),l=URL.createObjectURL(new Blob([d.bytes],{type:d.mimeType})),o(l)});return()=>{u.close(),l&&URL.revokeObjectURL(l)}},[t,s,n]),r?h.jsx("img",{className:"computer-live-preview",src:r,alt:"Agent 当前电脑操作画面"}):h.jsx("p",{className:"muted",children:"等待 Agent 的电脑操作画面。当前会话没有画面时,此处保持等待。"})}function yp(n){const t=new Map;class s extends EventTarget{constructor(o,l=[]){super(),this.url=o,t.set(this.id,this),parent.postMessage({channel:n,type:"ws-open",id:this.id,url:String(o),protocols:typeof l=="string"?[l]:l},"*")}static CONNECTING=0;static OPEN=1;static CLOSING=2;static CLOSED=3;CONNECTING=0;OPEN=1;CLOSING=2;CLOSED=3;readyState=0;binaryType="blob";bufferedAmount=0;extensions="";protocol="";onopen=null;onmessage=null;onerror=null;onclose=null;id=crypto.randomUUID();send(o){if(this.readyState!==1)throw new Error("WebSocket is not open");if(o instanceof Blob){o.arrayBuffer().then(u=>this.send(u));return}const l=ArrayBuffer.isView(o)?o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength):o;parent.postMessage({channel:n,type:"ws-send",id:this.id,data:l},"*")}close(){this.readyState=2,parent.postMessage({channel:n,type:"ws-close",id:this.id},"*")}receive(o,l,u){if(o==="ws-open"){this.readyState=1;const d=new Event("open");this.dispatchEvent(d),this.onopen?.(d)}if(o==="ws-data"){const d=new MessageEvent("message",{data:l instanceof ArrayBuffer&&this.binaryType==="blob"?new Blob([l]):l});this.dispatchEvent(d),this.onmessage?.(d)}if(o==="ws-close"){if(this.readyState=3,u){const m=new Event("error");this.dispatchEvent(m),this.onerror?.(m)}const d=new CloseEvent("close",{code:u?1006:1e3,reason:u??"",wasClean:!u});this.dispatchEvent(d),this.onclose?.(d),t.delete(this.id)}}}window.WebSocket=s,window.addEventListener("message",r=>{r.source===parent&&r.data?.channel===n&&t.get(r.data.id)?.receive(r.data.type,r.data.data,r.data.reason)})}function BM(){const{link:n,streams:t}=Lt(),s=Wt(),r=ea(()=>n.call("screen.access",{}),[n]),[o,l]=x.useState(!1),[u,d]=x.useState(0),[m,p]=x.useState(0),[b,v]=x.useState([]),[y,E]=x.useState(),[_,T]=x.useState(),S=x.useRef(null);return x.useEffect(()=>{if(!o)return;let C=!0;const j=new Map,k=new Set,A=crypto.randomUUID();let R=0;const O=z=>S.current?.contentWindow?.postMessage({channel:A,...z},"*"),M=z=>{if(z.source!==S.current?.contentWindow||z.data?.channel!==A||!R)return;const L=z.data;if(L.type==="ws-open"){if(j.has(L.id)||k.has(L.id)||j.size+k.size>=4)return;const V=new URL(L.url);if(!["ws:","wss:"].includes(V.protocol)||V.hostname!=="127.0.0.1"||Number(V.port)!==R||V.pathname!=="/stream")return;k.add(L.id),IE(t,R,V.pathname+V.search,{open:()=>O({id:L.id,type:"ws-open"}),data:q=>O({id:L.id,type:"ws-data",data:q}),close:q=>{k.delete(L.id),j.delete(L.id),O({id:L.id,type:"ws-close",reason:q})}},L.protocols).then(q=>{!C||!k.has(L.id)?q.close():(k.delete(L.id),j.set(L.id,q))},q=>{k.delete(L.id),O({id:L.id,type:"ws-close",reason:String(q)})})}else L.type==="ws-send"&&(typeof L.data=="string"||L.data instanceof ArrayBuffer)?j.get(L.id)?.send(L.data):L.type==="ws-close"&&(k.delete(L.id),j.get(L.id)?.close(),j.delete(L.id))};return window.addEventListener("message",M),E(void 0),T(void 0),n.call("screen.start",{}).then(async z=>{R=z.port,C&&v(z.displays);const L=`?token=${encodeURIComponent(z.token)}&display=${u}`,V=await zM(t,R,"/"+L);if(V.status!==200)throw new Error(`屏幕页面返回 ${V.status}`);let q=new TextDecoder().decode(V.body);q=q.replaceAll("location.search",JSON.stringify(L)).replaceAll("location.host",JSON.stringify(`127.0.0.1:${R}`)).replaceAll("location.protocol",'"http:"'),q=q.replace("<head>",`<head><script>(${yp.toString()})(${JSON.stringify(A)})<\/script>`),C&&E(q)}).catch(z=>{C&&T(String(z))}),()=>{C=!1,window.removeEventListener("message",M);for(const z of j.values())z.close();j.clear(),k.clear()}},[o,u,m,n,t]),h.jsxs("section",{className:"screen-page",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("h2",{children:"电脑屏幕"}),b.length>1&&h.jsx("div",{className:"w-48",children:h.jsx(bd,{label:"选择显示器",value:String(u),onValueChange:C=>d(Number(C)),options:b.map(C=>({value:String(C.index),label:C.name}))})}),o&&h.jsxs(h.Fragment,{children:[h.jsx("button",{className:"button secondary",onClick:()=>p(C=>C+1),children:"重新连接"}),h.jsx("button",{className:"button secondary",onClick:()=>void S.current?.requestFullscreen().catch(()=>{}),children:"全屏"}),h.jsx("button",{className:"text-button",onClick:()=>{l(!1),E(void 0)},children:"停止观看"})]})]}),h.jsx(ba,{...r}),h.jsx(Dt,{error:_??s.error}),!o&&r.value&&h.jsxs("div",{className:"notice-card",children:[h.jsx("p",{children:r.value.problem??(r.value.supported?"电脑支持屏幕共享":"此电脑暂不支持屏幕共享")}),h.jsxs("p",{className:"muted",children:["屏幕录制:",r.value.recording===null?"未知":r.value.recording?"已授权":"未授权"," ","· 操作控制:",r.value.control===null?"未知":r.value.control?"已授权":"未授权"]}),r.value.supported&&h.jsxs("div",{className:"permission-buttons",children:[h.jsx("button",{className:"button primary",onClick:()=>l(!0),children:"开始观看"}),h.jsx("button",{className:"button secondary",disabled:s.busy,onClick:()=>void s.run(async()=>{await n.call("screen.access",{ask:!0}),r.reload()}),children:"在电脑上检查权限"})]})]}),o&&!y&&!_&&h.jsx("p",{className:"muted",children:"正在打开加密屏幕通道…"}),y&&h.jsx("iframe",{ref:S,title:"电脑屏幕",sandbox:"allow-scripts allow-pointer-lock",allow:"autoplay; fullscreen",srcDoc:y})]})}function IM({session:n,navigate:t}){const s=co(),r=Lt(),{store:o,link:l}=r,u=Jn(),d=Wt(),m=yt(se=>se.views[n.id]),p=yt(se=>se.ready[n.id]),b=yt(se=>se.status==="online"),v=yt(se=>se.loadingEarlier[n.id]),y=yt(se=>se.machine?.agents.find(Re=>Re.id===n.agent)),E=yt(se=>se.queueing[n.id]),_=x.useMemo(()=>SM(n.agent,m?.commands??[],m?.config??[]),[n.agent,m?.commands,m?.config]),T=`draft.${r.computer.key}.${n.id}`,[S,C]=x.useState(()=>Gs(T,"")),[j,k]=x.useState([]),[A,R]=x.useState([]),[O,M]=x.useState(null),[z,L]=x.useState(),[V,q]=x.useState(),[Y,X]=x.useState(),[ee,re]=x.useState(!1),[U,$]=x.useState(0),[W,J]=x.useState(),[Q,pe]=x.useState(!1),G=x.useRef(null),te=x.useRef(null),de=x.useRef(null),ce=x.useRef(!0),ie=x.useRef(S);ie.current=S;const[we,me]=x.useState(),he=we===S?void 0:xM(S),De=he===void 0?[]:OE(_,he).slice(0,10),Oe=gR(n.queue,E),Me=(se,Re)=>{L(se),q(Re),M("files")};x.useEffect(()=>l.on("session.preview.show",se=>{se.sessionId===n.id&&M("preview")}),[l,n.id]),x.useEffect(()=>(o.getState().openSession(n.id),()=>o.getState().closeSession(n.id)),[o,n.id]),x.useEffect(()=>{const se=de.current;ce.current&&se&&se.scrollTo({top:se.scrollHeight})},[m?.items,m?.permissions]),x.useEffect(()=>{try{ua(T,S)}catch{}},[T,S]),x.useEffect(()=>{$(0)},[he]);async function He(se){const Re=y1(se),$e=Re&&_.find(gt=>gt.name===Re.name);if(!Re||!$e?.action)return!1;const Je=Re.args;switch($e.action){case"commands":M("commands");break;case"tasks":M("tasks");break;case"changes":M("changes");break;case"context":await s.alert(m?.usage?.contextWindow?`${m.usage.usedTokens??0} / ${m.usage.contextWindow} tokens`:"Agent 尚未报告上下文用量");break;case"goal":if(Je&&Je!=="edit")return!1;M("goal");break;case"settings":{const gt=m?.config.find(er=>er.id===$e.optionId);if($e.name==="plan"&&!Je&>)await u.setConfig(n.id,gt.id,gt.id==="plan"?"on":"plan");else if(!Je||!gt)M("settings");else{const er=gt.values.find($t=>$t.value.toLowerCase()===Je.toLowerCase()||$t.name.toLowerCase()===Je.toLowerCase());if(er)await u.setConfig(n.id,gt.id,er.value);else if($e.name==="plan"){if(await u.setConfig(n.id,gt.id,gt.id==="plan"?"on":"plan"),await u.send(n.id,[{type:"text",text:Je}])==="failed")throw new Error("任务发送失败,请重试")}else throw new Error(`可选值:${gt.values.map($t=>$t.value).join("、")}`)}break}case"rename":{const gt=Je||await s.prompt("会话名称",Cr(n));gt!==null&&await u.rename(n.id,gt);break}case"new":{if(Je)throw new Error("请先新建会话,再输入消息");const gt=await u.createSession({agent:n.agent,cwd:n.cwd});t(gt.id);break}case"fork":if(Je)throw new Error("/fork 不需要参数");J(null);break}return!0}function ze(se){M(null),se.action?(d.run(()=>He(`/${se.name}`)),C("")):(C(`/${se.name} `),G.current?.focus())}async function ht(se=!1){const Re=wM(ie.current).trim();if(!b||!Re&&!j.length&&!A.length)return;if(!j.length&&!A.length&&await He(Re)){ie.current===S&&C("");return}const $e=[...A];Re&&$e.unshift({type:"text",text:Re});for(const $t of j){const At=await pg($t);if(/^image\/(png|jpe?g|webp|gif)$/.test($t.type)&&y?.capabilities.images)$e.push({type:"image",mimeType:$t.type,data:At});else{const kd=await l.call("fs.upload",{dir:n.cwd,name:$t.name,data:At},18e4);$e.push({type:"resource_link",uri:kd.path,name:$t.name})}}const Je=y1(Re),gt=se||n.agent==="codex"&&!!Je&&["mcp","apps","status","ps","stop","goal"].includes(Je.name);if(await u.send(n.id,$e,{now:gt})==="failed")throw new Error("发送失败,消息可在会话中重试;输入已保留");ie.current.trim()===S.trim()&&C(""),k($t=>$t.filter(At=>!j.includes(At))),R($t=>$t.filter(At=>!A.includes(At))),ce.current=!0}function qn(se){M(se),d.run(async()=>{if(await u.send(n.id,[{type:"text",text:`/${se}`}],{now:!0})==="failed")throw new Error(`/${se} 执行失败`)})}return h.jsx(DE.Provider,{value:{cwd:n.cwd,open:Me},children:h.jsxs("div",{className:"session-page live-session",children:[h.jsxs("div",{className:"session-heading",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"session-title",children:[h.jsx("h1",{children:Cr(n)}),h.jsx(Ur,{state:n.state})]}),h.jsxs("div",{className:"session-subtitle",children:[h.jsx(Cd,{agent:n.agent}),h.jsx("span",{children:n.agent}),h.jsx("span",{className:"separator",children:"/"}),h.jsx("span",{title:n.cwd,children:n.cwd}),n.worktree&&h.jsx("span",{className:"branch-chip",children:n.worktree.branch})]})]}),h.jsxs("div",{className:"session-actions",children:[h.jsx("button",{className:"icon-button","aria-label":"会话命令",onClick:()=>M("commands"),children:h.jsx(_t,{name:"terminal"})}),h.jsx("button",{className:"icon-button","aria-label":"会话设置",onClick:()=>M("settings"),children:h.jsx(_t,{name:"settings"})}),h.jsxs(pM,{children:[h.jsx(gM,{asChild:!0,children:h.jsx("button",{className:"icon-button","aria-label":"会话操作",children:"•••"})}),h.jsxs(vM,{align:"end",className:"w-56",children:[h.jsxs(v1,{children:[h.jsx(Ln,{onSelect:()=>M("changes"),children:"文件变更"}),h.jsx(Ln,{onSelect:()=>{L(void 0),M("files")},children:"项目文件"}),h.jsx(Ln,{onSelect:()=>M("tasks"),children:"后台任务与子 Agent"}),h.jsx(Ln,{onSelect:()=>M("preview"),children:"电脑操作预览"}),_.some(se=>se.name==="goal")&&h.jsx(Ln,{onSelect:()=>M("goal"),children:"持续目标"}),_.some(se=>se.name==="mcp")&&h.jsx(Ln,{onSelect:()=>qn("mcp"),children:"MCP 服务"}),_.some(se=>se.name==="apps")&&h.jsx(Ln,{onSelect:()=>qn("apps"),children:"应用与连接器"}),h.jsx(Ln,{onSelect:()=>re(!0),children:"终端"})]}),h.jsx(yM,{}),h.jsxs(v1,{children:[h.jsx(Ln,{onSelect:()=>J(null),children:"分叉会话"}),h.jsx(Ln,{onSelect:()=>void d.run(()=>He("/rename")),children:"重命名"}),h.jsx(Ln,{onSelect:()=>void d.run(()=>u.archive(n.id,!n.archived)),children:n.archived?"取消归档":"归档"}),h.jsx(Ln,{variant:"destructive",disabled:n.state==="running",onSelect:()=>void d.run(async()=>{let se;if(n.worktree){const $e=(await u.listWorktrees()).find(Je=>Je.sessions.includes(n.id));if($e&&$e.sessions.length===1&&($e.dirty||$e.ahead>0)){const Je=await s.choose(`删除「${Cr(n)}」?worktree 还有${$e.ahead?` ${$e.ahead} 个新提交`:""}${$e.dirty?" 未提交改动":""}。Agent 原始会话记录也会删除。`,[{value:"keep",label:"保留 worktree"},{value:"remove",label:"一起删除改动与分支",destructive:!0}]);if(!Je)return;se=Je}else if(!await s.confirm(`永久删除「${Cr(n)}」?Agent 原始会话记录和此会话独占的干净 worktree 会一起删除。`))return}else if(!await s.confirm(`永久删除「${Cr(n)}」?Agent 原始会话记录也可能被删除。`))return;await u.deleteSession(n.id,se),t("home")}),children:"删除会话"})]})]})]})]})]}),y?.tier==="handoff"&&h.jsxs("div",{className:"handoff-bar",children:[h.jsxs("span",{children:["当前由",n.driver==="desktop"?"电脑端":n.driver==="remote"?"远程端":"空闲会话","控制"]}),h.jsx("button",{className:"text-button",disabled:!b||d.busy,onClick:()=>void d.run(()=>n.driver==="remote"?u.release(n.id):u.takeover(n.id)),children:n.driver==="remote"?"交回电脑":"接管会话"})]}),h.jsxs("div",{className:`session-layout ${O&&O!=="commands"?"with-panel":""}`,children:[h.jsxs("div",{className:"conversation-column",children:[h.jsxs("div",{className:"conversation",ref:de,onScroll:()=>{const se=de.current;ce.current=!!se&&se.scrollHeight-se.scrollTop-se.clientHeight<100},children:[!p&&h.jsx("p",{className:"muted",children:"正在加载会话…"}),m&&m.startSeq>0&&h.jsx("button",{className:"text-button",disabled:v,onClick:()=>void d.run(()=>u.loadEarlier(n.id)),children:"加载更早的历史"}),m&&h.jsx(mg,{items:m.items,sessionId:n.id,agent:n.agent,onFile:Me,onFork:J,onTerminal:se=>{X(se),re(!0)}}),m?.permissions.map(se=>h.jsx(RE,{permission:se,sessionId:n.id},se.requestId))]}),Y&&!ee&&h.jsxs("div",{className:"inline-terminal",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("span",{children:"终端"}),h.jsx("button",{className:"text-button",onClick:()=>X(void 0),children:"收起"})]}),h.jsx(LE,{id:Y},Y)]}),h.jsxs("div",{className:"composer-wrap",children:[h.jsx(Dt,{error:d.error}),Oe.length>0&&h.jsxs("div",{className:"message-queue",children:[h.jsxs("strong",{children:["待发送 · ",Oe.length]}),Oe.map((se,Re)=>h.jsxs("div",{children:[h.jsx("span",{children:se.text||`${se.images} 张图片`}),h.jsx("button",{disabled:d.busy||!b||se.pending,onClick:()=>void d.run(()=>u.sendQueuedNow(n.id,se.clientMessageId)),children:"立即发送"}),h.jsx("button",{disabled:d.busy||!b||se.pending,onClick:()=>void d.run(async()=>{const $e=await u.takeQueued(n.id,se.clientMessageId);$e&&(C($e.filter(Je=>Je.type==="text").map(Je=>Je.text).join(`
|
|
185
|
+
`)),R($e.filter(Je=>Je.type!=="text")))}),children:"编辑"}),h.jsx("button",{"aria-label":"上移队列消息",disabled:!Re||d.busy||!b||se.pending,onClick:()=>void d.run(()=>{const $e=Oe.filter(Je=>!Je.pending).map(Je=>Je.clientMessageId);return[$e[Re-1],$e[Re]]=[$e[Re],$e[Re-1]],u.reorderQueue(n.id,$e)}),children:"↑"}),h.jsx("button",{disabled:d.busy||!b||se.pending,onClick:()=>void d.run(()=>u.unqueue(n.id,se.clientMessageId)),children:"移除"})]},se.clientMessageId))]}),h.jsxs(IR,{open:he!==void 0,onOpenChange:se=>{se||me(S)},children:[h.jsx(HR,{side:"top",align:"start",sideOffset:8,collisionPadding:12,"aria-label":"命令建议",className:"w-(--radix-popover-trigger-width) max-h-(--radix-popover-content-available-height) overflow-hidden p-0",onOpenAutoFocus:se=>se.preventDefault(),onCloseAutoFocus:se=>se.preventDefault(),onInteractOutside:se=>{se.target===G.current&&se.preventDefault()},children:h.jsx(EE,{className:"h-auto",shouldFilter:!1,value:De[U]?.name??"",onValueChange:se=>{const Re=De.findIndex($e=>$e.name===se);Re>=0&&$(Re)},children:h.jsxs(_E,{"aria-label":"命令建议",className:"max-h-[min(18rem,35dvh,var(--radix-popover-content-available-height))]",children:[h.jsx(CE,{children:"没有匹配项,可打开命令面板查看全部。"}),h.jsx(AE,{children:De.map(se=>h.jsxs(jE,{value:se.name,onMouseDown:Re=>Re.preventDefault(),onSelect:()=>ze(se),children:[h.jsxs("strong",{children:["/",se.name]}),h.jsx("span",{className:"text-muted-foreground",children:se.description})]},se.name))})]})})}),h.jsx(VR,{asChild:!0,children:h.jsxs("div",{className:"composer",onDragOver:se=>se.preventDefault(),onDrop:se=>{se.preventDefault(),k(Re=>[...Re,...Array.from(se.dataTransfer.files)])},children:[h.jsxs("div",{className:"attachment-list",children:[j.map((se,Re)=>h.jsxs("span",{children:[se.name,h.jsx("button",{"aria-label":`移除附件 ${se.name}`,onClick:()=>k($e=>$e.filter((Je,gt)=>gt!==Re)),children:"×"})]},`${se.name}-${Re}`)),A.length>0&&h.jsxs("span",{children:[A.length," 个已有附件",h.jsx("button",{onClick:()=>R([]),children:"×"})]})]}),h.jsx("textarea",{ref:G,"aria-label":"消息",value:S,onChange:se=>C(se.target.value),placeholder:b?"发送消息,输入 / 选择命令或技能…":"连接已断开,可以继续编辑草稿…",rows:2,onPaste:se=>{const Re=Array.from(se.clipboardData.files);Re.length&&(se.preventDefault(),k($e=>[...$e,...Re]))},onKeyDown:se=>{if(!se.nativeEvent.isComposing){if(se.key==="Escape"&&he!==void 0){se.preventDefault(),me(S);return}De.length&&["ArrowDown","ArrowUp"].includes(se.key)?(se.preventDefault(),$(Re=>(Re+(se.key==="ArrowDown"?1:De.length-1))%De.length)):se.key==="Enter"&&!se.shiftKey&&(se.preventDefault(),De.length?ze(De[U]??De[0]):d.run(()=>ht(se.metaKey||se.ctrlKey)))}}}),h.jsxs("div",{className:"composer-toolbar",children:[h.jsxs("div",{children:[h.jsx("input",{ref:te,type:"file",multiple:!0,hidden:!0,onChange:se=>{k(Re=>[...Re,...Array.from(se.target.files??[])]),se.target.value=""}}),h.jsx("button",{className:"icon-button","aria-label":"添加附件",onClick:()=>te.current?.click(),children:h.jsx(_t,{name:"attach"})}),h.jsx("button",{className:"icon-button","aria-label":"打开命令面板",onClick:()=>M("commands"),children:"/"}),h.jsx("button",{className:"composer-agent",onClick:()=>M("settings"),children:n.model??"模型与权限"}),m?.usage?.contextWindow&&h.jsxs("span",{className:"context-meter",title:"上下文用量",children:[Math.round((m.usage.usedTokens??0)/m.usage.contextWindow*100),"%"]})]}),h.jsxs("div",{children:[m?.turnActive&&y?.capabilities.interrupt&&h.jsx("button",{className:"icon-button","aria-label":"停止当前回合",disabled:!b||d.busy,onClick:()=>void d.run(()=>u.cancel(n.id)),children:h.jsx(_t,{name:"stop"})}),m?.turnActive&&y?.capabilities.steer&&h.jsx("button",{className:"text-button",disabled:!b||d.busy||!S.trim(),onClick:()=>void d.run(()=>ht(!0)),children:"插话"}),h.jsx("button",{className:"send-button","aria-label":m?.turnActive?"加入发送队列":"发送消息",disabled:!b||d.busy||!S.trim()&&!j.length&&!A.length,onClick:()=>void d.run(()=>ht()),children:h.jsx(_t,{name:"send"})})]})]})]})})]}),h.jsxs("div",{className:"composer-caption",children:[h.jsx("span",{children:"Enter 发送 · Shift Enter 换行 · / 命令"}),h.jsx("span",{children:b?"端到端加密":"草稿已保留"})]})]})]}),O&&O!=="commands"&&h.jsxs("aside",{className:"live-side-panel",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("strong",{children:{settings:"会话设置",changes:"变更",files:"文件",tasks:"任务",goal:"目标",mcp:"MCP 服务",apps:"应用",preview:"电脑操作预览"}[O]}),h.jsx("button",{className:"icon-button","aria-label":"关闭面板",onClick:()=>M(null),children:h.jsx(_t,{name:"close"})})]}),h.jsxs("div",{className:"side-panel-content",children:[O==="settings"&&h.jsx(AM,{session:n,view:m}),O==="changes"&&h.jsx(jM,{view:m}),O==="files"&&(z?h.jsxs(h.Fragment,{children:[h.jsx("button",{className:"text-button",onClick:()=>L(void 0),children:"返回文件列表"}),h.jsx(zE,{line:V,path:z},z)]}):h.jsx(gg,{start:n.cwd})),O==="tasks"&&h.jsx(kM,{session:n,onFile:Me,onTerminal:X}),O==="goal"&&h.jsx(TM,{session:n,view:m}),O==="preview"&&h.jsx(UM,{sessionId:n.id}),(O==="mcp"||O==="apps")&&h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"muted",children:["由电脑上的 ",n.agent," ","提供。完整结果、授权请求和错误同时显示在会话中。"]}),h.jsxs("button",{className:"button secondary",disabled:!b||d.busy,onClick:()=>qn(O),children:["刷新 /",O]}),m?.items.filter(se=>se.kind==="notice"&&se.title===`/${O}`).slice(-1).map(se=>se.kind==="notice"&&h.jsx("pre",{className:"service-status",children:se.detail??"当前没有记录"},se.id))]})]})]})]}),O==="commands"&&h.jsx(CM,{returnFocus:()=>G.current?.focus(),commands:_,close:()=>M(null),choose:ze}),W!==void 0&&h.jsxs(El,{title:"分叉会话",close:()=>J(void 0),children:[h.jsx("p",{className:"muted",children:W?"从选中的消息开始一段新会话。":"保留当前上下文,创建独立的新会话。"}),h.jsxs("label",{className:"choice-option",children:[h.jsx("input",{type:"checkbox",checked:Q,onChange:se=>pe(se.target.checked)}),"在新的 worktree 中工作"]}),h.jsx(Dt,{error:d.error}),h.jsx("button",{className:"button primary",disabled:d.busy||!b,onClick:()=>void d.run(async()=>{const se=await u.forkSession(n.id,{itemId:W??void 0,worktree:Q});J(void 0),t(se.id)}),children:"创建分叉"})]}),ee&&h.jsx(El,{wide:!0,title:"终端",close:()=>re(!1),children:h.jsx(UE,{cwd:n.cwd,selected:Y,onSelect:X})})]})})}const Am=n=>{for(let t=0;t<n.length-1;t++)if(n[t]===13&&n[t+1]===10)return t;return-1};class HM{constructor(t,s,r){this.headOnly=t,this.onHead=s,this.onData=r}buffer=new Uint8Array;started=!1;remaining;chunked=!1;chunk;delimiter=!1;trailers=!1;done=!1;push(t){if(!this.done){if(this.buffer=to([this.buffer,t]),!this.started){const r=new TextDecoder("latin1").decode(this.buffer).indexOf(`\r
|
|
186
|
+
\r
|
|
187
|
+
`);if(r<0){if(this.buffer.length>65536)throw new Error("HTTP 响应头过大");return}const o=BE(this.buffer.slice(0,r+4),!0);if(this.buffer=this.buffer.slice(r+4),o.status>=100&&o.status<200){this.push(new Uint8Array);return}this.started=!0,this.chunked=o.headers.some(([u,d])=>u==="transfer-encoding"&&/chunked/i.test(d));const l=o.headers.find(([u])=>u==="content-length")?.[1];if(l!==void 0&&!this.chunked){if(!/^\d+$/.test(l))throw new Error("无效的响应长度");this.remaining=Number(l)}if(this.onHead({status:o.status,headers:o.headers}),this.headOnly||[204,205,304].includes(o.status)){this.done=!0;return}}if(!this.chunked){const s=this.remaining===void 0?this.buffer.length:Math.min(this.remaining,this.buffer.length);s&&this.onData(this.buffer.slice(0,s)),this.buffer=this.buffer.slice(s),this.remaining!==void 0&&(this.remaining-=s,this.remaining===0&&(this.done=!0));return}for(;this.buffer.length;){if(this.trailers){const r=Am(this.buffer);if(r<0)return;if(this.buffer=this.buffer.slice(r+2),r===0){this.done=!0;return}continue}if(this.delimiter){if(this.buffer.length<2)return;if(Am(this.buffer)!==0)throw new Error("无效的 HTTP 分块边界");this.buffer=this.buffer.slice(2),this.delimiter=!1}if(this.chunk===void 0){const r=Am(this.buffer);if(r<0)return;const o=new TextDecoder().decode(this.buffer.slice(0,r)).split(";")[0];if(!/^[0-9a-f]+$/i.test(o))throw new Error("无效的 HTTP 分块长度");if(this.chunk=parseInt(o,16),!Number.isSafeInteger(this.chunk))throw new Error("HTTP 分块过大");if(this.buffer=this.buffer.slice(r+2),this.chunk===0){this.trailers=!0;continue}}const s=Math.min(this.chunk,this.buffer.length);if(s&&this.onData(this.buffer.slice(0,s)),this.buffer=this.buffer.slice(s),this.chunk-=s,this.chunk===0)this.chunk=void 0,this.delimiter=!0;else return}}}end(){if(!this.started||!this.done&&(this.chunked||(this.remaining??0)>0))throw new Error("HTTP 响应被截断");this.done=!0}}function VM(n,t,s,r,o,l,u){return!s.startsWith("/")||/[\r\n]/.test(s)||!/^[A-Z]+$/.test(r)?Promise.reject(new Error("无效的预览请求")):new Promise((d,m)=>{let p,b=!1,v,y;const E=new ReadableStream({start(j){y=j},cancel(){T(new Error("预览请求已取消"))}}),_=()=>T(new Error("预览请求已取消"));function T(j){b||(b=!0,clearTimeout(v),u.removeEventListener("abort",_),p?.close(),j?(m(j),y.error(j)):y.close())}const S=new HM(r==="HEAD",j=>d({...j,body:E}),j=>y.enqueue(new Uint8Array(j))),C=()=>{clearTimeout(v),v=setTimeout(()=>T(new Error("预览响应超时")),6e4)};if(u.addEventListener("abort",_,{once:!0}),u.aborted){_();return}C(),n.open(t,{data(j){if(!b)try{C(),S.push(j),S.done&&T()}catch(k){T(k instanceof Error?k:new Error(String(k)))}},closed(j){if(!b)try{if(j)throw new Error(j);S.end(),T()}catch(k){T(k instanceof Error?k:new Error(String(k)))}}}).then(j=>{if(b){j.close();return}p=j;const k=o.filter(([A,R])=>!/[\r\n]/.test(A+R)&&!/^(host|connection|content-length|transfer-encoding|accept-encoding|origin|referer)$/i.test(A));j.write(new TextEncoder().encode(`${r} ${s} HTTP/1.1\r
|
|
188
|
+
Host: 127.0.0.1:${t}\r
|
|
189
|
+
Connection: close\r
|
|
190
|
+
Accept-Encoding: identity\r
|
|
191
|
+
Content-Length: ${l.length}\r
|
|
192
|
+
${k.map(([A,R])=>`${A}: ${R}\r
|
|
193
|
+
`).join("")}\r
|
|
194
|
+
`)),l.length&&j.write(l)},j=>T(new Error(String(j))))})}function qM(){const n=window.__LINKSHELL_CONFIG__?.previewOrigin,t=void 0;if(!n&&!t)return;const s=new URL(n??t);if(!(s.origin===location.origin||!["http:","https:"].includes(s.protocol)||s.username||s.password)&&!(location.protocol==="https:"&&s.protocol!=="https:"))return s.origin}function $M({port:n}){const{streams:t}=Lt(),s=x.useRef(null),[r,o]=x.useState(),[l]=x.useState(()=>crypto.randomUUID()),u=qM();return x.useEffect(()=>{if(!u)return;let d=!0;const m=new Map,p=new Set;let b=0;const v=new Map,y=new Map,E=T=>{d&&s.current?.contentWindow?.postMessage({...T,channel:l},u)},_=T=>{if(T.source!==s.current?.contentWindow||T.origin!==u||T.data?.channel!==l)return;const S=T.data;if(S.type==="preview-ready"&&E({type:"preview-init",bootstrap:yp.toString()}),S.type==="http-cancel"&&y.get(S.id)?.abort(),S.type==="http-request"){if(++b>128){b--,E({type:"http-error",id:S.id,error:"同时请求过多"});return}const C=(S.headers??[]).filter(([k])=>!/^(cookie|proxy-authorization)$/i.test(k));v.size&&C.push(["cookie",[...v].map(([k,A])=>`${k}=${A}`).join("; ")]);const j=new AbortController;y.set(S.id,j),VM(t,n,S.path??"/",S.method??"GET",C,S.body?new Uint8Array(S.body):new Uint8Array,j.signal).then(async k=>{for(const[M,z]of k.headers)if(M==="set-cookie"){const L=z.split(";")[0],V=L.indexOf("=");if(V>0){const q=L.slice(0,V);/max-age=0/i.test(z)?v.delete(q):v.set(q,L.slice(V+1))}}let A=k.body;const R=k.headers.find(([M])=>M==="content-encoding")?.[1];if(S.method!=="HEAD"&&![204,205,304].includes(k.status)&&(R==="gzip"||R==="deflate"))A=A.pipeThrough(new DecompressionStream(R));else if(R&&!["identity","gzip","deflate"].includes(R))throw new Error(`预览暂不支持 ${R} 压缩`);E({type:"http-head",id:S.id,status:k.status,headers:k.headers});const O=A.getReader();try{for(;d;){const M=await O.read();if(M.done)break;E({type:"http-chunk",id:S.id,body:M.value})}}finally{O.releaseLock(),d||j.abort()}E({type:"http-end",id:S.id})}).catch(k=>{j.abort(),E({type:"http-error",id:S.id,error:String(k)})}).finally(()=>{y.delete(S.id),b--})}if(S.type==="ws-open"){if(m.has(S.id)||p.has(S.id)||m.size+p.size>=24)return;try{const C=new URL(S.url,u);if(![new URL(u).hostname,"localhost","127.0.0.1"].includes(C.hostname)||!["ws:","wss:"].includes(C.protocol))throw new Error("仅代理当前预览端口的 WebSocket");const k=C.pathname.replace(new RegExp(`^/preview/view/${l}/`),"/")+C.search;p.add(S.id),IE(t,n,k,{open:()=>E({type:"ws-open",id:S.id}),data:A=>E({type:"ws-data",id:S.id,data:A}),close:A=>{p.delete(S.id),m.delete(S.id),E({type:"ws-close",id:S.id,reason:A})}},S.protocols).then(A=>{!d||!p.has(S.id)?A.close():(p.delete(S.id),m.set(S.id,A))},A=>{p.delete(S.id),E({type:"ws-close",id:S.id,reason:String(A)})})}catch(C){E({type:"ws-close",id:S.id,reason:String(C)})}}S.type==="ws-send"&&(typeof S.data=="string"||S.data instanceof ArrayBuffer)&&m.get(S.id)?.send(S.data),S.type==="ws-close"&&(p.delete(S.id),m.get(S.id)?.close(),m.delete(S.id))};return window.addEventListener("message",_),()=>{d=!1,window.removeEventListener("message",_);for(const T of m.values())T.close();p.clear();for(const T of y.values())T.abort();y.clear()}},[t,n,l,u]),u?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{error:r}),h.jsx("iframe",{className:"port-frame",ref:s,title:`端口 ${n} 预览`,src:`${u}/preview/bridge.html#${l}`,sandbox:"allow-scripts allow-same-origin allow-forms allow-downloads allow-modals allow-pointer-lock",allow:"autoplay; fullscreen",onLoad:()=>s.current?.contentWindow?.postMessage({channel:l,type:"preview-init",bootstrap:yp.toString()},u),onError:()=>o("隔离预览页面加载失败,请检查预览域名配置")})]}):h.jsxs("p",{className:"notice-card",children:["此部署尚未配置独立的预览域名。管理员需要设置 ",h.jsx("code",{children:"previewOrigin"})," ","并在该域名部署网页制品中的 preview 目录。开发网页与账号页面隔离,避免项目脚本读取登录凭证。"]})}function PM(){const{link:n}=Lt(),t=ea(()=>n.call("ports.list",{}),[n],1e4),[s,r]=x.useState(),[o,l]=x.useState("");return h.jsxs("section",{className:"ports-page",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("h2",{children:"端口预览"}),h.jsxs("form",{className:"inline-form",onSubmit:u=>{u.preventDefault(),r(Number(o))},children:[h.jsx("input",{"aria-label":"预览端口",type:"number",min:"1",max:"65535",value:o,onChange:u=>l(u.target.value),required:!0,placeholder:"端口号"}),h.jsx("button",{className:"button secondary",children:"打开"})]})]}),h.jsx(ba,{...t}),h.jsx("div",{className:"terminal-tabs",children:t.value?.ports.map(u=>h.jsxs("button",{className:s===u.port?"selected":"",onClick:()=>r(u.port),children:[u.port," · ",u.title??u.process,!u.http&&"(未识别为 HTTP)"]},u.port))}),s?h.jsx($M,{port:s},s):h.jsx("p",{className:"muted",children:"选择电脑上的 HTTP 服务。请求通过加密通道传输。"})]})}const GM=x.lazy(()=>Km(()=>import("./Prototype-B4M4qwtx.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>({default:n.Prototype})));function FM(){return new URLSearchParams(location.search).get("demo")==="1"?h.jsx(x.Suspense,{fallback:h.jsx("p",{children:"加载原型…"}),children:h.jsx(GM,{})}):h.jsx(ZM,{})}function ZM(){const n=xd(Qt.state),[t,s]=x.useState(!1),[r,o]=x.useState(()=>new URLSearchParams(location.hash.slice(1)).get("view")??Gs("lastView","home")),[l,u]=x.useState(!1),[d,m]=x.useState(()=>Gs("theme",matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"));x.useEffect(()=>{Qt.start()},[]),x.useEffect(()=>{document.documentElement.dataset.theme=d,ua("theme",d)},[d]),x.useEffect(()=>{const b=()=>o(new URLSearchParams(location.hash.slice(1)).get("view")??"home");return window.addEventListener("hashchange",b),()=>window.removeEventListener("hashchange",b)},[]);function p(b){ua("lastView",b),location.hash=new URLSearchParams({view:b}).toString(),o(b),u(!1)}return h.jsxs("div",{className:`app-shell ${l?"nav-open":""}`,children:[l&&h.jsx("button",{className:"nav-backdrop","aria-label":"关闭导航",onClick:()=>u(!1)}),h.jsxs("aside",{className:"sidebar",children:[h.jsxs("a",{className:"brand",href:"#home",onClick:b=>{b.preventDefault(),p("home")},children:[h.jsx("img",{src:cx,className:"brand-symbol",alt:""}),"LinkShell",h.jsx("span",{className:"brand-web",children:"web"})]}),h.jsxs("button",{className:"connection-switch",onClick:()=>s(!0),children:[h.jsx("span",{className:"source-icon",children:h.jsx(_t,{name:n.source==="official"?"globe":"server"})}),h.jsxs("span",{children:[h.jsx("strong",{children:n.source==="official"?"官方工作空间":"配对工作空间"}),h.jsx("small",{children:n.source==="official"?n.account??"登录或连接电脑":n.gateway?n.gateway.replace(/^wss?:\/\//,""):"设置你的网关"})]}),h.jsx(_t,{name:"down",size:14})]}),h.jsx("nav",{"aria-label":"主导航",children:[{id:"home",title:"首页",icon:"grid"},{id:"projects",title:"项目",icon:"folder"},{id:"computers",title:"电脑",icon:"computer"},{id:"files",title:"文件",icon:"file"},{id:"terminals",title:"终端",icon:"terminal"},{id:"ports",title:"端口预览",icon:"globe"},{id:"screen",title:"电脑屏幕",icon:"computer"},{id:"worktrees",title:"Worktree",icon:"branch"},{id:"archive",title:"已归档",icon:"clock"}].map(b=>h.jsxs("button",{className:`nav-item ${r===b.id?"active":""}`,onClick:()=>p(b.id),children:[h.jsx(_t,{name:b.icon}),b.title]},b.id))}),h.jsxs("div",{className:"sidebar-bottom",children:[h.jsxs("label",{className:"computer-select-label",children:["当前电脑",h.jsx(bd,{label:"切换电脑",value:n.connection?.computer.key??"",placeholder:"选择电脑",onValueChange:b=>{const v=n.computers.find(y=>y.key===b);v&&(Qt.select(v),p("home"))},options:n.computers.map(b=>({value:b.key,label:`${b.machine.name} · ${b.machine.online?"在线":"离线"}`}))})]}),h.jsxs("button",{className:"profile-button",onClick:()=>s(!0),children:[h.jsx("span",{className:"avatar",children:h.jsx(_t,{name:n.account?"globe":"server"})}),h.jsxs("span",{children:[h.jsx("strong",{children:n.account??"浏览器设备"}),h.jsx("small",{children:n.source==="official"?"账号连接":"配对连接"})]}),h.jsx(_t,{name:"settings"})]})]})]}),h.jsxs("main",{className:"main",children:[h.jsxs("header",{className:"topbar",children:[h.jsxs("div",{className:"breadcrumbs",children:[h.jsx("button",{className:"icon-button mobile-menu","aria-label":"打开导航",onClick:()=>u(!0),children:h.jsx(_t,{name:"menu"})}),h.jsx("strong",{children:n.connection?.computer.machine.name??"LinkShell"}),h.jsx("span",{className:"breadcrumb-slash",children:"/"}),h.jsx("span",{children:"网页工作台"})]}),h.jsxs("div",{className:"topbar-right",children:[h.jsx("button",{className:"icon-button","aria-label":"切换外观",onClick:()=>m(d==="light"?"dark":"light"),children:h.jsx(_t,{name:"moon"})}),h.jsx("button",{className:"button secondary",onClick:()=>s(!0),children:"连接设置"})]})]}),n.error&&h.jsxs("div",{className:"connection-banner",role:"alert",children:[h.jsx("span",{children:n.error}),h.jsx("button",{onClick:()=>{Qt.state.setState({error:void 0}),Qt.reconnect()},children:"重试"}),h.jsx("button",{onClick:()=>Qt.state.setState({error:void 0}),children:"关闭"})]}),n.locked?h.jsxs("div",{className:"welcome-live",children:[h.jsx("h1",{children:"工作台已在另一个标签页打开"}),h.jsx("p",{className:"muted",children:"同一个浏览器设备只保持一条连接,避免标签页相互挤掉。"}),h.jsx("button",{className:"button primary",onClick:()=>void Qt.claim(),children:"在此标签页继续"})]}):n.connection?h.jsx(Y2,{value:n.connection,children:h.jsx(YM,{view:r,navigate:p,connect:()=>s(!0)},n.connection.computer.key)}):h.jsxs("div",{className:"welcome-live",children:[h.jsx("img",{src:cx,alt:"LinkShell"}),h.jsx("h1",{children:"连接你的电脑"}),h.jsx("p",{className:"muted",children:"会话在电脑上运行,网页让你继续对话、审批和操作。"}),h.jsxs("pre",{children:["npm i -g linkshell-cli",`
|
|
195
|
+
`,"linkshell host --daemon"]}),h.jsx("button",{className:"button primary",disabled:!n.ready,onClick:()=>s(!0),children:n.ready?qs==="self-hosted"?"配对电脑":"登录或配对电脑":"正在准备设备身份…"}),h.jsx("p",{className:"muted",children:qs==="self-hosted"?"运行 linkshell pair,输入此网关的配对码即可连接。":"官方服务使用 iTool 账号,自托管使用自己的网关与配对码。"}),n.computers.map(b=>h.jsxs("button",{className:"button secondary",onClick:()=>Qt.select(b),children:[b.machine.name," ·"," ",b.machine.online?"在线":"离线"]},b.key)),h.jsx("a",{className:"text-button",href:"?demo=1",children:"查看独立 UI 演示"})]})]}),t&&h.jsx(BR,{close:()=>s(!1)})]})}function YM({view:n,navigate:t,connect:s}){const r=yt(b=>b),[o,l]=x.useState(),[u,d]=x.useState(),{store:m}=Lt(),p=r.sessions[n];return x.useEffect(()=>{n==="archive"&&m.getState().loadArchived()},[m,n]),h.jsxs(h.Fragment,{children:[r.status!=="online"&&h.jsxs("div",{className:"connection-banner",role:"status",children:[h.jsx("span",{children:r.statusDetail??"正在连接电脑…"}),h.jsx("button",{onClick:()=>Qt.reconnect(),children:"重新连接"})]}),p?h.jsx(IM,{session:p,navigate:t},p.id):h.jsxs("div",{className:"overview live-overview",children:[["home","archive"].includes(n)&&h.jsx(KM,{archived:n==="archive",navigate:t,create:()=>l(null)}),n==="projects"&&h.jsxs("section",{children:[h.jsxs("div",{className:"page-heading",children:[h.jsx("h1",{children:"项目"}),h.jsx("button",{className:"button primary",onClick:()=>l(null),children:"新建会话"})]}),r.projects.map(b=>h.jsxs("article",{className:"notice-card",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("strong",{children:b.name}),h.jsx("span",{className:"muted",children:b.branch}),h.jsx("button",{className:"text-button",onClick:()=>l(b.cwd),children:"在此新建"})]}),h.jsx("p",{className:"muted",children:b.cwd}),h.jsx("div",{className:"task-list",children:Object.values(r.sessions).filter(v=>v.cwd===b.cwd||v.worktree?.source===b.cwd).map(v=>h.jsx(HE,{session:v,open:()=>t(v.id)},v.id))})]},b.cwd))]}),n==="computers"&&h.jsx(QM,{connect:s}),n==="files"&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"文件"}),h.jsx(gg,{})]}),n==="terminals"&&h.jsx(UE,{selected:u,onSelect:d}),n==="worktrees"&&h.jsx(RM,{}),n==="ports"&&h.jsx(PM,{}),n==="screen"&&h.jsx(BM,{}),!["home","archive","projects","computers","files","terminals","worktrees","ports","screen"].includes(n)&&h.jsxs("div",{className:"empty-state",children:[h.jsx("h2",{children:"会话尚未加载或已被移除"}),h.jsx("button",{className:"text-button",onClick:()=>t("home"),children:"返回首页"})]})]}),o!==void 0&&h.jsx(XM,{initialDirectory:o??void 0,close:()=>l(void 0),created:b=>{l(void 0),t(b.id)}})]})}function HE({session:n,open:t}){return h.jsxs("button",{className:"task-row",onClick:t,children:[h.jsxs("span",{className:"row-avatar",children:[h.jsx(Cd,{agent:n.agent}),h.jsx("span",{className:`tiny-status ${n.state}`})]}),h.jsxs("span",{className:"task-info",children:[h.jsx("strong",{children:Cr(n)}),h.jsxs("span",{children:[h.jsx("span",{className:"project-label",children:Wu(n.worktree?.source??n.cwd)}),h.jsx("span",{className:"separator",children:"·"}),h.jsx("span",{className:n.state==="running"?"running-copy":"",children:n.activity?.title??n.preview??n.agent})]})]}),h.jsxs("span",{className:"task-meta",children:[h.jsx("small",{children:new Date(n.updatedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),h.jsx(Ur,{state:n.state})]}),h.jsx(_t,{name:"chevron",size:14})]})}function KM({archived:n,navigate:t,create:s}){const r=yt(v=>v),o=Jn(),[l,u]=x.useState(""),[d,m]=x.useState("all"),p=Wt(),b=Object.values(r.sessions).filter(v=>v.archived===n&&`${Cr(v)} ${v.cwd} ${v.agent} ${v.preview??""}`.toLowerCase().includes(l.toLowerCase())&&(d==="all"||v.state===d)).sort((v,y)=>y.updatedAt-v.updatedAt);return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"page-heading",children:[h.jsxs("div",{children:[h.jsx("h1",{children:n?"已归档":"首页"}),h.jsxs("p",{className:"host-summary",children:[h.jsx("span",{className:r.status==="online"?"online-dot":"offline-dot"}),r.machine?.hostname??"正在连接",h.jsxs("span",{className:"waiting-copy",children:[b.filter(v=>v.state==="waiting").length," ","项需要你"]})]})]}),h.jsxs("button",{className:"button primary",disabled:r.status!=="online",onClick:s,children:[h.jsx(_t,{name:"plus"}),"新建任务"]})]}),h.jsxs("div",{className:"home-controls",children:[h.jsxs("label",{className:"search-box",children:[h.jsx(_t,{name:"search"}),h.jsx("input",{"aria-label":"搜索会话",placeholder:"搜索会话、项目或 Agent",value:l,onChange:v=>u(v.target.value)})]}),h.jsx("div",{className:"filters",children:[{id:"all",name:"全部"},{id:"running",name:"进行中"},{id:"waiting",name:"需要你"},{id:"idle",name:"已完成"}].map(v=>h.jsx("button",{className:d===v.id?"selected":"",onClick:()=>m(v.id),children:v.name},v.id))})]}),h.jsx(Dt,{error:r.sessionsError??p.error}),!r.sessionsLoaded&&!r.sessionsError&&h.jsx("p",{className:"muted",children:"正在加载会话…"}),["waiting","running","recent"].map(v=>{const y=b.filter(E=>v==="recent"?!["waiting","running"].includes(E.state):E.state===v);return y.length?h.jsxs("section",{className:"session-group",children:[h.jsx("div",{className:`section-heading ${v==="waiting"?"waiting-heading":""}`,children:h.jsxs("h2",{children:[v==="waiting"?"需要你":v==="running"?"进行中":"最近",h.jsx("span",{children:y.length})]})}),h.jsx("div",{className:"task-list",children:y.map(E=>h.jsxs("div",{children:[h.jsx(HE,{session:E,open:()=>t(E.id)}),E.permission&&v==="waiting"&&h.jsx(RE,{permission:E.permission,sessionId:E.id})]},E.id))})]},v):null}),r.sessionsLoaded&&!b.length&&h.jsxs("div",{className:"empty-state",children:[h.jsx("h3",{children:l?"没有找到会话":n?"暂无已归档会话":"开始第一个任务"}),h.jsx("p",{children:"会话保存在当前电脑,手机与网页共享同一份记录。"})]}),h.jsx("button",{className:"text-button",disabled:p.busy,onClick:()=>void p.run(()=>o.refresh()),children:"刷新列表"})]})}function XM({initialDirectory:n,close:t,created:s}){const r=yt(z=>z.machine),o=yt(z=>z.projects),l=Jn(),{store:u}=Lt(),d=yt(z=>z.status==="online"),m=Wt(),[p,b]=x.useState(r?.agents.find(z=>z.installed&&!z.problem&&z.auth?.state!=="missing"&&z.tier!=="terminal")?.id??""),[v,y]=x.useState(n??o[0]?.cwd??r?.home??""),[E,_]=x.useState(""),[T,S]=x.useState(!1),[C,j]=x.useState(!1),[k,A]=x.useState(v);x.useEffect(()=>{S(!1);const z=setTimeout(()=>A(v),250);return()=>clearTimeout(z)},[v]);const R=ea(()=>k.trim()?l.gitInfo(k):Promise.resolve(void 0),[u,k]),O=r?.agents.find(z=>z.id===p),M=!!O&&O.installed&&!O.problem&&O.auth?.state!=="missing"&&O.tier!=="terminal";return h.jsx(El,{title:"新建任务",close:t,wide:C,children:C?h.jsx(gg,{start:v,directoriesOnly:!0,onPick:z=>{y(z),j(!1)}}):h.jsxs("form",{className:"new-form",onSubmit:z=>{z.preventDefault(),!(!d||!M||!v.trim())&&m.run(async()=>s(await l.createSession({agent:p,cwd:v,worktree:T&&!!R.value&&k===v,prompt:E.trim()?[{type:"text",text:E.trim()}]:void 0})))},children:[h.jsxs("label",{children:["任务描述",h.jsx("textarea",{value:E,onChange:z=>_(z.target.value),rows:4,placeholder:"想让 Agent 完成什么?"})]}),h.jsxs("label",{children:["Agent",h.jsx(bd,{label:"Agent",value:p,onValueChange:b,options:(r?.agents??[]).map(z=>({value:z.id,label:z.label+(z.installed?z.auth?.state==="missing"?" · 未登录":z.tier==="terminal"?" · 请从终端打开":z.problem?` · ${z.problem}`:"":" · 未安装"),disabled:!z.installed||!!z.problem||z.auth?.state==="missing"||z.tier==="terminal"}))})]}),h.jsxs("label",{children:["工作目录",h.jsx("input",{value:v,onChange:z=>y(z.target.value),required:!0})]}),h.jsx("button",{type:"button",className:"text-button",onClick:()=>j(!0),children:"浏览电脑目录"}),R.value&&k===v&&h.jsxs("label",{className:"choice-option",children:[h.jsx("input",{type:"checkbox",checked:T,onChange:z=>S(z.target.checked)}),"在新 worktree 中工作"]}),h.jsx(Dt,{error:m.error}),h.jsx("button",{className:"button primary full",disabled:m.busy||!d||!M||!v.trim(),children:"创建任务"})]})})}function QM({connect:n}){const t=co(),s=xd(Qt.state),r=yt(d=>d.machine),{link:o}=Lt(),l=Wt(),u=ea(()=>o.call("gateway.status",{}),[o],1e4);return h.jsxs("section",{children:[h.jsxs("div",{className:"page-heading",children:[h.jsx("h1",{children:"电脑"}),h.jsx("button",{className:"button primary",onClick:n,children:"添加电脑"})]}),h.jsx(Dt,{error:l.error}),s.computers.map(d=>h.jsxs("article",{className:"notice-card",children:[h.jsxs("div",{className:"browser-toolbar",children:[h.jsx(_t,{name:"computer"}),h.jsx("strong",{children:d.machine.name}),h.jsx("span",{className:"muted",children:d.machine.online?"在线":"离线"}),h.jsx("button",{className:"text-button",onClick:()=>Qt.select(d),children:"切换到此电脑"}),h.jsx("button",{className:"text-button danger-text",onClick:async()=>{await t.confirm(`移除「${d.machine.name}」的连接关系?需要时可重新登录或配对。`)&&l.run(()=>Qt.forget(d))},children:"移除"})]}),h.jsx("p",{className:"muted",children:d.gateway})]},d.key)),h.jsx("h2",{children:"当前电脑"}),h.jsxs("p",{className:"muted",children:[r?.hostname," · ",r?.platform," · Host ",r?.hostVersion]}),h.jsx("h3",{children:"Agent"}),h.jsx("div",{className:"agent-list",children:r?.agents.map(d=>h.jsxs("article",{children:[h.jsx(Cd,{agent:d.id}),h.jsxs("div",{children:[h.jsx("strong",{children:d.label}),h.jsxs("p",{children:[d.installed?d.version??"已安装":"未安装"," ·"," ",d.auth?.state==="ok"?"已登录":d.auth?.state==="missing"?"需要登录":"登录状态未知"]}),(d.problem||d.auth?.hint)&&h.jsx("p",{className:"muted",children:d.problem??d.auth?.hint})]})]},d.id))}),h.jsx("h3",{children:"配对设备"}),h.jsx(ba,{...u}),u.value?.devices.map(d=>h.jsx("article",{className:"notice-card",children:h.jsxs("div",{className:"browser-toolbar",children:[h.jsx("strong",{children:d.name}),h.jsx("span",{className:"muted",children:d.online?"在线":"离线"}),h.jsx("button",{className:"text-button danger-text",onClick:async()=>{await t.confirm(`撤销「${d.name}」的配对?该设备将需要重新配对。`)&&l.run(async()=>{await o.call("devices.revoke",{deviceId:d.id}),u.reload()})},children:"撤销配对"})]})},d.id))]})}const WM=["#4a6cf7","#7d95ff"],JM=["rgba(74,108,247,0.11)","rgba(125,149,255,0.18)"],e8=["#4a6cf7","#7d95ff"],t8=["rgba(232,131,12,0.12)","rgba(255,166,61,0.16)"],n8=["rgba(15,149,96,0.12)","rgba(61,214,140,0.15)"],a8=["rgba(220,61,61,0.10)","rgba(255,107,107,0.15)"],s8=["#F0F0F4","#26262B"],r8=["#f1f1f6","#1c1c22"],i8=["#2a2b35","#e4e4ec"],o8=["rgba(15,149,96,0.12)","rgba(61,214,140,0.14)"],l8=["rgba(220,61,61,0.10)","rgba(255,107,107,0.14)"],c8=["#0b7a4f","#7fddb4"],u8=["#b42f2f","#ff9a9a"],d8=["#000000","#FFFFFF"],f8=["rgba(60,60,67,0.6)","rgba(235,235,245,0.6)"],h8=["rgba(60,60,67,0.3)","rgba(235,235,245,0.3)"],m8=["rgba(60,60,67,0.3)","rgba(235,235,245,0.3)"],p8=["rgba(60,60,67,0.18)","rgba(84,84,88,0.6)"],g8=["#F2F2F7","#000000"],v8=["#FFFFFF","#1C1C1E"],y8=["#FFFFFF","#2C2C2E"],b8=["#F2F2F7","#1C1C1E"],x8=["#FFFFFF","#000000"],w8=["rgba(118,118,128,0.12)","rgba(118,118,128,0.24)"],S8=["rgba(120,120,128,0.16)","rgba(120,120,128,0.32)"],E8=["#E8830C","#FF9F0A"],_8=["#0F9560","#30D158"],C8=["#DC3D3D","#FF453A"],A8=["#F2F2F7","#1C1C1E"],j8=["#FFFFFF","#2C2C2E"],T8={accent:WM,accentSoft:JM,running:e8,waitingSoft:t8,okSoft:n8,dangerSoft:a8,userBubble:s8,code:r8,codeText:i8,diffAdd:o8,diffDel:l8,diffAddText:c8,diffDelText:u8,label:d8,secondaryLabel:f8,tertiaryLabel:h8,placeholder:m8,separator:p8,background:g8,card:v8,cardRaised:y8,inset:b8,plain:x8,fill:w8,fillStrong:S8,waiting:E8,ok:_8,danger:C8,sheet:A8,sheetCard:j8},jm=n=>Object.entries(T8).map(([t,s])=>`--${t}: ${s[n]};`).join(`
|
|
196
|
+
`),k8=`
|
|
197
|
+
:root { ${jm(0)} color-scheme: light; }
|
|
198
|
+
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { ${jm(1)} color-scheme: dark; } }
|
|
199
|
+
:root[data-theme="dark"] { ${jm(1)} color-scheme: dark; }
|
|
200
|
+
`;Q6.createRoot(document.getElementById("root")).render(h.jsxs(cl.StrictMode,{children:[h.jsx("style",{children:k8}),h.jsx(F6,{children:h.jsx(FM,{})})]}));export{bd as C,_t as I,El as M,Km as _,cx as a,zR as b,qs as d,tN as i,Er as o,om as v};
|