kcg-code 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/chunk-0k94bd7w.js +1 -0
- package/dist/web/chunk-1hsbtrt7.js +1 -0
- package/dist/web/chunk-1w20559j.js +2 -0
- package/dist/web/chunk-2g1d0p8k.js +1 -0
- package/dist/web/chunk-2y991ert.js +1 -0
- package/dist/web/chunk-3zr9b6sh.js +1 -0
- package/dist/web/chunk-4587k1kk.js +1 -0
- package/dist/web/chunk-4n8esv61.js +2 -0
- package/dist/web/chunk-5a2wt1wn.js +1 -0
- package/dist/web/chunk-6f4fhpq5.js +1 -0
- package/dist/web/chunk-70gs5473.js +2 -0
- package/dist/web/chunk-7fh46gy9.js +1 -0
- package/dist/web/chunk-7hpamxpk.js +1 -0
- package/dist/web/chunk-7k2ksd6m.js +1 -0
- package/dist/web/chunk-7r3qwgvk.js +1 -0
- package/dist/web/chunk-7vp7mn8t.js +1 -0
- package/dist/web/chunk-7zd31pph.js +2 -0
- package/dist/web/chunk-98m1ye59.js +1 -0
- package/dist/web/chunk-99ac747k.js +98 -0
- package/dist/web/chunk-9e08jfg6.js +1 -0
- package/dist/web/chunk-a4kekjaw.js +2 -0
- package/dist/web/chunk-a7dtx8vc.js +2 -0
- package/dist/web/chunk-aat7sg2w.js +2 -0
- package/dist/web/chunk-adfxb1sz.js +141 -0
- package/dist/web/chunk-c29x9yr7.js +1 -0
- package/dist/web/chunk-c84m5n2b.js +1 -0
- package/dist/web/chunk-deqmvh2y.js +1 -0
- package/dist/web/chunk-dwa0v44t.js +1 -0
- package/dist/web/chunk-ewkw0yxq.js +1 -0
- package/dist/web/chunk-fwhn9kja.js +1 -0
- package/dist/web/chunk-gzmwacrs.js +1 -0
- package/dist/web/chunk-jcnm8ap3.js +1 -0
- package/dist/web/chunk-jhww4q3p.css +1 -0
- package/dist/web/chunk-jt618p78.js +1 -0
- package/dist/web/chunk-k74h7e4d.js +2 -0
- package/dist/web/chunk-n2293q4w.js +2 -0
- package/dist/web/chunk-neqyf1jm.js +1 -0
- package/dist/web/chunk-nnhyekc9.js +1 -0
- package/dist/web/chunk-p5m4kcyp.js +1 -0
- package/dist/web/chunk-pae7wjqv.js +1 -0
- package/dist/web/chunk-pbh1r1h9.js +2 -0
- package/dist/web/chunk-qnky191x.js +1 -0
- package/dist/web/chunk-rachd7gd.js +1 -0
- package/dist/web/chunk-rcvsf7wj.js +2 -0
- package/dist/web/chunk-rj1164tm.js +1 -0
- package/dist/web/chunk-s0wykzpf.js +1 -0
- package/dist/web/chunk-sm5g3apm.js +1 -0
- package/dist/web/chunk-srr11f10.js +2 -0
- package/dist/web/chunk-tsyvyw54.js +2 -0
- package/dist/web/chunk-twh19bw5.js +2 -0
- package/dist/web/chunk-v0b1rz8b.js +1 -0
- package/dist/web/chunk-vcj3m7wp.js +1 -0
- package/dist/web/chunk-wqjjkgh9.js +1 -0
- package/dist/web/chunk-xgcdt3gc.js +2 -0
- package/dist/web/chunk-yenm06gj.js +1 -0
- package/dist/web/chunk-yvhjz3k7.js +12 -0
- package/dist/web/chunk-yymd449s.js +1 -0
- package/dist/web/chunk-z5ns215x.js +2 -0
- package/dist/web/index.html +14 -0
- package/dist/web/logo-sg2x36yb.svg +31 -0
- package/dist/web/logo.svg +1 -0
- package/dist/web/manifest.json +18 -0
- package/dist/web/sw.js +67 -0
- package/package.json +4 -3
- package/public/sw.js +20 -2
- package/src/cli/commands.ts +6 -1
- package/src/cli/dashboard.tsx +5 -1
- package/src/cli/ink-react.ts +26 -0
- package/src/paths.ts +3 -0
- package/src/server/__tests__/prebuilt-web.test.ts +35 -0
- package/src/server/app.ts +8 -0
- package/src/server/prebuilt-web.ts +46 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var xj=Object.create;var{getPrototypeOf:vj,defineProperty:Gh,getOwnPropertyNames:bj}=Object;var nR=Object.prototype.hasOwnProperty;function yj(e){return this[e]}var wj,Sj,iR=(e,t,a)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?wj??=new WeakMap:Sj??=new WeakMap,s=n.get(e);if(s)return s}a=e!=null?xj(vj(e)):{};let l=t||!e||!e.__esModule||!nR.call(e,"default")?Gh(a,"default",{value:e,enumerable:!0}):a;if(e&&typeof e==="object"||typeof e==="function"){for(let c of bj(e))if(!nR.call(l,c))Gh(l,c,{get:yj.bind(e,c),enumerable:!0})}if(r)n.set(e,l);return l};var Yf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var kj=(e)=>e;function Cj(e,t){this[e]=kj.bind(null,t)}var sR=(e,t)=>{for(var a in t)Gh(e,a,{get:t[a],enumerable:!0,configurable:!0,set:Cj.bind(t,a)})};var lR=(e,t,a)=>{for(var r in t)Gh(e,r,{get:t[r],set:a[r],enumerable:!0,configurable:!0})};var cR,gw,jh,Ye=(e,t)=>{for(var[a,r,n]of cR||[])for(var s=[e],l=globalThis,c=l.document,f,m,g,h,x;m=s.pop();)if(!gw[m]&&(g=r[m])){gw[m]=1;for(h=1;h<g.length;h++)s.push(n[g[h]]);if(!t&&m!==e&&(f=c&&c.head)){if(jh===void 0)jh=(h=c.querySelector("meta[property=csp-nonce]"))&&(h.nonce||h.getAttribute("nonce"))||"";if(x=c.createElement("link"),x.rel="modulepreload",x.crossOrigin="",jh)x.nonce=jh;x.href=new l.URL(g[0],a),f.appendChild(x)}}},Ij=(e,t,a,r)=>{for(var n={},s=0;s<t.length;s++)n[t[s]]=a[s];(cR||=[]).push([e,n,t]),gw||={},Ye(t[r],1)};Ij(import.meta.url,["99ac747k","ewkw0yxq","7vp7mn8t","jt618p78","wqjjkgh9","neqyf1jm","7r3qwgvk","yvhjz3k7","adfxb1sz","c84m5n2b","v0b1rz8b","rachd7gd","6f4fhpq5","7fh46gy9","2g1d0p8k","2y991ert","7k2ksd6m","qnky191x","s0wykzpf","0k94bd7w","nnhyekc9","5a2wt1wn","gzmwacrs","yymd449s","98m1ye59","pae7wjqv","vcj3m7wp","7hpamxpk","9e08jfg6","dwa0v44t","3zr9b6sh","fwhn9kja","sm5g3apm","c29x9yr7","rj1164tm","jcnm8ap3","p5m4kcyp","1hsbtrt7","yenm06gj","4587k1kk","deqmvh2y","4n8esv61","a4kekjaw","twh19bw5","xgcdt3gc","7zd31pph","a7dtx8vc","n2293q4w","70gs5473","pbh1r1h9","srr11f10","1w20559j","tsyvyw54","aat7sg2w","k74h7e4d","z5ns215x","rcvsf7wj"],[["/chunk-99ac747k.js"],["/chunk-ewkw0yxq.js"],["/chunk-7vp7mn8t.js",41,42,43],["/chunk-jt618p78.js"],["/chunk-wqjjkgh9.js"],["/chunk-neqyf1jm.js"],["/chunk-7r3qwgvk.js"],["/chunk-yvhjz3k7.js",0],["/chunk-adfxb1sz.js"],["/chunk-c84m5n2b.js"],["/chunk-v0b1rz8b.js",44],["/chunk-rachd7gd.js"],["/chunk-6f4fhpq5.js"],["/chunk-7fh46gy9.js",45],["/chunk-2g1d0p8k.js",46],["/chunk-2y991ert.js",41],["/chunk-7k2ksd6m.js",41],["/chunk-qnky191x.js",46,41,42,43,47],["/chunk-s0wykzpf.js"],["/chunk-0k94bd7w.js",45,46,41,48,42,47],["/chunk-nnhyekc9.js",44,45,46,41,49,48,50,51,52,42,53],["/chunk-5a2wt1wn.js"],["/chunk-gzmwacrs.js"],["/chunk-yymd449s.js",49],["/chunk-98m1ye59.js",48],["/chunk-pae7wjqv.js",50],["/chunk-vcj3m7wp.js"],["/chunk-7hpamxpk.js"],["/chunk-9e08jfg6.js"],["/chunk-dwa0v44t.js"],["/chunk-3zr9b6sh.js",54],["/chunk-fwhn9kja.js"],["/chunk-sm5g3apm.js",52],["/chunk-c29x9yr7.js",51],["/chunk-rj1164tm.js",42],["/chunk-jcnm8ap3.js",43],["/chunk-p5m4kcyp.js",55],["/chunk-1hsbtrt7.js",56],["/chunk-yenm06gj.js",47],["/chunk-4587k1kk.js"],["/chunk-deqmvh2y.js",53],["/chunk-4n8esv61.js"],["/chunk-a4kekjaw.js"],["/chunk-twh19bw5.js"],["/chunk-xgcdt3gc.js"],["/chunk-7zd31pph.js",54],["/chunk-a7dtx8vc.js",41,42],["/chunk-n2293q4w.js"],["/chunk-70gs5473.js"],["/chunk-pbh1r1h9.js",52],["/chunk-srr11f10.js",42,43,55,56],["/chunk-1w20559j.js",52],["/chunk-tsyvyw54.js"],["/chunk-aat7sg2w.js"],["/chunk-k74h7e4d.js"],["/chunk-z5ns215x.js"],["/chunk-rcvsf7wj.js"]],0);
|
|
2
|
+
var q7=Yf(function(rar,G7){var U7=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Roe=/\n/g,Aoe=/^\s*/,Moe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Poe=/^:\s*/,Eoe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Noe=/^[;\s]*/,Doe=/^\s+|\s+$/g,Ooe=`
|
|
3
|
+
`,H7="/",V7="*",Ru="",_oe="comment",zoe="declaration";function Boe(e,t){if(typeof e!=="string")throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,r=1;function n(w){var C=w.match(Roe);if(C)a+=C.length;var L=w.lastIndexOf(Ooe);r=~L?w.length-L:r+w.length}function s(){var w={line:a,column:r};return function(C){return C.position=new l(w),m(),C}}function l(w){this.start=w,this.end={line:a,column:r},this.source=t.source}l.prototype.content=e;function c(w){var C=Error(t.source+":"+a+":"+r+": "+w);if(C.reason=w,C.filename=t.source,C.line=a,C.column=r,C.source=e,t.silent);else throw C}function f(w){var C=w.exec(e);if(!C)return;var L=C[0];return n(L),e=e.slice(L.length),C}function m(){f(Aoe)}function g(w){var C;w=w||[];while(C=h())if(C!==!1)w.push(C);return w}function h(){var w=s();if(H7!=e.charAt(0)||V7!=e.charAt(1))return;var C=2;while(Ru!=e.charAt(C)&&(V7!=e.charAt(C)||H7!=e.charAt(C+1)))++C;if(C+=2,Ru===e.charAt(C-1))return c("End of comment missing");var L=e.slice(2,C-2);return r+=2,n(L),e=e.slice(C),r+=2,w({type:_oe,comment:L})}function x(){var w=s(),C=f(Moe);if(!C)return;if(h(),!f(Poe))return c("property missing ':'");var L=f(Eoe),k=w({type:zoe,property:j7(C[0].replace(U7,Ru)),value:L?j7(L[0].replace(U7,Ru)):Ru});return f(Noe),k}function v(){var w=[];g(w);var C;while(C=x())if(C!==!1)w.push(C),g(w);return w}return m(),v()}function j7(e){return e?e.replace(Doe,Ru):Ru}G7.exports=Boe});var K7=Yf(function(kh){var Foe=kh&&kh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kh,"__esModule",{value:!0});kh.default=Hoe;var Uoe=Foe(q7());function Hoe(e,t){let a=null;if(!e||typeof e!=="string")return a;let r=(0,Uoe.default)(e),n=typeof t==="function";return r.forEach((s)=>{if(s.type!=="declaration")return;let{property:l,value:c}=s;if(n)t(l,c,s);else if(c)a=a||{},a[l]=c}),a}});var $7=Yf(function(Y7){Object.defineProperty(Y7,"__esModule",{value:!0});Y7.camelCase=void 0;var Voe=/^--[a-zA-Z0-9_-]+$/,joe=/-([a-z])/g,Goe=/^[^-]+$/,qoe=/^-(webkit|moz|ms|o|khtml)-/,Koe=/^-(ms)-/,Xoe=function(e){return!e||Goe.test(e)||Voe.test(e)},Yoe=function(e,t){return t.toUpperCase()},X7=function(e,t){return"".concat(t,"-")},Woe=function(e,t){if(t===void 0)t={};if(Xoe(e))return e;if(e=e.toLowerCase(),t.reactCompat)e=e.replace(Koe,X7);else e=e.replace(qoe,X7);return e.replace(joe,Yoe)};Y7.camelCase=Woe});var Z7=Yf(function(rL,Q7){var $oe=rL&&rL.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Qoe=$oe(K7()),Zoe=$7();function aL(e,t){var a={};if(!e||typeof e!=="string")return a;return(0,Qoe.default)(e,function(r,n){if(r&&n)a[(0,Zoe.camelCase)(r,t)]=n}),a}aL.default=aL;Q7.exports=aL});var y9=Yf(function($sr,b9){var jy=Object.prototype.hasOwnProperty,v9=Object.prototype.toString,{defineProperty:f9,getOwnPropertyDescriptor:p9}=Object,m9=function(t){if(typeof Array.isArray==="function")return Array.isArray(t);return v9.call(t)==="[object Array]"},g9=function(t){if(!t||v9.call(t)!=="[object Object]")return!1;var a=jy.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&jy.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!r)return!1;var n;for(n in t);return typeof n>"u"||jy.call(t,n)},h9=function(t,a){if(f9&&a.name==="__proto__")f9(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0});else t[a.name]=a.newValue},x9=function(t,a){if(a==="__proto__"){if(!jy.call(t,a))return;else if(p9)return p9(t,a).value}return t[a]};b9.exports=function e(){var t,a,r,n,s,l,c=arguments[0],f=1,m=arguments.length,g=!1;if(typeof c==="boolean")g=c,c=arguments[1]||{},f=2;if(c==null||typeof c!=="object"&&typeof c!=="function")c={};for(;f<m;++f)if(t=arguments[f],t!=null){for(a in t)if(r=x9(c,a),n=x9(t,a),c!==n){if(g&&n&&(g9(n)||(s=m9(n)))){if(s)s=!1,l=r&&m9(r)?r:[];else l=r&&g9(r)?r:{};h9(c,{name:a,newValue:e(g,l,n)})}else if(typeof n<"u")h9(c,{name:a,newValue:n})}}return c}});var Cr="/logo-sg2x36yb.svg";var Pe={};lR(Pe,{Activity:()=>SR,Children:()=>ur,Component:()=>Kh,Fragment:()=>Za,Profiler:()=>kR,PureComponent:()=>CR,StrictMode:()=>Xh,Suspense:()=>IR,ViewTransition:()=>LR,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>Xu,__COMPILER_RUNTIME:()=>TR,addTransitionType:()=>RR,cache:()=>AR,cacheSignal:()=>MR,cloneElement:()=>Ir,createContext:()=>ht,createElement:()=>Be,createRef:()=>PR,forwardRef:()=>ne,isValidElement:()=>Yt,lazy:()=>ER,memo:()=>NR,startTransition:()=>DR,unstable_useCacheRefresh:()=>OR,use:()=>_R,useActionState:()=>zR,useCallback:()=>j,useContext:()=>We,useDebugValue:()=>BR,useDeferredValue:()=>FR,useEffect:()=>U,useEffectEvent:()=>UR,useId:()=>lt,useImperativeHandle:()=>Yh,useInsertionEffect:()=>cs,useLayoutEffect:()=>Vt,useMemo:()=>de,useOptimistic:()=>HR,useReducer:()=>us,useRef:()=>B,useState:()=>A,useSyncExternalStore:()=>Eo,useTransition:()=>VR,version:()=>Wh},{Activity:(wde)=>SR=wde,Children:(wde)=>ur=wde,Component:(wde)=>Kh=wde,Fragment:(wde)=>Za=wde,Profiler:(wde)=>kR=wde,PureComponent:(wde)=>CR=wde,StrictMode:(wde)=>Xh=wde,Suspense:(wde)=>IR=wde,ViewTransition:(wde)=>LR=wde,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:(wde)=>Xu=wde,__COMPILER_RUNTIME:(wde)=>TR=wde,addTransitionType:(wde)=>RR=wde,cache:(wde)=>AR=wde,cacheSignal:(wde)=>MR=wde,cloneElement:(wde)=>Ir=wde,createContext:(wde)=>ht=wde,createElement:(wde)=>Be=wde,createRef:(wde)=>PR=wde,forwardRef:(wde)=>ne=wde,isValidElement:(wde)=>Yt=wde,lazy:(wde)=>ER=wde,memo:(wde)=>NR=wde,startTransition:(wde)=>DR=wde,unstable_useCacheRefresh:(wde)=>OR=wde,use:(wde)=>_R=wde,useActionState:(wde)=>zR=wde,useCallback:(wde)=>j=wde,useContext:(wde)=>We=wde,useDebugValue:(wde)=>BR=wde,useDeferredValue:(wde)=>FR=wde,useEffect:(wde)=>U=wde,useEffectEvent:(wde)=>UR=wde,useId:(wde)=>lt=wde,useImperativeHandle:(wde)=>Yh=wde,useInsertionEffect:(wde)=>cs=wde,useLayoutEffect:(wde)=>Vt=wde,useMemo:(wde)=>de=wde,useOptimistic:(wde)=>HR=wde,useReducer:(wde)=>us=wde,useRef:(wde)=>B=wde,useState:(wde)=>A=wde,useSyncExternalStore:(wde)=>Eo=wde,useTransition:(wde)=>VR=wde,version:(wde)=>Wh=wde});var vw=Symbol.for("react.transitional.element"),Tj=Symbol.for("react.portal"),Rj=Symbol.for("react.fragment"),Aj=Symbol.for("react.strict_mode"),Mj=Symbol.for("react.profiler"),Pj=Symbol.for("react.consumer"),Ej=Symbol.for("react.context"),Nj=Symbol.for("react.forward_ref"),Dj=Symbol.for("react.suspense"),Oj=Symbol.for("react.memo"),mR=Symbol.for("react.lazy"),_j=Symbol.for("react.activity"),zj=Symbol.for("react.view_transition"),uR=Symbol.iterator;function Bj(e){if(e===null||typeof e!=="object")return null;return e=uR&&e[uR]||e["@@iterator"],typeof e==="function"?e:null}var gR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hR=Object.assign,xR={};function Ku(e,t,a){this.props=e,this.context=t,this.refs=xR,this.updater=a||gR}Ku.prototype.isReactComponent={};Ku.prototype.setState=function(e,t){if(typeof e!=="object"&&typeof e!=="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ku.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vR(){}vR.prototype=Ku.prototype;function bw(e,t,a){this.props=e,this.context=t,this.refs=xR,this.updater=a||gR}var yw=bw.prototype=new vR;yw.constructor=bw;hR(yw,Ku.prototype);yw.isPureReactComponent=!0;var dR=Array.isArray;function xw(){}var Rt={H:null,A:null,T:null,S:null},bR=Object.prototype.hasOwnProperty;function ww(e,t,a){var r=a.ref;return{$$typeof:vw,type:e,key:t,ref:r!==void 0?r:null,props:a}}function Fj(e,t){return ww(e.type,t,e.props)}function Sw(e){return typeof e==="object"&&e!==null&&e.$$typeof===vw}function Uj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var fR=/\/+/g;function hw(e,t){return typeof e==="object"&&e!==null&&e.key!=null?Uj(""+e.key):t.toString(36)}function Hj(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status==="string"?e.then(xw,xw):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function qu(e,t,a,r,n){var s=typeof e;if(s==="undefined"||s==="boolean")e=null;var l=!1;if(e===null)l=!0;else switch(s){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case vw:case Tj:l=!0;break;case mR:return l=e._init,qu(l(e._payload),t,a,r,n)}}if(l)return n=n(e),l=r===""?"."+hw(e,0):r,dR(n)?(a="",l!=null&&(a=l.replace(fR,"$&/")+"/"),qu(n,t,a,"",function(m){return m})):n!=null&&(Sw(n)&&(n=Fj(n,a+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(fR,"$&/")+"/")+l)),t.push(n)),1;l=0;var c=r===""?".":r+":";if(dR(e))for(var f=0;f<e.length;f++)r=e[f],s=c+hw(r,f),l+=qu(r,t,a,s,n);else if(f=Bj(e),typeof f==="function")for(e=f.call(e),f=0;!(r=e.next()).done;)r=r.value,s=c+hw(r,f++),l+=qu(r,t,a,s,n);else if(s==="object"){if(typeof e.then==="function")return qu(Hj(e),t,a,r,n);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function qh(e,t,a){if(e==null)return e;var r=[],n=0;return qu(e,r,"","",function(s){return t.call(a,s,n++)}),r}function Vj(e){if(e._status===-1){var t=e._result,a=t();a.then(function(r){if(e._status===0||e._status===-1)e._status=1,e._result=r,a.status===void 0&&(a.status="fulfilled",a.value=r)},function(r){if(e._status===0||e._status===-1)e._status=2,e._result=r,a.status===void 0&&(a.status="rejected",a.reason=r)}),e._status===-1&&(e._status=0,e._result=a)}if(e._status===1)return e._result.default;throw e._result}var pR=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=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(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)};function yR(e){var t=Rt.T,a={};a.types=t!==null?t.types:null,Rt.T=a;try{var r=e(),n=Rt.S;n!==null&&n(a,r),typeof r==="object"&&r!==null&&typeof r.then==="function"&&r.then(xw,pR)}catch(s){pR(s)}finally{t!==null&&a.types!==null&&(t.types=a.types),Rt.T=t}}function wR(e){var t=Rt.T;if(t!==null){var a=t.types;a===null?t.types=[e]:a.indexOf(e)===-1&&a.push(e)}else yR(wR.bind(null,e))}var jj={map:qh,forEach:function(e,t,a){qh(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return qh(e,function(){t++}),t},toArray:function(e){return qh(e,function(t){return t})||[]},only:function(e){if(!Sw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};var SR=_j,ur=jj,Kh=Ku,Za=Rj,kR=Mj,CR=bw,Xh=Aj,IR=Dj,LR=zj,Xu=Rt,TR={__proto__:null,c:function(e){return Rt.H.useMemoCache(e)}},RR=wR,AR=function(e){return function(){return e.apply(null,arguments)}},MR=function(){return null},Ir=function(e,t,a){if(e===null||e===void 0)throw Error("The argument must be a React element, but you passed "+e+".");var r=hR({},e.props),n=e.key;if(t!=null)for(s in t.key!==void 0&&(n=""+t.key),t)!bR.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(r[s]=t[s]);var s=arguments.length-2;if(s===1)r.children=a;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];r.children=l}return ww(e.type,n,r)},ht=function(e){return e={$$typeof:Ej,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Pj,_context:e},e},Be=function(e,t,a){var r,n={},s=null;if(t!=null)for(r in t.key!==void 0&&(s=""+t.key),t)bR.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=t[r]);var l=arguments.length-2;if(l===1)n.children=a;else if(1<l){for(var c=Array(l),f=0;f<l;f++)c[f]=arguments[f+2];n.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)n[r]===void 0&&(n[r]=l[r]);return ww(e,s,n)},PR=function(){return{current:null}},ne=function(e){return{$$typeof:Nj,render:e}},Yt=Sw,ER=function(e){return{$$typeof:mR,_payload:{_status:-1,_result:e},_init:Vj}},NR=function(e,t){return{$$typeof:Oj,type:e,compare:t===void 0?null:t}},DR=yR,OR=function(){return Rt.H.useCacheRefresh()},_R=function(e){return Rt.H.use(e)},zR=function(e,t,a){return Rt.H.useActionState(e,t,a)},j=function(e,t){return Rt.H.useCallback(e,t)},We=function(e){return Rt.H.useContext(e)},BR=function(){},FR=function(e,t){return Rt.H.useDeferredValue(e,t)},U=function(e,t){return Rt.H.useEffect(e,t)},UR=function(e){return Rt.H.useEffectEvent(e)},lt=function(){return Rt.H.useId()},Yh=function(e,t,a){return Rt.H.useImperativeHandle(e,t,a)},cs=function(e,t){return Rt.H.useInsertionEffect(e,t)},Vt=function(e,t){return Rt.H.useLayoutEffect(e,t)},de=function(e,t){return Rt.H.useMemo(e,t)},HR=function(e,t){return Rt.H.useOptimistic(e,t)},us=function(e,t,a){return Rt.H.useReducer(e,t,a)},B=function(e){return Rt.H.useRef(e)},A=function(e){return Rt.H.useState(e)},Eo=function(e,t,a){return Rt.H.useSyncExternalStore(e,t,a)},VR=function(){return Rt.H.useTransition()},Wh="19.3.0";function DN(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DN)}catch(e){console.error(e)}}var Gl={};lR(Gl,{unstable_now:()=>No,unstable_IdlePriority:()=>tx,unstable_ImmediatePriority:()=>ax,unstable_LowPriority:()=>rx,unstable_NormalPriority:()=>ql,unstable_Profiling:()=>WR,unstable_UserBlockingPriority:()=>ox,unstable_cancelCallback:()=>nx,unstable_forceFrameRate:()=>$R,unstable_getCurrentPriorityLevel:()=>ix,unstable_next:()=>QR,unstable_requestPaint:()=>sx,unstable_runWithPriority:()=>ZR,unstable_scheduleCallback:()=>Kl,unstable_shouldYield:()=>lx,unstable_wrapCallback:()=>JR},{unstable_now:(Sde)=>No=Sde,unstable_IdlePriority:(Sde)=>tx=Sde,unstable_ImmediatePriority:(Sde)=>ax=Sde,unstable_LowPriority:(Sde)=>rx=Sde,unstable_NormalPriority:(Sde)=>ql=Sde,unstable_Profiling:(Sde)=>WR=Sde,unstable_UserBlockingPriority:(Sde)=>ox=Sde,unstable_cancelCallback:(Sde)=>nx=Sde,unstable_forceFrameRate:(Sde)=>$R=Sde,unstable_getCurrentPriorityLevel:(Sde)=>ix=Sde,unstable_next:(Sde)=>QR=Sde,unstable_requestPaint:(Sde)=>sx=Sde,unstable_runWithPriority:(Sde)=>ZR=Sde,unstable_scheduleCallback:(Sde)=>Kl=Sde,unstable_shouldYield:(Sde)=>lx=Sde,unstable_wrapCallback:(Sde)=>JR=Sde});function Cw(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,n=e[r];if(0<$h(n,t))e[r]=t,e[a]=n,a=r;else break e}}function dn(e){return e.length===0?null:e[0]}function ex(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,n=e.length,s=n>>>1;r<s;){var l=2*(r+1)-1,c=e[l],f=l+1,m=e[f];if(0>$h(c,a))f<n&&0>$h(m,c)?(e[r]=m,e[f]=a,r=f):(e[r]=c,e[l]=a,r=l);else if(f<n&&0>$h(m,a))e[r]=m,e[f]=a,r=f;else break e}}return t}function $h(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}var No=void 0;if(typeof performance==="object"&&typeof performance.now==="function")Iw=performance,No=function(){return Iw.now()};else Qh=Date,Lw=Qh.now(),No=function(){return Qh.now()-Lw};var Iw,Qh,Lw,li=[],ds=[],Gj=1,io=null,Ja=3,Tw=!1,Wf=!1,$f=!1,Aw=!1,GR=typeof setTimeout==="function"?setTimeout:null,qR=typeof clearTimeout==="function"?clearTimeout:null,jR=typeof setImmediate<"u"?setImmediate:null;function Zh(e){for(var t=dn(ds);t!==null;){if(t.callback===null)ex(ds);else if(t.startTime<=e)ex(ds),t.sortIndex=t.expirationTime,Cw(li,t);else break;t=dn(ds)}}function Mw(e){if($f=!1,Zh(e),!Wf)if(dn(li)!==null)Wf=!0,Wu||(Wu=!0,Yu());else{var t=dn(ds);t!==null&&Pw(Mw,t.startTime-e)}}var Wu=!1,Qf=-1,KR=5,XR=-1;function YR(){return Aw?!0:Gl.unstable_now()-XR<KR?!1:!0}function kw(){if(Aw=!1,Wu){var e=Gl.unstable_now();XR=e;var t=!0;try{e:{Wf=!1,$f&&($f=!1,qR(Qf),Qf=-1),Tw=!0;var a=Ja;try{t:{Zh(e);for(io=dn(li);io!==null&&!(io.expirationTime>e&&YR());){var r=io.callback;if(typeof r==="function"){io.callback=null,Ja=io.priorityLevel;var n=r(io.expirationTime<=e);if(e=Gl.unstable_now(),typeof n==="function"){io.callback=n,Zh(e),t=!0;break t}io===dn(li)&&ex(li),Zh(e)}else ex(li);io=dn(li)}if(io!==null)t=!0;else{var s=dn(ds);s!==null&&Pw(Mw,s.startTime-e),t=!1}}break e}finally{io=null,Ja=a,Tw=!1}t=void 0}}finally{t?Yu():Wu=!1}}}var Yu;if(typeof jR==="function")Yu=function(){jR(kw)};else if(typeof MessageChannel<"u")Jh=new MessageChannel,Rw=Jh.port2,Jh.port1.onmessage=kw,Yu=function(){Rw.postMessage(null)};else Yu=function(){GR(kw,0)};var Jh,Rw;function Pw(e,t){Qf=GR(function(){e(Gl.unstable_now())},t)}var tx=5,ax=1,rx=4,ql=3,WR=null,ox=2,nx=function(e){e.callback=null},$R=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):KR=0<e?Math.floor(1000/e):5},ix=function(){return Ja},QR=function(e){switch(Ja){case 1:case 2:case 3:var t=3;break;default:t=Ja}var a=Ja;Ja=t;try{return e()}finally{Ja=a}},sx=function(){Aw=!0},ZR=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Ja;Ja=e;try{return t()}finally{Ja=a}},Kl=function(e,t,a){var r=Gl.unstable_now();switch(typeof a==="object"&&a!==null?(a=a.delay,a=typeof a==="number"&&0<a?r+a:r):a=r,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5000}return n=a+n,e={id:Gj++,callback:t,priorityLevel:e,startTime:a,expirationTime:n,sortIndex:-1},a>r?(e.sortIndex=a,Cw(ds,e),dn(li)===null&&e===dn(ds)&&($f?(qR(Qf),Qf=-1):$f=!0,Pw(Mw,a-r))):(e.sortIndex=n,Cw(li,e),Wf||Tw||(Wf=!0,Wu||(Wu=!0,Yu()))),e},lx=YR,JR=function(e){var t=Ja;return function(){var a=Ja;Ja=t;try{return e.apply(this,arguments)}finally{Ja=a}}};function aA(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aA)}catch(e){console.error(e)}}function tA(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function fs(){}var Zf={d:{f:fs,r:function(){throw Error(tA(522))},D:fs,C:fs,L:fs,m:fs,X:fs,S:fs,M:fs},p:0,findDOMNode:null},qj=Symbol.for("react.portal");var eA=Symbol.for("react.optimistic_key");function Kj(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qj,key:r==null?null:r===eA?eA:""+r,children:e,containerInfo:t,implementation:a}}var Ew=Xu;var Nw=Zf;var fn=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(tA(299));return Kj(e,t,null,a)},ps=function(e){var t=Ew.T,a=Zf.p;try{if(Ew.T=null,Zf.p=2,e)return e()}finally{Ew.T=t,Zf.p=a,Zf.d.f()}};aA();function ie(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Xj(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Vp(e){for(var t=e,a=t;a&&!a.alternate;)t=a,(t.flags&4098)!==0&&(e=t.return),a=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function FM(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function UM(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function rA(e){if(Vp(e)!==e)throw Error(ie(188))}function Yj(e){var t=e.alternate;if(!t){if(t=Vp(e),t===null)throw Error(ie(188));return t!==e?null:e}for(var a=e,r=t;;){var n=a.return;if(n===null)break;var s=n.alternate;if(s===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===s.child){for(s=n.child;s;){if(s===a)return rA(n),e;if(s===r)return rA(n),t;s=s.sibling}throw Error(ie(188))}if(a.return!==r.return)a=n,r=s;else{for(var l=!1,c=n.child;c;){if(c===a){l=!0,a=n,r=s;break}if(c===r){l=!0,r=n,a=s;break}c=c.sibling}if(!l){for(c=s.child;c;){if(c===a){l=!0,a=s,r=n;break}if(c===r){l=!0,r=s,a=n;break}c=c.sibling}if(!l)throw Error(ie(189))}}if(a.alternate!==r)throw Error(ie(190))}if(a.tag!==3)throw Error(ie(188));return a.stateNode.current===a?e:t}function HM(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=HM(e),t!==null)return t;e=e.sibling}return null}function Pr(e,t,a,r,n,s){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&a(e,r,n,s)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&Pr(e.child,t,a,r,n,s))return!0;e=e.sibling}return!1}function hc(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function oA(e){var t=!1;for(e=e.return;e!==null;){if(e.tag===4&&(t=!0),e.tag===3||e.tag===5||e.tag===27)break;e=e.return}return t}function VM(e){var t=[null,null],a=hc(e);if(a===null)return t;return jM(t,e,a.child,{foundSelf:!1}),t}function jM(e,t,a,r){for(;a!==null;){if(a===t)r.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(r.foundSelf)return e[1]=a,!0;e[0]=a}else if((a.tag!==22||a.memoizedState===null)&&jM(e,t,a.child,r))return!0;a=a.sibling}return!1}function fa(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(ie(559))}}var rd=null,u1=null;function Wj(e,t,a){return e===a?!0:e===t?(rd=e,!0):!1}function $j(e,t,a){return e===a?(u1=e,!1):e===t?(u1!==null&&(rd=e),!0):!1}function nA(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e?e:null}function d1(e,t,a){for(var r=0,n=e;n;n=a(n))r++;n=0;for(var s=t;s;s=a(s))n++;for(;0<r-n;)e=a(e),r--;for(;0<n-r;)t=a(t),n--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=a(e),t=a(t)}return null}var It=Object.assign,Qj=Symbol.for("react.element"),cx=Symbol.for("react.transitional.element"),op=Symbol.for("react.portal"),od=Symbol.for("react.fragment"),GM=Symbol.for("react.strict_mode"),f1=Symbol.for("react.profiler"),qM=Symbol.for("react.consumer"),vn=Symbol.for("react.context"),kS=Symbol.for("react.forward_ref"),p1=Symbol.for("react.suspense"),m1=Symbol.for("react.suspense_list"),CS=Symbol.for("react.memo"),xs=Symbol.for("react.lazy"),g1=Symbol.for("react.activity"),Zj=Symbol.for("react.legacy_hidden"),Jj=Symbol.for("react.memo_cache_sentinel"),h1=Symbol.for("react.view_transition"),eG=Symbol.for("react.recoverable"),iA=Symbol.iterator;function Jf(e){if(e===null||typeof e!=="object")return null;return e=iA&&e[iA]||e["@@iterator"],typeof e==="function"?e:null}var tG=Symbol.for("react.client.reference");function x1(e){if(e==null)return null;if(typeof e==="function")return e.$$typeof===tG?null:e.displayName||e.name||null;if(typeof e==="string")return e;switch(e){case od:return"Fragment";case f1:return"Profiler";case GM:return"StrictMode";case p1:return"Suspense";case m1:return"SuspenseList";case g1:return"Activity";case h1:return"ViewTransition"}if(typeof e==="object")switch(e.$$typeof){case op:return"Portal";case vn:return e.displayName||"Context";case qM:return(e._context.displayName||"Context")+".Consumer";case kS:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case CS:return t=e.displayName||null,t!==null?t:x1(e.type)||"Memo";case xs:t=e._payload,e=e._init;try{return x1(e(t))}catch(a){}}return null}var np=Array.isArray,je=Xu,dt=Nw,tc={pending:!1,data:null,method:null,action:null},v1=[],nd=-1;function In(e){return{current:e}}function Ba(e){0>nd||(e.current=v1[nd],v1[nd]=null,nd--)}function Pt(e,t){nd++,v1[nd]=e.current,e.current=t}var Sn=In(null),Lp=In(null),Ls=In(null),Kx=In(null);function Xx(e,t){switch(Pt(Ls,t),Pt(Lp,e),Pt(Sn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)?(e=e.namespaceURI)?vM(e):0:0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vM(t),e=fN(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ba(Sn),Pt(Sn,e)}function Id(){Ba(Sn),Ba(Lp),Ba(Ls)}function b1(e){var t=e.memoizedState;t!==null&&(Od._currentValue=t.memoizedState,Pt(Kx,e)),t=Sn.current;var a=fN(t,e.type);t!==a&&(Pt(Lp,e),Pt(Sn,a))}function Yx(e){Lp.current===e&&(Ba(Sn),Ba(Lp)),Kx.current===e&&(Ba(Kx),Od._currentValue=tc)}var Dw,sA;function gs(e){if(Dw===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Dw=t&&t[1]||"",sA=-1<a.stack.indexOf(`
|
|
4
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
5
|
+
`+Dw+e+sA}var Ow=!1;function _w(e,t){if(!e||Ow)return"";Ow=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(w){var x=w}Reflect.construct(e,[],h)}else{try{h.call()}catch(w){x=w}h=!1;try{var v=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),h=!0,new e}finally{h&&(v!==void 0?Object.defineProperty(e.prototype,"props",v):delete e.prototype.props)}}}else{try{throw Error()}catch(w){x=w}(h=e())&&typeof h.catch==="function"&&h.catch(function(){})}}catch(w){if(w&&x&&typeof w.stack==="string")return[w.stack,x.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=r.DetermineComponentFrameRoot(),l=s[0],c=s[1];if(l&&c){var f=l.split(`
|
|
6
|
+
`),m=c.split(`
|
|
7
|
+
`);for(n=r=0;r<f.length&&!f[r].includes("DetermineComponentFrameRoot");)r++;for(;n<m.length&&!m[n].includes("DetermineComponentFrameRoot");)n++;if(r===f.length||n===m.length)for(r=f.length-1,n=m.length-1;1<=r&&0<=n&&f[r]!==m[n];)n--;for(;1<=r&&0<=n;r--,n--)if(f[r]!==m[n]){if(r!==1||n!==1)do if(r--,n--,0>n||f[r]!==m[n]){var g=`
|
|
8
|
+
`+f[r].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),g}while(1<=r&&0<=n);break}}}finally{Ow=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?gs(a):""}function aG(e,t){switch(e.tag){case 26:case 27:case 5:return gs(e.type);case 16:return gs("Lazy");case 13:return e.child!==t&&t!==null?gs("Suspense Fallback"):gs("Suspense");case 19:return gs("SuspenseList");case 0:case 15:return _w(e.type,!1);case 11:return _w(e.type.render,!1);case 1:return _w(e.type,!0);case 31:return gs("Activity");case 30:return gs("ViewTransition");default:return""}}function lA(e){try{var t="",a=null;do t+=aG(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
|
|
9
|
+
Error generating stack: `+r.message+`
|
|
10
|
+
`+r.stack}}var y1=Object.prototype.hasOwnProperty,IS=Kl,zw=nx,rG=lx,oG=sx,Xr=No,nG=ix,KM=ax,XM=ox,Wx=ql,iG=rx,YM=tx,sG=void 0,lG=void 0,jp=null,Yr=null;function ys(e){if(typeof sG==="function"&&lG(e),Yr&&typeof Yr.setStrictMode==="function")try{Yr.setStrictMode(jp,e)}catch(t){}}var Wr=Math.clz32?Math.clz32:dG,{log:cG,LN2:uG}=Math;function dG(e){return e>>>=0,e===0?32:31-(cG(e)/uG|0)|0}var ux=256,dx=262144,fx=4194304;function Wl(e){var t=e&42;if(t!==0)return t;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&-e;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 wv(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,l=e.pingedLanes;e=e.warmLanes;var c=r&134217727;return c!==0?(r=c&~s,r!==0?n=Wl(r):(l&=c,l!==0?n=Wl(l):a||(a=c&~e,a!==0&&(n=Wl(a))))):(c=r&~s,c!==0?n=Wl(c):l!==0?n=Wl(l):a||(a=r&~e,a!==0&&(n=Wl(a)))),n===0?0:t!==0&&t!==n&&(t&s)===0&&(s=n&-n,a=t&-t,s>=a||s===32&&(a&4194048)!==0)?t:n}function Gp(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function WM(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-Wr(a),n=1<<r;t|=e[r],a&=~n}return t}function fG(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+5000;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 $M(){var e=fx;return fx<<=1,(fx&62914560)===0&&(fx=4194304),e}function Bw(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Sv(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pG(e,t,a,r,n,s){var l=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var{entanglements:c,expirationTimes:f,hiddenUpdates:m}=e;for(a=l&~a;0<a;){var g=31-Wr(a),h=1<<g;c[g]=0,f[g]=-1;var x=m[g];if(x!==null)for(m[g]=null,g=0;g<x.length;g++){var v=x[g];v!==null&&(v.lane&=-536870913)}a&=~h}r!==0&&QM(e,r,0),s!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=s&~(l&~t))}function QM(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Wr(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function ZM(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Wr(a),n=1<<r;n&t|e[r]&t&&(e[r]|=t),a&=~n}}function JM(e,t){var a=t&-t;return a=(a&42)!==0?1:eP(a),(a&(e.suspendedLanes|t))!==0?0:a}function eP(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 LS(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function tP(){var e=dt.p;if(e!==0)return e;return e=window.event,e===void 0?32:EN(e.type)}function cA(e,t){var a=dt.p;try{return dt.p=e,t()}finally{dt.p=a}}var wi=Math.random().toString(36).slice(2),_a="__reactFiber$"+wi,Er="__reactProps$"+wi,qp="__reactContainer$"+wi,uA="__reactEvents$"+wi,mG="__reactListeners$"+wi,gG="__reactHandles$"+wi,dA="__reactResources$"+wi,Kp="__reactMarker$"+wi,$x="__reactLoad$"+wi;function kv(e){delete e[_a],delete e[Er],delete e[mG],delete e[gG]}function Jl(e){var t;if(t=e[_a])return t;for(var a=e.parentNode;a;){if(t=a[qp]||a[_a]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=LM(e);e!==null;){if(a=e[_a])return a;e=LM(e)}return t}e=a,a=e.parentNode}return null}function Bd(e){if(e=e[_a]||e[qp]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ip(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(ie(33))}function gd(e){var t=e[dA];return t||(t=e[dA]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function wa(e){e[Kp]=!0}function aP(e){e[$x]=void 0}var rP=new Set,oP={};function xc(e,t){Ld(e,t),Ld(e+"Capture",t)}function Ld(e,t){oP[e]=t;for(e=0;e<t.length;e++)rP.add(t[e])}var hG=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]*$"),fA={},pA={};function xG(e){if(y1.call(pA,e))return!0;if(y1.call(fA,e))return!1;if(hG.test(e))return pA[e]=!0;return fA[e]=!0,!1}var ct=!1;function mA(){var e=ct;return ct=!1,e}function Lx(e,t,a){if(xG(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,a)}}function px(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,a)}}function ci(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,r)}}function jr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vG(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get==="function"&&typeof r.set==="function"){var{get:n,set:s}=r;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(l){a=""+l,s.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(l){a=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function w1(e){if(!e._valueTracker){var t=nP(e)?"checked":"value";e._valueTracker=vG(e,t,""+e[t])}}function iP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=nP(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}var bG=/[\n"\\]/g;function fo(e){return e.replace(bG,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function S1(e,t,a,r,n,s,l,c){if(e.name="",l!=null&&typeof l!=="function"&&typeof l!=="symbol"&&typeof l!=="boolean"?e.type=l:e.removeAttribute("type"),t!=null)if(l==="number"){if(t===0&&e.value===""||e.value!=t)e.value=""+jr(t)}else e.value!==""+jr(t)&&(e.value=""+jr(t));else l!=="submit"&&l!=="reset"||e.removeAttribute("value");t!=null?l==="number"&&e.value==t?Fw(e,jr(e.value)):Fw(e,jr(t)):a!=null?Fw(e,jr(a)):r!=null&&e.removeAttribute("value"),n==null&&s!=null&&(e.defaultChecked=!!s),n!=null&&(e.checked=n&&typeof n!=="function"&&typeof n!=="symbol"),c!=null&&typeof c!=="function"&&typeof c!=="symbol"&&typeof c!=="boolean"?e.name=""+jr(c):e.removeAttribute("name")}function sP(e,t,a,r,n,s,l,c){if(s!=null&&typeof s!=="function"&&typeof s!=="symbol"&&typeof s!=="boolean"&&(e.type=s),t!=null||a!=null){if(!(s!=="submit"&&s!=="reset"||t!==void 0&&t!==null)){w1(e);return}a=a!=null?""+jr(a):"",t=t!=null?""+jr(t):a,c||t===e.value||(e.value=t),e.defaultValue=t}r=r!=null?r:n,r=typeof r!=="function"&&typeof r!=="symbol"&&!!r,e.checked=c?e.checked:!!r,e.defaultChecked=!!r,l!=null&&typeof l!=="function"&&typeof l!=="symbol"&&typeof l!=="boolean"&&(e.name=l),w1(e)}function Fw(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function hd(e,t,a,r){if(e=e.options,t){t={};for(var n=0;n<a.length;n++)t["$"+a[n]]=!0;for(a=0;a<e.length;a++)n=t.hasOwnProperty("$"+e[a].value),e[a].selected!==n&&(e[a].selected=n),n&&r&&(e[a].defaultSelected=!0)}else{a=""+jr(a),t=null;for(n=0;n<e.length;n++){if(e[n].value===a){e[n].selected=!0,r&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function lP(e,t,a){if(t!=null&&(t=""+jr(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+jr(a):""}function cP(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(ie(92));if(np(r)){if(1<r.length)throw Error(ie(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=jr(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),w1(e)}function Td(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var yG=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 gA(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a==="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!=="number"||a===0||yG.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function uP(e,t,a){if(t!=null&&typeof t!=="object")throw Error(ie(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="",ct=!0);for(var n in t)r=t[n],t.hasOwnProperty(n)&&a[n]!==r&&(gA(e,n,r),ct=!0)}else for(var s in t)t.hasOwnProperty(s)&&gA(e,s,t[s])}function TS(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 wG=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"],["maskType","mask-type"],["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"]]),SG=/^[\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 Tx(e){return SG.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function bn(){}var k1=null;function RS(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var id=null,xd=null;function hA(e){var t=Bd(e);if(t&&(e=t.stateNode)){var a=e[Er]||null;e:switch(e=t.stateNode,t.type){case"input":if(S1(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;a=a.querySelectorAll('input[name="'+fo(""+t)+'"][type="radio"]');for(t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var n=r[Er]||null;if(!n)throw Error(ie(90));S1(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&iP(r)}break e;case"textarea":lP(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&hd(e,!!a.multiple,t,!1)}}}var Uw=!1;function dP(e,t,a){if(Uw)return e(t,a);Uw=!0;try{var r=e(t);return r}finally{if(Uw=!1,id!==null||xd!==null){if(zv(),id&&(t=id,e=xd,xd=id=null,hA(t),e))for(t=0;t<e.length;t++)hA(e[t])}}}function Tp(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Er]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!=="function")throw Error(ie(231,t,typeof a));return a}var gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),C1=!1;if(gi)try{$l={},Object.defineProperty($l,"passive",{get:function(){C1=!0}}),window.addEventListener("test",$l,$l),window.removeEventListener("test",$l,$l)}catch(e){C1=!1}var $l,ws=null,AS=null,Rx=null;function fP(){if(Rx)return Rx;var e,t=AS,a=t.length,r,n="value"in ws?ws.value:ws.textContent,s=n.length;for(e=0;e<a&&t[e]===n[e];e++);var l=a-e;for(r=1;r<=l&&t[a-r]===n[s-r];r++);return Rx=n.slice(e,1<r?1-r:void 0)}function Ax(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mx(){return!0}function xA(){return!1}function mr(e){function t(a,r,n,s,l){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=s,this.target=l,this.currentTarget=null;for(var c in e)e.hasOwnProperty(c)&&(a=e[c],this[c]=a?a(s):s[c]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?mx:xA,this.isPropagationStopped=xA,this}return It(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!=="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=mx)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!=="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=mx)},persist:function(){},isPersistent:mx}),t}var Fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cv=mr(Fs),Xp=It({},Fs,{view:0,detail:0}),kG=mr(Xp),Hw,Vw,ep,Iv=It({},Xp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:MS,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){if("movementX"in e)return e.movementX;return e!==ep&&(ep&&e.type==="mousemove"?(Hw=e.screenX-ep.screenX,Vw=e.screenY-ep.screenY):Vw=Hw=0,ep=e),Hw},movementY:function(e){return"movementY"in e?e.movementY:Vw}}),vA=mr(Iv),CG=It({},Iv,{dataTransfer:0}),IG=mr(CG),LG=It({},Xp,{relatedTarget:0}),jw=mr(LG),TG=It({},Fs,{animationName:0,elapsedTime:0,pseudoElement:0}),RG=mr(TG),AG=It({},Fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),MG=mr(AG),PG=It({},Fs,{data:0}),bA=mr(PG),EG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NG={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"},DG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OG(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=DG[e])?!!t[e]:!1}function MS(){return OG}var _G=It({},Xp,{key:function(e){if(e.key){var t=EG[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ax(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?NG[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:MS,charCode:function(e){return e.type==="keypress"?Ax(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ax(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zG=mr(_G),BG=It({},Iv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yA=mr(BG),FG=It({},Fs,{submitter:0}),UG=mr(FG),HG=It({},Xp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:MS}),VG=mr(HG),jG=It({},Fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),GG=mr(jG),qG=It({},Iv,{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}),KG=mr(qG),XG=It({},Fs,{newState:0,oldState:0,source:0}),YG=mr(XG),WG=[9,13,27,32],PS=gi&&"CompositionEvent"in window,pp=null;gi&&"documentMode"in document&&(pp=document.documentMode);var $G=gi&&"TextEvent"in window&&!pp,pP=gi&&(!PS||pp&&8<pp&&11>=pp),wA=String.fromCharCode(32),SA=!1;function mP(e,t){switch(e){case"keyup":return WG.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gP(e){return e=e.detail,typeof e==="object"&&"data"in e?e.data:null}var sd=!1;function QG(e,t){switch(e){case"compositionend":return gP(t);case"keypress":if(t.which!==32)return null;return SA=!0,wA;case"textInput":return e=t.data,e===wA&&SA?null:e;default:return null}}function ZG(e,t){if(sd)return e==="compositionend"||!PS&&mP(e,t)?(e=fP(),Rx=AS=ws=null,sd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return pP&&t.locale!=="ko"?null:t.data;default:return null}}var JG={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 kA(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!JG[e.type]:t==="textarea"?!0:!1}function hP(e,t,a,r){id?xd?xd.push(r):xd=[r]:id=r,t=vv(t,"onChange"),0<t.length&&(a=new Cv("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var mp=null,Rp=null;function eq(e){lN(e,0)}function Lv(e){var t=ip(e);if(iP(t))return e}function CA(e,t){if(e==="change")return t}var xP=!1;if(gi){if(gi){if(lp="oninput"in document,!lp)Mx=document.createElement("div"),Mx.setAttribute("oninput","return;"),lp=typeof Mx.oninput==="function";sp=lp}else sp=!1;xP=sp&&(!document.documentMode||9<document.documentMode)}var sp,lp,Mx;function IA(){mp&&(mp.detachEvent("onpropertychange",vP),Rp=mp=null)}function vP(e){if(e.propertyName==="value"&&Lv(Rp)){var t=[];hP(t,Rp,e,RS(e)),dP(eq,t)}}function tq(e,t,a){e==="focusin"?(IA(),mp=t,Rp=a,mp.attachEvent("onpropertychange",vP)):e==="focusout"&&IA()}function aq(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Lv(Rp)}function rq(e,t){if(e==="click")return Lv(t)}function oq(e,t){if(e==="input"||e==="change")return Lv(t)}function nq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $r=typeof Object.is==="function"?Object.is:nq;function Ap(e,t){if($r(e,t))return!0;if(typeof e!=="object"||e===null||typeof t!=="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var n=a[r];if(!y1.call(t,n)||!$r(e[n],t[n]))return!1}return!0}function I1(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function LA(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function TA(e,t){var a=LA(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=LA(a)}}function bP(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bP(e,t.parentNode):("contains"in e)?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yP(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=I1(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href==="string"}catch(r){a=!1}if(a)e=t.contentWindow;else break;t=I1(e.document)}return t}function ES(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var iq=gi&&"documentMode"in document&&11>=document.documentMode,ld=null,L1=null,gp=null,T1=!1;function RA(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;T1||ld==null||ld!==I1(r)||(r=ld,("selectionStart"in r)&&ES(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),gp&&Ap(gp,r)||(gp=r,r=vv(L1,"onSelect"),0<r.length&&(t=new Cv("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=ld)))}function Xl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var cd={animationend:Xl("Animation","AnimationEnd"),animationiteration:Xl("Animation","AnimationIteration"),animationstart:Xl("Animation","AnimationStart"),transitionrun:Xl("Transition","TransitionRun"),transitionstart:Xl("Transition","TransitionStart"),transitioncancel:Xl("Transition","TransitionCancel"),transitionend:Xl("Transition","TransitionEnd")},Gw={},wP={};gi&&(wP=document.createElement("div").style,("AnimationEvent"in window)||(delete cd.animationend.animation,delete cd.animationiteration.animation,delete cd.animationstart.animation),("TransitionEvent"in window)||delete cd.transitionend.transition);function vc(e){if(Gw[e])return Gw[e];if(!cd[e])return e;var t=cd[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in wP)return Gw[e]=t[a];return e}var SP=vc("animationend"),kP=vc("animationiteration"),CP=vc("animationstart"),sq=vc("transitionrun"),lq=vc("transitionstart"),cq=vc("transitioncancel"),IP=vc("transitionend"),LP=new Map,R1="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");R1.push("scrollEnd");function Fo(e,t){LP.set(e,t),xc(t,[e])}var uq=0;function hi(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Bo.identifierPrefix;var a=uq++;return e="_"+e+"t_"+a.toString(32)+"_",t.autoName=e}function AA(e){if(e==null||typeof e==="string")return e;var t=null,a=Cd;if(a!==null)for(var r=0;r<a.length;r++){var n=e[a[r]];if(n!=null){if(n==="none")return"none";t=t==null?n:t+(" "+n)}}return t==null?e.default:t}function Si(e,t){return e=AA(e),t=AA(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Qx=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=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(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)},lo=[],ud=0,NS=0;function Tv(){for(var e=ud,t=NS=ud=0;t<e;){var a=lo[t];lo[t++]=null;var r=lo[t];lo[t++]=null;var n=lo[t];lo[t++]=null;var s=lo[t];if(lo[t++]=null,r!==null&&n!==null){var l=r.pending;l===null?n.next=n:(n.next=l.next,l.next=n),r.pending=n}s!==0&&TP(a,n,s)}}function Rv(e,t,a,r){lo[ud++]=e,lo[ud++]=t,lo[ud++]=a,lo[ud++]=r,NS|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function DS(e,t,a,r){return Rv(e,t,a,r),Zx(e)}function bc(e,t){return Rv(e,null,null,t),Zx(e)}function TP(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var n=!1,s=e.return;s!==null;)s.childLanes|=a,r=s.alternate,r!==null&&(r.childLanes|=a),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(n=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,n&&t!==null&&(n=31-Wr(a),e=s.hiddenUpdates,r=e[n],r===null?e[n]=[t]:r.push(t),t.lane=a|536870912),s):null}function Zx(e){if(50<Ip)throw Ip=0,Ux=null,Error(ie(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var dd={};function dq(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ar(e,t,a,r){return new dq(e,t,a,r)}function OS(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pi(e,t){var a=e.alternate;return a===null?(a=Ar(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&1206910976,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function RP(e,t){e.flags&=1206910978;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Px(e,t,a,r,n,s){var l=0;if(r=e,typeof r==="function")OS(r)&&(l=1);else if(typeof r==="string")l=UK(e,a,Sn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(r){case g1:return e=Ar(31,a,t,n),e.elementType=g1,e.lanes=s,e;case od:return ac(a.children,n,s,t);case GM:l=8,n|=24;break;case f1:return e=Ar(12,a,t,n|2),e.elementType=f1,e.lanes=s,e;case p1:return e=Ar(13,a,t,n),e.elementType=p1,e.lanes=s,e;case m1:return e=Ar(19,a,t,n),e.elementType=m1,e.lanes=s,e;case Zj:case h1:return e=n|32,e=Ar(30,a,t,e),e.elementType=h1,e.lanes=s,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==="object"&&r!==null)switch(r.$$typeof){case vn:l=10;break e;case qM:l=9;break e;case kS:l=11;break e;case CS:l=14;break e;case xs:l=16,r=null;break e}l=29,a=Error(ie(130,e===null?"null":typeof e,"")),r=null}return t=Ar(l,a,t,n),t.elementType=e,t.type=r,t.lanes=s,t}function ac(e,t,a,r){return e=Ar(7,e,r,t),e.lanes=a,e}function qw(e,t,a){return e=Ar(6,e,null,t),e.lanes=a,e}function AP(e){var t=Ar(18,null,null,0);return t.stateNode=e,t}function Kw(e,t,a){return t=Ar(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var MA=new WeakMap;function po(e,t){if(typeof e==="object"&&e!==null){var a=MA.get(e);if(a!==void 0)return a;return t={value:e,source:t,stack:lA(t)},MA.set(e,t),t}return{value:e,source:t,stack:lA(t)}}var fd=[],pd=0,Jx=null,Mp=0,co=[],uo=0,Ds=null,yn=1,wn="";function di(e,t){fd[pd++]=Mp,fd[pd++]=Jx,Jx=e,Mp=t}function MP(e,t,a){co[uo++]=yn,co[uo++]=wn,co[uo++]=Ds,Ds=e;var r=yn;e=wn;var n=32-Wr(r)-1;r&=~(1<<n),a+=1;var s=32-Wr(t)+n;if(30<s){var l=n-n%5;s=(r&(1<<l)-1).toString(32),r>>=l,n-=l,yn=1<<32-Wr(t)+n|a<<n|r,wn=s+e}else yn=1<<s|a<<n|r,wn=e}function Av(e){e.return!==null&&(di(e,1),MP(e,1,0))}function _S(e){for(;e===Jx;)Jx=fd[--pd],fd[pd]=null,Mp=fd[--pd],fd[pd]=null;for(;e===Ds;)Ds=co[--uo],co[uo]=null,wn=co[--uo],co[uo]=null,yn=co[--uo],co[uo]=null}function PP(e,t){co[uo++]=yn,co[uo++]=wn,co[uo++]=Ds,yn=t.id,wn=t.overflow,Ds=e}var Sa=null,Mt=null,Je=!1,Ts=null,mo=!1,A1=Error(ie(519));function Os(e){var t=Error(ie(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Pp(po(t,e)),A1}function PA(e){var{stateNode:t,type:a,memoizedProps:r}=e;switch(t[_a]=e,t[Er]=r,a){case"dialog":at("cancel",t),at("close",t);break;case"iframe":case"object":case"embed":at("load",t);break;case"video":case"audio":for(a=0;a<Op.length;a++)at(Op[a],t);break;case"source":at("error",t);break;case"img":case"image":case"link":at("error",t),at("load",t);break;case"details":at("toggle",t);break;case"input":at("invalid",t),sP(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":at("invalid",t);break;case"textarea":at("invalid",t),cP(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!=="string"&&typeof a!=="number"&&typeof a!=="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||dN(t.textContent,a)?(r.popover!=null&&(at("beforetoggle",t),at("toggle",t)),r.onScroll!=null&&at("scroll",t),r.onScrollEnd!=null&&at("scrollend",t),r.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||Os(e,!0)}function ev(e){for(Sa=e.return;Sa;)switch(Sa.tag){case 5:case 31:case 13:mo=!1;return;case 27:case 3:mo=!0;return;default:Sa=Sa.return}}function Qu(e){if(e!==Sa)return!1;if(!Je)return ev(e),Je=!0,!1;var t=e.tag,a;if(a=t!==3&&t!==27){if(a=t===5)a=e.type,a=!(a!=="form"&&a!=="button")||gS(e.type,e.memoizedProps);a=!a}if(a&&Mt&&Os(e),ev(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ie(317));Mt=IM(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ie(317));Mt=IM(e)}else t===27?(t=Mt,Us(e.type)?(e=bS,bS=null,Mt=e):Mt=t):Mt=Sa?ho(e.stateNode.nextSibling):null;return!0}function lc(){Mt=Sa=null,Je=!1}function Xw(){var e=Ts;return e!==null&&(Tr===null?Tr=e:Tr.push.apply(Tr,e),Ts=null),e}function Pp(e){Ts===null?Ts=[e]:Ts.push(e)}var M1=In(null),yc=null,fi=null;function Ss(e,t,a){Pt(M1,t._currentValue),t._currentValue=a}function mi(e){e._currentValue=M1.current,Ba(M1)}function Ex(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function P1(e,t,a,r){var n=e.child;n!==null&&(n.return=e);for(;n!==null;){var s=n.dependencies;if(s!==null){var l=n.child;s=s.firstContext;e:for(;s!==null;){var c=s;s=n;for(var f=0;f<t.length;f++)if(c.context===t[f]){s.lanes|=a,c=s.alternate,c!==null&&(c.lanes|=a),Ex(s.return,a,e),r||(l=null);break e}s=c.next}}else if(n.tag===18){if(l=n.return,l===null)throw Error(ie(341));l.lanes|=a,s=l.alternate,s!==null&&(s.lanes|=a),Ex(l,a,e),l=null}else n.tag===13&&n.memoizedState!==null&&n.memoizedState.dehydrated===null?(n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Ex(n.return,a,e),l=n.child,l=l!==null?l.sibling:null):l=n.child;if(l!==null)l.return=n;else for(l=n;l!==null;){if(l===e){l=null;break}if(n=l.sibling,n!==null){n.return=l.return,l=n;break}l=l.return}n=l}}function cc(e,t,a,r){e=null;for(var n=t,s=!1;n!==null;){if(!s){if((n.flags&524288)!==0)s=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var l=n.alternate;if(l===null)throw Error(ie(387));if(l=l.memoizedProps,l!==null){var c=n.type;$r(n.pendingProps.value,l.value)||(e!==null?e.push(c):e=[c])}}else if(n===Kx.current){if(l=n.alternate,l===null)throw Error(ie(387));l.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Od):e=[Od])}n=n.return}return e!==null&&P1(t,e,a,r),t.flags|=262144,e!==null}function tv(e){for(e=e.firstContext;e!==null;){if(!$r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function uc(e){yc=e,fi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function za(e){return EP(yc,e)}function gx(e,t){return yc===null&&uc(e),EP(e,t)}function EP(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},fi===null){if(e===null)throw Error(ie(308));fi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fi=fi.next=t;return a}var fq=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},pq=Kl,mq=ql,na={$$typeof:vn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zS(){return{controller:new fq,data:new Map,refCount:0}}function Yp(e){e.refCount--,e.refCount===0&&pq(mq,function(){e.controller.abort()})}function EA(e,t){if((e.pendingLanes&4194048)!==0){var a=e.transitionTypes;a===null&&(a=e.transitionTypes=[]);for(e=0;e<t.length;e++){var r=t[e];a.indexOf(r)===-1&&a.push(r)}}}var cp=null;function gq(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var hp=null,E1=0,dc=0,vd=null;function hq(e,t){if(hp===null){var a=hp=[];E1=0,dc=dk(),vd={status:"pending",value:void 0,then:function(r){a.push(r)}}}return E1++,t.then(NA,NA),t}function NA(){if(--E1===0&&(cp=null,hp!==null)){vd!==null&&(vd.status="fulfilled");var e=hp;hp=null,dc=0,vd=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xq(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var n=0;n<a.length;n++)(0,a[n])(t)},function(n){r.status="rejected",r.reason=n;for(n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var DA=je.S;je.S=function(e,t){if(XE=Xr(),typeof t==="object"&&t!==null&&typeof t.then==="function"&&hq(e,t),cp!==null)for(var a=Ed;a!==null;)EA(a,cp),a=a.next;if(a=e.types,a!==null){for(var r=Ed;r!==null;)EA(r,a),r=r.next;if(dc!==0){r=cp,r===null&&(r=cp=[]);for(var n=0;n<a.length;n++){var s=a[n];r.indexOf(s)===-1&&r.push(s)}}}DA!==null&&DA(e,t)};var rc=In(null);function BS(){var e=rc.current;return e!==null?e:Ct.pooledCache}function Nx(e,t){t===null?Pt(rc,rc.current):Pt(rc,t.pool)}function NP(){var e=BS();return e===null?null:{parent:na._currentValue,pool:e}}var Fd=Error(ie(460)),FS=Error(ie(474)),Mv=Error(ie(542)),av={then:function(){}};function OA(e){return e=e.status,e==="fulfilled"||e==="rejected"}function DP(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(bn,bn),t=a),t.status){case"fulfilled":return t.value;case"rejected":if(e=t.reason,zA(e),e===void 0&&!("reason"in t))throw Error(ie(600));throw e;default:if(typeof t.status==="string")t.then(bn,bn);else{if(e=Ct,e!==null&&100<e.shellSuspendCounter)throw Error(ie(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=r}},function(r){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zA(e),e}throw oc=t,Fd}}function Ql(e){try{var t=e._init;return t(e._payload)}catch(a){if(a!==null&&typeof a==="object"&&typeof a.then==="function")throw oc=a,Fd;throw a}}var oc=null;function _A(){if(oc===null)throw Error(ie(459));var e=oc;return oc=null,e}function zA(e){if(e===Fd||e===Mv)throw Error(ie(483))}var bd=null,Ep=0;function hx(e){var t=Ep;return Ep+=1,bd===null&&(bd=[]),DP(bd,e,t)}function ms(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xx(e,t){if(t.$$typeof===Qj)throw Error(ie(525));throw e=Object.prototype.toString.call(t),Error(ie(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function OP(e){function t(k,I){if(e){var T=k.deletions;T===null?(k.deletions=[I],k.flags|=16):T.push(I)}}function a(k,I){if(!e)return null;for(;I!==null;)t(k,I),I=I.sibling;return null}function r(k){for(var I=new Map;k!==null;)k.key===null?I.set(k.index,k):I.set(k.key,k),k=k.sibling;return I}function n(k,I){return k=pi(k,I),k.index=0,k.sibling=null,k}function s(k,I,T){if(k.index=T,!e)return k.flags|=1048576,I;if(T=k.alternate,T!==null)return T=T.index,T<I?(k.flags|=2,I):T;return k.flags|=134217730,I}function l(k){return e&&k.alternate===null&&(k.flags|=134217730),k}function c(k,I,T,R){if(I===null||I.tag!==6)return I=qw(T,k.mode,R),I.return=k,I;return I=n(I,T),I.return=k,I}function f(k,I,T,R){var E=T.type;if(E===od)return k=g(k,I,T.props.children,R,T.key),ms(k,T),k;if(I!==null&&(I.elementType===E||typeof E==="object"&&E!==null&&E.$$typeof===xs&&Ql(E)===I.type))return I=n(I,T.props),ms(I,T),I.return=k,I;return I=Px(T.type,T.key,T.props,null,k.mode,R),ms(I,T),I.return=k,I}function m(k,I,T,R){if(I===null||I.tag!==4||I.stateNode.containerInfo!==T.containerInfo||I.stateNode.implementation!==T.implementation)return I=Kw(T,k.mode,R),I.return=k,I;return I=n(I,T.children||[]),I.return=k,I}function g(k,I,T,R,E){if(I===null||I.tag!==7)return I=ac(T,k.mode,R,E),I.return=k,I;return I=n(I,T),I.return=k,I}function h(k,I,T){if(typeof I==="string"&&I!==""||typeof I==="number"||typeof I==="bigint")return I=qw(""+I,k.mode,T),I.return=k,I;if(typeof I==="object"&&I!==null){switch(I.$$typeof){case cx:return T=Px(I.type,I.key,I.props,null,k.mode,T),ms(T,I),T.return=k,T;case op:return I=Kw(I,k.mode,T),I.return=k,I;case xs:return I=Ql(I),h(k,I,T)}if(np(I)||Jf(I))return I=ac(I,k.mode,T,null),I.return=k,I;if(typeof I.then==="function")return h(k,hx(I),T);if(I.$$typeof===vn)return h(k,gx(k,I),T);xx(k,I)}return null}function x(k,I,T,R){var E=I!==null?I.key:null;if(typeof T==="string"&&T!==""||typeof T==="number"||typeof T==="bigint")return E!==null?null:c(k,I,""+T,R);if(typeof T==="object"&&T!==null){switch(T.$$typeof){case cx:return T.key===E?f(k,I,T,R):null;case op:return T.key===E?m(k,I,T,R):null;case xs:return T=Ql(T),x(k,I,T,R)}if(np(T)||Jf(T))return E!==null?null:g(k,I,T,R,null);if(typeof T.then==="function")return x(k,I,hx(T),R);if(T.$$typeof===vn)return x(k,I,gx(k,T),R);xx(k,T)}return null}function v(k,I,T,R,E){if(typeof R==="string"&&R!==""||typeof R==="number"||typeof R==="bigint")return k=k.get(T)||null,c(I,k,""+R,E);if(typeof R==="object"&&R!==null){switch(R.$$typeof){case cx:return k=k.get(R.key===null?T:R.key)||null,f(I,k,R,E);case op:return k=k.get(R.key===null?T:R.key)||null,m(I,k,R,E);case xs:return R=Ql(R),v(k,I,T,R,E)}if(np(R)||Jf(R))return k=k.get(T)||null,g(I,k,R,E,null);if(typeof R.then==="function")return v(k,I,T,hx(R),E);if(R.$$typeof===vn)return v(k,I,T,gx(I,R),E);xx(I,R)}return null}function w(k,I,T,R){for(var E=null,M=null,P=I,O=I=0,F=null;P!==null&&O<T.length;O++){P.index>O?(F=P,P=null):F=P.sibling;var z=x(k,P,T[O],R);if(z===null){P===null&&(P=F);break}e&&P&&z.alternate===null&&t(k,P),I=s(z,I,O),M===null?E=z:M.sibling=z,M=z,P=F}if(O===T.length)return a(k,P),Je&&di(k,O),E;if(P===null){for(;O<T.length;O++)P=h(k,T[O],R),P!==null&&(I=s(P,I,O),M===null?E=P:M.sibling=P,M=P);return Je&&di(k,O),E}for(P=r(P);O<T.length;O++)F=v(P,k,O,T[O],R),F!==null&&(e&&(z=F.alternate,z!==null&&P.delete(z.key===null?O:z.key)),I=s(F,I,O),M===null?E=F:M.sibling=F,M=F);return e&&P.forEach(function(Y){return t(k,Y)}),Je&&di(k,O),E}function C(k,I,T,R){if(T==null)throw Error(ie(151));for(var E=null,M=null,P=I,O=I=0,F=null,z=T.next();P!==null&&!z.done;O++,z=T.next()){P.index>O?(F=P,P=null):F=P.sibling;var Y=x(k,P,z.value,R);if(Y===null){P===null&&(P=F);break}e&&P&&Y.alternate===null&&t(k,P),I=s(Y,I,O),M===null?E=Y:M.sibling=Y,M=Y,P=F}if(z.done)return a(k,P),Je&&di(k,O),E;if(P===null){for(;!z.done;O++,z=T.next())z=h(k,z.value,R),z!==null&&(I=s(z,I,O),M===null?E=z:M.sibling=z,M=z);return Je&&di(k,O),E}for(P=r(P);!z.done;O++,z=T.next())z=v(P,k,O,z.value,R),z!==null&&(e&&(F=z.alternate,F!==null&&P.delete(F.key===null?O:F.key)),I=s(z,I,O),M===null?E=z:M.sibling=z,M=z);return e&&P.forEach(function(q){return t(k,q)}),Je&&di(k,O),E}function L(k,I,T,R){if(typeof T==="object"&&T!==null&&T.type===od&&T.key===null&&T.props.ref===void 0&&(T=T.props.children),typeof T==="object"&&T!==null){switch(T.$$typeof){case cx:e:{for(var E=T.key;I!==null;){if(I.key===E){if(E=T.type,E===od){if(I.tag===7){a(k,I.sibling),R=n(I,T.props.children),ms(R,T),R.return=k,k=R;break e}}else if(I.elementType===E||typeof E==="object"&&E!==null&&E.$$typeof===xs&&Ql(E)===I.type){a(k,I.sibling),R=n(I,T.props),ms(R,T),R.return=k,k=R;break e}a(k,I);break}else t(k,I);I=I.sibling}T.type===od?(R=ac(T.props.children,k.mode,R,T.key),ms(R,T),R.return=k,k=R):(R=Px(T.type,T.key,T.props,null,k.mode,R),ms(R,T),R.return=k,k=R)}return l(k);case op:e:{for(E=T.key;I!==null;){if(I.key===E)if(I.tag===4&&I.stateNode.containerInfo===T.containerInfo&&I.stateNode.implementation===T.implementation){a(k,I.sibling),R=n(I,T.children||[]),R.return=k,k=R;break e}else{a(k,I);break}else t(k,I);I=I.sibling}R=Kw(T,k.mode,R),R.return=k,k=R}return l(k);case xs:return T=Ql(T),L(k,I,T,R)}if(np(T))return w(k,I,T,R);if(Jf(T)){if(E=Jf(T),typeof E!=="function")throw Error(ie(150));return T=E.call(T),C(k,I,T,R)}if(typeof T.then==="function")return L(k,I,hx(T),R);if(T.$$typeof===vn)return L(k,I,gx(k,T),R);xx(k,T)}return typeof T==="string"&&T!==""||typeof T==="number"||typeof T==="bigint"?(T=""+T,I!==null&&I.tag===6?(a(k,I.sibling),R=n(I,T),R.return=k,k=R):(a(k,I),R=qw(T,k.mode,R),R.return=k,k=R),l(k)):a(k,I)}return function(k,I,T,R){try{Ep=0;var E=L(k,I,T,R);return bd=null,E}catch(P){if(P===Fd||P===Mv)throw P;var M=Ar(29,P,null,k.mode);return M.lanes=R,M.return=k,M}finally{}}}var fc=OP(!0),_P=OP(!1),vs=!1;function US(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function N1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function nc(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ic(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ut&2)!==0){var n=r.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),r.pending=t,t=Zx(e),TP(e,null,a),t}return Rv(e,r,t,a),Zx(e)}function xp(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ZM(e,a)}}function Yw(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,s=null;if(a=a.firstBaseUpdate,a!==null){do{var l={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};s===null?n=s=l:s=s.next=l,a=a.next}while(a!==null);s===null?n=s=t:s=s.next=t}else n=s=t;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var D1=!1;function vp(){if(D1){var e=vd;if(e!==null)throw e}}function bp(e,t,a,r){D1=!1;var n=e.updateQueue;vs=!1;var{firstBaseUpdate:s,lastBaseUpdate:l}=n,c=n.shared.pending;if(c!==null){n.shared.pending=null;var f=c,m=f.next;f.next=null,l===null?s=m:l.next=m,l=f;var g=e.alternate;g!==null&&(g=g.updateQueue,c=g.lastBaseUpdate,c!==l&&(c===null?g.firstBaseUpdate=m:c.next=m,g.lastBaseUpdate=f))}if(s!==null){var h=n.baseState;l=0,g=m=f=null,c=s;do{var x=c.lane&-536870913,v=x!==c.lane;if(v?(ot&x)===x:(r&x)===x){x!==0&&x===dc&&(D1=!0),g!==null&&(g=g.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});e:{var w=e,C=c;x=t;var L=a;switch(C.tag){case 1:if(w=C.payload,typeof w==="function"){h=w.call(L,h,x);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=C.payload,x=typeof w==="function"?w.call(L,h,x):w,x===null||x===void 0)break e;h=It({},h,x);break e;case 2:vs=!0}}x=c.callback,x!==null&&(e.flags|=64,v&&(e.flags|=8192),v=n.callbacks,v===null?n.callbacks=[x]:v.push(x))}else v={lane:x,tag:c.tag,payload:c.payload,callback:c.callback,next:null},g===null?(m=g=v,f=h):g=g.next=v,l|=x;if(c=c.next,c===null)if(c=n.shared.pending,c===null)break;else v=c,c=v.next,v.next=null,n.lastBaseUpdate=v,n.shared.pending=null}while(1);g===null&&(f=h),n.baseState=f,n.firstBaseUpdate=m,n.lastBaseUpdate=g,s===null&&(n.shared.lanes=0),Bs|=l,e.lanes=l,e.memoizedState=h}}function zP(e,t){if(typeof e!=="function")throw Error(ie(191,e));e.call(t)}function BP(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)zP(a[e],t)}var _s=In(null),rv=In(0);function BA(e,t){e=yi,Pt(rv,e),Pt(_s,t),yi=e|t.baseLanes}function O1(){Pt(rv,yi),Pt(_s,_s.current)}function HS(){yi=rv.current,Ba(_s),Ba(rv)}var Ha=In(null),er=null;function Rs(e){var t=e.alternate;Pt(Fa,Fa.current&1),Pt(Ha,e),er===null&&(t===null||_s.current!==null?er=e:t.memoizedState!==null&&(er=e))}function _1(e){Pt(Fa,Fa.current),Pt(Ha,e),er===null&&(er=e)}function FP(e){e.tag===22?(Pt(Fa,Fa.current),Pt(Ha,e),er===null&&(er=e)):As()}function As(){Pt(Fa,Fa.current),Pt(Ha,Ha.current)}function Gr(e){Ba(Ha),er===e&&(er=null),Ba(Fa)}var Fa=In(0);function Np(e,t){Pt(Ha,Ha.current),Pt(Fa,t)}function VS(e){Ba(Fa),Ba(Ha),er===e&&(er=null)}function ov(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||vS(a)||mk(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var xi=0,Xe=null,St=null,oa=null,nv=!1,yd=!1,pc=!1,iv=0,Dp=0,wd=null,vq=0;function jt(){throw Error(ie(321))}function jS(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!$r(e[a],t[a]))return!1;return!0}function GS(e,t,a,r,n,s){return xi=s,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,je.H=e===null||e.memoizedState===null?hE:xE,pc=!1,s=a(r,n),pc=!1,yd&&(s=HP(t,a,r,n)),UP(e),s}function UP(e){je.H=sv;var t=St!==null&&St.next!==null;if(xi=0,oa=St=Xe=null,nv=!1,Dp=0,wd=null,t)throw Error(ie(300));e===null||ia||(e=e.dependencies,e!==null&&tv(e)&&(ia=!0))}function HP(e,t,a,r){Xe=e;var n=0;do{if(yd&&(wd=null),Dp=0,yd=!1,25<=n)throw Error(ie(301));if(n+=1,oa=St=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}je.H=Lq,s=t(a,r)}while(yd);return s}function bq(){var e=je.H,t=e.useState()[0];return t=typeof t.then==="function"?Wp(t):t,e=e.useState()[0],(St!==null?St.memoizedState:null)!==e&&(Xe.flags|=1024),t}function qS(){var e=iv!==0;return iv=0,e}function KS(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function XS(e){if(nv){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nv=!1}xi=0,oa=St=Xe=null,yd=!1,Dp=iv=0,wd=null}function pr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oa===null?Xe.memoizedState=oa=e:oa=oa.next=e,oa}function Wt(){if(St===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=oa===null?Xe.memoizedState:oa.next;if(t!==null)oa=t,St=e;else{if(e===null){if(Xe.alternate===null)throw Error(ie(467));throw Error(ie(310))}St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},oa===null?Xe.memoizedState=oa=e:oa=oa.next=e}return oa}function Pv(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wp(e){var t=Dp;return Dp+=1,wd===null&&(wd=[]),e=DP(wd,e,t),t=Xe,(oa===null?t.memoizedState:oa.next)===null&&(t=t.alternate,je.H=t===null||t.memoizedState===null?hE:xE),e}function Ev(e){if(e!==null&&typeof e==="object"){if(typeof e.then==="function")return Wp(e);if(e.$$typeof===eG)return;if(e.$$typeof===vn)return za(e)}throw Error(ie(438,String(e)))}function YS(e){var t=null,a=Xe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=Xe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Pv(),Xe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=Jj;return t.index++,a}function vi(e,t){return typeof t==="function"?t(e):t}function Dx(e){var t=Wt();return WS(t,St,e)}function WS(e,t,a){var r=e.queue;if(r===null)throw Error(ie(311));r.lastRenderedReducer=a;var n=e.baseQueue,s=r.pending;if(s!==null){if(n!==null){var l=n.next;n.next=s.next,s.next=l}t.baseQueue=n=s,r.pending=null}if(s=e.baseState,n===null)e.memoizedState=s;else{t=n.next;var c=l=null,f=null,m=t,g=!1;do{var h=m.lane&-536870913;if(h!==m.lane?(ot&h)===h:(xi&h)===h){var x=m.revertLane;if(x===0)f!==null&&(f=f.next={lane:0,revertLane:0,gesture:null,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null}),h===dc&&(g=!0);else if((xi&x)===x){m=m.next,x===dc&&(g=!0);continue}else h={lane:0,revertLane:m.revertLane,gesture:null,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null},f===null?(c=f=h,l=s):f=f.next=h,Xe.lanes|=x,Bs|=x;h=m.action,pc&&a(s,h),s=m.hasEagerState?m.eagerState:a(s,h)}else x={lane:h,revertLane:m.revertLane,gesture:m.gesture,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null},f===null?(c=f=x,l=s):f=f.next=x,Xe.lanes|=h,Bs|=h;m=m.next}while(m!==null&&m!==t);if(f===null?l=s:f.next=c,!$r(s,e.memoizedState)&&(ia=!0,g&&(a=vd,a!==null)))throw a;e.memoizedState=s,e.baseState=l,e.baseQueue=f,r.lastRenderedState=s}return n===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ww(e){var t=Wt(),a=t.queue;if(a===null)throw Error(ie(311));a.lastRenderedReducer=e;var{dispatch:r,pending:n}=a,s=t.memoizedState;if(n!==null){a.pending=null;var l=n=n.next;do s=e(s,l.action),l=l.next;while(l!==n);$r(s,t.memoizedState)||(ia=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),a.lastRenderedState=s}return[s,r]}function VP(e,t,a){var r=Xe,n=Wt(),s=Je;if(s){if(a===void 0)throw Error(ie(407));a=a()}else a=t();var l=!$r((St||n).memoizedState,a);if(l&&(n.memoizedState=a,ia=!0),n=n.queue,$S(qP.bind(null,r,n,e),[e]),e=n.getSnapshot!==t||l||oa!==null&&(oa.memoizedState.tag&1)!==0,Rd(e?9:8,{destroy:void 0},GP.bind(null,r,n,a,t),null),e){if(r.flags|=2048,Ct===null)throw Error(ie(349));s||(xi&127)!==0||jP(r,t,a)}return a}function jP(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Xe.updateQueue,t===null?(t=Pv(),Xe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function GP(e,t,a,r){t.value=a,t.getSnapshot=r,KP(t)&&XP(e)}function qP(e,t,a){return a(function(){KP(t)&&XP(e)})}function KP(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!$r(e,a)}catch(r){return!0}}function XP(e){var t=bc(e,2);t!==null&&Mr(t,e,2)}function z1(e){var t=pr();if(typeof e==="function"){var a=e;if(e=a(),pc){ys(!0);try{a()}finally{ys(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:e},t}function YP(e,t,a,r){return e.baseState=a,WS(e,St,typeof r==="function"?r:vi)}function yq(e,t,a,r,n){if(Dv(e))throw Error(ie(485));if(e=t.action,e!==null){var s={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(l){s.listeners.push(l)}};je.T!==null?a(!0):s.isTransition=!1,r(s),a=t.pending,a===null?(s.next=t.pending=s,WP(t,s)):(s.next=a.next,t.pending=a.next=s)}}function WP(e,t){var{action:a,payload:r}=t,n=e.state;if(t.isTransition){var s=je.T,l={};l.types=s!==null?s.types:null,je.T=l;try{var c=a(n,r),f=je.S;f!==null&&f(l,c),FA(e,t,c)}catch(m){B1(e,t,m)}finally{s!==null&&l.types!==null&&(s.types=l.types),je.T=s}}else try{s=a(n,r),FA(e,t,s)}catch(m){B1(e,t,m)}}function FA(e,t,a){a!==null&&typeof a==="object"&&typeof a.then==="function"?a.then(function(r){UA(e,t,r)},function(r){return B1(e,t,r)}):UA(e,t,a)}function UA(e,t,a){t.status="fulfilled",t.value=a,$P(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,WP(e,a)))}function B1(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,$P(t),t=t.next;while(t!==r)}e.action=null}function $P(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function QP(e,t){return t}function HA(e,t){if(Je){var a=Ct.formState;if(a!==null){e:{var r=Xe;if(Je){if(Mt){t:{var n=Mt;for(var s=mo;n.nodeType!==8;){if(!s){n=null;break t}if(n=ho(n.nextSibling),n===null){n=null;break t}}s=n.data,n=s==="F!"||s==="F"?n:null}if(n){Mt=ho(n.nextSibling),r=n.data==="F!";break e}}Os(r)}r=!1}r&&(t=a[0])}}return a=pr(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:QP,lastRenderedState:t},a.queue=r,a=pE.bind(null,Xe,r),r.dispatch=a,r=z1(!1),s=ek.bind(null,Xe,!1,r.queue),r=pr(),n={state:t,dispatch:null,action:e,pending:null},r.queue=n,a=yq.bind(null,Xe,n,s,a),n.dispatch=a,r.memoizedState=e,[t,a,!1]}function VA(e){var t=Wt();return ZP(t,St,e)}function ZP(e,t,a){if(t=WS(e,t,QP)[0],e=Dx(vi)[0],typeof t==="object"&&t!==null&&typeof t.then==="function")try{var r=Wp(t)}catch(l){if(l===Fd)throw Mv;throw l}else r=t;t=Wt();var n=t.queue,s=n.dispatch;return a!==t.memoizedState&&(Xe.flags|=2048,Rd(9,{destroy:void 0},wq.bind(null,n,a),null)),[r,s,e]}function wq(e,t){e.action=t}function jA(e){var t=Wt(),a=St;if(a!==null)return ZP(t,a,e);Wt(),t=t.memoizedState,a=Wt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function Rd(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=Xe.updateQueue,t===null&&(t=Pv(),Xe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function JP(){return Wt().memoizedState}function Ox(e,t,a,r){var n=pr();Xe.flags|=e,n.memoizedState=Rd(1|t,{destroy:void 0},a,r===void 0?null:r)}function Nv(e,t,a,r){var n=Wt();r=r===void 0?null:r;var s=n.memoizedState.inst;St!==null&&r!==null&&jS(r,St.memoizedState.deps)?n.memoizedState=Rd(t,s,a,r):(Xe.flags|=e,n.memoizedState=Rd(1|t,s,a,r))}function GA(e,t){Ox(8390656,8,e,t)}function $S(e,t){Nv(2048,8,e,t)}function Sq(e){Xe.flags|=4;var t=Xe.updateQueue;if(t===null)t=Pv(),Xe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function eE(e){var t=Wt().memoizedState;return Sq({ref:t,nextImpl:e}),function(){if((ut&2)!==0)throw Error(ie(440));return t.impl.apply(void 0,arguments)}}function tE(e,t){return Nv(4,2,e,t)}function aE(e,t){return Nv(4,4,e,t)}function rE(e,t){if(typeof t==="function"){e=e();var a=t(e);return function(){typeof a==="function"?a():t(null)}}if(t!==null&&t!==void 0)return e=e(),t.current=e,function(){t.current=null}}function oE(e,t,a){a=a!==null&&a!==void 0?a.concat([e]):null,Nv(4,4,rE.bind(null,t,e),a)}function QS(){}function nE(e,t){var a=Wt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&jS(t,r[1]))return r[0];return a.memoizedState=[e,t],e}function iE(e,t){var a=Wt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&jS(t,r[1]))return r[0];if(r=e(),pc){ys(!0);try{e()}finally{ys(!1)}}return a.memoizedState=[r,t],r}function ZS(e,t,a){if(a===void 0||(xi&1073741824)!==0&&(ot&261930)===0)return e.memoizedState=t;return e.memoizedState=a,e=WE(),Xe.lanes|=e,Bs|=e,a}function sE(e,t,a,r){if($r(a,t))return a;if(_s.current!==null)return e=ZS(e,a,r),$r(e,t)||(ia=!0),e;if((xi&106)===0||(xi&1073741824)!==0&&(ot&261930)===0)return ia=!0,e.memoizedState=a;return e=WE(),Xe.lanes|=e,Bs|=e,t}function lE(e,t,a,r,n){var s=dt.p;dt.p=s!==0&&8>s?s:8;var l=je.T,c={};c.types=l!==null?l.types:null,je.T=c,ek(e,!1,t,a);try{var f=n(),m=je.S;if(m!==null&&m(c,f),f!==null&&typeof f==="object"&&typeof f.then==="function"){var g=xq(f,r);yp(e,t,g,go(e))}else yp(e,t,r,go(e))}catch(h){yp(e,t,{then:function(){},status:"rejected",reason:h},go())}finally{dt.p=s,l!==null&&c.types!==null&&(l.types=c.types),je.T=l}}function kq(){}function F1(e,t,a,r){if(e.tag!==5)throw Error(ie(476));var n=cE(e).queue;lE(e,n,t,tc,a===null?kq:function(){return uE(e),a(r)})}function cE(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:tc,baseState:tc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:tc},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function uE(e){var t=cE(e);t.next===null&&(t=e.alternate.memoizedState),yp(e,t.next.queue,{},go())}function JS(){return za(Od)}function dE(){return Wt().memoizedState}function fE(){return Wt().memoizedState}function Cq(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=go();e=nc(a);var r=ic(t,e,a);r!==null&&(Mr(r,t,a),xp(r,t,a)),t={cache:zS()},e.payload=t;return}t=t.return}}function Iq(e,t,a){var r=go();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Dv(e)?mE(t,a):(a=DS(e,t,a,r),a!==null&&(Mr(a,e,r),gE(a,t,r)))}function pE(e,t,a){var r=go();yp(e,t,a,r)}function yp(e,t,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Dv(e))mE(t,n);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var l=t.lastRenderedState,c=s(l,a);if(n.hasEagerState=!0,n.eagerState=c,$r(c,l))return Rv(e,t,n,0),Ct===null&&Tv(),!1}catch(f){}finally{}if(a=DS(e,t,n,r),a!==null)return Mr(a,e,r),gE(a,t,r),!0}return!1}function ek(e,t,a,r){if(r={lane:2,revertLane:dk(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Dv(e)){if(t)throw Error(ie(479))}else t=DS(e,a,r,2),t!==null&&Mr(t,e,2)}function Dv(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function mE(e,t){yd=nv=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function gE(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ZM(e,a)}}var sv={readContext:za,use:Ev,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt,useEffectEvent:jt},hE={readContext:za,use:Ev,useCallback:function(e,t){return pr().memoizedState=[e,t===void 0?null:t],e},useContext:za,useEffect:GA,useImperativeHandle:function(e,t,a){a=a!==null&&a!==void 0?a.concat([e]):null,Ox(4194308,4,rE.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ox(4194308,4,e,t)},useInsertionEffect:function(e,t){Ox(4,2,e,t)},useMemo:function(e,t){var a=pr();t=t===void 0?null:t;var r=e();if(pc){ys(!0);try{e()}finally{ys(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=pr();if(a!==void 0){var n=a(t);if(pc){ys(!0);try{a(t)}finally{ys(!1)}}}else n=t;return r.memoizedState=r.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=Iq.bind(null,Xe,e),[r.memoizedState,e]},useRef:function(e){var t=pr();return e={current:e},t.memoizedState=e},useState:function(e){e=z1(e);var t=e.queue,a=pE.bind(null,Xe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:QS,useDeferredValue:function(e,t){var a=pr();return ZS(a,e,t)},useTransition:function(){var e=z1(!1);return e=lE.bind(null,Xe,e.queue,!0,!1),pr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=Xe,n=pr();if(Je){if(a===void 0)throw Error(ie(407));a=a()}else{if(a=t(),Ct===null)throw Error(ie(349));(ot&127)!==0||jP(r,t,a)}n.memoizedState=a;var s={value:a,getSnapshot:t};return n.queue=s,GA(qP.bind(null,r,s,e),[e]),r.flags|=2048,Rd(9,{destroy:void 0},GP.bind(null,r,s,a,t),null),a},useId:function(){var e=pr(),t=Ct.identifierPrefix;if(Je){var a=wn,r=yn;a=(r&~(1<<32-Wr(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=iv++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=vq++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:JS,useFormState:HA,useActionState:HA,useOptimistic:function(e){var t=pr();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ek.bind(null,Xe,!0,a),a.dispatch=t,[e,t]},useMemoCache:YS,useCacheRefresh:function(){return pr().memoizedState=Cq.bind(null,Xe)},useEffectEvent:function(e){var t=pr(),a={impl:e};return t.memoizedState=a,function(){if((ut&2)!==0)throw Error(ie(440));return a.impl.apply(void 0,arguments)}}},xE={readContext:za,use:Ev,useCallback:nE,useContext:za,useEffect:$S,useImperativeHandle:oE,useInsertionEffect:tE,useLayoutEffect:aE,useMemo:iE,useReducer:Dx,useRef:JP,useState:function(){return Dx(vi)},useDebugValue:QS,useDeferredValue:function(e,t){var a=Wt();return sE(a,St.memoizedState,e,t)},useTransition:function(){var e=Dx(vi)[0],t=Wt().memoizedState;return[typeof e==="boolean"?e:Wp(e),t]},useSyncExternalStore:VP,useId:dE,useHostTransitionStatus:JS,useFormState:VA,useActionState:VA,useOptimistic:function(e,t){var a=Wt();return YP(a,St,e,t)},useMemoCache:YS,useCacheRefresh:fE,useEffectEvent:eE},Lq={readContext:za,use:Ev,useCallback:nE,useContext:za,useEffect:$S,useImperativeHandle:oE,useInsertionEffect:tE,useLayoutEffect:aE,useMemo:iE,useReducer:Ww,useRef:JP,useState:function(){return Ww(vi)},useDebugValue:QS,useDeferredValue:function(e,t){var a=Wt();return St===null?ZS(a,e,t):sE(a,St.memoizedState,e,t)},useTransition:function(){var e=Ww(vi)[0],t=Wt().memoizedState;return[typeof e==="boolean"?e:Wp(e),t]},useSyncExternalStore:VP,useId:dE,useHostTransitionStatus:JS,useFormState:jA,useActionState:jA,useOptimistic:function(e,t){var a=Wt();if(St!==null)return YP(a,St,e,t);return a.baseState=e,[e,a.queue.dispatch]},useMemoCache:YS,useCacheRefresh:fE,useEffectEvent:eE};function $w(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a===null||a===void 0?t:It({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var U1={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=go(),n=nc(r);n.payload=t,a!==void 0&&a!==null&&(n.callback=a),t=ic(e,n,r),t!==null&&(Mr(t,e,r),xp(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=go(),n=nc(r);n.tag=1,n.payload=t,a!==void 0&&a!==null&&(n.callback=a),t=ic(e,n,r),t!==null&&(Mr(t,e,r),xp(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=go(),r=nc(a);r.tag=2,t!==void 0&&t!==null&&(r.callback=t),t=ic(e,r,a),t!==null&&(Mr(t,e,a),xp(t,e,a))}};function qA(e,t,a,r,n,s,l){return e=e.stateNode,typeof e.shouldComponentUpdate==="function"?e.shouldComponentUpdate(r,s,l):t.prototype&&t.prototype.isPureReactComponent?!Ap(a,r)||!Ap(n,s):!0}function KA(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps==="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps==="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&U1.enqueueReplaceState(t,t.state,null)}function mc(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=It({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function Tq(e){Qx(e)}function Rq(e){console.error(e)}function Aq(e){Qx(e)}function lv(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function XA(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function H1(e,t,a){return a=nc(a),a.tag=3,a.payload={element:null},a.callback=function(){lv(e,t)},a}function vE(e){return e=nc(e),e.tag=3,e}function bE(e,t,a,r){var n=a.type.getDerivedStateFromError;if(typeof n==="function"){var s=r.value;e.payload=function(){return n(s)},e.callback=function(){XA(t,a,r)}}var l=a.stateNode;l!==null&&typeof l.componentDidCatch==="function"&&(e.callback=function(){XA(t,a,r),typeof n!=="function"&&(Ms===null?Ms=new Set([this]):Ms.add(this));var c=r.stack;this.componentDidCatch(r.value,{componentStack:c!==null?c:""})})}function Mq(e,t,a,r,n){if(a.flags|=32768,r!==null&&typeof r==="object"&&typeof r.then==="function"){if(t=a.alternate,t!==null&&cc(t,a,n,!0),a=Ha.current,a!==null){switch(a.tag){case 31:case 13:case 19:return er===null?hv():a.alternate===null&&Gt===0&&(Gt=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===av?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),r1(e,r,n)),!1;case 22:return a.flags|=65536,r===av?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),r1(e,r,n)),!1}throw Error(ie(435,a.tag))}return r1(e,r,n),hv(),!1}if(Je)return t=Ha.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,r!==A1&&(e=Error(ie(422),{cause:r}),Pp(po(e,a)))):(r!==A1&&(t=Error(ie(423),{cause:r}),Pp(po(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,r=po(r,a),n=H1(e.stateNode,r,n),Yw(e,n),Gt!==4&&(Gt=2)),!1;var s=Error(ie(520),{cause:r});if(s=po(s,a),Cp===null?Cp=[s]:Cp.push(s),Gt!==4&&(Gt=2),t===null)return!0;r=po(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=H1(a.stateNode,r,e),Yw(a,e),!1;case 1:if(t=a.type,s=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError==="function"||s!==null&&typeof s.componentDidCatch==="function"&&(Ms===null||!Ms.has(s))))return a.flags|=65536,n&=-n,a.lanes|=n,n=vE(n),bE(n,e,a,r),Yw(a,n),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var tk=Error(ie(461)),ia=!1;function da(e,t,a,r){t.child=e===null?_P(t,null,a,r):fc(t,e.child,a,r)}function YA(e,t,a,r,n){a=a.render;var s=t.ref;if("ref"in r){var l={};for(var c in r)c!=="ref"&&(l[c]=r[c])}else l=r;if(uc(t),r=GS(e,t,a,l,s,n),c=qS(),e!==null&&!ia)return KS(e,t,n),bi(e,t,n);return Je&&c&&Av(t),t.flags|=1,da(e,t,r,n),t.child}function WA(e,t,a,r,n){if(e===null){var s=a.type;if(typeof s==="function"&&!OS(s)&&s.defaultProps===void 0&&a.compare===null)return t.tag=15,t.type=s,yE(e,t,s,r,n);return e=Px(a.type,null,r,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e}if(s=e.child,!rk(e,n)){var l=s.memoizedProps;if(a=a.compare,a=a!==null?a:Ap,a(l,r)&&e.ref===t.ref)return bi(e,t,n)}return t.flags|=1,e=pi(s,r),e.ref=t.ref,e.return=t,t.child=e}function yE(e,t,a,r,n){if(e!==null){var s=e.memoizedProps;if(Ap(s,r)&&e.ref===t.ref)if(ia=!1,t.pendingProps=r=s,rk(e,n))(e.flags&131072)!==0&&(ia=!0);else return t.lanes=e.lanes,bi(e,t,n)}return V1(e,t,a,r,n)}function wE(e,t,a,r){var n=r.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(s=s!==null?s.baseLanes|a:a,e!==null){r=t.child=e.child;for(n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~s}else r=0,t.child=null;return $A(e,t,s,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Nx(t,s!==null?s.cachePool:null),s!==null?BA(t,s):O1(),FP(t);else return r=t.lanes=536870912,$A(e,t,s!==null?s.baseLanes|a:a,a,r)}else s!==null?(Nx(t,s.cachePool),BA(t,s),As(),t.memoizedState=null):(e!==null&&Nx(t,null),O1(),As());return da(e,t,n,a),t.child}function wp(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $A(e,t,a,r,n){var s=BS();return s=s===null?null:{parent:na._currentValue,pool:s},t.memoizedState={baseLanes:a,cachePool:s},e!==null&&Nx(t,null),O1(),FP(t),e!==null&&cc(e,t,r,!0),t.childLanes=n,null}function _x(e,t){return t=Ov({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function QA(e,t,a){return fc(t,e.child,null,a),e=_x(t,t.pendingProps),e.flags|=2,Gr(t),t.memoizedState=null,e}function Pq(e,t,a){var r=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Je){if(r.mode==="hidden")return e=_x(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},wp(null,e);if(_1(t),(e=Mt)?(e=SN(e,mo),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ds!==null?{id:yn,overflow:wn}:null,retryLane:536870912,hydrationErrors:null},a=AP(e),a.return=t,t.child=a,Sa=t,Mt=null)):e=null,e===null)throw Os(t);return t.lanes=536870912,null}return _x(t,r)}var s=e.memoizedState;if(s!==null){var l=s.dehydrated;if(_1(t),n)if(t.flags&256)t.flags&=-257,t=QA(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(ie(558));else if(ia||cc(e,t,a,!1),n=(a&e.childLanes)!==0,ia||n){if(_s.current===null){if(r=Ct,r!==null&&(l=JM(r,a),l!==0&&l!==s.retryLane))throw s.retryLane=l,bc(e,l),Mr(r,e,l),tk;hv()}t=QA(e,t,a)}else e=s.treeContext,Mt=ho(l.nextSibling),Sa=t,Je=!0,Ts=null,mo=!1,e!==null&&PP(t,e),t=_x(t,r),t.flags|=134221824;return t}return e=pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ju(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!=="function"&&typeof a!=="object")throw Error(ie(284));if(e===null||e.ref!==a)t.flags|=4194816}}function V1(e,t,a,r,n){if(uc(t),a=GS(e,t,a,r,void 0,n),r=qS(),e!==null&&!ia)return KS(e,t,n),bi(e,t,n);return Je&&r&&Av(t),t.flags|=1,da(e,t,a,n),t.child}function ZA(e,t,a,r,n,s){if(uc(t),t.updateQueue=null,a=HP(t,r,a,n),UP(e),r=qS(),e!==null&&!ia)return KS(e,t,s),bi(e,t,s);return Je&&r&&Av(t),t.flags|=1,da(e,t,a,s),t.child}function JA(e,t,a,r,n){if(uc(t),t.stateNode===null){var s=dd,l=a.contextType;typeof l==="object"&&l!==null&&(s=za(l)),s=new a(r,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=U1,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=r,s.state=t.memoizedState,s.refs={},US(t),l=a.contextType,s.context=typeof l==="object"&&l!==null?za(l):dd,s.state=t.memoizedState,l=a.getDerivedStateFromProps,typeof l==="function"&&($w(t,a,l,r),s.state=t.memoizedState),typeof a.getDerivedStateFromProps==="function"||typeof s.getSnapshotBeforeUpdate==="function"||typeof s.UNSAFE_componentWillMount!=="function"&&typeof s.componentWillMount!=="function"||(l=s.state,typeof s.componentWillMount==="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount==="function"&&s.UNSAFE_componentWillMount(),l!==s.state&&U1.enqueueReplaceState(s,s.state,null),bp(t,r,s,n),vp(),s.state=t.memoizedState),typeof s.componentDidMount==="function"&&(t.flags|=4194308),r=!0}else if(e===null){s=t.stateNode;var c=t.memoizedProps,f=mc(a,c);s.props=f;var m=s.context,g=a.contextType;l=dd,typeof g==="object"&&g!==null&&(l=za(g));var h=a.getDerivedStateFromProps;g=typeof h==="function"||typeof s.getSnapshotBeforeUpdate==="function",c=t.pendingProps!==c,g||typeof s.UNSAFE_componentWillReceiveProps!=="function"&&typeof s.componentWillReceiveProps!=="function"||(c||m!==l)&&KA(t,s,r,l),vs=!1;var x=t.memoizedState;s.state=x,bp(t,r,s,n),vp(),m=t.memoizedState,c||x!==m||vs?(typeof h==="function"&&($w(t,a,h,r),m=t.memoizedState),(f=vs||qA(t,a,f,r,x,m,l))?(g||typeof s.UNSAFE_componentWillMount!=="function"&&typeof s.componentWillMount!=="function"||(typeof s.componentWillMount==="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount==="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount==="function"&&(t.flags|=4194308)):(typeof s.componentDidMount==="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=f):(typeof s.componentDidMount==="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,N1(e,t),l=t.memoizedProps,g=mc(a,l),s.props=g,h=t.pendingProps,x=s.context,m=a.contextType,f=dd,typeof m==="object"&&m!==null&&(f=za(m)),c=a.getDerivedStateFromProps,(m=typeof c==="function"||typeof s.getSnapshotBeforeUpdate==="function")||typeof s.UNSAFE_componentWillReceiveProps!=="function"&&typeof s.componentWillReceiveProps!=="function"||(l!==h||x!==f)&&KA(t,s,r,f),vs=!1,x=t.memoizedState,s.state=x,bp(t,r,s,n),vp();var v=t.memoizedState;l!==h||x!==v||vs||e!==null&&e.dependencies!==null&&tv(e.dependencies)?(typeof c==="function"&&($w(t,a,c,r),v=t.memoizedState),(g=vs||qA(t,a,g,r,x,v,f)||e!==null&&e.dependencies!==null&&tv(e.dependencies))?(m||typeof s.UNSAFE_componentWillUpdate!=="function"&&typeof s.componentWillUpdate!=="function"||(typeof s.componentWillUpdate==="function"&&s.componentWillUpdate(r,v,f),typeof s.UNSAFE_componentWillUpdate==="function"&&s.UNSAFE_componentWillUpdate(r,v,f)),typeof s.componentDidUpdate==="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate==="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!=="function"||l===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!=="function"||l===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=f,r=g):(typeof s.componentDidUpdate!=="function"||l===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!=="function"||l===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),r=!1)}return s=r,Ju(e,t),r=(t.flags&128)!==0,s||r?(s=t.stateNode,a=r&&typeof a.getDerivedStateFromError!=="function"?null:s.render(),t.flags|=1,e!==null&&r?(t.child=fc(t,e.child,null,n),t.child=fc(t,null,a,n)):da(e,t,a,n),t.memoizedState=s.state,e=t.child):e=bi(e,t,n),e}function eM(e,t,a,r){return lc(),t.flags|=256,da(e,t,a,r),t.child}var j1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function G1(e){return{baseLanes:e,cachePool:NP()}}function q1(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Kr),e}function SE(e,t,a){var r=t.pendingProps,n=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(Fa.current&2)!==0),l&&(n=!0,t.flags&=-129),l=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(n?Rs(t):As(),(e=Mt)?(e=SN(e,mo),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ds!==null?{id:yn,overflow:wn}:null,retryLane:536870912,hydrationErrors:null},a=AP(e),a.return=t,t.child=a,Sa=t,Mt=null)):e=null,e===null)throw Os(t);return mk(e)?t.lanes=32:t.lanes=536870912,null}if(s=r.children,r=r.fallback,n)return As(),n=t.mode,s=Ov({mode:"hidden",children:s},n),r=ac(r,n,a,null),s.return=t,r.return=t,s.sibling=r,t.child=s,r=t.child,r.memoizedState=G1(a),r.childLanes=q1(e,l,a),t.memoizedState=j1,wp(null,r);return Rs(t),ak(t,s)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(f!==null)return Eq(e,t,s,l,r,f,c,a)}if(n)return As(),n=r.fallback,s=t.mode,c=e.child,f=c.sibling,r=pi(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&1206910976,f!==null?n=pi(f,n):(n=ac(n,s,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,wp(null,r),r=t.child,n=e.child.memoizedState,n===null?n=G1(a):(s=n.cachePool,s!==null?(c=na._currentValue,s=s.parent!==c?{parent:c,pool:c}:s):s=NP(),n={baseLanes:n.baseLanes|a,cachePool:s}),r.memoizedState=n,r.childLanes=q1(e,l,a),t.memoizedState=j1,wp(e.child,r);return Rs(t),a=e.child,e=a.sibling,a=pi(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(l=t.deletions,l===null?(t.deletions=[e],t.flags|=16):l.push(e)),t.child=a,t.memoizedState=null,a}function ak(e,t){return t=Ov({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ov(e,t){return e=Ar(22,e,null,t),e.lanes=0,e}function vx(e,t,a){return fc(t,e.child,null,a),e=ak(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Eq(e,t,a,r,n,s,l,c){if(a){if(t.flags&256)return Rs(t),t.flags&=-257,vx(e,t,c);if(t.memoizedState!==null)return As(),t.child=e.child,t.flags|=128,null;return As(),s=n.fallback,l=t.mode,n=Ov({mode:"visible",children:n.children},l),s=ac(s,l,c,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,fc(t,e.child,null,c),n=t.child,n.memoizedState=G1(c),n.childLanes=q1(e,r,c),t.memoizedState=j1,wp(null,n)}if(Rs(t),mk(s)){if(r=s.nextSibling&&s.nextSibling.dataset,r)var f=r.dgst;return r=f,r!==""&&(n=Error(ie(419)),n.stack="",n.digest=r,Pp({value:n,source:null,stack:null})),vx(e,t,c)}if(ia||cc(e,t,c,!1),r=(c&e.childLanes)!==0,ia||r){if(_s.current!==null)return vx(e,t,c);if(r=Ct,r!==null&&(n=JM(r,c),n!==0&&n!==l.retryLane))throw l.retryLane=n,bc(e,n),Mr(r,e,n),tk;return vS(s)||hv(),vx(e,t,c)}if(vS(s))return t.flags|=192,t.child=e.child,null;return e=l.treeContext,Mt=ho(s.nextSibling),Sa=t,Je=!0,Ts=null,mo=!1,e!==null&&PP(t,e),t=ak(t,n.children),t.flags|=134221824,t}function tM(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ex(e.return,t,a)}function aM(e){for(var t=null;e!==null;){var a=e.alternate;a!==null&&ov(a)===null&&(t=e),e=e.sibling}return t}function bx(e,t,a,r,n,s){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:s}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=a,l.tailMode=n,l.treeForkCount=s)}function Qw(e){var t=e.child;for(e.child=null;t!==null;){var a=t.sibling;t.sibling=e.child,e.child=t,t=a}}function K1(e,t,a){var r=t.pendingProps,n=r.revealOrder,s=r.tail;r=r.children;var l=Fa.current;if(t.flags&128)return Np(t,l),null;var c=(l&2)!==0;if(c?(l=l&1|2,t.flags|=128):l&=1,Np(t,l),n==="backwards"&&e!==null?(Qw(e),da(e,t,r,a),Qw(e)):da(e,t,r,a),r=Je?Mp:0,!c&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tM(e,a,t);else if(e.tag===19)tM(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"backwards":a=aM(t.child),a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null,Qw(t)),bx(t,!0,n,null,s,r);break;case"unstable_legacy-backwards":a=null,n=t.child;for(t.child=null;n!==null;){if(e=n.alternate,e!==null&&ov(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}bx(t,!0,a,null,s,r);break;case"together":bx(t,!1,null,null,void 0,r);break;case"independent":t.memoizedState=null;break;default:a=aM(t.child),a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),bx(t,!1,n,a,s,r)}return t.child}function rM(e,t,a){var r=t.pendingProps;return Ss(t,t.type,r.value),da(e,t,r.children,a),t.child}function bi(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Bs|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(cc(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(ie(153));if(t.child!==null){e=t.child,a=pi(e,e.pendingProps),t.child=a;for(a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=pi(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function rk(e,t){if((e.lanes&t)!==0)return!0;return e=e.dependencies,e!==null&&tv(e)?!0:!1}function Nq(e,t,a){switch(t.tag){case 3:Xx(t,t.stateNode.containerInfo),Ss(t,na,e.memoizedState.cache),lc();break;case 27:case 5:b1(t);break;case 4:Xx(t,t.stateNode.containerInfo);break;case 10:Ss(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,_1(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Rs(t),t.flags|=128,null;r=cc(e,t,a,!1);var n=t.child.childLanes;if(r||(a&n)!==0)return SE(e,t,a);return Rs(t),e=bi(e,t,a),e!==null?e.sibling:null}Rs(t);break;case 19:if(t.flags&128)return K1(e,t,a);if(n=(e.flags&128)!==0,r=(a&t.childLanes)!==0,r||(cc(e,t,a,!1),r=(a&t.childLanes)!==0),n){if(r)return K1(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Np(t,Fa.current),r)break;else return null;case 22:return t.lanes=0,wE(e,t,a,t.pendingProps);case 24:Ss(t,na,e.memoizedState.cache)}return bi(e,t,a)}function kE(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ia=!0;else{if(!rk(e,a)&&(t.flags&128)===0)return ia=!1,Nq(e,t,a);ia=(e.flags&131072)!==0?!0:!1}else ia=!1,Je&&(t.flags&1048576)!==0&&MP(t,Mp,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Ql(t.elementType),t.type=e,typeof e==="function")OS(e)?(r=mc(e,r),t.tag=1,t=JA(null,t,e,r,a)):(t.tag=0,t=V1(null,t,e,r,a));else{if(e!==void 0&&e!==null){var n=e.$$typeof;if(n===kS){t.tag=11,t=YA(null,t,e,r,a);break e}else if(n===CS){t.tag=14,t=WA(null,t,e,r,a);break e}else if(n===vn){t.tag=10,t.type=e,t=rM(null,t,a);break e}}throw t=x1(e)||e,Error(ie(306,t,""))}}return t;case 0:return V1(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,n=mc(r,t.pendingProps),JA(e,t,r,n,a);case 3:e:{if(Xx(t,t.stateNode.containerInfo),e===null)throw Error(ie(387));r=t.pendingProps;var s=t.memoizedState;n=s.element,N1(e,t),bp(t,r,null,a);var l=t.memoizedState;if(r=l.cache,Ss(t,na,r),r!==s.cache&&P1(t,[na],a,!0),vp(),r=l.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:l.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=eM(e,t,r,a);break e}else if(r!==n){n=po(Error(ie(424)),t),Pp(n),t=eM(e,t,r,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}Mt=ho(e.firstChild),Sa=t,Je=!0,Ts=null,mo=!0,a=_P(t,null,r,a);for(t.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling}else{if(lc(),r===n){t=bi(e,t,a);break e}da(e,t,r,a)}t=t.child}return t;case 26:return Ju(e,t),e===null?(a=RM(t.type,null,t.pendingProps,null))?t.memoizedState=a:Je||(t.stateNode=pN(t.type,t.pendingProps,Ls.current,t)):t.memoizedState=RM(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return b1(t),e===null&&Je&&(r=t.stateNode=kN(t.type,t.pendingProps,Ls.current),Sa=t,mo=!0,n=Mt,Us(t.type)?(bS=n,Mt=ho(r.firstChild)):Mt=n),da(e,t,t.pendingProps.children,a),Ju(e,t),e===null&&(t.flags|=4194304),t.child;case 5:if(e===null&&Je){if(n=r=Mt)r=IK(r,t.type,t.pendingProps,mo),r!==null?(t.stateNode=r,Sa=t,Mt=ho(r.firstChild),mo=!1,n=!0):n=!1;n||Os(t)}return b1(t),n=t.type,s=t.pendingProps,l=e!==null?e.memoizedProps:null,r=s.children,gS(n,s)?r=null:l!==null&&gS(n,l)&&(t.flags|=32),t.memoizedState!==null&&(n=GS(e,t,bq,null,null,a),Od._currentValue=n),Ju(e,t),da(e,t,r,a),t.child;case 6:if(e===null&&Je){if(e=a=Mt)a=LK(a,t.pendingProps,mo),a!==null?(t.stateNode=a,Sa=t,Mt=null,e=!0):e=!1;e||Os(t)}return null;case 13:return SE(e,t,a);case 4:return Xx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fc(t,null,r,a):da(e,t,r,a),t.child;case 11:return YA(e,t,t.type,t.pendingProps,a);case 7:return r=t.pendingProps,Ju(e,t),da(e,t,r,a),t.child;case 8:return da(e,t,t.pendingProps.children,a),t.child;case 12:return da(e,t,t.pendingProps.children,a),t.child;case 10:return rM(e,t,a);case 9:return n=t.type._context,r=t.pendingProps.children,uc(t),n=za(n),r=r(n),t.flags|=1,da(e,t,r,a),t.child;case 14:return WA(e,t,t.type,t.pendingProps,a);case 15:return yE(e,t,t.type,t.pendingProps,a);case 19:return K1(e,t,a);case 31:return Pq(e,t,a);case 22:return wE(e,t,a,t.pendingProps);case 24:return uc(t),r=za(na),e===null?(n=BS(),n===null&&(n=Ct,s=zS(),n.pooledCache=s,s.refCount++,s!==null&&(n.pooledCacheLanes|=a),n=s),t.memoizedState={parent:r,cache:n},US(t),Ss(t,na,n)):((e.lanes&a)!==0&&(N1(e,t),bp(t,null,null,a),vp()),n=e.memoizedState,s=t.memoizedState,n.parent!==r?(n={parent:r,cache:r},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),Ss(t,na,r)):(r=s.cache,Ss(t,na,r),r!==n.cache&&P1(t,[na],a,!0))),da(e,t,t.pendingProps.children,a),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!=="auto"?t.flags|=e===null?18882560:18874368:Je&&Av(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Ju(e,t),da(e,t,r.children,a),t.child;case 29:throw t.pendingProps}throw Error(ie(156,t.tag))}function ui(e){e.flags|=4}function Zw(e,t,a,r,n){var s;if(s=(e.mode&32)!==0)s=a===null?PM(t,r):PM(t,r)&&(r.src!==a.src||r.srcSet!==a.srcSet);if(s){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(ZE())e.flags|=8192;else throw oc=av,FS}else e.flags&=-16777217}function oM(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!TN(t))if(ZE())e.flags|=8192;else throw oc=av,FS}function yx(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?$M():536870912,e.lanes|=t,Ad|=t)}function tp(e,t){if(!Je)switch(e.tailMode){case"visible":break;case"collapsed":for(var a=e.tail,r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:t=e.tail;for(a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null}}function At(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&1206910976,r|=n.flags&1206910976,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Dq(e,t,a){var r=t.pendingProps;switch(_S(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(t),null;case 1:return At(t),null;case 3:if(a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),mi(na),Id(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),e===null||e.child===null)Qu(t)?ui(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xw());return At(t),null;case 26:var{type:n,memoizedState:s}=t;return e===null?(ui(t),s!==null?(At(t),oM(t,s)):(At(t),Zw(t,n,null,r,a))):s?s!==e.memoizedState?(ui(t),At(t),oM(t,s)):(At(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&ui(t),At(t),Zw(t,n,e,r,a)),null;case 27:if(Yx(t),a=Ls.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ui(t);else{if(!r){if(t.stateNode===null)throw Error(ie(166));return At(t),t.subtreeFlags&=-33554433,null}e=Sn.current,Qu(t)?PA(t,e):(e=kN(n,r,a),t.stateNode=e,ui(t))}return At(t),t.subtreeFlags&=-33554433,null;case 5:if(Yx(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ui(t);else{if(!r){if(t.stateNode===null)throw Error(ie(166));return At(t),t.subtreeFlags&=-33554433,null}if(s=Sn.current,Qu(t))PA(t,s);else{var l=zp(Ls.current);switch(s){case 1:s=l.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:s=l.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":s=l.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":s=l.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":s=l.createElement("div"),s.innerHTML="<script></script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof r.is==="string"?l.createElement("select",{is:r.is}):l.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s=typeof r.is==="string"?l.createElement(n,{is:r.is}):l.createElement(n)}}s[_a]=t,s[Er]=r;e:for(l=t.child;l!==null;){if(l.tag===5||l.tag===6)s.appendChild(l.stateNode);else if(l.tag!==4&&l.tag!==27&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;l.sibling===null;){if(l.return===null||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}t.stateNode=s;e:switch(Ua(s,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ui(t)}}return At(t),t.subtreeFlags&=-33554433,Zw(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ui(t);else{if(typeof r!=="string"&&t.stateNode===null)throw Error(ie(166));if(e=Ls.current,Qu(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,n=Sa,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}e[_a]=t,e=e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||dN(e.nodeValue,a)?!0:!1,e||Os(t,!0)}else e=zp(e).createTextNode(r),e[_a]=t,t.stateNode=e}return At(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Qu(t),a!==null){if(e===null){if(!r)throw Error(ie(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ie(557));e[_a]=t}else lc(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;At(t),e=!1}else a=Xw(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e){if(t.flags&256)return Gr(t),t;return Gr(t),null}if((t.flags&128)!==0)throw Error(ie(558))}return At(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Qu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(ie(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(ie(317));n[_a]=t}else lc(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;At(t),n=!1}else n=Xw(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n){if(t.flags&256)return Gr(t),t;return Gr(t),null}}if(Gr(t),(t.flags&128)!==0)return t.lanes=a,t;return a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==n&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),yx(t,t.updateQueue),At(t),null;case 4:return Id(),e===null&&cN(t.stateNode.containerInfo),t.flags|=67108864,At(t),null;case 10:return mi(t.type),At(t),null;case 19:if(VS(t),r=t.memoizedState,r===null)return At(t),null;if(n=(t.flags&128)!==0,s=r.rendering,s===null)if(n)tp(r,!1);else{if(Gt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=ov(e),s!==null){t.flags|=128,tp(r,!1),e=s.updateQueue,t.updateQueue=e,yx(t,e),t.subtreeFlags=0,e=a;for(a=t.child;a!==null;)RP(a,e),a=a.sibling;return Np(t,Fa.current&1|2),Je&&di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Xr()>mv&&(t.flags|=128,n=!0,tp(r,!1),t.lanes=4194304)}else{if(!n)if(e=ov(s),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,yx(t,e),tp(r,!0),r.tail===null&&r.tailMode!=="collapsed"&&r.tailMode!=="visible"&&!s.alternate&&!Je)return At(t),null}else 2*Xr()-r.renderingStartTime>mv&&a!==536870912&&(t.flags|=128,n=!0,tp(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(e=r.last,e!==null?e.sibling=s:t.child=s,r.last=s)}if(r.tail!==null){e=r.tail;e:{for(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Xr(),e.sibling=null,s=Fa.current,s=n?s&1|2:s&1,r.tailMode==="visible"||r.tailMode==="collapsed"||!a||Je?Np(t,s):(a=s,Pt(Ha,t),Pt(Fa,a),er===null&&(er=t)),Je&&di(t,r.treeForkCount),e}return At(t),null;case 22:case 23:return Gr(t),HS(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(At(t),t.subtreeFlags&6&&(t.flags|=8192)):At(t),a=t.updateQueue,a!==null&&yx(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&Ba(rc),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),mi(na),At(t),null;case 25:return null;case 30:return t.flags|=33554432,At(t),null}throw Error(ie(156,t.tag))}function Oq(e,t){switch(_S(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mi(na),Id(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Yx(t),null;case 31:if(t.memoizedState!==null){if(Gr(t),t.alternate===null)throw Error(ie(340));lc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));lc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return VS(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Id(),null;case 10:return mi(t.type),null;case 22:case 23:return Gr(t),HS(),e!==null&&Ba(rc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return mi(na),null;case 25:return null;default:return null}}function CE(e,t){switch(_S(t),t.tag){case 3:mi(na),Id();break;case 26:case 27:case 5:Yx(t);break;case 4:Id();break;case 31:t.memoizedState!==null&&Gr(t);break;case 13:Gr(t);break;case 19:VS(t);break;case 10:mi(t.type);break;case 22:case 23:Gr(t),HS(),e!==null&&Ba(rc);break;case 24:mi(na)}}function $p(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&e)===e){r=void 0;var s=a.create,l=a.inst;r=s(),l.destroy=r}a=a.next}while(a!==n)}}catch(c){bt(t,t.return,c)}}function zs(e,t,a){try{var r=t.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var s=n.next;r=s;do{if((r.tag&e)===e){var l=r.inst,c=l.destroy;if(c!==void 0){l.destroy=void 0,n=t;var f=a,m=c;try{m()}catch(g){bt(n,f,g)}}}r=r.next}while(r!==s)}}catch(g){bt(t,t.return,g)}}function IE(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{BP(t,a)}catch(r){bt(e,e.return,r)}}}function LE(e,t,a){a.props=mc(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){bt(e,t,r)}}function hn(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var n=e.stateNode,s=hi(e.memoizedProps,n);if(n.ref===null||n.ref.name!==s)n.ref=xN(s);r=n.ref;break;case 7:if(e.stateNode===null){var l=new Qr(e);Pr(e.child,!1,kK,l,void 0,void 0),e.stateNode=l}r=e.stateNode;break;default:r=e.stateNode}typeof a==="function"?e.refCleanup=a(r):a.current=r}}catch(c){bt(e,t,c)}}function Oa(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r==="function")try{r()}catch(n){bt(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a==="function")try{a(null)}catch(n){bt(e,t,n)}else a.current=null}function cv(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a<t.length;a++)wN(e.stateNode,t[a])}function nM(e){for(var t=e.return;t!==null;){if(nk(t)&&wN(e.stateNode,t.stateNode),ok(t))break;t=t.return}}function Sp(e){for(var t=e.return;t!==null;){if(nk(t)&&CK(e.stateNode,t.stateNode),ok(t))break;t=t.return}}function ok(e){return e.tag===5||e.tag===3||e.tag===27}function nk(e){return e&&e.tag===7&&e.stateNode!==null}function X1(e){var{type:t,memoizedProps:a,stateNode:r}=e;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(n){bt(e,e.return,n)}}function Jw(e,t,a){try{var r=e.stateNode;nK(r,e.type,a,t),r[Er]=t}catch(n){bt(e,e.return,n)}}function TE(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Us(e.type)||e.tag===4}function e1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||TE(e.return))return null;e=e.return}e.sibling.return=e.return;for(e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Us(e.type))continue e;if(e.flags&2)continue e;if(e.child===null||e.tag===4)continue e;else e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Y1(e,t,a,r){var n=e.tag;if(n===5||n===6)n=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(n,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(n),a=a._reactRootContainer,a!==null&&a!==void 0||t.onclick!==null||(t.onclick=bn)),cv(e,r),ct=!0;else if(n!==4&&(n===27&&(cv(e,r),r=null,Us(e.type)&&(a=e.stateNode,t=null)),e=e.child,e!==null))for(Y1(e,t,a,r),e=e.sibling;e!==null;)Y1(e,t,a,r),e=e.sibling}function uv(e,t,a,r){var n=e.tag;if(n===5||n===6)n=e.stateNode,t?a.insertBefore(n,t):a.appendChild(n),cv(e,r),ct=!0;else if(n!==4&&(n===27&&(cv(e,r),r=null,Us(e.type)&&(a=e.stateNode)),e=e.child,e!==null))for(uv(e,t,a,r),e=e.sibling;e!==null;)uv(e,t,a,r),e=e.sibling}function RE(e){var{stateNode:t,memoizedProps:a}=e;try{for(var r=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ua(t,r,a),t[_a]=e,t[Er]=a}catch(s){bt(e,e.return,s)}}var dv=!1,qr=null;function iM(e){if(e.tag===30||(e.subtreeFlags&33554432)!==0)dv=!0}var xn=null;function sM(){var e=xn;return xn=null,e}var Rr=0;function Ud(e,t,a,r,n){return Rr=0,AE(e.child,t,a,r,n)}function AE(e,t,a,r,n){for(var s=!1;e!==null;){if(e.tag===5){var l=e.stateNode;if(r!==null){var c=hS(l);r.push(c),c.view&&(s=!0)}else s||hS(l).view&&(s=!0);dv=!0,mN(l,Rr===0?t:t+"_"+Rr,a),Rr++}else if(e.tag!==22||e.memoizedState===null)e.tag===30&&n||AE(e.child,t,a,r,n)&&(s=!0);e=e.sibling}return s}function Cn(e,t){for(;e!==null;){if(e.tag===5)gN(e.stateNode,e.memoizedProps);else if(e.tag!==22||e.memoizedState===null)e.tag===30&&t||Cn(e.child,t);e=e.sibling}}function zx(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(zx(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(ie(544));var a=t.name;t=Si(t.default,t.share),t!=="none"&&(Ud(e,a,t,null,!1)||Cn(e.child,!1))}}e=e.sibling}}function W1(e,t){if(e.tag===30){var a=e.stateNode,r=e.memoizedProps,n=hi(r,a),s=Si(r.default,a.paired?r.share:r.enter);s!=="none"?Ud(e,n,s,null,!1)?(zx(e),a.paired||t||Md(e,r.onEnter)):Cn(e.child,!1):zx(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)W1(e,t),e=e.sibling;else zx(e)}function $1(e){if(qr!==null&&qr.size!==0){var t=qr;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var a=e.memoizedProps,r=a.name;if(r!=null&&r!=="auto"){var n=t.get(r);if(n!==void 0){var s=Si(a.default,a.share);if(s!=="none"&&(Ud(e,r,s,null,!1)?(s=e.stateNode,n.paired=s,s.paired=n,Md(e,a.onShare)):Cn(e.child,!1)),t.delete(r),t.size===0)break}}}$1(e)}e=e.sibling}}}function Q1(e){if(e.tag===30){var t=e.memoizedProps,a=hi(t,e.stateNode),r=qr!==null?qr.get(a):void 0,n=Si(t.default,r!==void 0?t.share:t.exit);n!=="none"&&(Ud(e,a,n,null,!1)?r!==void 0?(n=e.stateNode,r.paired=n,n.paired=r,qr.delete(a),Md(e,t.onShare)):Md(e,t.onExit):Cn(e.child,!1)),qr!==null&&$1(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Q1(e),e=e.sibling;else qr!==null&&$1(e)}function ME(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,a=hi(t,e.stateNode);t=Si(t.default,t.update),e.flags&=-5,t!=="none"&&Ud(e,a,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&ME(e);e=e.sibling}}function Z1(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,Cn(e.child,!1))}Z1(e)}e=e.sibling}}function Bx(e){if(e.tag===30)e.stateNode.paired=null,Cn(e.child,!1),Z1(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Bx(e),e=e.sibling;else Z1(e)}function PE(e){for(e=e.child;e!==null;)e.tag===30?Cn(e.child,!1):(e.subtreeFlags&33554432)!==0&&PE(e),e=e.sibling}function ik(e,t,a,r,n,s,l){for(var c=!1;t!==null;){if(t.tag===5){var f=t.stateNode;if(s!==null&&Rr<s.length){var m=s[Rr],g=hS(f);if(m.view||g.view)c=!0;var h;if(h=(e.flags&4)===0)if(g.clip)h=!0;else{h=m.rect;var x=g.rect;h=h.y!==x.y||h.x!==x.x||h.height!==x.height||h.width!==x.width}h&&(e.flags|=4),g.abs?g=!m.abs:(m=m.rect,g=g.rect,g=m.height!==g.height||m.width!==g.width),g&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&mN(f,Rr===0?a:a+"_"+Rr,n),c&&(e.flags&4)!==0||(xn===null&&(xn=[]),xn.push(f,Rr===0?r:r+"_"+Rr,t.memoizedProps)),Rr++}else if(t.tag!==22||t.memoizedState===null)t.tag===30&&l?e.flags|=t.flags&32:ik(e,t.child,a,r,n,s,l)&&(c=!0);t=t.sibling}return c}function EE(e,t){for(e=e.child;e!==null;){if(e.tag===30){var a=e.memoizedProps,r=e.stateNode,n=hi(a,r),s=Si(a.default,a.update);if(t){r=r.clones;var l=r===null?null:r.map(dK)}else l=e.memoizedState,e.memoizedState=null;r=e;var c=e.child;Rr=0,n=ik(r,c,n,n,s,l,!1),(e.flags&4)!==0&&n&&(t||Md(e,a.onUpdate))}else(e.subtreeFlags&33554432)!==0&&EE(e,t);e=e.sibling}}var ba=!1,mt=!1,pn=!1,t1=!1,lM=typeof WeakSet==="function"?WeakSet:Set,ya=null,mn=!1,up=!1,fv=!1,J1=!1;function _q(e,t,a){if(e=e.containerInfo,pS=_d,e=yP(e),ES(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,l=n.focusNode;n=n.focusOffset;try{r.nodeType,l.nodeType}catch(C){r=null;break e}var c=0,f=-1,m=-1,g=0,h=0,x=e,v=null;t:for(;;){for(var w;;){if(x!==r||s!==0&&x.nodeType!==3||(f=c+s),x!==l||n!==0&&x.nodeType!==3||(m=c+n),x.nodeType===3&&(c+=x.nodeValue.length),(w=x.firstChild)===null)break;v=x,x=w}for(;;){if(x===e)break t;if(v===r&&++g===s&&(f=c),v===l&&++h===n&&(m=c),(w=x.nextSibling)!==null)break;x=v,v=x.parentNode}x=w}r=f===-1||m===-1?null:{start:f,end:m}}else r=null}r=r||{start:0,end:0}}else r=null;mS={focusedElem:e,selectionRange:r},_d=!1,a=(a&335544064)===a,ya=t;for(t=a?9270:1024;ya!==null;){if(e=ya,a&&(r=e.deletions,r!==null))for(s=0;s<r.length;s++)a&&Q1(r[s]);if(e.alternate===null&&(e.flags&2)!==0)a&&iM(e),wx(a);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&a&&Q1(r),wx(a);continue}else if(r!==null&&r.memoizedState!==null){a&&iM(e),wx(a);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ya=r):(a&&ME(e),wx(a))}}qr=null}function wx(e){for(;ya!==null;){var t=ya,a=e,{alternate:r,flags:n}=t;switch(t.tag){case 0:case 11:case 15:break;case 1:if((n&1024)!==0&&r!==null){a=void 0,n=r.memoizedProps,r=r.memoizedState;var s=t.stateNode;try{var l=mc(t.type,n);a=s.getSnapshotBeforeUpdate(l,r),s.__reactInternalSnapshotBeforeUpdate=a}catch(c){bt(t,t.return,c)}}break;case 3:if((n&1024)!==0){if(r=t.stateNode.containerInfo,a=r.nodeType,a===9)xS(r);else if(a===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":xS(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&r!==null&&(a=hi(r.memoizedProps,r.stateNode),n=t.memoizedProps,n=Si(n.default,n.update),n!=="none"&&Ud(r,a,n,r.memoizedState=[],!0));break;default:if((n&1024)!==0)throw Error(ie(163))}if(r=t.sibling,r!==null){r.return=t.return,ya=r;break}ya=t.return}}function NE(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:gn(e,a),r&4&&$p(5,a);break;case 1:if(gn(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(l){bt(a,a.return,l)}else{var n=mc(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){bt(a,a.return,l)}}r&64&&IE(a),r&512&&hn(a,a.return);break;case 3:if(gn(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{BP(e,t)}catch(l){bt(a,a.return,l)}}break;case 27:t===null&&r&4&&RE(a);case 26:case 5:gn(e,a),t===null&&r&4&&X1(a),r&512&&hn(a,a.return);break;case 12:gn(e,a);break;case 31:gn(e,a),r&4&&zE(e,a);break;case 13:gn(e,a),r&4&&BE(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Yq.bind(null,a),TK(e,a))));break;case 22:if(r=a.memoizedState!==null||ba,!r){var s=t!==null&&t.memoizedState!==null||mt;t=ba,n=mt,ba=r,(mt=s)&&!n?(r=2,(a.subtreeFlags&8772)!==0&&(r|=1),Oo(e,a,r)):gn(e,a),ba=t,mt=n}break;case 30:gn(e,a),r&512&&hn(a,a.return);break;case 7:r&512&&hn(a,a.return);default:gn(e,a)}}function eS(e,t){for(e=e.child;e!==null;)DE(e,t),e=e.sibling}function DE(e,t){switch(e.tag){case 5:case 26:try{var a=e.stateNode;if(t){var r=a.style;typeof r.setProperty==="function"?r.setProperty("display","none","important"):r.display="none"}else{var n=e.stateNode,s=e.memoizedProps.style,l=s!==void 0&&s!==null&&s.hasOwnProperty("display")?s.display:null;n.style.display=l==null||typeof l==="boolean"?"":(""+l).trim()}}catch(f){bt(e,e.return,f)}tS(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,ct=!0}catch(f){bt(e,e.return,f)}break;case 18:try{var c=e.stateNode;t?SM(c,!0):SM(e.stateNode,!1)}catch(f){bt(e,e.return,f)}break;case 22:case 23:e.memoizedState===null&&eS(e,t);break;default:eS(e,t)}}function tS(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var a=e,r=t;switch(a.tag){case 4:DE(a,r);break e;case 22:a.memoizedState===null&&tS(a,r);break e;default:tS(a,r)}}e=e.sibling}}function OE(e){var t=e.alternate;t!==null&&(e.alternate=null,OE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kv(t)),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 Ot=null,Lr=!1;function Do(e,t,a){for(a=a.child;a!==null;)_E(e,t,a),a=a.sibling}function _E(e,t,a){if(Yr&&typeof Yr.onCommitFiberUnmount==="function")try{Yr.onCommitFiberUnmount(jp,a)}catch(s){}switch(a.tag){case 26:mt||Oa(a,t),Do(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!mt&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:mt||Oa(a,t),Sp(a);var r=Ot,n=Lr;Us(a.type)&&(Ot=a.stateNode,Lr=!1),Do(e,t,a),CN(a.stateNode,a.type,a.memoizedProps),Ot=r,Lr=n;break;case 5:mt||Oa(a,t),Sp(a);case 6:if(a.tag===6&&Sp(a),r=Ot,n=Lr,Ot=null,Do(e,t,a),Ot=r,Lr=n,Ot!==null)if(Lr)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(a.stateNode),ct=!0}catch(s){bt(a,t,s)}else try{Ot.removeChild(a.stateNode),ct=!0}catch(s){bt(a,t,s)}break;case 18:Ot!==null&&(Lr?(e=Ot,wM(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),zd(e)):wM(Ot,a.stateNode));break;case 4:r=Ot,n=Lr,Ot=a.stateNode.containerInfo,Lr=!0,Do(e,t,a),Ot=r,Lr=n;break;case 0:case 11:case 14:case 15:zs(2,a,t),mt||zs(4,a,t),Do(e,t,a);break;case 1:mt||(Oa(a,t),r=a.stateNode,typeof r.componentWillUnmount==="function"&&LE(a,t,r)),Do(e,t,a);break;case 21:Do(e,t,a);break;case 22:mt=(r=mt)||a.memoizedState!==null,Do(e,t,a),mt=r;break;case 30:Oa(a,t),Do(e,t,a);break;case 7:mt||Oa(a,t),Do(e,t,a);break;default:Do(e,t,a)}}function zE(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zd(e)}catch(a){bt(t,t.return,a)}}}function BE(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zd(e)}catch(a){bt(t,t.return,a)}}function zq(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lM),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lM),t;default:throw Error(ie(435,e.tag))}}function Sx(e,t){var a=zq(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var n=Wq.bind(null,e,r);r.then(n,n)}})}function dr(e,t,a){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n],l=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(Us(f.type)){Ot=f.stateNode,Lr=!1;break e}break;case 5:Ot=f.stateNode,Lr=!1;break e;case 3:case 4:Ot=f.stateNode.containerInfo,Lr=!0;break e}f=f.return}if(Ot===null)throw Error(ie(160));_E(l,c,s),Ot=null,Lr=!1,l=s.alternate,l!==null&&(l.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)FE(t,e,a),t=t.sibling}var _o=null;function FE(e,t,a){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(n&4&&(r=e.updateQueue,r=r!==null?r.events:null,r!==null))for(var s=0;s<r.length;s++){var l=r[s];l.ref.impl=l.nextImpl}dr(t,e,a),fr(e),n&4&&(zs(3,e,e.return),$p(3,e),zs(5,e,e.return));break;case 1:dr(t,e,a),fr(e),n&512&&(mt||r===null||Oa(r,r.return)),n&64&&ba&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(s=_o,dr(t,e,a),fr(e),n&512&&(mt||r===null||Oa(r,r.return)),n&4)if(n=r!==null?r.memoizedState:null,a=e.memoizedState,r===null)if(a===null)if(e.stateNode===null)if(ba)e.stateNode=pN(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,a=e.memoizedProps,n=s.ownerDocument||s;t:switch(t){case"title":if(r=n.getElementsByTagName("title")[0],!r||r[Kp]||r[_a]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))r=n.createElement(t),n.head.insertBefore(r,n.querySelector("head > title"));Ua(r,t,a),r[_a]=e,wa(r),t=r;break e;case"link":if(s=MM("link","href",n).get(t+(a.href||""))){for(l=0;l<s.length;l++)if(r=s[l],r.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&r.getAttribute("rel")===(a.rel==null?null:a.rel)&&r.getAttribute("title")===(a.title==null?null:a.title)&&r.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){s.splice(l,1);break t}}r=n.createElement(t),Ua(r,t,a),n.head.appendChild(r);break;case"meta":if(s=MM("meta","content",n).get(t+(a.content||""))){for(l=0;l<s.length;l++)if(r=s[l],r.getAttribute("content")===(a.content==null?null:""+a.content)&&r.getAttribute("name")===(a.name==null?null:a.name)&&r.getAttribute("property")===(a.property==null?null:a.property)&&r.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&r.getAttribute("charset")===(a.charSet==null?null:a.charSet)){s.splice(l,1);break t}}r=n.createElement(t),Ua(r,t,a),n.head.appendChild(r);break;default:throw Error(ie(468,t))}r[_a]=e,wa(r),t=r}e.stateNode=t}else ba||yS(s,e.type,e.stateNode);else e.stateNode=AM(s,a,e.memoizedProps);else n!==a?(n===null?(t=r.stateNode,t===null||mt||t.parentNode.removeChild(t)):n.count--,a===null?ba||yS(s,e.type,e.stateNode):AM(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Jw(e,e.memoizedProps,r.memoizedProps);break;case 27:dr(t,e,a),fr(e),n&512&&(mt||r===null||Oa(r,r.return)),r!==null&&n&4&&Jw(e,e.memoizedProps,r.memoizedProps);break;case 5:if(s=pn,pn=!1,dr(t,e,a),pn=s,fr(e),n&512&&(mt||r===null||Oa(r,r.return)),e.flags&32){t=e.stateNode;try{Td(t,""),ct=!0}catch(g){bt(e,e.return,g)}}n&4&&e.stateNode!=null&&(t=e.memoizedProps,Jw(e,t,r!==null?r.memoizedProps:t)),n&1024&&(t1=!0);break;case 6:if(dr(t,e,a),fr(e),n&4){if(e.stateNode===null)throw Error(ie(162));t=e.memoizedProps,a=e.stateNode;try{a.nodeValue=t,ct=!0}catch(g){bt(e,e.return,g)}}break;case 3:if(ct=!1,Vx=null,s=_o,_o=Bp(t.containerInfo),dr(t,e,a),_o=s,fr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{zd(t.containerInfo)}catch(g){bt(e,e.return,g)}t1&&(t1=!1,UE(e)),ct=!1;break;case 4:n=pn,pn=ba,r=mA(),s=_o,_o=Bp(e.stateNode.containerInfo),dr(t,e,a),fr(e),_o=s,ct&&up&&(fv=!0),ct=r,pn=n;break;case 12:dr(t,e,a),fr(e);break;case 31:dr(t,e,a),fr(e),n&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sx(e,t)));break;case 13:dr(t,e,a),fr(e),e.child.flags&8192&&e.memoizedState!==null!==(r!==null&&r.memoizedState!==null)&&(_v=Xr()),n&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sx(e,t)));break;case 22:s=e.memoizedState!==null,l=r!==null&&r.memoizedState!==null;var c=ba,f=mt,m=pn;ba=c||s,pn=m||s,mt=f||l,dr(t,e,a),mt=f,pn=m,ba=c,fr(e),n&8192&&(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,!s||r===null||l||ba||mt||(t=l||mt,a=ba,r=mt,ba=s||ba,mt=t,hs(e,2),ba=a,mt=r),!s&&pn||eS(e,s)),n&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,Sx(e,a))));break;case 19:dr(t,e,a),fr(e),n&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sx(e,t)));break;case 30:n&512&&(mt||r===null||Oa(r,r.return)),n=mA(),s=up,l=(a&335544064)===a,c=e.memoizedProps,up=l&&Si(c.default,c.update)!=="none",dr(t,e,a),fr(e),l&&r!==null&&ct&&(e.flags|=4),up=s,ct=n;break;case 21:break;case 7:n&512&&(mt||r===null||Oa(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:dr(t,e,a),fr(e)}}function fr(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(TE(r)){a=r;break}r=r.return}r=null;for(var n=e.return;n!==null;){if(nk(n)){var s=n.stateNode;r===null?r=[s]:r.push(s)}if(ok(n))break;n=n.return}var l=r;if(a==null)throw Error(ie(160));switch(a.tag){case 27:var c=a.stateNode,f=e1(e);uv(e,f,c,l);break;case 5:var m=a.stateNode;a.flags&32&&(Td(m,""),a.flags&=-33);var g=e1(e);uv(e,g,m,l);break;case 3:case 4:var h=a.stateNode.containerInfo,x=e1(e);Y1(e,x,h,l);break;default:throw Error(ie(161))}}catch(v){bt(e,e.return,v)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function UE(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;UE(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_d=!0,t.reset(),_d=!1),e=e.sibling}}function Zu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)HE(t,e),t=t.sibling;else EE(t,!1)}function HE(e,t){var a=e.alternate;if(a===null)W1(e,!1);else switch(e.tag){case 3:if(J1=mn=!1,sM(),Zu(t,e),!mn&&!fv){if(e=xn,e!==null)for(var r=0;r<e.length;r+=3){a=e[r];var n=e[r+1];gN(a,e[r+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+n+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),J1=!0}xn=null;break;case 5:Zu(t,e);break;case 4:r=mn,mn=!1,Zu(t,e),mn&&(fv=!0),mn=r;break;case 22:e.memoizedState===null&&(a.memoizedState!==null?W1(e,!1):Zu(t,e));break;case 30:r=mn,n=sM(),mn=!1,Zu(t,e),mn&&(e.flags|=4);var s=e.memoizedProps,l=e.stateNode;t=hi(s,l),l=hi(a.memoizedProps,l);var c=Si(s.default,s.update);c==="none"?t=!1:(s=a.memoizedState,a.memoizedState=null,a=e.child,Rr=0,t=ik(e,a,t,l,c,s,!0),Rr!==(s===null?0:s.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Md(e,e.memoizedProps.onUpdate),xn=n):n!==null&&(n.push.apply(n,xn),xn=n),mn=(e.flags&32)!==0?!0:r;break;default:Zu(t,e)}}function gn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)NE(e,t.alternate,t),t=t.sibling}function hs(e,t){for(e=e.child;e!==null;){var a=e,r=t;switch(a.tag){case 0:case 11:case 14:case 15:zs(4,a,a.return),hs(a,r);break;case 1:Oa(a,a.return);var n=a.stateNode;typeof n.componentWillUnmount==="function"&&LE(a,a.return,n),hs(a,r);break;case 27:(r&2)!==0&&CN(a.stateNode,a.type,a.memoizedProps);case 5:Oa(a,a.return),a.tag!==5&&a.tag!==27||Sp(a),hs(a,r);break;case 6:Sp(a);break;case 26:Oa(a,a.return),n=a.stateNode,a.memoizedState!==null||n===null||mt||n.parentNode.removeChild(n),hs(a,r);break;case 22:a.memoizedState===null&&hs(a,r);break;case 30:Oa(a,a.return),hs(a,r);break;case 7:Oa(a,a.return);default:hs(a,r)}e=e.sibling}}function Oo(e,t,a){a=(t.subtreeFlags&8772)!==0?a:a&-2;for(t=t.child;t!==null;){var r=t.alternate,n=e,s=t,l=s.flags,c=(a&1)!==0;switch(s.tag){case 0:case 11:case 15:Oo(n,s,a),$p(4,s);break;case 1:if(Oo(n,s,a),r=s,n=r.stateNode,typeof n.componentDidMount==="function")try{n.componentDidMount()}catch(g){bt(r,r.return,g)}if(r=s,n=r.updateQueue,n!==null){var f=r.stateNode;try{var m=n.shared.hiddenCallbacks;if(m!==null)for(n.shared.hiddenCallbacks=null,n=0;n<m.length;n++)zP(m[n],f)}catch(g){bt(r,r.return,g)}}c&&l&64&&IE(s),hn(s,s.return);break;case 27:(a&2)!==0&&RE(s);case 5:s.tag!==5&&s.tag!==27||nM(s),Oo(n,s,a),c&&r===null&&l&4&&X1(s),hn(s,s.return);break;case 6:nM(s);break;case 26:f=s.stateNode,s.memoizedState!==null||f===null||ba||yS(Bp(f.ownerDocument),s.type,f),Oo(n,s,a),c&&r===null&&l&4&&X1(s),hn(s,s.return);break;case 12:Oo(n,s,a);break;case 31:Oo(n,s,a),c&&l&4&&zE(n,s);break;case 13:Oo(n,s,a),c&&l&4&&BE(n,s);break;case 22:s.memoizedState===null&&Oo(n,s,a),hn(s,s.return);break;case 30:Oo(n,s,a),hn(s,s.return);break;case 7:hn(s,s.return);default:Oo(n,s,a)}t=t.sibling}}function sk(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Yp(a))}function lk(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yp(e))}function so(e,t,a,r){var n=(a&335544064)===a;if(t.subtreeFlags&(n?10262:10256))for(t=t.child;t!==null;)VE(e,t,a,r),t=t.sibling;else n&&PE(t)}function VE(e,t,a,r){var n=(a&335544064)===a;n&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Bx(t);var s=t.flags;switch(t.tag){case 0:case 11:case 15:so(e,t,a,r),s&2048&&$p(9,t);break;case 1:so(e,t,a,r);break;case 3:so(e,t,a,r),n&&J1&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),s&2048&&(s=null,t.alternate!==null&&(s=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==s&&(t.refCount++,s!=null&&Yp(s)));break;case 12:if(s&2048){so(e,t,a,r),s=t.stateNode;try{var l=t.memoizedProps,c=l.id,f=l.onPostCommit;typeof f==="function"&&f(c,t.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(m){bt(t,t.return,m)}}else so(e,t,a,r);break;case 31:so(e,t,a,r);break;case 13:so(e,t,a,r);break;case 23:break;case 22:l=t.stateNode,c=t.alternate,t.memoizedState!==null?(n&&c!==null&&c.memoizedState===null&&Bx(c),l._visibility&2?so(e,t,a,r):kp(e,t)):(n&&c!==null&&c.memoizedState!==null&&Bx(t),l._visibility&2?so(e,t,a,r):(l._visibility|=2,ed(e,t,a,r,(t.subtreeFlags&10256)!==0||!1))),s&2048&&sk(c,t);break;case 24:so(e,t,a,r),s&2048&&lk(t.alternate,t);break;case 30:n&&(s=t.alternate,s!==null&&(Cn(s.child,!0),Cn(t.child,!0))),so(e,t,a,r);break;default:so(e,t,a,r)}}function ed(e,t,a,r,n){n=n&&((t.subtreeFlags&10256)!==0||!1);for(t=t.child;t!==null;){var s=e,l=t,c=a,f=r,m=l.flags;switch(l.tag){case 0:case 11:case 15:ed(s,l,c,f,n),$p(8,l);break;case 23:break;case 22:var g=l.stateNode;l.memoizedState!==null?g._visibility&2?ed(s,l,c,f,n):kp(s,l):(g._visibility|=2,ed(s,l,c,f,n)),n&&m&2048&&sk(l.alternate,l);break;case 24:ed(s,l,c,f,n),n&&m&2048&&lk(l.alternate,l);break;default:ed(s,l,c,f,n)}t=t.sibling}}function kp(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,n=r.flags;switch(r.tag){case 22:kp(a,r),n&2048&&sk(r.alternate,r);break;case 24:kp(a,r),n&2048&&lk(r.alternate,r);break;default:kp(a,r)}t=t.sibling}}var Zl=8192;function Yl(e,t,a){if(e.subtreeFlags&Zl)for(e=e.child;e!==null;)jE(e,t,a),e=e.sibling}function jE(e,t,a){switch(e.tag){case 26:Yl(e,t,a),e.flags&Zl&&(e.memoizedState!==null?HK(a,_o,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&EM(a,e)));break;case 5:Yl(e,t,a),e.flags&Zl&&(e=e.stateNode,(t&335544128)===t&&EM(a,e));break;case 3:case 4:var r=_o;_o=Bp(e.stateNode.containerInfo),Yl(e,t,a),_o=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zl,Zl=16777216,Yl(e,t,a),Zl=r):Yl(e,t,a));break;case 30:if((e.flags&Zl)!==0&&(r=e.memoizedProps.name,r!=null&&r!=="auto")){var n=e.stateNode;n.paired=null,qr===null&&(qr=new Map),qr.set(r,n)}Yl(e,t,a);break;default:Yl(e,t,a)}}function GE(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ap(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];ya=r,KE(r,e)}GE(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qE(e),e=e.sibling}function qE(e){switch(e.tag){case 0:case 11:case 15:ap(e),e.flags&2048&&zs(9,e,e.return);break;case 3:ap(e);break;case 12:ap(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fx(e)):ap(e);break;default:ap(e)}}function Fx(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];ya=r,KE(r,e)}GE(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zs(8,t,t.return),Fx(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Fx(t));break;default:Fx(t)}e=e.sibling}}function KE(e,t){for(;ya!==null;){var a=ya;switch(a.tag){case 0:case 11:case 15:zs(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Yp(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ya=r;else e:for(a=e;ya!==null;){r=ya;var n=r.sibling,s=r.return;if(OE(r),r===a){ya=null;break e}if(n!==null){n.return=s,ya=n;break e}ya=s}}}var Bq={getCacheForType:function(e){var t=za(na),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return za(na).controller.signal}},Fq=typeof WeakMap==="function"?WeakMap:Map,ut=0,Ct=null,rt=null,ot=0,xt=0,Vr=null,ks=!1,Hd=!1,ck=!1,yi=0,Gt=0,Bs=0,sc=0,pv=0,Kr=0,Ad=0,Cp=null,Tr=null,aS=!1,_v=0,XE=0,mv=1/0,gv=null,Ms=null,Bt=0,Bo=null,gc=null,kn=0,rS=0,oS=null,YE=null,Sd=null,kd=null,Cd=null,Ip=0,Ux=null;function go(){return(ut&2)!==0&&ot!==0?ot&-ot:je.T!==null?dk():tP()}function WE(){if(Kr===0)if((ot&536870912)===0||Je){var e=dx;dx<<=1,(dx&3932160)===0&&(dx=262144),Kr=e}else Kr=536870912;return e=Ha.current,e!==null&&(e.flags|=32),Kr}function Md(e,t){if(t!=null){var a=e.stateNode,r=a.ref;r===null&&(r=a.ref=xN(hi(e.memoizedProps,a))),kd===null&&(kd=[]),kd.push(t.bind(null,r))}}function Mr(e,t,a){if(e===Ct&&(xt===2||xt===9)||e.cancelPendingCommit!==null)Pd(e,0),Cs(e,ot,Kr,!1);if(Sv(e,a),(ut&2)===0||e!==Ct)e===Ct&&((ut&2)===0&&(sc|=a),Gt===4&&Cs(e,ot,Kr,!1)),ki(e)}function $E(e,t,a){if((ut&6)!==0)throw Error(ie(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Gp(e,t),n=r?Vq(e,t):a1(e,t,!0),s=r;do{if(n===0){Hd&&!r&&Cs(e,t,0,!1);break}else{if(a=e.current.alternate,s&&!Uq(a)){n=a1(e,t,!1),s=!1;continue}if(n===2){if(s=t,e.errorRecoveryDisabledLanes&s)var l=0;else l=e.pendingLanes&-536870913,l=l!==0?l:l&536870912?536870912:0;if(l!==0){t=l;e:{var c=e;n=Cp;var f=c.current.memoizedState.isDehydrated;if(f&&(Pd(c,l).flags|=256),l=a1(c,l,!1),l!==2&&l!==6){if(ck&&!f){c.errorRecoveryDisabledLanes|=s,sc|=s,n=4;break e}s=Tr,Tr=n,s!==null&&(Tr===null?Tr=s:Tr.push.apply(Tr,s))}n=l}if(s=!1,n!==2)continue}}if(n===1){Pd(e,0),Cs(e,t,0,!0);break}e:{switch(r=e,s=n,s){case 0:case 1:throw Error(ie(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Cs(r,t,Kr,!ks);break e;case 2:Tr=null;break;case 3:case 5:break;default:throw Error(ie(329))}if((t&62914560)===t&&(n=_v+300-Xr(),10<n)){if(Cs(r,t,Kr,!ks),wv(r,0,!0)!==0)break e;kn=t,r.timeoutHandle=fk(cM.bind(null,r,a,Tr,gv,aS,t,Kr,sc,Ad,ks,s,"Throttled",-0,0),n);break e}cM(r,a,Tr,gv,aS,t,Kr,sc,Ad,ks,s,null,-0,0)}}break}while(1);ki(e)}function cM(e,t,a,r,n,s,l,c,f,m,g,h,x,v){e.timeoutHandle=-1;var w=t.subtreeFlags,C=(s&335544064)===s;if(h=null,C||w&8192||(w&16785408)===16785408){if(h={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},qr=null,jE(t,s,h),C&&(w=h,C=e.containerInfo,C=(C.nodeType===9?C:C.ownerDocument).__reactViewTransition,C!=null&&(w.count++,w.waitingForViewTransition=!0,w=Fp.bind(w),C.finished.then(w,w))),w=(s&62914560)===s?_v-Xr():(s&4194048)===s?XE-Xr():0,w=VK(h,w),w!==null){kn=s,e.cancelPendingCommit=w(dM.bind(null,e,t,s,a,r,n,l,c,f,m,g,h,null,x,v)),Cs(e,s,l,!m);return}}dM(e,t,s,a,r,n,l,c,f,m,g,h)}function Uq(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var n=a[r],s=n.getSnapshot;n=n.value;try{if(!$r(s(),n))return!1}catch(l){return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Cs(e,t,a,r){t=WM(e,t),t&=~pv,t&=~sc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var n=t;0<n;){var s=31-Wr(n),l=1<<s;r[s]=-1,n&=~l}a!==0&&QM(e,a,t)}function zv(){return(ut&6)===0?(Qp(0,!1),!1):!0}function uk(){if(rt!==null){if(xt===0)var e=rt.return;else e=rt,fi=yc=null,XS(e),bd=null,Ep=0,e=rt;for(;e!==null;)CE(e.alternate,e),e=e.return;rt=null}}function Pd(e,t){var a=e.timeoutHandle;return a!==-1&&(e.timeoutHandle=-1,lK(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),kn=0,uk(),Ct=e,rt=a=pi(e.current,null),ot=t,xt=0,Vr=null,ks=!1,Hd=Gp(e,t),ck=!1,Ad=Kr=pv=sc=Bs=Gt=0,Tr=Cp=null,aS=!1,yi=WM(e,t),Tv(),a}function QE(e,t){Xe=null,je.H=sv,t===Fd||t===Mv?(t=_A(),xt=3):t===FS?(t=_A(),xt=4):xt=t===tk?8:t!==null&&typeof t==="object"&&typeof t.then==="function"?6:1,Vr=t,rt===null&&(Gt=1,lv(e,po(t,e.current)))}function ZE(){var e=Ha.current;return e===null?!0:(ot&4194048)===ot?er===null?!0:!1:(ot&62914560)===ot||(ot&536870912)!==0?e===er:!1}function JE(){var e=je.H;return je.H=sv,e===null?sv:e}function eN(){var e=je.A;return je.A=Bq,e}function hv(){Gt=4,ks||(ot&4194048)!==ot&&Ha.current!==null||(Hd=!0),(Bs&134217727)===0&&(sc&134217727)===0||Ct===null||Cs(Ct,ot,Kr,!1)}function a1(e,t,a){var r=ut;ut|=2;var n=JE(),s=eN();if(Ct!==e||ot!==t)gv=null,Pd(e,t);t=!1;var l=Gt;e:do try{if(xt!==0&&rt!==null){var c=rt,f=Vr;switch(xt){case 8:uk(),l=6;break e;case 3:case 2:case 9:case 6:Ha.current===null&&(t=!0);var m=xt;if(xt=0,Vr=null,md(e,c,f,m),a&&Hd){l=0;break e}break;default:m=xt,xt=0,Vr=null,md(e,c,f,m)}}Hq(),l=Gt;break}catch(g){QE(e,g)}while(1);return t&&e.shellSuspendCounter++,fi=yc=null,ut=r,je.H=n,je.A=s,rt===null&&(Ct=null,ot=0,Tv()),l}function Hq(){for(;rt!==null;)tN(rt)}function Vq(e,t){var a=ut;ut|=2;var r=JE(),n=eN();Ct!==e||ot!==t?(gv=null,mv=Xr()+500,Pd(e,t)):Hd=Gp(e,t);e:do try{if(xt!==0&&rt!==null){t=rt;var s=Vr;t:switch(xt){case 1:xt=0,Vr=null,md(e,t,s,1);break;case 2:case 9:if(OA(s)){xt=0,Vr=null,uM(t);break}t=function(){xt!==2&&xt!==9||Ct!==e||(xt=7),ki(e)},s.then(t,t);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:OA(s)?(xt=0,Vr=null,uM(t)):(xt=0,Vr=null,md(e,t,s,7));break;case 5:var l=null;switch(rt.tag){case 26:l=rt.memoizedState;case 5:case 27:var c=rt;if(l?TN(l):c.stateNode.complete){xt=0,Vr=null;var f=c.sibling;if(f!==null)rt=f;else{var m=c.return;m!==null?(rt=m,Bv(m)):rt=null}break t}}xt=0,Vr=null,md(e,t,s,5);break;case 6:xt=0,Vr=null,md(e,t,s,6);break;case 8:uk(),Gt=6;break e;default:throw Error(ie(462))}}jq();break}catch(g){QE(e,g)}while(1);if(fi=yc=null,je.H=r,je.A=n,ut=a,rt!==null)return 0;return Ct=null,ot=0,Tv(),Gt}function jq(){for(;rt!==null&&!rG();)tN(rt)}function tN(e){var t=kE(e.alternate,e,yi);e.memoizedProps=e.pendingProps,t===null?Bv(e):rt=t}function uM(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=ZA(a,t,t.pendingProps,t.type,void 0,ot);break;case 11:t=ZA(a,t,t.pendingProps,t.type.render,t.ref,ot);break;case 5:XS(t);var r=t;r===Sa&&(Je?(ev(r),r.tag===5&&r.stateNode!=null&&(Mt=r.stateNode)):(ev(r),Je=!0));default:CE(a,t),t=rt=RP(t,yi),t=kE(a,t,yi)}e.memoizedProps=e.pendingProps,t===null?Bv(e):rt=t}function md(e,t,a,r){fi=yc=null,XS(t),bd=null,Ep=0;var n=t.return;try{if(Mq(e,n,t,a,ot)){Gt=1,lv(e,po(a,e.current)),rt=null;return}}catch(s){if(n!==null)throw rt=n,s;Gt=1,lv(e,po(a,e.current)),rt=null;return}if(t.flags&32768){if(Je||r===1)e=!0;else if(Hd||(ot&536870912)!==0)e=!1;else if(ks=e=!0,r===2||r===9||r===3||r===6)r=Ha.current,r!==null&&r.tag===13&&(r.flags|=16384);aN(t,e)}else Bv(t)}function Bv(e){var t=e;do{if((t.flags&32768)!==0){aN(t,ks);return}e=t.return;var a=Dq(t.alternate,t,yi);if(a!==null){rt=a;return}if(t=t.sibling,t!==null){rt=t;return}rt=t=e}while(t!==null);Gt===0&&(Gt=5)}function aN(e,t){do{var a=Oq(e.alternate,e);if(a!==null){a.flags&=32767,rt=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){rt=e;return}rt=e=a}while(e!==null);Gt=6,rt=null}function dM(e,t,a,r,n,s,l,c,f,m,g,h){e.cancelPendingCommit=null;do Fv();while(Bt!==0);if((ut&6)!==0)throw Error(ie(327));if(t!==null){if(t===e.current)throw Error(ie(177));e===Ct&&(rt=Ct=null,ot=0),gc=t,Bo=e,kn=a,oS=n,YE=r,Gq(e,t,a,l,c,f,h)}}function Gq(e,t,a,r,n,s,l){var c=t.lanes|t.childLanes;if(rS=c,c|=NS,pG(e,a,c,r,n,s),kd=null,(a&335544064)===a?(Cd=gq(e),r=10262):(Cd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,$q(Wx,function(){return lS(),null})):(e.callbackNode=null,e.callbackPriority=0),dv=!1,r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=je.T,je.T=null,n=dt.p,dt.p=2,s=ut,ut|=4;try{_q(e,t,a)}finally{ut=s,dt.p=n,je.T=r}}Bt=1,dv?Sd=mK(l,e.containerInfo,Cd,nS,iS,Kq,sS,lS,qq,null,null):(nS(),iS(),sS())}function qq(e){if(Bt!==0){var t=Bo.onRecoverableError;t(e,{componentStack:null})}}function Kq(){Bt===3&&(Bt=0,HE(gc,Bo),Bt=4)}function nS(){if(Bt===1){Bt=0;var e=Bo,t=gc,a=kn,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=je.T,je.T=null;var n=dt.p;dt.p=2;var s=ut;ut|=4;try{up=fv=!1,FE(t,e,a),a=mS;var l=yP(e.containerInfo),c=a.focusedElem,f=a.selectionRange;if(l!==c&&c&&c.ownerDocument&&bP(c.ownerDocument.documentElement,c)){if(f!==null&&ES(c)){var{start:m,end:g}=f;if(g===void 0&&(g=m),"selectionStart"in c)c.selectionStart=m,c.selectionEnd=Math.min(g,c.value.length);else{var h=c.ownerDocument||document,x=h&&h.defaultView||window;if(x.getSelection){var v=x.getSelection(),w=c.textContent.length,C=Math.min(f.start,w),L=f.end===void 0?C:Math.min(f.end,w);!v.extend&&C>L&&(l=L,L=C,C=l);var k=TA(c,C),I=TA(c,L);if(k&&I&&(v.rangeCount!==1||v.anchorNode!==k.node||v.anchorOffset!==k.offset||v.focusNode!==I.node||v.focusOffset!==I.offset)){var T=h.createRange();T.setStart(k.node,k.offset),v.removeAllRanges(),C>L?(v.addRange(T),v.extend(I.node,I.offset)):(T.setEnd(I.node,I.offset),v.addRange(T))}}}}h=[];for(v=c;v=v.parentNode;)v.nodeType===1&&h.push({element:v,left:v.scrollLeft,top:v.scrollTop});typeof c.focus==="function"&&c.focus();for(c=0;c<h.length;c++){var R=h[c];R.element.scrollLeft=R.left,R.element.scrollTop=R.top}}_d=!!pS,mS=pS=null}finally{ut=s,dt.p=n,je.T=r}}e.current=t,Bt=2}}function iS(){if(Bt===2){Bt=0;var e=Bo,t=gc,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=je.T,je.T=null;var r=dt.p;dt.p=2;var n=ut;ut|=4;try{NE(e,t.alternate,t)}finally{ut=n,dt.p=r,je.T=a}}Bt=3}}function sS(){if(Bt===4||Bt===3){Bt=0;var e=Sd;Sd=null,oG();var t=Bo,a=gc,r=kn,n=YE,s=(r&335544064)===r?10262:10256;if((a.subtreeFlags&s)!==0||(a.flags&s)!==0?Bt=5:(Bt=0,gc=Bo=null,rN(t,t.pendingLanes)),s=t.pendingLanes,s===0&&(Ms=null),LS(r),a=a.stateNode,Yr&&typeof Yr.onCommitFiberRoot==="function")try{Yr.onCommitFiberRoot(jp,a,void 0,(a.current.flags&128)===128)}catch(m){}if(n!==null){a=je.T,s=dt.p,dt.p=2,je.T=null;try{for(var l=t.onRecoverableError,c=0;c<n.length;c++){var f=n[c];l(f.value,{componentStack:f.stack})}}finally{je.T=a,dt.p=s}}if(n=kd,l=Cd,Cd=null,n!==null&&(kd=null,l===null&&(l=[]),e!==null))for(f=0;f<n.length;f++)a=(0,n[f])(l),a!==void 0&&e.finished.finally(a);(kn&3)!==0&&Fv(),ki(t),s=t.pendingLanes,(r&261930)!==0&&(s&42)!==0?t===Ux?Ip++:(Ip=0,Ux=t):(Ip=0,Ux=null),Qp(0,!1)}}function rN(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Yp(t)))}function Fv(){return Sd!==null&&(Sd.skipTransition(),Sd=null),nS(),iS(),sS(),lS()}function lS(){if(Bt!==5)return!1;var e=Bo,t=rS;rS=0;var a=LS(kn),r=je.T,n=dt.p;try{dt.p=32>a?32:a,je.T=null,a=oS,oS=null;var s=Bo,l=kn;if(Bt=0,gc=Bo=null,kn=0,(ut&6)!==0)throw Error(ie(331));var c=ut;if(ut|=4,qE(s.current),VE(s,s.current,l,a),ut=c,Qp(0,!1),Yr&&typeof Yr.onPostCommitFiberRoot==="function")try{Yr.onPostCommitFiberRoot(jp,s)}catch(f){}return!0}finally{dt.p=n,je.T=r,rN(e,t)}}function fM(e,t,a){t=po(a,t),t=H1(e.stateNode,t,2),e=ic(e,t,2),e!==null&&(Sv(e,2),ki(e))}function bt(e,t,a){if(e.tag===3)fM(e,e,a);else for(;t!==null;){if(t.tag===3){fM(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==="function"||typeof r.componentDidCatch==="function"&&(Ms===null||!Ms.has(r))){e=po(a,e),a=vE(2),r=ic(t,a,2),r!==null&&(bE(a,r,t,e),Sv(r,2),ki(r));break}}t=t.return}}function r1(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Fq;var n=new Set;r.set(t,n)}else n=r.get(t),n===void 0&&(n=new Set,r.set(t,n));n.has(a)||(ck=!0,n.add(a),e=Xq.bind(null,e,t,a),t.then(e,e))}function Xq(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ct===e&&(ot&a)===a&&(Gt===4||Gt===3&&(ot&62914560)===ot&&300>Xr()-_v?(ut&2)===0?Pd(e,0):pv|=a:pv|=a,Ad===ot&&(Ad=0)),ki(e)}function oN(e,t){t===0&&(t=$M()),e=bc(e,t),e!==null&&(Sv(e,t),ki(e))}function Yq(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),oN(e,a)}function Wq(e,t){var a=0;switch(e.tag){case 31:case 13:var{stateNode:r,memoizedState:n}=e;n!==null&&(a=n.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(ie(314))}r!==null&&r.delete(t),oN(e,a)}function $q(e,t){return IS(e,t)}var Ed=null,td=null,cS=!1,xv=!1,o1=!1,Is=0;function ki(e){e!==td&&e.next===null&&(td===null?Ed=td=e:td=td.next=e),xv=!0,cS||(cS=!0,Zq())}function Qp(e,t){if(!o1&&xv){o1=!0;do{var a=!1;for(var r=Ed;r!==null;){if(!t)if(e!==0){var n=r.pendingLanes;if(n===0)var s=0;else{var l=r.suspendedLanes,c=r.pingedLanes;s=(1<<31-Wr(42|e)+1)-1,s&=n&~(l&~c),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(a=!0,pM(r,s))}else s=ot,s=wv(r,r===Ct?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(s&3)===0||Gp(r,s)||(a=!0,pM(r,s));r=r.next}}while(a);o1=!1}}function Qq(){nN()}function nN(){xv=cS=!1;var e=0;Is!==0&&sK()&&(e=Is);for(var t=Xr(),a=null,r=Ed;r!==null;){var n=r.next,s=iN(r,t);if(s===0)r.next=null,a===null?Ed=n:a.next=n,n===null&&(td=a);else if(a=r,e!==0||(s&3)!==0)xv=!0;r=n}Bt!==0&&Bt!==5||Qp(e,!1),Is!==0&&(Is=0)}function iN(e,t){for(var{suspendedLanes:a,pingedLanes:r,expirationTimes:n}=e,s=e.pendingLanes&-62914561;0<s;){var l=31-Wr(s),c=1<<l,f=n[l];if(f===-1){if((c&a)===0||(c&r)!==0)n[l]=fG(c,t)}else f<=t&&(e.expiredLanes|=c);s&=~c}if(t=Ct,a=ot,a=wv(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(xt===2||xt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&zw(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Gp(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&zw(r),LS(a)){case 2:case 8:a=XM;break;case 32:a=Wx;break;case 268435456:a=YM;break;default:a=Wx}return r=sN.bind(null,e),a=IS(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&zw(r),e.callbackPriority=2,e.callbackNode=null,2}function sN(e,t){if(Bt!==0&&Bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Fv()&&e.callbackNode!==a)return null;var r=ot;if(r=wv(e,e===Ct?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0)return null;return $E(e,r,t),iN(e,Xr()),e.callbackNode!=null&&e.callbackNode===a?sN.bind(null,e):null}function pM(e,t){if(Fv())return null;$E(e,t,!0)}function Zq(){cK(function(){(ut&6)!==0?IS(KM,Qq):nN()})}function dk(){if(Is===0){var e=dc;e===0&&(e=ux,ux<<=1,(ux&261888)===0&&(ux=256)),Is=e}return Is}function mM(e){return e==null||typeof e==="symbol"||typeof e==="boolean"?null:typeof e==="function"?e:Tx(e)}function Jq(e,t,a,r,n){if(t==="submit"&&a&&a.stateNode===n){var s=mM((n[Er]||null).action),l=r.submitter;l&&(t=(t=l[Er]||null)?mM(t.formAction):l.getAttribute("formAction"),t!==null&&(s=t,l=null));var c=new Cv("action","action",null,r,n);e.push({event:c,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Is!==0){var f=new FormData(n,l);F1(a,{pending:!0,data:f,method:n.method,action:s},null,f)}}else typeof s==="function"&&(c.preventDefault(),f=new FormData(n,l),F1(a,{pending:!0,data:f,method:n.method,action:s},s,f))},currentTarget:n}]})}}for(dp=0;dp<R1.length;dp++)fp=R1[dp],uS=fp.toLowerCase(),dS=fp[0].toUpperCase()+fp.slice(1),Fo(uS,"on"+dS);var fp,uS,dS,dp;Fo(SP,"onAnimationEnd");Fo(kP,"onAnimationIteration");Fo(CP,"onAnimationStart");Fo("dblclick","onDoubleClick");Fo("focusin","onFocus");Fo("focusout","onBlur");Fo(sq,"onTransitionRun");Fo(lq,"onTransitionStart");Fo(cq,"onTransitionCancel");Fo(IP,"onTransitionEnd");Ld("onMouseEnter",["mouseout","mouseover"]);Ld("onMouseLeave",["mouseout","mouseover"]);Ld("onPointerEnter",["pointerout","pointerover"]);Ld("onPointerLeave",["pointerout","pointerover"]);xc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xc("onBeforeInput",["compositionend","keypress","textInput","paste"]);xc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Op="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(" "),eK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Op));function lN(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],n=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var l=r.length-1;0<=l;l--){var c=r[l],f=c.instance,m=c.currentTarget;if(c=c.listener,f!==s&&n.isPropagationStopped())break e;s=c,n.currentTarget=m;try{s(n)}catch(g){Qx(g)}n.currentTarget=null,s=f}else for(l=0;l<r.length;l++){if(c=r[l],f=c.instance,m=c.currentTarget,c=c.listener,f!==s&&n.isPropagationStopped())break e;s=c,n.currentTarget=m;try{s(n)}catch(g){Qx(g)}n.currentTarget=null,s=f}}}}function at(e,t){var a=t[uA];a===void 0&&(a=t[uA]=new Set);var r=e+"__bubble";a.has(r)||(uN(t,e,2,!1),a.add(r))}function n1(e,t,a){var r=0;t&&(r|=4),uN(a,e,r,t)}var kx="_reactListening"+Math.random().toString(36).slice(2);function cN(e){if(!e[kx]){e[kx]=!0,rP.forEach(function(a){a!=="selectionchange"&&(eK.has(a)||n1(a,!1,e),n1(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kx]||(t[kx]=!0,n1("selectionchange",!1,t))}}function uN(e,t,a,r){switch(EN(t)){case 2:var n=YK;break;case 8:n=WK;break;default:n=vk}a=n.bind(null,t,a,e),n=void 0,!C1||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),r?n!==void 0?e.addEventListener(t,a,{capture:!0,passive:n}):e.addEventListener(t,a,!0):n!==void 0?e.addEventListener(t,a,{passive:n}):e.addEventListener(t,a,!1)}function i1(e,t,a,r,n){var s=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var c=r.stateNode.containerInfo;if(c===n)break;if(l===4)for(l=r.return;l!==null;){var f=l.tag;if((f===3||f===4)&&l.stateNode.containerInfo===n)return;l=l.return}for(;c!==null;){if(l=Jl(c),l===null)return;if(f=l.tag,f===5||f===6||f===26||f===27){r=s=l;continue e}c=c.parentNode}}r=r.return}dP(function(){var m=s,g=RS(a),h=[];e:{var x=LP.get(e);if(x!==void 0){var v=Cv,w=e;switch(e){case"keypress":if(Ax(a)===0)break e;case"keydown":case"keyup":v=zG;break;case"focusin":w="focus",v=jw;break;case"focusout":w="blur",v=jw;break;case"beforeblur":case"afterblur":v=jw;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=vA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=IG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=VG;break;case SP:case kP:case CP:v=RG;break;case IP:v=GG;break;case"scroll":case"scrollend":v=kG;break;case"wheel":v=KG;break;case"copy":case"cut":case"paste":v=MG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=yA;break;case"submit":v=UG;break;case"toggle":case"beforetoggle":v=YG}var C=(t&4)!==0,L=!C&&(e==="scroll"||e==="scrollend"),k=C?x!==null?x+"Capture":null:x;C=[];for(var I=m,T;I!==null;){var R=I;if(T=R.stateNode,R=R.tag,R!==5&&R!==26&&R!==27||T===null||k===null||(R=Tp(I,k),R!=null&&C.push(_p(I,R,T))),L)break;I=I.return}0<C.length&&(x=new v(x,w,null,a,g),h.push({event:x,listeners:C}))}}if((t&7)===0){e:{if(v=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",v&&a!==k1&&(w=a.relatedTarget||a.fromElement)&&(Jl(w)||w[qp]))break e;if(x||v){if(w=g.window===g?g:(v=g.ownerDocument)?v.defaultView||v.parentWindow:window,x){if(v=a.relatedTarget||a.toElement,x=m,v=v?Jl(v):null,v!==null&&(L=Vp(v),C=v.tag,v!==L||C!==5&&C!==27&&C!==6))v=null}else x=null,v=m;if(x!==v){if(C=vA,R="onMouseLeave",k="onMouseEnter",I="mouse",e==="pointerout"||e==="pointerover")C=yA,R="onPointerLeave",k="onPointerEnter",I="pointer";L=x==null?w:ip(x),T=v==null?w:ip(v),w=new C(R,I+"leave",x,a,g),w.target=L,w.relatedTarget=T,R=null,Jl(g)===m&&(C=new C(k,I+"enter",v,a,g),C.target=T,C.relatedTarget=L,R=C),L=R,C=x&&v?d1(x,v,tK):null,x!==null&&gM(h,w,x,C,!1),v!==null&&L!==null&&gM(h,L,v,C,!0)}}}e:{if(x=m?ip(m):window,v=x.nodeName&&x.nodeName.toLowerCase(),v==="select"||v==="input"&&x.type==="file")var E=CA;else if(kA(x))if(xP)E=oq;else{E=aq;var M=tq}else v=x.nodeName,!v||v.toLowerCase()!=="input"||x.type!=="checkbox"&&x.type!=="radio"?m&&TS(m.elementType)&&(E=CA):E=rq;if(E&&(E=E(e,m))){hP(h,E,a,g);break e}M&&M(e,x,m)}switch(M=m?ip(m):window,e){case"focusin":if(kA(M)||M.contentEditable==="true")ld=M,L1=m,gp=null;break;case"focusout":gp=L1=ld=null;break;case"mousedown":T1=!0;break;case"contextmenu":case"mouseup":case"dragend":T1=!1,RA(h,a,g);break;case"selectionchange":if(iq)break;case"keydown":case"keyup":RA(h,a,g)}var P;if(PS)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else sd?mP(e,a)&&(O="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(O="onCompositionStart");if(O&&(pP&&a.locale!=="ko"&&(sd||O!=="onCompositionStart"?O==="onCompositionEnd"&&sd&&(P=fP()):(ws=g,AS=("value"in ws)?ws.value:ws.textContent,sd=!0)),M=vv(m,O),0<M.length&&(O=new bA(O,e,null,a,g),h.push({event:O,listeners:M}),P?O.data=P:(P=gP(a),P!==null&&(O.data=P)))),P=$G?QG(e,a):ZG(e,a))O=vv(m,"onBeforeInput"),0<O.length&&(M=new bA("onBeforeInput","beforeinput",null,a,g),h.push({event:M,listeners:O}),M.data=P);Jq(h,e,m,a,g)}lN(h,t)})}function _p(e,t,a){return{instance:e,listener:t,currentTarget:a}}function vv(e,t){for(var a=t+"Capture",r=[];e!==null;){var n=e,s=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||s===null||(n=Tp(e,a),n!=null&&r.unshift(_p(e,n,s)),n=Tp(e,t),n!=null&&r.push(_p(e,n,s))),e.tag===3)return r;e=e.return}return[]}function tK(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e?e:null}function gM(e,t,a,r,n){for(var s=t._reactName,l=[];a!==null&&a!==r;){var c=a,f=c.alternate,m=c.stateNode;if(c=c.tag,f!==null&&f===r)break;c!==5&&c!==26&&c!==27||m===null||(f=m,n?(m=Tp(a,s),m!=null&&l.unshift(_p(a,m,f))):n||(m=Tp(a,s),m!=null&&l.push(_p(a,m,f)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var aK=/\r\n?/g,rK=/\u0000|\uFFFD/g;function hM(e){return(typeof e==="string"?e:""+e).replace(aK,`
|
|
11
|
+
`).replace(rK,"")}function dN(e,t){return t=hM(t),hM(e)===t?!0:!1}function vt(e,t,a,r,n,s){switch(a){case"children":if(typeof r==="string")t==="body"||t==="textarea"&&r===""||Td(e,r);else if(typeof r==="number"||typeof r==="bigint")t!=="body"&&Td(e,""+r);else return;break;case"className":px(e,"class",r);break;case"tabIndex":px(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":px(e,a,r);break;case"style":uP(e,r,s);return;case"data":if(t!=="object"){px(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r==="function"||typeof r==="symbol"||typeof r==="boolean"){e.removeAttribute(a);break}r=Tx(r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r==="function"){e.setAttribute(a,"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 s==="function"&&(a==="formAction"?(t!=="input"&&vt(e,t,"name",n.name,n,null),vt(e,t,"formEncType",n.formEncType,n,null),vt(e,t,"formMethod",n.formMethod,n,null),vt(e,t,"formTarget",n.formTarget,n,null)):(vt(e,t,"encType",n.encType,n,null),vt(e,t,"method",n.method,n,null),vt(e,t,"target",n.target,n,null)));if(r==null||typeof r==="symbol"||typeof r==="boolean"){e.removeAttribute(a);break}r=Tx(r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=bn);return;case"onScroll":r!=null&&at("scroll",e);return;case"onScrollEnd":r!=null&&at("scrollend",e);return;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!=="object"||!("__html"in r))throw Error(ie(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(ie(60));(s!=null?s.__html:void 0)!==a&&(e.innerHTML=a)}}break;case"multiple":e.multiple=r&&typeof r!=="function"&&typeof r!=="symbol";break;case"muted":e.muted=r&&typeof r!=="function"&&typeof r!=="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r==="function"||typeof r==="boolean"||typeof r==="symbol"){e.removeAttribute("xlink:href");break}a=Tx(r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!=="function"&&typeof r!=="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":r&&typeof r!=="function"&&typeof r!=="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!=="function"&&typeof r!=="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!=="function"&&typeof r!=="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r==="function"||typeof r==="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":at("beforetoggle",e),at("toggle",e),Lx(e,"popover",r);break;case"xlinkActuate":ci(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ci(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ci(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ci(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ci(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ci(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ci(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ci(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ci(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Lx(e,"is",r);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=wG.get(a)||a,Lx(e,a,r);else return}ct=!0}function fS(e,t,a,r,n,s){switch(a){case"style":uP(e,r,s);return;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!=="object"||!("__html"in r))throw Error(ie(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(ie(60));(s!=null?s.__html:void 0)!==a&&(e.innerHTML=a)}}break;case"children":if(typeof r==="string")Td(e,r);else if(typeof r==="number"||typeof r==="bigint")Td(e,""+r);else return;break;case"onScroll":r!=null&&at("scroll",e);return;case"onScrollEnd":r!=null&&at("scrollend",e);return;case"onClick":r!=null&&(e.onclick=bn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!oP.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),s=a.slice(2,n?a.length-7:void 0),t=e[Er]||null,t=t!=null?t[a]:null,typeof t==="function"&&e.removeEventListener(s,t,n),typeof r==="function")){typeof t!=="function"&&t!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(s,r,n);break e}ct=!0,a in e?e[a]=r:r===!0?e.setAttribute(a,""):Lx(e,a,r)}return}ct=!0}function Ua(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",e),at("load",e);var r=!1,n=!1,s;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];if(l!=null)switch(s){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(ie(137,t));default:vt(e,t,s,l,a,null)}}n&&vt(e,t,"srcSet",a.srcSet,a,null),r&&vt(e,t,"src",a.src,a,null);return;case"input":at("invalid",e);var c=s=l=n=null,f=null,m=null;for(r in a)if(a.hasOwnProperty(r)){var g=a[r];if(g!=null)switch(r){case"name":n=g;break;case"type":l=g;break;case"checked":f=g;break;case"defaultChecked":m=g;break;case"value":s=g;break;case"defaultValue":c=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(ie(137,t));break;default:vt(e,t,r,g,a,null)}}sP(e,s,c,f,m,l,n,!1);return;case"select":at("invalid",e),r=l=s=null;for(n in a)if(a.hasOwnProperty(n)&&(c=a[n],c!=null))switch(n){case"value":s=c;break;case"defaultValue":l=c;break;case"multiple":r=c;default:vt(e,t,n,c,a,null)}t=s,a=l,e.multiple=!!r,t!=null?hd(e,!!r,t,!1):a!=null&&hd(e,!!r,a,!0);return;case"textarea":at("invalid",e),s=n=r=null;for(l in a)if(a.hasOwnProperty(l)&&(c=a[l],c!=null))switch(l){case"value":r=c;break;case"defaultValue":n=c;break;case"children":s=c;break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(ie(91));break;default:vt(e,t,l,c,a,null)}cP(e,r,n,s);return;case"option":for(f in a)if(a.hasOwnProperty(f)&&(r=a[f],r!=null))switch(f){case"selected":e.selected=r&&typeof r!=="function"&&typeof r!=="symbol";break;default:vt(e,t,f,r,a,null)}return;case"dialog":at("beforetoggle",e),at("toggle",e),at("cancel",e),at("close",e);break;case"iframe":case"object":at("load",e);break;case"video":case"audio":for(r=0;r<Op.length;r++)at(Op[r],e);break;case"image":at("error",e),at("load",e);break;case"details":at("toggle",e);break;case"embed":case"source":case"link":at("error",e),at("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(m in a)if(a.hasOwnProperty(m)&&(r=a[m],r!=null))switch(m){case"children":case"dangerouslySetInnerHTML":throw Error(ie(137,t));default:vt(e,t,m,r,a,null)}return;default:if(TS(t)){for(g in a)a.hasOwnProperty(g)&&(r=a[g],r!==void 0&&fS(e,t,g,r,a,void 0));return}}for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null&&vt(e,t,c,r,a,null))}var oK={};function nK(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,s=null,l=null,c=null,f=null,m=null,g=null;for(v in a){var h=a[v];if(a.hasOwnProperty(v)&&h!=null)switch(v){case"checked":break;case"value":break;case"defaultValue":f=h;default:r.hasOwnProperty(v)||vt(e,t,v,null,r,h)}}for(var x in r){var v=r[x];if(h=a[x],r.hasOwnProperty(x)&&(v!=null||h!=null))switch(x){case"type":v!==h&&(ct=!0),s=v;break;case"name":v!==h&&(ct=!0),n=v;break;case"checked":v!==h&&(ct=!0),m=v;break;case"defaultChecked":v!==h&&(ct=!0),g=v;break;case"value":v!==h&&(ct=!0),l=v;break;case"defaultValue":v!==h&&(ct=!0),c=v;break;case"children":case"dangerouslySetInnerHTML":if(v!=null)throw Error(ie(137,t));break;default:v!==h&&vt(e,t,x,v,r,h)}}S1(e,l,c,f,m,g,s,n);return;case"select":v=l=c=x=null;for(s in a)if(f=a[s],a.hasOwnProperty(s)&&f!=null)switch(s){case"value":break;case"multiple":v=f;default:r.hasOwnProperty(s)||vt(e,t,s,null,r,f)}for(n in r)if(s=r[n],f=a[n],r.hasOwnProperty(n)&&(s!=null||f!=null))switch(n){case"value":s!==f&&(ct=!0),x=s;break;case"defaultValue":s!==f&&(ct=!0),c=s;break;case"multiple":s!==f&&(ct=!0),l=s;default:s!==f&&vt(e,t,n,s,r,f)}t=c,a=l,r=v,x!=null?hd(e,!!a,x,!1):!!r!==!!a&&(t!=null?hd(e,!!a,t,!0):hd(e,!!a,a?[]:"",!1));return;case"textarea":v=x=null;for(c in a)if(n=a[c],a.hasOwnProperty(c)&&n!=null&&!r.hasOwnProperty(c))switch(c){case"value":break;case"children":break;default:vt(e,t,c,null,r,n)}for(l in r)if(n=r[l],s=a[l],r.hasOwnProperty(l)&&(n!=null||s!=null))switch(l){case"value":n!==s&&(ct=!0),x=n;break;case"defaultValue":n!==s&&(ct=!0),v=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(ie(91));break;default:n!==s&&vt(e,t,l,n,r,s)}lP(e,x,v);return;case"option":for(var w in a)if(x=a[w],a.hasOwnProperty(w)&&x!=null&&!r.hasOwnProperty(w))switch(w){case"selected":e.selected=!1;break;default:vt(e,t,w,null,r,x)}for(f in r)if(x=r[f],v=a[f],r.hasOwnProperty(f)&&x!==v&&(x!=null||v!=null))switch(f){case"selected":x!==v&&(ct=!0),e.selected=x&&typeof x!=="function"&&typeof x!=="symbol";break;default:vt(e,t,f,x,r,v)}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 C in a)x=a[C],a.hasOwnProperty(C)&&x!=null&&!r.hasOwnProperty(C)&&vt(e,t,C,null,r,x);for(m in r)if(x=r[m],v=a[m],r.hasOwnProperty(m)&&x!==v&&(x!=null||v!=null))switch(m){case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(ie(137,t));break;default:vt(e,t,m,x,r,v)}return;default:if(TS(t)){for(var L in a)x=a[L],a.hasOwnProperty(L)&&x!==void 0&&!r.hasOwnProperty(L)&&fS(e,t,L,void 0,r,x);for(g in r)x=r[g],v=a[g],!r.hasOwnProperty(g)||x===v||x===void 0&&v===void 0||fS(e,t,g,x,r,v);return}}for(var k in a)x=a[k],a.hasOwnProperty(k)&&x!=null&&!r.hasOwnProperty(k)&&vt(e,t,k,null,r,x);for(h in r)x=r[h],v=a[h],!r.hasOwnProperty(h)||x===v||x==null&&v==null||vt(e,t,h,x,r,v)}function xM(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iK(){if(typeof performance.getEntriesByType==="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],{transferSize:s,initiatorType:l,duration:c}=n;if(s&&c&&xM(l)){l=0,c=n.responseEnd;for(r+=1;r<a.length;r++){var f=a[r],m=f.startTime;if(m>c)break;var g=f.transferSize,h=f.initiatorType;g&&xM(h)&&(f=f.responseEnd,l+=g*(f<c?1:(c-m)/(f-m)))}if(--r,t+=8*(s+l)/(n.duration/1000),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==="number")?e:5}var pS=null,mS=null;function zp(e){return e.nodeType===9?e:e.ownerDocument}function vM(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 fN(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function pN(e,t,a,r){return a=zp(a).createElement(e),a[_a]=r,a[Er]=t,Ua(a,e,t),wa(a),a}function gS(e,t){return e==="textarea"||e==="noscript"||typeof t.children==="string"||typeof t.children==="number"||typeof t.children==="bigint"||typeof t.dangerouslySetInnerHTML==="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var s1=null;function sK(){var e=window.event;if(e&&e.type==="popstate"){if(e===s1)return!1;return s1=e,!0}return s1=null,!1}var fk=typeof setTimeout==="function"?setTimeout:void 0,lK=typeof clearTimeout==="function"?clearTimeout:void 0,bM=typeof Promise==="function"?Promise:void 0,yM=typeof requestAnimationFrame==="function"?requestAnimationFrame:fk,cK=typeof queueMicrotask==="function"?queueMicrotask:typeof bM<"u"?function(e){return bM.resolve(null).then(e).catch(uK)}:fk;function uK(e){setTimeout(function(){throw e})}function Us(e){return e==="head"}function wM(e,t){var a=t,r=0;do{var n=a.nextSibling;if(e.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(n),zd(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")c1(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,c1(a);for(var s=a.firstChild;s;){var l=s.nextSibling,c=s.nodeName;s[Kp]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&s.rel.toLowerCase()==="stylesheet"||a.removeChild(s),s=l}}else a==="body"&&c1(e.ownerDocument.body);a=n}while(a);zd(t)}function SM(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$")if(e===0)break;else e--;else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function mN(e,t,a){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,a!=null&&(e.style.viewTransitionClass=a),a=getComputedStyle(e),a.display==="inline"){if(t=e.getClientRects(),t.length===1)var r=1;else for(var n=r=0;n<t.length;n++){var s=t[n];0<s.width&&0<s.height&&r++}r===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+a.paddingTop,e.marginBottom="-"+a.paddingBottom)}}function gN(e,t){e=e.style,t=t.style;var a=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=a==null||typeof a==="boolean"?"":(""+a).trim(),a=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=a==null||typeof a==="boolean"?"":(""+a).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(a=t.display,e.display=a==null||typeof a==="boolean"?"":a,a=t.margin,a!=null?e.margin=a:(a=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=a==null||typeof a==="boolean"?"":a,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t==="boolean"?"":t)))}function hN(e,t,a){return a=a.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=a.innerHeight&&e.left<=a.innerWidth}}function hS(e){var t=e.getBoundingClientRect(),a=getComputedStyle(e);return hN(t,a,e)}function dK(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+20000,t.y+20000,t.width,t.height);var a=getComputedStyle(e);return hN(t,a,e)}function fK(e){return e.documentElement.clientHeight}function pK(e){this.addEventListener("load",e),this.addEventListener("error",e)}function mK(e,t,a,r,n,s,l,c,f){var m=t.nodeType===9?t:t.ownerDocument;try{var g=m.startViewTransition({update:function(){var x=m.defaultView,v=x.navigation&&x.navigation.transition,w=m.fonts.status;r();var C=[];if(w==="loaded"&&(fK(m),m.fonts.status==="loading"&&C.push(m.fonts.ready)),w=C.length,e!==null)for(var L=e.suspenseyImages,k=0,I=0;I<L.length;I++){var T=L[I];if(!T.complete){var R=T.getBoundingClientRect();if(0<R.bottom&&0<R.right&&R.top<x.innerHeight&&R.left<x.innerWidth){if(k+=RN(T),k>jx){C.length=w;break}T=new Promise(pK.bind(T)),C.push(T)}}}if(0<C.length)return x=Promise.race([Promise.all(C),new Promise(function(E){return setTimeout(E,500)})]).then(n,n),(v?Promise.allSettled([v.finished,x]):x).then(s,s);if(n(),v)return v.finished.then(s,s);s()},types:a});m.__reactViewTransition=g;var h=[];return g.ready.then(function(){for(var x=m.documentElement.getAnimations({subtree:!0}),v=0;v<x.length;v++){var w=x[v],C=w.effect,L=C.pseudoElement;if(L!=null&&L.startsWith("::view-transition")){h.push(w),w=C.getKeyframes();for(var k=L=void 0,I=!0,T=0;T<w.length;T++){var R=w[T],E=R.width;if(L===void 0)L=E;else if(L!==E){I=!1;break}if(E=R.height,k===void 0)k=E;else if(k!==E){I=!1;break}delete R.width,delete R.height,R.transform==="none"&&delete R.transform}I&&L!==void 0&&k!==void 0&&(C.setKeyframes(w),I=getComputedStyle(C.target,C.pseudoElement),I.width!==L||I.height!==k)&&(I=w[0],I.width=L,I.height=k,I=w[w.length-1],I.width=L,I.height=k,C.setKeyframes(w))}}l()},function(x){m.__reactViewTransition===g&&(m.__reactViewTransition=null);try{if(typeof x==="object"&&x!==null)switch(x.name){case"InvalidStateError":if(x.message==="View transition was skipped because document visibility state is hidden."||x.message==="Skipping view transition because document visibility state has become hidden."||x.message==="Skipping view transition because viewport size changed."||x.message==="Transition was aborted because of invalid state")x=null}x!==null&&f(x)}finally{r(),n(),l()}}),g.finished.finally(function(){for(var x=0;x<h.length;x++)h[x].cancel();m.__reactViewTransition===g&&(m.__reactViewTransition=null),c()}),g}catch(x){return r(),n(),l(),null}}function ec(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ec.prototype.animate=function(e,t){return t=typeof t==="number"?{duration:t}:It({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};ec.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,a=e.getAnimations({subtree:!0}),r=[],n=0;n<a.length;n++){var s=a[n].effect;s!==null&&s.target===e&&s.pseudoElement===t&&r.push(a[n])}return r};ec.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function xN(e){return{name:e,group:new ec("group",e),imagePair:new ec("image-pair",e),old:new ec("old",e),new:new ec("new",e)}}function Qr(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Qr.prototype.addEventListener=function(e,t,a){var r=null,n=null;if(a!=null&&typeof a!=="boolean"&&(r=a.signal||null,r!==null&&r.aborted))return;this._eventListeners===null&&(this._eventListeners=[]);var s=this._eventListeners;if(vN(s,e,t,a)===-1){var l=this,c=t;a!=null&&typeof a!=="boolean"&&a.once===!0&&(c=function(f){l.removeEventListener(e,t,a),typeof t==="function"?t.call(this,f):t.handleEvent(f)}),r!==null&&(n=l.removeEventListener.bind(l,e,t,a),r.addEventListener("abort",n,{once:!0}),n=r.removeEventListener.bind(r,"abort",n)),r=Nd(a),s.push({type:e,listener:t,optionsOrUseCapture:a,attachedListener:c,cleanup:n}),Pr(this._fragmentFiber.child,!1,gK,e,c,r)}this._eventListeners=s};function gK(e,t,a,r){return fa(e).addEventListener(t,a,r),!1}Qr.prototype.removeEventListener=function(e,t,a){var r=this._eventListeners;if(r!==null&&(t=vN(r,e,t,a),t!==-1)){var n=r[t];a=n.attachedListener;var s=n.cleanup;n=Nd(n.optionsOrUseCapture),Pr(this._fragmentFiber.child,!1,hK,e,a,n),r.splice(t,1),s!==null&&s()}};function hK(e,t,a,r){return fa(e).removeEventListener(t,a,r),!1}function Nd(e){return e!=null&&typeof e!=="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function kM(e){return e==null?"c=0":typeof e==="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function vN(e,t,a,r){if(e.length===0)return-1;r=kM(r);for(var n=0;n<e.length;n++){var s=e[n];if(s.type===t&&s.listener===a&&kM(s.optionsOrUseCapture)===r)return n}return-1}Qr.prototype.dispatchEvent=function(e){var t=hc(this._fragmentFiber);if(t===null)return!0;t=fa(t);var a=this._eventListeners;if(a!==null&&0<a.length||!e.bubbles){var r=t.nodeType===9?t.createComment(""):document.createTextNode("");if(a)for(var n=0;n<a.length;n++){var s=a[n];r.addEventListener(s.type,s.attachedListener,Nd(s.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),a)for(n=0;n<a.length;n++)s=a[n],r.removeEventListener(s.type,s.attachedListener,Nd(s.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)};Qr.prototype.focus=function(e){Pr(this._fragmentFiber.child,!0,bN,e,void 0,void 0)};function bN(e,t){if(e.tag===6)return!1;return e=fa(e),RK(e,t)}Qr.prototype.focusLast=function(e){var t=[];Pr(this._fragmentFiber.child,!0,pk,t,void 0,void 0);for(var a=t.length-1;0<=a&&!bN(t[a],e);a--);};function pk(e,t){return t.push(e),!1}Qr.prototype.blur=function(){var e=hc(this._fragmentFiber);e!==null&&(e=fa(e),e=zp(e).activeElement,e!==null&&Pr(this._fragmentFiber.child,!1,xK,e,void 0,void 0))};function xK(e,t){if(e.tag===6)return!1;return e=fa(e),e===t||e.contains(t)?(t.blur(),!0):!1}Qr.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),Pr(this._fragmentFiber.child,!1,vK,e,void 0,void 0)};function vK(e,t){if(e.tag===6)return!1;return e=fa(e),t.observe(e),!1}Qr.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),Pr(this._fragmentFiber.child,!1,bK,e,void 0,void 0);for(var a=t=0;a<zo.length;a++){var r=zo[a];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):zo[t++]=r}zo.length=t}};function bK(e,t){if(e.tag===6)return!1;return e=fa(e),t.unobserve(e),!1}var zo=[],l1=!1;function yK(e,t,a){zo.push({fragmentInstance:e,observer:t,instance:a}),l1||(l1=!0,AK(function(){l1=!1;var r=zo;zo=[];for(var n=0;n<r.length;n++){var s=r[n];s.observer.unobserve(s.instance)}}))}Qr.prototype.getClientRects=function(){var e=[];return Pr(this._fragmentFiber.child,!1,wK,e,void 0,void 0),e};function wK(e,t){if(e.tag===6){e=e.stateNode;var a=e.ownerDocument.createRange();a.selectNodeContents(e),t.push.apply(t,a.getClientRects())}else e=fa(e),t.push.apply(t,e.getClientRects());return!1}Qr.prototype.getRootNode=function(e){var t=hc(this._fragmentFiber);return t===null?this:fa(t).getRootNode(e)};Qr.prototype.compareDocumentPosition=function(e){var t=hc(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];Pr(this._fragmentFiber.child,!1,pk,a,void 0,void 0);var r=fa(t);if(a.length===0){if(a=r,oA(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(a=t)}t=this._fragmentFiber;var n=r=a.compareDocumentPosition(e);return a===e?n=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=VM(t)[1],a===null?n=Node.DOCUMENT_POSITION_PRECEDING:(e=fa(a).compareDocumentPosition(e),n=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),n|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=fa(a[0]),n=fa(a[a.length-1]);var s=oA(this._fragmentFiber)?t.parentElement:r;if(s==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=s.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,s=s.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY;var l=t.compareDocumentPosition(e),c=n.compareDocumentPosition(e),f=l&Node.DOCUMENT_POSITION_CONTAINED_BY||c&Node.DOCUMENT_POSITION_CONTAINED_BY;return c=r&&s&&l&Node.DOCUMENT_POSITION_FOLLOWING&&c&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||s&&n===e||f||c?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!s&&n===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:l,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||SK(t,this._fragmentFiber,a[0],a[a.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function SK(e,t,a,r,n){var s=Jl(n);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!s)e:{for(;s!==null;){if(s.tag===7&&(s===t||s.alternate===t)){a=!0;break e}s=s.return}a=!1}return a}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(s===null)return s=n.ownerDocument,n===s||n===s.documentElement||n===s.body;e:{s=t;for(t=hc(t);s!==null;){if(!(s.tag!==5&&s.tag!==3&&s.tag!==27||s!==t&&s.alternate!==t)){s=!0;break e}s=s.return}s=!1}return s}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!s)&&!(t=s===a)&&(t=d1(a,s,nA),t===null?t=!1:(Pr(t,!0,Wj,s,a),s=rd,rd=null,t=s!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!s)&&!(t=s===r)&&(t=d1(r,s,nA),t===null?t=!1:(Pr(t,!0,$j,s,r),s=rd,u1=rd=null,t=s!==null)),t):!1}function CM(e,t){var a=e.ownerDocument.createRange();a.selectNodeContents(e),e=a.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Qr.prototype.scrollIntoView=function(e){if(typeof e==="object")throw Error(ie(566));var t=[];Pr(this._fragmentFiber.child,!1,pk,t,void 0,void 0);var a=e!==!1;if(t.length===0){var r=VM(this._fragmentFiber);if(r=a?r[1]||r[0]||hc(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=fa(r),CM(e,a);return}if(r=fa(r),r.nodeType!==9){if(r.nodeType===11){a="host"in r?r.host:null,a!==null&&a.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=a?t.length-1:0;r!==(a?-1:t.length);){var n=t[r];n.tag===6?(n=fa(n),CM(n,a)):fa(n).scrollIntoView(e),r+=a?-1:1}};function kK(e,t){return e=fa(e),yN(e,t),!1}function yN(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function wN(e,t){var a=t._eventListeners;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r];e.addEventListener(n.type,n.attachedListener,Nd(n.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(s){for(var l=0,c=0;c<zo.length;c++){var f=zo[c];if(f.fragmentInstance!==t||f.observer!==s||f.instance!==e)zo[l++]=f}zo.length=l,s.observe(e)}),yN(e,t))}function CK(e,t){var a=t._eventListeners;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r];e.removeEventListener(n.type,n.attachedListener,Nd(n.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(s){typeof s.rootMargin==="string"?yK(t,s,e):s.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function xS(e){var t=e.firstChild;t&&t.nodeType===10&&(t=t.nextSibling);for(;t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":xS(a),kv(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function IK(e,t,a,r){for(;e.nodeType===1;){var n=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(!r)if(t==="input"&&e.type==="hidden"){var s=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;else if(!e[Kp])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;else if(s!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}if(e=ho(e.nextSibling),e===null)break}return null}function LK(e,t,a){if(t==="")return null;for(;e.nodeType!==3;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a)return null;if(e=ho(e.nextSibling),e===null)return null}return e}function SN(e,t){for(;e.nodeType!==8;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t)return null;if(e=ho(e.nextSibling),e===null)return null}return e}function vS(e){return e.data==="$?"||e.data==="$~"}function mk(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function TK(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ho(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var bS=null;function IM(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ho(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function LM(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function RK(e,t){function a(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener("focus",a,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",a,!0)}return r}function AK(e){yM(function(){yM(function(t){return e(t)})})}function kN(e,t,a){switch(t=zp(a),e){case"html":if(e=t.documentElement,!e)throw Error(ie(452));return e;case"head":if(e=t.head,!e)throw Error(ie(453));return e;case"body":if(e=t.body,!e)throw Error(ie(454));return e;default:throw Error(ie(451))}}function CN(e,t,a){for(var r in a){var n=a[r];a.hasOwnProperty(r)&&n!=null&&vt(e,t,r,null,oK,n)}a.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===bn&&(e.onclick=null),kv(e)}function c1(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kv(e)}var xo=new Map,TM=new Set;function Bp(e){if(typeof e.getRootNode==="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Ci=dt.d;dt.d={f:MK,r:PK,D:EK,C:NK,L:DK,m:OK,X:zK,S:_K,M:BK};function MK(){var e=Ci.f(),t=zv();return e||t}function PK(e){var t=Bd(e);t!==null&&t.tag===5&&t.type==="form"?uE(t):Ci.r(e)}var Vd=typeof document>"u"?null:document;function IN(e,t,a){var r=Vd;if(r&&typeof t==="string"&&t){var n=fo(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a==="string"&&(n+='[crossorigin="'+a+'"]'),TM.has(n)||(TM.add(n),e={rel:e,crossOrigin:a,href:t},r.querySelector(n)===null&&(t=r.createElement("link"),Ua(t,"link",e),wa(t),r.head.appendChild(t)))}}function EK(e){Ci.D(e),IN("dns-prefetch",e,null)}function NK(e,t){Ci.C(e,t),IN("preconnect",e,t)}function DK(e,t,a){Ci.L(e,t,a);var r=Vd;if(r&&e&&t){var n='link[rel="preload"][as="'+fo(t)+'"]';t==="image"?a&&a.imageSrcSet?(n+='[imagesrcset="'+fo(a.imageSrcSet)+'"]',typeof a.imageSizes==="string"&&(n+='[imagesizes="'+fo(a.imageSizes)+'"]')):n+='[href="'+fo(e)+'"]':n+='[href="'+fo(e)+'"]';var s=n;switch(t){case"style":s=Dd(e);break;case"script":s=jd(e)}if(!(xo.has(s)||(e=It({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),xo.set(s,e),r.querySelector(n)!==null||t==="style"&&r.querySelector(Zp(s))||t==="script"&&r.querySelector(Jp(s))))){var l=r.createElement("link");Ua(l,"link",e),t==="style"&&(l[$x]=!0,l.onload=l.onerror=function(){aP(l)}),wa(l),r.head.appendChild(l)}}}function OK(e,t){Ci.m(e,t);var a=Vd;if(a&&e){var r=t&&typeof t.as==="string"?t.as:"script",n='link[rel="modulepreload"][as="'+fo(r)+'"][href="'+fo(e)+'"]',s=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=jd(e)}if(!xo.has(s)&&(e=It({rel:"modulepreload",href:e},t),xo.set(s,e),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Jp(s)))return}r=a.createElement("link"),Ua(r,"link",e),wa(r),a.head.appendChild(r)}}}function _K(e,t,a){Ci.S(e,t,a);var r=Vd;if(r&&e){var n=gd(r).hoistableStyles,s=Dd(e);t=t||"default";var l=n.get(s);if(!l){var c={loading:0,preload:null};if(l=r.querySelector(Zp(s)))c.loading=5;else{e=It({rel:"stylesheet",href:e,"data-precedence":t},a),(a=xo.get(s))&&gk(e,a);var f=l=r.createElement("link");wa(f),Ua(f,"link",e),f._p=new Promise(function(m,g){f.onload=m,f.onerror=g}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Hx(l,t,r)}l={type:"stylesheet",instance:l,count:1,state:c},n.set(s,l)}}}function zK(e,t){Ci.X(e,t);var a=Vd;if(a&&e){var r=gd(a).hoistableScripts,n=jd(e),s=r.get(n);s||(s=a.querySelector(Jp(n)),s||(e=It({src:e,async:!0},t),(t=xo.get(n))&&hk(e,t),s=a.createElement("script"),wa(s),Ua(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(n,s))}}function BK(e,t){Ci.M(e,t);var a=Vd;if(a&&e){var r=gd(a).hoistableScripts,n=jd(e),s=r.get(n);s||(s=a.querySelector(Jp(n)),s||(e=It({src:e,async:!0,type:"module"},t),(t=xo.get(n))&&hk(e,t),s=a.createElement("script"),wa(s),Ua(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(n,s))}}function RM(e,t,a,r){var n=(n=Ls.current)?Bp(n):null;if(!n)throw Error(ie(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence==="string"&&typeof a.href==="string"?(a=Dd(a.href),t=gd(n).hoistableStyles,r=t.get(a),r||(r={type:"style",instance:null,count:0,state:null},t.set(a,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href==="string"&&typeof a.precedence==="string"){e=Dd(a.href);var s=gd(n).hoistableStyles,l=s.get(e);if(l||(n=n.ownerDocument||n,l={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,l),(s=n.querySelector(Zp(e)))?s._p||(l.instance=s,l.state.loading=5):(s=xo.get(e),s||(s={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},xo.set(e,s)),FK(n,e,s,l.state))),t&&r===null)throw Error(ie(528,""));return l}if(t&&r!==null)throw Error(ie(529,""));return null;case"script":return t=a.async,a=a.src,typeof a==="string"&&t&&typeof t!=="function"&&typeof t!=="symbol"?(a=jd(a),t=gd(n).hoistableScripts,r=t.get(a),r||(r={type:"script",instance:null,count:0,state:null},t.set(a,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(ie(444,e))}}function Dd(e){return'href="'+fo(e)+'"'}function Zp(e){return'link[rel="stylesheet"]['+e+"]"}function LN(e){return It({},e,{"data-precedence":e.precedence,precedence:null})}function FK(e,t,a,r){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[$x]!==!0){r.loading=1;return}}else t=e.createElement("link"),t[$x]=!0,t.onload=t.onerror=aP.bind(null,t),Ua(t,"link",a),wa(t),e.head.appendChild(t);r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2})}function jd(e){return'[src="'+fo(e)+'"]'}function Jp(e){return"script[async]"+e}function AM(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+fo(a.href)+'"]');if(r)return t.instance=r,wa(r),r;var n=It({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),wa(r),Ua(r,"style",n),Hx(r,a.precedence,e),t.instance=r;case"stylesheet":n=Dd(a.href);var s=e.querySelector(Zp(n));if(s)return t.state.loading|=4,t.instance=s,wa(s),s;r=LN(a),(n=xo.get(n))&&gk(r,n),s=(e.ownerDocument||e).createElement("link"),wa(s);var l=s;return l._p=new Promise(function(c,f){l.onload=c,l.onerror=f}),Ua(s,"link",r),t.state.loading|=4,Hx(s,a.precedence,e),t.instance=s;case"script":if(s=jd(a.src),n=e.querySelector(Jp(s)))return t.instance=n,wa(n),n;if(r=a,n=xo.get(s))r=It({},a),hk(r,n);return e=e.ownerDocument||e,n=e.createElement("script"),wa(n),Ua(n,"link",r),e.head.appendChild(n),t.instance=n;case"void":return null;default:throw Error(ie(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Hx(r,a.precedence,e));return t.instance}function Hx(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,s=n,l=0;l<r.length;l++){var c=r[l];if(c.dataset.precedence===t)s=c;else if(s!==n)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function gk(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hk(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vx=null;function MM(e,t,a){if(Vx===null){var r=new Map,n=Vx=new Map;n.set(a,r)}else n=Vx,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(e))return r;r.set(e,null),a=a.getElementsByTagName(e);for(n=0;n<a.length;n++){var s=a[n];if(!(s[Kp]||s[_a]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var l=s.getAttribute(t)||"";l=e+l;var c=r.get(l);c?c.push(s):r.set(l,[s])}}return r}function yS(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function UK(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!=="string"||typeof t.href!=="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!=="string"||typeof t.href!=="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence==="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!=="function"&&typeof t.async!=="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==="string")return!0}return!1}function PM(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function TN(e){return e.type==="stylesheet"&&(e.state.loading&3)===0?!1:!0}function RN(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==="number"?devicePixelRatio:1)*0.25}function EM(e,t){typeof t.decode==="function"&&(e.imgCount++,t.complete||(e.imgBytes+=RN(t),e.suspenseyImages.push(t)),e=jK.bind(e),t.decode().then(e,e))}function HK(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!=="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=Dd(r.href),s=t.querySelector(Zp(n));if(s){t=s._p,t!==null&&typeof t==="object"&&typeof t.then==="function"&&(e.count++,e=Fp.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=s,wa(s);return}s=t.ownerDocument||t,r=LN(r),(n=xo.get(n))&&gk(r,n),s=s.createElement("link"),wa(s);var l=s;l._p=new Promise(function(c,f){l.onload=c,l.onerror=f}),Ua(s,"link",r),a.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Fp.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var jx=0;function VK(e,t){return e.stylesheets&&e.count===0&&Gx(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Gx(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},60000+t);0<e.imgBytes&&jx===0&&(jx=62500*iK());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Gx(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>jx?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function AN(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Gx(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Fp(){this.count--,AN(this)}function jK(){this.imgCount--,AN(this)}var bv=null;function Gx(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bv=new Map,t.forEach(GK,e),bv=null,Fp.call(e))}function GK(e,t){if(!(t.state.loading&4)){var a=bv.get(e);if(a)var r=a.get(null);else{a=new Map,bv.set(e,a);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<n.length;s++){var l=n[s];if(l.nodeName==="LINK"||l.getAttribute("media")!=="not all")a.set(l.dataset.precedence,l),r=l}r&&a.set(null,r)}n=t.instance,l=n.getAttribute("data-precedence"),s=a.get(l)||r,s===r&&a.set(null,n),a.set(l,n),this.count++,r=Fp.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),s?s.parentNode.insertBefore(n,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Od={$$typeof:vn,Provider:null,Consumer:null,_currentValue:tc,_currentValue2:tc,_threadCount:0};function qK(e,t,a,r,n,s,l,c,f){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=Bw(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bw(0),this.hiddenUpdates=Bw(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=s,this.onRecoverableError=l,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=f,this.transitionTypes=null,this.incompleteTransitions=new Map}function KK(e,t,a,r,n,s,l,c,f,m,g,h){return e=new qK(e,t,a,l,f,m,g,h,c),t=1,s===!0&&(t|=24),s=Ar(3,null,null,t),e.current=s,s.stateNode=e,t=zS(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:r,isDehydrated:a,cache:t},US(s),e}function XK(e){if(!e)return dd;return e=dd,e}function MN(e,t,a,r,n,s){n=XK(n),r.context===null?r.context=n:r.pendingContext=n,r=nc(t),r.payload={element:a},s=s===void 0?null:s,s!==null&&(r.callback=s),a=ic(e,r,t),a!==null&&(Mr(a,e,t),xp(a,e,t))}function NM(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function xk(e,t){NM(e,t),(e=e.alternate)&&NM(e,t)}function PN(e){if(e.tag===13||e.tag===31){var t=bc(e,67108864);t!==null&&Mr(t,e,67108864),xk(e,67108864)}}function DM(e){if(e.tag===13||e.tag===31){var t=go();t=eP(t);var a=bc(e,t);a!==null&&Mr(a,e,t),xk(e,t)}}var _d=!0;function YK(e,t,a,r){var n=je.T;je.T=null;var s=dt.p;try{dt.p=2,vk(e,t,a,r)}finally{dt.p=s,je.T=n}}function WK(e,t,a,r){var n=je.T;je.T=null;var s=dt.p;try{dt.p=8,vk(e,t,a,r)}finally{dt.p=s,je.T=n}}function vk(e,t,a,r){if(_d){var n=wS(r);if(n===null)i1(e,t,r,yv,a),OM(e,r);else if(QK(n,e,t,a,r))r.stopPropagation();else if(OM(e,r),t&4&&-1<$K.indexOf(e)){for(;n!==null;){var s=Bd(n);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var l=Wl(s.pendingLanes);if(l!==0){var c=s;c.pendingLanes|=2;for(c.entangledLanes|=2;l;){var f=1<<31-Wr(l);c.entanglements[1]|=f,l&=~f}ki(s),(ut&6)===0&&(mv=Xr()+500,Qp(0,!1))}}break;case 31:case 13:c=bc(s,2),c!==null&&Mr(c,s,2),zv(),xk(s,2)}if(s=wS(r),s===null&&i1(e,t,r,yv,a),s===n)break;n=s}n!==null&&r.stopPropagation()}else i1(e,t,r,null,a)}}function wS(e){return e=RS(e),bk(e)}var yv=null;function bk(e){if(yv=null,e=Jl(e),e!==null){var t=Vp(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=FM(t),e!==null)return e;e=null}else if(a===31){if(e=UM(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return yv=e,null}function EN(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nG()){case KM:return 2;case XM:return 8;case Wx:case iG:return 32;case YM:return 268435456;default:return 32}default:return 32}}var SS=!1,Ps=null,Es=null,Ns=null,Up=new Map,Hp=new Map,bs=[],$K="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 OM(e,t){switch(e){case"focusin":case"focusout":Ps=null;break;case"dragenter":case"dragleave":Es=null;break;case"mouseover":case"mouseout":Ns=null;break;case"pointerover":case"pointerout":Up.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hp.delete(t.pointerId)}}function rp(e,t,a,r,n,s){if(e===null||e.nativeEvent!==s)return e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:s,targetContainers:[n]},t!==null&&(t=Bd(t),t!==null&&PN(t)),e;return e.eventSystemFlags|=r,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e}function QK(e,t,a,r,n){switch(t){case"focusin":return Ps=rp(Ps,e,t,a,r,n),!0;case"dragenter":return Es=rp(Es,e,t,a,r,n),!0;case"mouseover":return Ns=rp(Ns,e,t,a,r,n),!0;case"pointerover":var s=n.pointerId;return Up.set(s,rp(Up.get(s)||null,e,t,a,r,n)),!0;case"gotpointercapture":return s=n.pointerId,Hp.set(s,rp(Hp.get(s)||null,e,t,a,r,n)),!0}return!1}function NN(e){var t=Jl(e.target);if(t!==null){var a=Vp(t);if(a!==null){if(t=a.tag,t===13){if(t=FM(a),t!==null){e.blockedOn=t,cA(e.priority,function(){DM(a)});return}}else if(t===31){if(t=UM(a),t!==null){e.blockedOn=t,cA(e.priority,function(){DM(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qx(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=wS(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);k1=r,a.target.dispatchEvent(r),k1=null}else return t=Bd(a),t!==null&&PN(t),e.blockedOn=a,!1;t.shift()}return!0}function _M(e,t,a){qx(e)&&a.delete(t)}function ZK(){SS=!1,Ps!==null&&qx(Ps)&&(Ps=null),Es!==null&&qx(Es)&&(Es=null),Ns!==null&&qx(Ns)&&(Ns=null),Up.forEach(_M),Hp.forEach(_M)}function Cx(e,t){e.blockedOn===t&&(e.blockedOn=null,SS||(SS=!0,Kl(ql,ZK)))}var Ix=null;function zM(e){Ix!==e&&(Ix=e,Kl(ql,function(){Ix===e&&(Ix=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],n=e[t+2];if(typeof r!=="function")if(bk(r||a)===null)continue;else break;var s=Bd(a);s!==null&&(e.splice(t,3),t-=3,F1(s,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function zd(e){function t(f){return Cx(f,e)}Ps!==null&&Cx(Ps,e),Es!==null&&Cx(Es,e),Ns!==null&&Cx(Ns,e),Up.forEach(t),Hp.forEach(t);for(var a=0;a<bs.length;a++){var r=bs[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<bs.length&&(a=bs[0],a.blockedOn===null);)NN(a),a.blockedOn===null&&bs.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],s=a[r+1],l=n[Er]||null;if(typeof s==="function")l||zM(a);else if(l){var c=null;if(s&&s.hasAttribute("formAction")){if(n=s,l=s[Er]||null)c=l.formAction;else if(bk(n)!==null)continue}else c=l.action;typeof c==="function"?a[r+1]=c:(a.splice(r,3),r-=3),zM(a)}}}function JK(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(l){return n=l})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation==="object"){var r=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function yk(e){this._internalRoot=e}wk.prototype.render=yk.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ie(409));var a=t.current,r=go();MN(a,r,e,t,null,null)};wk.prototype.unmount=yk.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;MN(e.current,2,null,e,null,null),zv(),t[qp]=null}};function wk(e){this._internalRoot=e}wk.prototype.unstable_scheduleHydration=function(e){if(e){var t=tP();e={blockedOn:null,target:e,priority:t};for(var a=0;a<bs.length&&t!==0&&t<bs[a].priority;a++);bs.splice(a,0,e),a===0&&NN(e)}};var BM=Wh;if(BM!=="19.3.0")throw Error(ie(527,BM,"19.3.0"));dt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0){if(typeof e.render==="function")throw Error(ie(188));throw e=Object.keys(e).join(","),Error(ie(268,e))}return e=Yj(t),e=e!==null?HM(e):null,e=e===null?null:e.stateNode,e};var eX={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:je,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){if(ad=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ad.isDisabled&&ad.supportsFiber)try{jp=ad.inject(eX),Yr=ad}catch(e){}}var ad;var Sk=function(e,t){if(!Xj(e))throw Error(ie(299));var a=!1,r="",n=Tq,s=Rq,l=Aq;return t!==null&&t!==void 0&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=KK(e,1,!1,null,null,a,r,null,n,s,l,JK),e[qp]=t.current,cN(e),new yk(t)};DN();var rX=Symbol.for("react.transitional.element"),oX=Symbol.for("react.fragment");function ON(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var n in t)n!=="key"&&(a[n]=t[n])}else a=t;return t=a.ref,{$$typeof:rX,type:e,key:r,ref:t!==void 0?t:null,props:a}}var se=oX,d=ON,S=ON;var Uv=ht({});function Hs(e){let t=B(null);if(t.current===null)t.current=e();return t.current}var _N=typeof window<"u";var Vs=_N?Vt:U;var Ii=ht(null);function zN(e,t){if(e.indexOf(t)===-1)e.push(t)}function BN(e,t){let a=e.indexOf(t);if(a>-1)e.splice(a,1)}var Va=(e,t,a)=>{if(a>t)return t;if(a<e)return e;return a};function kk(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var Ln=()=>{},Nr=()=>{};if(typeof process<"u"&&process.env?.NODE_ENV!=="production")Ln=(e,t,a)=>{if(!e&&typeof console<"u")console.warn(kk(t,a))},Nr=(e,t,a)=>{if(!e)throw Error(kk(t,a))};var ja={};var wc=(e)=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var Ck=(e)=>typeof e==="object"&&e!==null;var Sc=(e)=>/^0[^.\s]+$/u.test(e);function em(e){let t;return()=>{if(t===void 0)t=e();return t}}var Uo=(e)=>e;var Li=(...e)=>e.reduce((t,a)=>(r)=>a(t(r)));var tm=(e,t,a)=>{let r=t-e;return r?(a-e)/r:1};class kc{constructor(){this.subscriptions=[]}add(e){return zN(this.subscriptions,e),()=>this.remove(e)}remove(e){BN(this.subscriptions,e)}notify(e,t,a){let r=this.subscriptions.length;if(!r)return;if(r===1)this.subscriptions[0](e,t,a);else for(let n=0;n<r;n++){let s=this.subscriptions[n];s&&s(e,t,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}var Ga=(e)=>e*1000,tr=(e)=>e/1000;var am=(e,t)=>t?e*(1000/t):0;var FN=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,nX=0.0000001,iX=12;function sX(e,t,a,r,n){let s,l,c=0;do if(l=t+(a-t)/2,s=FN(l,r,n)-e,s>0)a=l;else t=l;while(Math.abs(s)>nX&&++c<iX);return l}function js(e,t,a,r){if(e===t&&a===r)return Uo;let n=(s)=>sX(s,0,1,e,a);return(s)=>s===0||s===1?s:FN(n(s),t,r)}var Hv=(e)=>(t)=>t<=0.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Vv=(e)=>(t)=>1-e(1-t);var jv=js(0.33,1.53,0.69,0.99),Gd=Vv(jv),rm=Hv(Gd);var om=(e)=>e>=1?1:(e*=2)<1?0.5*Gd(e):0.5*(2-Math.pow(2,-10*(e-1)));var nm=(e)=>1-Math.sin(Math.acos(e)),Ik=Vv(nm),im=Hv(nm);var Lk=js(0.42,0,1,1),Tk=js(0,0,0.58,1),qd=js(0.42,0,0.58,1);var Rk=(e)=>Array.isArray(e)&&typeof e[0]!=="number";var sm=(e)=>Array.isArray(e)&&typeof e[0]==="number";var UN={linear:Uo,easeIn:Lk,easeInOut:qd,easeOut:Tk,circIn:nm,circInOut:im,circOut:Ik,backIn:Gd,backInOut:rm,backOut:jv,anticipate:om},lX=(e)=>typeof e==="string",Gv=(e)=>{if(sm(e)){Nr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,a,r,n]=e;return js(t,a,r,n)}else if(lX(e))return Nr(UN[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),UN[e];return e};var lm=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function HN(e){let t=new Set,a=new Set,r=!1,n=!1,s=new Set,l={delta:0,timestamp:0,isProcessing:!1};function c(m){if(s.has(m))a.add(m),e();m(l)}let f={schedule:(m,g=!1,h=!1)=>{let v=h&&r?t:a;if(g)s.add(m);return v.add(m),m},cancel:(m)=>{a.delete(m),s.delete(m)},process:(m)=>{if(l=m,r){n=!0;return}r=!0;let g=t;if(t=a,a=g,t.forEach(c),t.clear(),r=!1,n)n=!1,f.process(m)}};return f}var cX=40;function qv(e,t){let a=!1,r=!0,n={delta:0,timestamp:0,isProcessing:!1},s=()=>a=!0,l=lm.reduce((T,R)=>(T[R]=HN(s),T),{}),{setup:c,read:f,resolveKeyframes:m,preUpdate:g,update:h,preRender:x,render:v,postRender:w}=l,C=()=>{let T=ja.useManualTiming,R=T?n.timestamp:performance.now();if(a=!1,!T)n.delta=r?16.666666666666668:Math.max(Math.min(R-n.timestamp,cX),1);if(n.timestamp=R,n.isProcessing=!0,c.process(n),f.process(n),m.process(n),g.process(n),h.process(n),x.process(n),v.process(n),w.process(n),n.isProcessing=!1,a&&t)r=!1,e(C)},L=()=>{if(a=!0,r=!0,!n.isProcessing)e(C)};return{schedule:lm.reduce((T,R)=>{let E=l[R];return T[R]=(M,P=!1,O=!1)=>{if(!a)L();return E.schedule(M,P,O)},T},{}),cancel:(T)=>{for(let R=0;R<lm.length;R++)l[lm[R]].cancel(T)},state:n,steps:l}}var{schedule:$t,cancel:Kd,state:Tn,steps:uX}=qv(typeof requestAnimationFrame<"u"?requestAnimationFrame:Uo,!0);var Kv;function dX(){Kv=void 0}var Qt={now:()=>{if(Kv===void 0)Qt.set(Tn.isProcessing||ja.useManualTiming?Tn.timestamp:performance.now());return Kv},set:(e)=>{Kv=e,queueMicrotask(dX)}};var Rn=(e)=>Math.round(e*1e5)/1e5;var VN=(e)=>(t)=>typeof t==="string"&&t.startsWith(e),Xv=VN("--"),fX=VN("var(--"),Xd=(e)=>{if(!fX(e))return!1;return pX.test(e.split("/*")[0].trim())},pX=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ak(e){if(typeof e!=="string")return!1;return e.split("/*")[0].includes("var(--")}var An={test:(e)=>typeof e==="number",parse:parseFloat,transform:(e)=>e},Ti={...An,transform:(e)=>Va(0,1,e)},cm={...An,default:1};var Yd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jN(e){return e==null}var GN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Wd=(e,t)=>(a)=>Boolean(typeof a==="string"&&GN.test(a)&&a.startsWith(e)||t&&!jN(a)&&Object.prototype.hasOwnProperty.call(a,t)),Yv=(e,t,a)=>(r)=>{if(typeof r!=="string")return r;let[n,s,l,c]=r.match(Yd);return{[e]:parseFloat(n),[t]:parseFloat(s),[a]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}};var mX=(e)=>Va(0,255,e),Mk={...An,transform:(e)=>Math.round(mX(e))},Mn={test:Wd("rgb","red"),parse:Yv("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+Mk.transform(e)+", "+Mk.transform(t)+", "+Mk.transform(a)+", "+Rn(Ti.transform(r))+")"};function gX(e){let t="",a="",r="",n="";if(e.length>5)t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),n=e.substring(7,9);else t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),n=e.substring(4,5),t+=t,a+=a,r+=r,n+=n;return{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:n?parseInt(n,16)/255:1}}var um={test:Wd("#"),parse:gX,transform:Mn.transform};var dm=(e)=>({test:(t)=>typeof t==="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:(t)=>`${t}${e}`}),Ho=dm("deg"),Gs=dm("%"),Re=dm("px"),qN=dm("vh"),KN=dm("vw"),Pk=(()=>({...Gs,parse:(e)=>Gs.parse(e)/100,transform:(e)=>Gs.transform(e*100)}))();var qs={test:Wd("hsl","hue"),parse:Yv("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Gs.transform(Rn(t))+", "+Gs.transform(Rn(a))+", "+Rn(Ti.transform(r))+")"};var qt={test:(e)=>Mn.test(e)||um.test(e)||qs.test(e),parse:(e)=>{if(Mn.test(e))return Mn.parse(e);else if(qs.test(e))return qs.parse(e);else return um.parse(e)},transform:(e)=>typeof e==="string"?e:e.hasOwnProperty("red")?Mn.transform(e):qs.transform(e),getAnimatableNone:(e)=>{let t=qt.parse(e);return t.alpha=0,qt.transform(t)}};var XN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;var WN=new RegExp(Yd.source),$N=new RegExp(XN.source,"i");function hX(e){return isNaN(e)&&typeof e==="string"&&(WN.test(e)||$N.test(e))}var QN="number",ZN="color",xX="var",vX="var(",YN="${}",bX=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function JN(e){let t=e.toString();return WN.test(t)||$N.test(t)}function $d(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},n=[],s=0,c=t.replace(bX,(f)=>{if(qt.test(f))r.color.push(s),n.push(ZN),a.push(qt.parse(f));else if(f.startsWith(vX))r.var.push(s),n.push(xX),a.push(f);else r.number.push(s),n.push(QN),a.push(parseFloat(f));return++s,YN}).split(YN);return{values:a,split:c,indexes:r,types:n}}function yX(e){return $d(e).values}function eD({split:e,types:t}){let a=e.length;return(r)=>{let n="";for(let s=0;s<a;s++)if(n+=e[s],r[s]!==void 0){let l=t[s];if(l===QN)n+=Rn(r[s]);else if(l===ZN)n+=qt.transform(r[s]);else n+=r[s]}return n}}function wX(e){return eD($d(e))}var SX=(e)=>typeof e==="number"?0:qt.test(e)?qt.getAnimatableNone(e):e,kX=(e,t)=>{if(typeof e==="number")return t?.trim().endsWith("/")?e:0;return SX(e)};function CX(e){let t=$d(e);return eD(t)(t.values.map((r,n)=>kX(r,t.split[n])))}var Zt={test:hX,parse:yX,createTransformer:wX,getAnimatableNone:CX};function Ek(e,t,a){if(a<0)a+=1;if(a>1)a-=1;if(a<0.16666666666666666)return e+(t-e)*6*a;if(a<0.5)return t;if(a<0.6666666666666666)return e+(t-e)*(0.6666666666666666-a)*6;return e}function tD({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let n=0,s=0,l=0;if(!t)n=s=l=a;else{let c=a<0.5?a*(1+t):a+t-a*t,f=2*a-c;n=Ek(f,c,e+0.3333333333333333),s=Ek(f,c,e),l=Ek(f,c,e-0.3333333333333333)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:r}}function Qd(e,t){return(a)=>a>0?t:e}var Vo=(e,t,a)=>e+(t-e)*a;var Nk=(e,t,a)=>{let r=e*e,n=a*(t*t-r)+r;return n<0?0:Math.sqrt(n)},IX=[um,Mn,qs],LX=(e)=>IX.find((t)=>t.test(e));function aD(e){let t=LX(e);if(!t)return Ln(!1,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let a=t.parse(e);if(t===qs)a=tD(a);return a}var Dk=(e,t)=>{let a=aD(e),r=aD(t);if(!a||!r)return Qd(e,t);let n={...a};return(s)=>(n.red=Nk(a.red,r.red,s),n.green=Nk(a.green,r.green,s),n.blue=Nk(a.blue,r.blue,s),n.alpha=Vo(a.alpha,r.alpha,s),Mn.transform(n))};var Wv=new Set(["none","hidden"]);function rD(e,t){if(Wv.has(e))return(a)=>a<=0?e:t;else return(a)=>a>=1?t:e}function TX(e,t){return(a)=>Vo(e,t,a)}function $v(e){if(typeof e==="number")return TX;else if(typeof e==="string")return Xd(e)?Qd:qt.test(e)?Dk:MX;else if(Array.isArray(e))return oD;else if(typeof e==="object")return qt.test(e)?Dk:RX;return Qd}function oD(e,t){let a=[...e],r=a.length,n=e.map((s,l)=>$v(s)(s,t[l]));return(s)=>{for(let l=0;l<r;l++)a[l]=n[l](s);return a}}function RX(e,t){let a={...e,...t},r={};for(let n in a)if(e[n]!==void 0&&t[n]!==void 0)r[n]=$v(e[n])(e[n],t[n]);return(n)=>{for(let s in r)a[s]=r[s](n);return a}}function AX(e,t){let a=[],r={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],l=e.indexes[s][r[s]],c=e.values[l]??0;a[n]=c,r[s]++}return a}var MX=(e,t)=>{let a=Zt.createTransformer(t),r=$d(e),n=$d(t);if(r.indexes.var.length===n.indexes.var.length&&r.indexes.color.length===n.indexes.color.length&&r.indexes.number.length>=n.indexes.number.length){if(Wv.has(e)&&!n.values.length||Wv.has(t)&&!r.values.length)return rD(e,t);return Li(oD(AX(r,n),n.values),a)}else return Ln(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Qd(e,t)};var nD=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function PX(e,t){let a=nD.exec(e);if(!a)return;let r=nD.exec(t);if(!r||a[2]!==r[2])return;let n=a[2],s=parseFloat(a[1]),l=parseFloat(r[1]);return(c)=>Rn(Vo(s,l,c))+n}function Zd(e,t,a){if(typeof e==="number"&&typeof t==="number"&&typeof a==="number")return Vo(e,t,a);if(typeof e==="string"&&typeof t==="string"){let n=PX(e,t);if(n)return n}return $v(e)(e,t)}var iD=(e)=>{let t=({timestamp:a})=>e(a);return{start:(a=!0)=>$t.update(t,a),stop:()=>Kd(t),now:()=>Tn.isProcessing?Tn.timestamp:Qt.now()}};var Qv=(e,t,a=10)=>{let r="",n=Math.max(Math.round(t/a),2);for(let s=0;s<n;s++)r+=Math.round(e(s/(n-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`};var Zv=20000;function Jd(e,t=50,a=20000,r){let n=0,s=e.next(n);r?.push(s.value);while(!s.done&&n<a)n+=t,s=e.next(n),r?.push(s.value);return n>=a?1/0:n}function sD(e,t=100,a){let r=a({...e,keyframes:[0,t]}),n=Math.min(Jd(r),Zv);return{type:"keyframes",ease:(s)=>r.next(n*s).value/t,duration:tr(n)}}var ka={stiffness:100,damping:10,mass:1,duration:800,bounce:0.3,visualDuration:0.3,restSpeed:{granular:0.01,default:2},restDelta:{granular:0.005,default:0.5},minDuration:0.01,maxDuration:10,minDamping:0.05,maxDamping:1};function zk(e,t){return e*Math.sqrt(1-t*t)}var EX=12;function NX(e,t,a){let r=a;for(let n=1;n<EX;n++)r=r-e(r)/t(r);return r}var Ok=0.001;function DX({duration:e=ka.duration,bounce:t=ka.bounce}){let a,r;Ln(e<=Ga(ka.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let n=1-t;if(n=Va(ka.minDamping,ka.maxDamping,n),e=Va(ka.minDuration,ka.maxDuration,tr(e)),n<1)a=(f)=>{let m=f*n,g=m*e,h=zk(f,n),x=Math.exp(-g);return Ok-m/h*x},r=(f)=>{let g=f*n*e,h=n*n*f*f*e,x=Math.exp(-g),v=zk(f*f,n);return(-a(f)+Ok>0?-1:1)*-h*x/v};else a=(f)=>{let m=Math.exp(-f*e),g=f*e+1;return-Ok+m*g},r=(f)=>{let m=Math.exp(-f*e),g=-f*(e*e);return m*g};let s=5/e,l=NX(a,r,s),c=l*l;return{stiffness:c,damping:n*2*Math.sqrt(c),duration:Ga(e)}}var Bk=(e,t)=>(t?e>=0:e>0)&&e<1/0;function _k(e,t){if(Bk(e,t))return e;return}function OX(e){let t=_k(e.stiffness),a=_k(e.damping,!0),r=_k(e.mass),n={...e,stiffness:t??ka.stiffness,damping:a??ka.damping,mass:r??ka.mass,isResolvedFromDuration:!1,isTimeDefined:(t??a??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(n.isTimeDefined){if(e.visualDuration){let s=2*Math.PI/(e.visualDuration*1.2);n.stiffness=s*s,n.damping=2*Va(0.05,1,1-(e.bounce||0))*Math.sqrt(n.stiffness)}else Object.assign(n,DX(n)),n.isResolvedFromDuration=!0;if(!Bk(n.stiffness)||!Bk(n.damping,!0))n.stiffness=ka.stiffness,n.damping=ka.damping}return n}function ef(e=ka.visualDuration,t=ka.bounce){let a=typeof e!=="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,r=a.keyframes[0],n=a.keyframes[a.keyframes.length-1],s={done:!1,value:r},{stiffness:l,damping:c,mass:f,duration:m,isResolvedFromDuration:g,isTimeDefined:h}=OX({...a}),x=(P)=>h?0:-tr(P),v=c/(2*Math.sqrt(l*f)),w=tr(Math.sqrt(l/f)),C=v*w,L={target:n,delta:n-r,velocity:x(a.velocity||0)||0,restSpeed:0,restDelta:0},k=()=>{let P=Math.abs(L.delta)<5;L.restSpeed=a.restSpeed||(P?ka.restSpeed.granular:ka.restSpeed.default),L.restDelta=a.restDelta||(P?ka.restDelta.granular:ka.restDelta.default)};k();let I,T,R;if(v<1){let P=zk(w,v),O={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};R=()=>{O.A=(L.velocity+C*L.delta)/P,O.sinC=C*O.A+L.delta*P,O.cosC=C*L.delta-O.A*P};let F=(z)=>{if(z!==O.t)O.t=z,O.env=Math.exp(-C*z),O.sin=Math.sin(P*z),O.cos=Math.cos(P*z)};I=(z)=>(F(z),L.target-O.env*(O.A*O.sin+L.delta*O.cos)),T=(z)=>(F(z),O.env*(O.sinC*O.sin+O.cosC*O.cos))}else if(v===1){I=(O)=>L.target-Math.exp(-w*O)*(L.delta+(L.velocity+w*L.delta)*O);let P={C:0};R=()=>{P.C=L.velocity+w*L.delta},T=(O)=>Math.exp(-w*O)*(w*P.C*O-L.velocity)}else{let P=w*Math.sqrt(v*v-1);I=(F)=>{let z=Math.exp(-C*F),Y=Math.min(P*F,300);return L.target-z*((L.velocity+C*L.delta)*Math.sinh(Y)+P*L.delta*Math.cosh(Y))/P};let O={P:0,sinh:0,cosh:0};R=()=>{O.P=(L.velocity+C*L.delta)/P,O.sinh=C*O.P-L.delta*P,O.cosh=C*L.delta-O.P*P},T=(F)=>{let z=Math.exp(-C*F),Y=Math.min(P*F,300);return z*(O.sinh*Math.sinh(Y)+O.cosh*Math.cosh(Y))}}R();let E=g?m||null:null,M={calculatedDuration:E,retarget:(P,O)=>{if(L.target=P[P.length-1],L.delta=L.target-P[0],L.velocity=x(O),!(a.restSpeed&&a.restDelta))k();M.calculatedDuration=E,s.done=!1,R()},velocity:(P)=>Ga(T(P)),next:(P)=>{let O=I(P);if(!g){let F=Ga(T(P));s.done=Math.abs(F)<=L.restSpeed&&Math.abs(L.target-O)<=L.restDelta}else s.done=P>=m;return s.value=s.done?L.target:O,s},toString:()=>{let P=Math.min(Jd(M),Zv),O=Qv((F)=>M.next(P*F).value,P,30);return P+"ms "+O},toTransition:()=>{}};return M}ef.applyToOptions=(e)=>{let t=sD(e,100,ef);return e.ease=t.ease,e.duration=Ga(t.duration),e.type="keyframes",e};function fm({keyframes:e,velocity:t=0,power:a=0.8,timeConstant:r=325,bounceDamping:n=10,bounceStiffness:s=500,modifyTarget:l,min:c,max:f,restDelta:m=0.5,restSpeed:g}){let h=e[0],x={done:!1,value:h},v=(P)=>P<c||P>f,w=(P)=>{if(c===void 0)return f;if(f===void 0)return c;return Math.abs(c-P)<Math.abs(f-P)?c:f},C=a*t,L=h+C,k=l===void 0?L:l(L);if(k!==L)C=k-h;let I=(P)=>-C*Math.exp(-P/r),T=(P)=>{let O=I(P);x.done=Math.abs(O)<=m,x.value=x.done?k:k+O},R,E,M=(P)=>{if(!v(x.value))return;R=P,E=ef({keyframes:[x.value,w(x.value)],velocity:-I(P)/r*1000,damping:n,stiffness:s,restDelta:m,restSpeed:g})};return M(0),{calculatedDuration:null,next:(P)=>{let O=!1;if(!E&&R===void 0)O=!0,T(P),M(P);if(R!==void 0&&P>=R)return E.next(P-R);else return!O&&T(P),x}}}function _X(e,t,a){let r=[],n=a||ja.mix||Zd,s=e.length-1;for(let l=0;l<s;l++){let c=n(e[l],e[l+1]);if(t){let f=Array.isArray(t)?t[l]||Uo:t;c=Li(f,c)}r.push(c)}return r}function lD(e,t,{clamp:a=!0,ease:r,mixer:n}={}){let s=e.length;if(Nr(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];let l=e[0]===e[1];if(e[0]>e[s-1])e=[...e].reverse(),t=[...t].reverse();let c=_X(t,r,n),f=c.length,m=(g)=>{if(l&&g<e[0])return t[0];let h=0;if(f>1){for(;h<e.length-2;h++)if(g<e[h+1])break}let x=tm(e[h],e[h+1],g);return c[h](x)};return a?(g)=>m(Va(e[0],e[s-1],g)):m}function cD(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let n=tm(0,t,r);e.push(Vo(a,1,n))}}function uD(e){let t=[0];return cD(t,e.length-1),t}function dD(e,t){return e.map((a)=>a*t)}function zX(e,t){return e.map(()=>t||qd).splice(0,e.length-1)}function Cc({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let n=Rk(r)?r.map(Gv):Gv(r)||qd,s={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(n)&&(!a||a.length!==2||a[0]===0&&a[1]===1)){let[f,m]=t,g=f===m?void 0:(ja.mix||Zd)(f,m);return{calculatedDuration:e,next:(h)=>(s.value=g?g(n(e>0?Va(0,1,h/e):1)):m,s.done=h>=e,s)}}let l=dD(a&&a.length===t.length?a:uD(t),e),c=lD(l,t,{ease:Array.isArray(n)?n:zX(t,n)});return{calculatedDuration:e,next:(f)=>(s.value=c(f),s.done=f>=e,s)}}var BX=5;function FX(e,t,a){let r=Math.max(t-BX,0);return am(a-e(r),t-r)}function fD(e,t,a=0){if(t<=0)return a;return e.velocity?e.velocity(t):FX((r)=>e.next(r).value,t,e.next(t).value)}var UX=(e)=>e!==null;function Ks(e,{repeat:t,repeatType:a="loop"},r,n=1){let s=e.filter(UX),c=n<0||t&&a!=="loop"&&t%2===1?0:s.length-1;return!c||r===void 0?s[c]:r}var HX={decay:fm,inertia:fm,tween:Cc,keyframes:Cc,spring:ef};function Jv(e){if(typeof e.type==="string")e.type=HX[e.type]}function VX(e,t){return{kind:e,animation:t,timestamp:Qt.now(),frameTimestamp:Tn.timestamp,frameIsProcessing:Tn.isProcessing}}function eb(e,t,a){let r=globalThis.__MOTION_INSPECT__;if(!r)return;try{r({...VX("animation-start",e),options:a?{...t,...a}:t})}catch{}}class Ic{constructor(){this.isResolved=!1}get finished(){if(!this._finished)this._finished=this.isResolved?Promise.resolve():new Promise((e)=>{this._resolve=e});return this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}}var jX=(e)=>e/100;class Xs extends Ic{constructor(e){super();if(this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:t}=this.options;if(t&&t.updatedAt!==Qt.now())this.tick(Qt.now());if(this.isStopped=!0,this.state==="idle")return;this.teardown(),this.options.onStop?.()},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1)this.pause();eb(this,this.options)}initAnimation(){let{options:e}=this;Jv(e);let{type:t=Cc,repeat:a=0,repeatDelay:r=0,repeatType:n,velocity:s=0}=e,{keyframes:l}=e,c=t||Cc;if(c!==Cc&&typeof l[0]!=="number")this.mixKeyframes=Li(jX,Zd(l[0],l[1])),l=[0,100];let f=c(l===e.keyframes?e:{...e,keyframes:l});if(n==="mirror")this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-s});if(f.calculatedDuration===null)f.calculatedDuration=Jd(f);let{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+r,this.totalDuration=this.resolvedDuration*(a+1)-r,this.generator=f}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;if(this.holdTime!==null)this.currentTime=this.holdTime;else this.currentTime=t}tick(e,t=!1){let{generator:a,totalDuration:r,mixKeyframes:n,mirroredGenerator:s,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return a.next(0);let{delay:f=0,keyframes:m,repeat:g,repeatType:h,repeatDelay:x,type:v,onUpdate:w,finalKeyframe:C}=this.options;if(this.speed>0)this.startTime=Math.min(this.startTime,e);else if(this.speed<0)this.startTime=Math.min(e-r/this.speed,this.startTime);if(t)this.currentTime=e;else this.updateTime(e);let L=this.currentTime-f*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?L<0:L>r;if(this.currentTime=Math.max(L,0),this.state==="finished"&&this.holdTime===null)this.currentTime=r;let I=this.currentTime,T=a;if(g){let P=Math.min(this.currentTime,r)/l,O=Math.floor(P),F=P%1;if(!F&&P>=1)F=1;if(F===1&&O--,O=Math.min(O,g+1),Boolean(O%2)){if(h==="reverse"){if(F=1-F,x)F-=x/l}else if(h==="mirror")T=s}I=Va(0,1,F)*l}let R;if(k)this.delayState.value=m[0],R=this.delayState;else R=T.next(I);if(n&&!k)R.value=n(R.value);let{done:E}=R;if(!k&&c!==null)E=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0;let M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);if(M&&v!==fm)R.value=Ks(m,this.options,C,this.speed);if(w)w(R.value);if(M)this.finish();return R}then(e,t){return this.finished.then(e,t)}get duration(){return tr(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+tr(e)}get time(){return tr(this.currentTime)}set time(e){if(e=Ga(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0)this.holdTime=e;else if(this.driver)this.startTime=this.driver.now()-e/this.playbackSpeed;if(this.driver)this.driver.start(!1);else this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e)}getGeneratorVelocity(){return fD(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;if(t&&this.driver)this.updateTime(Qt.now());if(this.playbackSpeed=e,t&&this.driver)this.time=tr(this.currentTime)}play(){if(this.isStopped)return;let{driver:e=iD,startTime:t}=this.options;if(!this.driver)this.driver=e((r)=>this.tick(r));this.options.onPlay?.();let a=this.driver.now();if(this.state==="finished")this.updateFinished(),this.startTime=a;else if(this.holdTime!==null)this.startTime=a-this.holdTime;else if(!this.startTime)this.startTime=t??a;if(this.state==="finished"&&this.speed<0)this.startTime+=this.calculatedDuration;this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Qt.now()),this.holdTime=this.currentTime}complete(){if(this.state!=="running")this.play();this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){if(!this.driver)return;this.driver.stop(),this.driver=void 0}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){if(this.options.allowFlatten)this.options.type="keyframes",this.options.ease="linear",this.initAnimation();return this.driver?.stop(),e.observe(this)}}var GX=new Set(["brightness","contrast","saturate","opacity"]);function qX(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(Yd)||[];if(!r)return e;let n=a.replace(r,""),s=GX.has(t)?1:0;if(r!==a)s*=100;return t+"("+s+n+")"}var KX=/\b([a-z-]*)\(.*?\)/gu,pm={...Zt,getAnimatableNone:(e)=>{let t=e.match(KX);return t?t.map(qX).join(" "):e}};var mm={...Zt,getAnimatableNone:(e)=>{let t=Zt.parse(e);return Zt.createTransformer(e)(t.map((r)=>typeof r==="number"?0:typeof r==="object"?{...r,alpha:1}:r))}};var Fk={...An,transform:Math.round};var pD={rotate:Ho,pathRotation:Ho,rotateX:Ho,rotateY:Ho,rotateZ:Ho,scale:cm,scaleX:cm,scaleY:cm,scaleZ:cm,skew:Ho,skewX:Ho,skewY:Ho,distance:Re,translateX:Re,translateY:Re,translateZ:Re,x:Re,y:Re,z:Re,perspective:Re,transformPerspective:Re,opacity:Ti,originX:Pk,originY:Pk,originZ:Re};var Lc={borderWidth:Re,borderTopWidth:Re,borderRightWidth:Re,borderBottomWidth:Re,borderLeftWidth:Re,borderRadius:Re,borderTopLeftRadius:Re,borderTopRightRadius:Re,borderBottomRightRadius:Re,borderBottomLeftRadius:Re,width:Re,maxWidth:Re,height:Re,maxHeight:Re,top:Re,right:Re,bottom:Re,left:Re,inset:Re,insetBlock:Re,insetBlockStart:Re,insetBlockEnd:Re,insetInline:Re,insetInlineStart:Re,insetInlineEnd:Re,padding:Re,paddingTop:Re,paddingRight:Re,paddingBottom:Re,paddingLeft:Re,paddingBlock:Re,paddingBlockStart:Re,paddingBlockEnd:Re,paddingInline:Re,paddingInlineStart:Re,paddingInlineEnd:Re,margin:Re,marginTop:Re,marginRight:Re,marginBottom:Re,marginLeft:Re,marginBlock:Re,marginBlockStart:Re,marginBlockEnd:Re,marginInline:Re,marginInlineStart:Re,marginInlineEnd:Re,fontSize:Re,backgroundPositionX:Re,backgroundPositionY:Re,...pD,zIndex:Fk,fillOpacity:Ti,strokeOpacity:Ti,numOctaves:Fk};var XX={...Lc,color:qt,backgroundColor:qt,outlineColor:qt,fill:qt,stroke:qt,borderColor:qt,borderTopColor:qt,borderRightColor:qt,borderBottomColor:qt,borderLeftColor:qt,filter:pm,WebkitFilter:pm,mask:mm,WebkitMask:mm},tb=(e)=>XX[e];var YX=new Set([pm,mm]);function tf(e,t){let a=tb(e);if(!YX.has(a))a=Zt;return a.getAnimatableNone?a.getAnimatableNone(t):void 0}function mD(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Tc=(e)=>e*180/Math.PI,Uk=(e)=>{let t=Tc(Math.atan2(e[1],e[0]));return Hk(t)},WX={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:(e)=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Uk,rotateZ:Uk,skewX:(e)=>Tc(Math.atan(e[1])),skewY:(e)=>Tc(Math.atan(e[2])),skew:(e)=>(Math.abs(e[1])+Math.abs(e[2]))/2},Hk=(e)=>{if(e=e%360,e<0)e+=360;return e},gD=Uk,hD=(e)=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xD=(e)=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),$X={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hD,scaleY:xD,scale:(e)=>(hD(e)+xD(e))/2,rotateX:(e)=>Hk(Tc(Math.atan2(e[6],e[5]))),rotateY:(e)=>Hk(Tc(Math.atan2(-e[2],e[0]))),rotateZ:gD,rotate:gD,skewX:(e)=>Tc(Math.atan(e[4])),skewY:(e)=>Tc(Math.atan(e[1])),skew:(e)=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ab(e){return e.includes("scale")?1:0}function rb(e,t){if(!e||e==="none")return ab(t);let a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,n;if(a)r=$X,n=a;else{let c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=WX,n=c}if(!n)return ab(t);let s=r[t],l=n[1].split(",").map(QX);return typeof s==="function"?s(l):l[s]}var vD=(e,t)=>{let{transform:a="none"}=getComputedStyle(e);return rb(a,t)};function QX(e){return parseFloat(e.trim())}var Pn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vo=(()=>new Set([...Pn,"pathRotation"]))();var Vk=(e)=>e===An||e===Re,ZX=new Set(["x","y","z"]),JX=Pn.filter((e)=>!ZX.has(e));function yD(e){let t=[];return JX.forEach((a)=>{let r=e.getValue(a);if(r!==void 0){let n=r.get(),s=a.startsWith("scale")?1:0;if(n===s)return;t.push([a,n]),r.set(s)}}),t}var wD=new Set(["bottom","right"]);function bD(e,t,a,r,n,s){let l=parseFloat(e);if(!isNaN(l))return l;let{min:c,max:f}=t()[a],m=f-c;return s==="border-box"?m:m-parseFloat(r)-parseFloat(n)}var Ys={width:({width:e,paddingLeft:t="0",paddingRight:a="0",boxSizing:r},n)=>bD(e,n,"x",t,a,r),height:({height:e,paddingTop:t="0",paddingBottom:a="0",boxSizing:r},n)=>bD(e,n,"y",t,a,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:a}=t();return parseFloat(e)+(a.max-a.min)},right:({left:e},t)=>{let{x:a}=t();return parseFloat(e)+(a.max-a.min)},x:({transform:e})=>rb(e,"x"),y:({transform:e})=>rb(e,"y")};Ys.translateX=Ys.x;Ys.translateY=Ys.y;var Rc=new Set,jk=!1,Gk=!1,qk=!1;function SD(){if(Gk){let e=[],t=new Set,a=new Set;Rc.forEach((n)=>{if(!n.needsMeasurement)return;if(e.push(n),t.add(n.element),wD.has(n.name))a.add(n.element)});let r=new Map;a.forEach((n)=>{let s=yD(n);if(!s.length)return;r.set(n,s),n.render()}),e.forEach((n)=>n.measureInitialState()),t.forEach((n)=>{n.render();let s=r.get(n);if(s)s.forEach(([l,c])=>{n.getValue(l)?.set(c)})}),e.forEach((n)=>n.measureEndState()),e.forEach((n)=>{if(n.suspendedScrollY!==void 0)window.scrollTo(0,n.suspendedScrollY)})}Gk=!1,jk=!1,Rc.forEach((e)=>e.complete(qk)),Rc.clear()}function kD(){Rc.forEach((e)=>{if(e.readKeyframes(),e.needsMeasurement)Gk=!0})}function CD(){qk=!0,kD(),SD(),qk=!1}function eY(e,t,a){if(typeof e==="string"){if(wc(e)||Sc(e))return parseFloat(e);else if(!Zt.test(e)&&Zt.test(a))return tf(t,a)}return e??void 0}class Ac{constructor(e,t,a,r,n,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=a,this.motionValue=r,this.element=n,this.isAsync=s}scheduleResolve(){if(this.state="scheduled",this.isAsync){if(Rc.add(this),!jk)jk=!0,$t.read(kD),$t.resolveKeyframes(SD)}else this.readKeyframes(),this.complete()}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:a,motionValue:r}=this;if(e[0]===null){let n=r?.get(),s=e[e.length-1];if(n!==void 0)e[0]=n;else if(a&&t){let l=eY(a.readValue(t,s),t,s);if(l!==void 0)e[0]=l}if(e[0]===void 0)e[0]=s;if(r&&n===void 0)r.set(e[0])}mD(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Rc.delete(this)}cancel(){if(this.state==="scheduled")Rc.delete(this),this.state="pending"}resume(){if(this.state==="pending")this.scheduleResolve()}}var ID=(e)=>e.startsWith("--");function ob(e,t,a){ID(t)?e.style.setProperty(t,a):e.style[t]=a}var LD={};function nb(e,t){let a=em(e);return()=>LD[t]??a()}var TD=nb(()=>window.ScrollTimeline!==void 0,"scrollTimeline");var ib=nb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing");var Mc=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`;var Kk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mc([0,0.65,0.55,1]),circOut:Mc([0.55,0,1,0.45]),backIn:Mc([0.31,0.01,0.66,-0.59]),backOut:Mc([0.33,1.53,0.69,0.99])};function Xk(e,t){if(!e)return;else if(typeof e==="function")return ib()?Qv(e,t):"ease-out";else if(sm(e))return Mc(e);else if(Array.isArray(e))return e.map((a)=>Xk(a,t)||Kk.easeOut);else return Kk[e]}function RD(e,t,a,{delay:r=0,duration:n=300,repeat:s=0,repeatType:l="loop",ease:c="easeOut",times:f}={},m=void 0){let g={[t]:a};if(f)g.offset=f;let h=Xk(c,n);if(Array.isArray(h))g.easing=h;let x={delay:r,duration:n,easing:!Array.isArray(h)?h:"linear",fill:"both",iterations:s+1,direction:l==="reverse"?"alternate":"normal"};if(m)x.pseudoElement=m;return e.animate(g,x)}function sb(e){return typeof e==="function"&&"applyToOptions"in e}function AD({type:e,...t}){if(sb(e)&&ib())return e.applyToOptions(t);else t.duration??(t.duration=300),t.ease??(t.ease="easeOut");return t}class gm extends Ic{constructor(e){super();if(this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:a,keyframes:r,pseudoElement:n,allowFlatten:s=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=Boolean(n),this.allowFlatten=s,this.options=e,Nr(typeof e.type!=="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let f=AD(e);if(this.animation=RD(t,a,r,f,n),f.autoplay===!1)this.animation.pause();this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let m=Ks(r,this.options,l,this.speed);if(this.updateMotionValue)this.updateMotionValue(m);ob(t,a,m),this.animation.cancel()}c?.(),this.notifyFinished()},eb(this,e,f)}play(){if(this.isStopped)return;if(this.manualStartTime=null,this.animation.play(),this.state==="finished")this.updateFinished()}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;if(e==="idle"||e==="finished")return;if(this.updateMotionValue)this.updateMotionValue();else this.commitStyles();if(!this.isPseudoElement)this.cancel()}commitStyles(){let e=this.options?.element;if(!this.isPseudoElement&&e?.isConnected)this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return tr(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+tr(e)}get time(){return tr(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;if(this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ga(e),t)this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){if(e<0)this.finishedTime=null;this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:a,observe:r}){if(this.allowFlatten)this.animation.effect?.updateTiming({easing:"linear"});if(this.animation.onfinish=null,e&&TD()){if(this.animation.timeline=e,t)this.animation.rangeStart=t;if(a)this.animation.rangeEnd=a;return Uo}else return r(this)}}var MD={anticipate:om,backInOut:rm,circInOut:im};function tY(e){return e in MD}function PD(e){if(typeof e.ease==="string"&&tY(e.ease))e.ease=MD[e.ease]}var Yk=10;class Wk extends gm{constructor(e){PD(e),Jv(e);super(e);if(e.startTime!==void 0&&e.autoplay!==!1)this.startTime=e.startTime;this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:a,onComplete:r,element:n,...s}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let l=new Xs({...s,autoplay:!1}),c=Math.max(Yk,Qt.now()-this.startTime),f=Va(0,Yk,c-Yk),m=l.sample(c).value,{name:g}=this.options;if(n&&g)ob(n,g,m);t.setWithVelocity(l.sample(Math.max(0,c-f)).value,m,f),l.stop()}}var $k=(e,t)=>{if(t==="zIndex")return!1;if(typeof e==="number"||Array.isArray(e))return!0;if(typeof e==="string"&&(Zt.test(e)||e==="0")&&!e.startsWith("url("))return!0;return!1};function aY(e){let t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function ED(e,t,a,r){let n=e[0];if(n===null)return!1;if(t==="display"||t==="visibility")return!0;let s=e[e.length-1],l=$k(n,t),c=$k(s,t);if(!l||!c)return l!==c&&Ln(!1,`You are trying to animate ${t} from "${n}" to "${s}". "${l?s:n}" is not an animatable value.`,"value-not-animatable"),!1;return aY(e)||(a==="spring"||sb(a))&&r}function hm(e){e.duration=0,e.type="keyframes"}var xm=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);var rY=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ND(e){for(let t=0;t<e.length;t++)if(typeof e[t]==="string"&&rY.test(e[t]))return!0;return!1}var DD=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),oY=em(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function OD(e){let{motionValue:t,name:a,repeatDelay:r,repeatType:n,damping:s,type:l,keyframes:c}=e;if(!a||!(xm.has(a)||DD.has(a)))return!1;let f=t?.owner?.current;if(!(f instanceof HTMLElement)&&!(f instanceof SVGElement))return!1;let{onUpdate:m,transformTemplate:g}=t.owner.getProps();return oY()&&(xm.has(a)||DD.has(a)&&ND(c))&&(a!=="transform"||!g)&&!m&&!r&&n!=="mirror"&&s!==0&&l!=="inertia"}var nY=40;class Qk extends Ic{constructor(e){super();this.stop=()=>{if(this._animation)this._animation.stop(),this.stopTimeline?.();this.keyframeResolver?.cancel()},this.createdAt=Qt.now();let{keyframes:t,name:a,motionValue:r,element:n}=e,s=e;s.autoplay??(s.autoplay=!0),s.delay??(s.delay=0),s.type??(s.type="keyframes"),s.repeat??(s.repeat=0),s.repeatDelay??(s.repeatDelay=0),s.repeatType??(s.repeatType="loop");let l=n?.KeyframeResolver||Ac;this.keyframeResolver=new l(t,(c,f,m)=>this.onKeyframesResolved(c,f,s,!m),a,r,n),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,a,r){this.keyframeResolver=void 0;let{name:n,type:s,velocity:l,delay:c,isHandoff:f,onUpdate:m}=a;this.resolvedAt=Qt.now();let g=!0;if(!ED(e,n,s,l)){if(g=!1,ja.instantAnimations||!c)m?.(Ks(e,a,t));e[0]=e[e.length-1],hm(a),a.repeat=0}let h=r?!this.resolvedAt?this.createdAt:this.resolvedAt-this.createdAt>nY?this.resolvedAt:this.createdAt:void 0,{onComplete:x}=a;a.startTime??(a.startTime=h),a.finalKeyframe=t,a.keyframes=e,a.onComplete=()=>{x?.(),this.notifyFinished()};let v=g&&!f&&OD(a),w;if(v){a.element=a.motionValue?.owner?.current;try{w=new Wk(a)}catch{w=new Xs(a)}}else w=new Xs(a);if(this.pendingTimeline)this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0;this._animation=w}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){if(!this._animation)this.keyframeResolver?.resume(),CD();return this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){if(this._animation)this.stopTimeline=this.animation.attachTimeline(e);else this.pendingTimeline=e;return()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){if(this._animation)this.animation.cancel();this.keyframeResolver?.cancel()}}function lb(e,t,a,r=0,n=1){let s=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),l=e.size,c=(l-1)*r;return typeof a==="function"?a(s,l):n===1?s*r:c-s*r}var _D=30,sY=(e)=>!isNaN(parseFloat(e)),zD={current:void 0};class BD{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(a)=>{let r=Qt.now();if(this.updatedAt!==r)this.setPrevFrameValue();if(this.prev=this.current,this.setCurrent(a),this.current!==this.prev){if(this.notifyChange(),this.dependents)for(let n of this.dependents)n.dirty()}},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){if(this.current=e,this.updatedAt=Qt.now(),this.canTrackVelocity===null&&e!==void 0)this.canTrackVelocity=sY(this.current)}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){var a;if(e==="change")return this.onChangeSubscribe(t);return((a=this.events)[e]||(a[e]=new kc)).add(t)}onChangeSubscribe(e){let{events:t}=this;if(!t.change&&!this.changeSubscriber)this.changeSubscriber=e;else{if(!t.change)t.change=new kc,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0;t.change.add(e)}return()=>{if(this.changeSubscriber===e)this.changeSubscriber=void 0;else t.change?.remove(e);this.stopIfUnobserved()}}stopIfUnobserved(){$t.read(()=>{if(!this.changeSubscriber&&!this.events.change?.getSize())this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){if(!this.passiveEffect)this.updateAndNotify(e);else this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,a){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-a}jump(e,t=!0){if(this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect)this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;if(t)t(e);else this.events.change?.notify(e)}addDependent(e){if(!this.dependents)this.dependents=new Set;this.dependents.add(e)}removeDependent(e){if(this.dependents)this.dependents.delete(e)}get(){if(zD.current)zD.current.push(this);return this.current}getPrevious(){return this.prev}getVelocity(){let e=Qt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>_D)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,_D);return am(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t)=>{this.hasAnimated=!0;let a=!1,r;if(r=e(()=>{if(a=!0,this.events.animationComplete?.notify(),this.animation===r)this.clearAnimation();t()}),!a)this.animation=r;this.events.animationStart?.notify()})}stop(){if(this.animation){if(this.animation.stop(),this.events.animationCancel)this.events.animationCancel.notify()}this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){if(this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect)this.stopPassiveEffect()}}function Pc(e,t){return new BD(e,t)}function Ec(e,t){if(e?.inherit&&t){let{inherit:a,...r}=e;return{...t,...r}}return e}function cb(e,t){let a=e?.[t]??e?.default??e;if(a!==e)return Ec(a,e);return a}var lY={type:"spring",stiffness:500,damping:25,restSpeed:10},cY=(e)=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),uY={type:"keyframes",duration:0.8},dY={type:"keyframes",ease:[0.25,0.1,0.35,1],duration:0.3},FD=(e,{keyframes:t})=>{if(t.length>2)return uY;else if(vo.has(e))return e.startsWith("scale")?cY(t[1]):lY;return dY};var fY=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function UD(e){for(let t in e)if(!fY.has(t))return!0;return!1}var HD=(e,t,a,r={},n,s)=>(l)=>{let c=cb(r,e)||{},f=c.delay||r.delay||0,{elapsed:m=0}=r;m=m-Ga(f);let g={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-m,onUpdate:(x)=>{t.set(x),c.onUpdate&&c.onUpdate(x)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:s?void 0:n};if(!UD(c))Object.assign(g,FD(e,g));if(g.duration&&(g.duration=Ga(g.duration)),g.repeatDelay&&(g.repeatDelay=Ga(g.repeatDelay)),g.from!==void 0)g.keyframes[0]=g.from;let h=!1;if(g.type===!1||g.duration===0&&!g.repeatDelay){if(hm(g),g.delay===0)h=!0}if(ja.instantAnimations||ja.skipAnimations||n?.shouldSkipAnimations||c.skipAnimations)h=!0,hm(g),g.delay=0;if(g.allowFlatten=!c.type&&!c.ease,h&&!s&&t.get()!==void 0){let x=Ks(g.keyframes,c);if(x!==void 0){$t.update(()=>{g.onUpdate(x),g.onComplete()});return}}return c.isSync?new Xs(g):new Qk(g)};var pY=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mY(e){let t=pY.exec(e);if(!t)return[,];let[,a,r,n]=t;return[`--${a??r}`,n]}var gY=4;function Zk(e,t,a=1){Nr(a<=gY,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[r,n]=mY(e);if(!r)return;let s=window.getComputedStyle(t).getPropertyValue(r);if(s){let l=s.trim();return wc(l)?parseFloat(l):l}return Xd(n)?Zk(n,t,a+1):n}function VD(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Nc(e,t,a,r){if(typeof t==="function"){let[n,s]=VD(r);t=t(a!==void 0?a:e.custom,n,s)}if(typeof t==="string")t=e.variants&&e.variants[t];if(typeof t==="function"){let[n,s]=VD(r);t=t(a!==void 0?a:e.custom,n,s)}return t}function Zr(e,t,a){let r=e.getProps();return Nc(r,t,a!==void 0?a:r.custom,e)}var ub=new Set(["width","height","top","left","right","bottom",...Pn]);var vm=(e)=>Array.isArray(e);function hY(e,t,a){if(e.hasValue(t))e.getValue(t).set(a);else e.addValue(t,Pc(a))}function xY(e){return vm(e)?e[e.length-1]||0:e}function jD(e,t){let a=Zr(e,t),{transitionEnd:r={},transition:n={},...s}=a||{};s={...s,...r};for(let l in s){let c=xY(s[l]);hY(e,l,c)}}var Lt=(e)=>Boolean(e&&e.getVelocity);function GD(e){return Boolean(Lt(e)&&e.add)}function qD(e,t){let a=e.getValue("willChange");if(GD(a))return a.add(t);else if(!a&&ja.WillChange){let r=new ja.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function af(e){return e.replace(/([A-Z])/g,(t)=>`-${t.toLowerCase()}`)}var KD="framerAppearId",bm="data-"+af(KD);function XD(e){return e.props[bm]}var vY=typeof window<"u";function bY({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function db(e,t,{delay:a=0,transitionOverride:r,type:n}={}){let{transition:s,transitionEnd:l,...c}=t,f=e.getDefaultTransition();s=s?Ec(s,f):f;let m=s?.reduceMotion,g=s?.skipAnimations;if(r)s=r;let h=[],x=n&&e.animationState&&e.animationState.getState()[n],v=s?.path;if(v)v.animateVisualElement(e,c,s,a,h);for(let w in c){let C=e.getValue(w,e.latestValues[w]??null),L=c[w];if(L===void 0||x&&bY(x,w))continue;let k={delay:a,...cb(s||{},w)};if(g)k.skipAnimations=!0;let I=C.get();if(I!==void 0&&!C.isAnimating()&&!Array.isArray(L)&&L===I&&!k.velocity){$t.update(()=>C.set(L));continue}let T=!1;if(vY&&window.MotionHandoffAnimation){let M=XD(e);if(M){let P=window.MotionHandoffAnimation(M,w,$t);if(P!==null)k.startTime=P,T=!0}}qD(e,w);let R=m??e.shouldReduceMotion;C.start(HD(w,C,L,R&&ub.has(w)?{type:!1}:k,e,T));let E=C.animation;if(E)h.push(E)}if(l){let w=()=>$t.update(()=>{l&&jD(e,l)});if(h.length)Promise.all(h).then(w);else w()}return h}function fb(e,t,a={}){let r=Zr(e,t,a.type==="exit"?e.presenceContext?.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=r||{};if(a.transitionOverride)n=a.transitionOverride;let s=r?()=>Promise.all(db(e,r,a)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(f=0)=>{let{delayChildren:m=0,staggerChildren:g,staggerDirection:h}=n;return yY(e,t,f,m,g,h,a)}:()=>Promise.resolve(),{when:c}=n;if(c){let[f,m]=c==="beforeChildren"?[s,l]:[l,s];return f().then(()=>m())}else return Promise.all([s(),l(a.delay)])}function yY(e,t,a=0,r=0,n=0,s=1,l){let c=[];for(let f of e.variantChildren)f.notify("AnimationStart",t),c.push(fb(f,t,{...l,delay:a+(typeof r==="function"?0:r)+lb(e.variantChildren,f,r,n,s)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(c)}function YD(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let n=t.map((s)=>fb(e,s,a));r=Promise.all(n)}else if(typeof t==="string")r=fb(e,t,a);else{let n=typeof t==="function"?Zr(e,t,a.custom):t;r=Promise.all(db(e,n,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var WD={test:(e)=>e==="auto",parse:(e)=>e};var $D=(e)=>(t)=>t.test(e);var wY=[An,Re,Gs,Ho,KN,qN,WD],Jk=(e)=>wY.find($D(e));function QD(e){if(typeof e==="number")return e===0;else if(e!==null)return e==="none"||e==="0"||Sc(e);else return!0}var SY=new Set(["auto","none","0"]);function ZD(e,t,a){let r=0,n=void 0;while(r<e.length&&!n){let s=e[r];if(typeof s==="string"&&!SY.has(s)&&JN(s))n=e[r];r++}if(n&&a)for(let s of t){if(e[s]===n)continue;e[s]=tf(a,n)}}class eC extends Ac{constructor(e,t,a,r,n){super(e,t,a,r,n,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:a}=this;if(!t||!t.current)return;super.readKeyframes();for(let m=0;m<e.length;m++){let g=e[m];if(typeof g==="string"){if(g=g.trim(),Xd(g)){let h=Zk(g,t.current);if(h!==void 0)e[m]=h;if(m===e.length-1)this.finalKeyframe=g}}}if(this.resolveNoneKeyframes(),!ub.has(a)||e.length!==2)return;let[r,n]=e;if(typeof r==="number"&&typeof n==="number")return;let s=Jk(r),l=Jk(n),c=Ak(r),f=Ak(n);if(c!==f&&Ys[a]){this.needsMeasurement=!0;return}if(s===l)return;if(Vk(s)&&Vk(l))for(let m=0;m<e.length;m++){let g=e[m];if(typeof g==="string")e[m]=parseFloat(g)}else if(Ys[a])this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,a=[];for(let r=0;r<e.length;r++)if(e[r]===null||QD(e[r]))a.push(r);if(a.length)ZD(e,a,t)}measure(){let{element:e,name:t}=this;return Ys[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:a}=this;if(!e||!e.current)return;if(a==="height")this.suspendedScrollY=window.pageYOffset;this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];if(r!==void 0)this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let a=t.length-1,r=t[a];if(t[a]=this.measure(),r!==null&&this.finalKeyframe===void 0)this.finalKeyframe=r;if(this.removedTransforms?.length)this.removedTransforms.forEach(([n,s])=>{e.getValue(n).set(s)});this.resolveNoneKeyframes()}}var JD=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Dc(e){return Ck(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var ym=(e,t)=>t&&typeof e==="number"?t.transform(e):e;function e5(e,t,a){if(e==null)return[];if(e instanceof EventTarget)return[e];else if(typeof e==="string"){let r=document;if(t)r=t.current;let n=a?.[e]??r.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e).filter((r)=>r!=null)}var kY={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},CY=Pn.length;function t5(e,t,a){let r="",n=!0;for(let l=0;l<CY;l++){let c=Pn[l],f=e[c];if(f===void 0)continue;let m=!0;if(typeof f==="number")m=f===(c.startsWith("scale")?1:0);else{let g=parseFloat(f);m=c.startsWith("scale")?g===1:g===0}if(!m||a){let g=ym(f,Lc[c]);if(!m){n=!1;let h=kY[c]||c;r+=`${h}(${g}) `}if(a)t[c]=g}}let s=e.pathRotation;if(s)n=!1,r+=`rotate(${ym(s,Lc.pathRotation)}) `;if(r=r.trim(),a)r=a(t,n?"":r);else if(n)r="none";return r}function Oc(e,t,a){let{style:r,vars:n,transformOrigin:s}=e,l=!1,c=!1;for(let f in t){let m=t[f];if(vo.has(f)){l=!0;continue}else if(Xv(f)){n[f]=m;continue}else{let g=ym(m,Lc[f]);if(f.startsWith("origin"))c=!0,s[f]=g;else r[f]=g}}if(!t.transform){if(l||a)r.transform=t5(t,e.transform,a);else if(r.transform)r.transform="none"}if(c){let{originX:f="50%",originY:m="50%",originZ:g=0}=s;r.transformOrigin=`${f} ${m} ${g}`}}var IY={offset:"stroke-dashoffset",array:"stroke-dasharray"},LY={offset:"strokeDashoffset",array:"strokeDasharray"};function a5(e,t,a=1,r=0,n=!0){e.pathLength=1;let s=n?IY:LY;e[s.offset]=`${-r}`,e[s.array]=`${t} ${a}`}var tC=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function wm(e,{attrX:t,attrY:a,attrScale:r,pathLength:n,pathSpacing:s=1,pathOffset:l=0,...c},f,m,g){if(Oc(e,c,m),f){if(e.style.viewBox)e.attrs.viewBox=e.style.viewBox;return}e.attrs=e.style,e.style={};let{attrs:h,style:x}=e;for(let v of tC)if(h[v]!==void 0)x[v]=h[v],delete h[v];if(x.transform||h.transformOrigin)x.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin;if(x.transform)x.transformBox=g?.transformBox??"fill-box",delete h.transformBox;if(t!==void 0)h.x=t;if(a!==void 0)h.y=a;if(r!==void 0)h.scale=r;if(n!==void 0)a5(h,n,s,l,!1)}function r5({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function o5(e,t){if(!t)return e;let a=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:r.y,right:r.x}}function n5(e,t){return r5(o5(e.getBoundingClientRect(),t))}var{schedule:i5,cancel:fbe}=qv(queueMicrotask,!1);var s5={x:!1,y:!1};function pb(){return s5.x||s5.y}function mb(e,t){let a=e5(e),r=new AbortController,n={passive:!0,...t,signal:r.signal};return[a,n,()=>r.abort()]}function TY(e){return!(e.pointerType==="touch"||pb())}function aC(e,t,a={}){let[r,n,s]=mb(e,a);return r.forEach((l)=>{let c=!1,f=!1,m,g=()=>{l.removeEventListener("pointerleave",w)},h=(L)=>{if(m)m(L),m=void 0;g()},x=(L)=>{if(c=!1,window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),f)f=!1,h(L)},v=()=>{c=!0,window.addEventListener("pointerup",x,n),window.addEventListener("pointercancel",x,n)},w=(L)=>{if(L.pointerType==="touch")return;if(c){f=!0;return}h(L)},C=(L)=>{if(!TY(L))return;f=!1;let k=t(l,L);if(typeof k!=="function")return;m=k,l.addEventListener("pointerleave",w,n)};l.addEventListener("pointerenter",C,n),l.addEventListener("pointerdown",v,n)}),s}var rC=(e,t)=>{if(!t)return!1;else if(e===t)return!0;else return rC(e,t.parentElement)};var l5=(e)=>{if(e.pointerType==="mouse")return typeof e.button!=="number"||e.button<=0;else return e.isPrimary!==!1};var RY=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function c5(e){return RY.has(e.tagName)||e.isContentEditable===!0}var rf=new WeakSet;function u5(e){return(t)=>{if(t.key!=="Enter")return;e(t)}}function oC(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var d5=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=u5(()=>{if(rf.has(a))return;oC(a,"down");let n=u5(()=>{oC(a,"up")}),s=()=>oC(a,"cancel");a.addEventListener("keyup",n,t),a.addEventListener("blur",s,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function f5(e){return l5(e)&&!pb()}var p5=new WeakSet;function nC(e,t,a={}){let[r,n,s]=mb(e,a),l=(c)=>{let f=c.currentTarget;if(!f5(c))return;if(p5.has(c))return;if(rf.add(f),a.stopPropagation)p5.add(c);let m=t(f,c),g={...n,capture:!0},h=(w,C)=>{if(window.removeEventListener("pointerup",x,g),window.removeEventListener("pointercancel",v,g),rf.has(f))rf.delete(f);if(!f5(w))return;if(typeof m==="function")m(w,{success:C})},x=(w)=>{h(w,f===window||f===document||a.useGlobalTarget||rC(f,w.target))},v=(w)=>{h(w,!1)};window.addEventListener("pointerup",x,g),window.addEventListener("pointercancel",v,g)};return r.forEach((c)=>{if((a.useGlobalTarget?window:c).addEventListener("pointerdown",l,n),Dc(c)){if(c.addEventListener("focus",(m)=>d5(m,n)),!c5(c)&&!c.hasAttribute("tabindex"))c.tabIndex=0}}),s}var m5=()=>({min:0,max:0}),gb=()=>({x:m5(),y:m5()});var g5=new WeakMap;function Ri(e){return e!==null&&typeof e==="object"&&typeof e.start==="function"}function En(e){return typeof e==="string"||Array.isArray(e)}var hb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],of=["initial",...hb];function Ws(e){if(Ri(e.animate))return!0;for(let t=0;t<of.length;t++)if(En(e[of[t]]))return!0;return!1}function Sm(e){return Boolean(Ws(e)||e.variants)}function h5(e,t,a){for(let r in t){let n=t[r],s=a[r];if(Lt(n))e.addValue(r,n);else if(Lt(s))e.addValue(r,Pc(n,{owner:e}));else if(s!==n)if(e.hasValue(r)){let l=e.getValue(r);if(l.liveStyle===!0)l.jump(n);else if(!l.hasAnimated)l.set(n)}else{let l=e.getStaticValue(r);e.addValue(r,Pc(l!==void 0?l:n,{owner:e}))}}for(let r in a)if(t[r]===void 0)e.removeValue(r);return t}var $s={current:null},_c={current:!1};var AY=typeof window<"u";function km(){if(_c.current=!0,!AY)return;if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$s.current=e.matches;e.addEventListener("change",t),t()}else $s.current=!1}var x5=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],xb={};function Cm(e){xb=e}function iC(){return xb}class vb{scrapeMotionValuesFromProps(e,t,a){return{}}constructor({parent:e,props:t,presenceContext:a,reducedMotionConfig:r,skipAnimations:n,blockInitialAnimation:s,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ac,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{if(!this.current)return;this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection)},this.renderScheduledAt=0,this.scheduleRender=()=>{let x=Qt.now();if(this.renderScheduledAt<x)this.renderScheduledAt=x,$t.render(this.render,!1,!0)};let{latestValues:f,renderState:m}=l;if(this.latestValues=f,this.baseTarget={...f},this.initialValues=t.initial?{...f}:{},this.renderState=m,this.parent=e,this.props=t,this.presenceContext=a,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=n,this.options=c,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Ws(t),this.isVariantNode=Sm(t),this.isVariantNode)this.variantChildren=new Set;this.manuallyAnimateOnMount=Boolean(e&&e.current);let{willChange:g,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(let x in h){let v=h[x];if(f[x]!==void 0&&Lt(v))v.set(f[x])}}mount(e){if(this.hasBeenMounted)for(let t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];if(this.current=e,g5.set(e,this),this.projection&&!this.projection.instance)this.projection.mount(e);if(this.parent&&this.isVariantNode&&!this.isControllingVariants)this.removeFromVariantTree=this.parent.addVariantChild(this);if(this.values.forEach((t,a)=>this.bindToMotionValue(a,t)),this.reducedMotionConfig==="never")this.shouldReduceMotion=!1;else if(this.reducedMotionConfig==="always")this.shouldReduceMotion=!0;else{if(!_c.current)km();this.shouldReduceMotion=$s.current}this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Kd(this.notifyUpdate),Kd(this.render),this.valueSubscriptions.forEach((e)=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];if(t)t.unmount(),t.isMounted=!1}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e))this.valueSubscriptions.get(e)();if(t.accelerate&&xm.has(e)&&this.current instanceof HTMLElement){let{factory:s,keyframes:l,times:c,ease:f,duration:m}=t.accelerate,g=new gm({element:this.current,name:e,keyframes:l,times:c,ease:f,duration:Ga(m)}),h=s(g);this.valueSubscriptions.set(e,()=>{h(),g.cancel()});return}let a=vo.has(e);if(a&&this.onBindTransform)this.onBindTransform();let r=t.on("change",(s)=>{if(this.latestValues[e]=s,this.props.onUpdate&&$t.preRender(this.notifyUpdate),a&&this.projection)this.projection.isTransformDirty=!0;this.scheduleRender()}),n;if(typeof window<"u"&&window.MotionCheckAppearSync)n=window.MotionCheckAppearSync(this,e,t);this.valueSubscriptions.set(e,()=>{if(r(),n)n()})}sortNodePosition(e){if(!this.current||!this.sortInstanceNodePosition||this.type!==e.type)return 0;return this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in xb){let t=xb[e];if(!t)continue;let{isEnabled:a,Feature:r}=t;if(!this.features[e]&&r&&a(this.props))this.features[e]=new r(this);if(this.features[e]){let n=this.features[e];if(n.isMounted)n.update();else n.mount(),n.isMounted=!0}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gb()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){if(e.transformTemplate||this.props.transformTemplate)this.scheduleRender();this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let a=0;a<x5.length;a++){let r=x5[a];if(this.propEventSubscriptions[r])this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r];let n="on"+r,s=e[n];if(s)this.propEventSubscriptions[r]=this.on(r,s)}if(this.prevMotionValues=h5(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue)this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let a=this.values.get(e);if(t!==a){if(a)this.removeValue(e);this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get()}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);if(t)t(),this.valueSubscriptions.delete(e);delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let a=this.values.get(e);if(a===void 0&&t!==void 0)a=Pc(t===null?void 0:t,{owner:this}),this.addValue(e,a);return a}readValue(e,t){let a=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);if(a!==void 0&&a!==null){if(typeof a==="string"&&(wc(a)||Sc(a)))a=parseFloat(a);else if(typeof a!=="number"&&!Zt.test(a)&&Zt.test(t))a=tf(e,t);this.setBaseTarget(e,Lt(a)?a.get():a)}return Lt(a)?a.get():a}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,a;if(typeof t==="string"||typeof t==="object"){let n=Nc(this.props,t,this.presenceContext?.custom);if(n)a=n[e]}if(t&&a!==void 0)return a;let r=this.getBaseTargetFromProps(this.props,e);if(r!==void 0&&!Lt(r))return r;return this.initialValues[e]!==void 0&&a===void 0?void 0:this.baseTarget[e]}on(e,t){if(!this.events[e])this.events[e]=new kc;return this.events[e].add(t)}notify(e,...t){if(this.events[e])this.events[e].notify(...t)}scheduleRenderMicrotask(){i5.render(this.render)}}class Im extends vb{constructor(){super(...arguments);this.KeyframeResolver=eC}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let a=e.style;return a?a[t]:void 0}removeValueFromRenderState(e,{vars:t,style:a}){delete t[e],delete a[e]}handleChildMotionValue(){if(this.childSubscription)this.childSubscription(),delete this.childSubscription;let{children:e}=this.props;if(Lt(e))this.childSubscription=e.on("change",(t)=>{if(this.current)this.current.textContent=`${t}`})}}class Dr{constructor(e){this.isMounted=!1,this.node=e}update(){}}function bb(e,{style:t,vars:a},r,n){let s=e.style,l;for(l in t)s[l]=t[l];n?.applyProjectionStyles(s,r);for(l in a)s.setProperty(l,a[l])}function v5(e,t){if(t.max===t.min)return 0;return e/(t.max-t.min)*100}var nf={correct:(e,t)=>{if(!t.target)return e;if(typeof e==="string")if(Re.test(e))e=parseFloat(e);else return e;let a=v5(e,t.target.x),r=v5(e,t.target.y);return`${a}% ${r}%`}};var b5={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,n=Zt.parse(e);if(n.length>5)return r;let s=Zt.createTransformer(e),l=typeof n[0]!=="number"?1:0,c=a.x.scale*t.x,f=a.y.scale*t.y;n[0+l]/=c,n[1+l]/=f;let m=Vo(c,f,0.5);if(typeof n[2+l]==="number")n[2+l]/=m;if(typeof n[3+l]==="number")n[3+l]/=m;return s(n)}};var y5={borderRadius:{...nf,applyTo:[...JD]},borderTopLeftRadius:nf,borderTopRightRadius:nf,borderBottomLeftRadius:nf,borderBottomRightRadius:nf,boxShadow:b5};function Lm(e,{layout:t,layoutId:a}){return vo.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!y5[e]||e==="opacity")}function zc(e,t,a){let r=e.style,n=t?.style,s={};if(!r)return s;for(let l in r)if(Lt(r[l])||n&&Lt(n[l])||Lm(l,e)||a?.getValue(l)?.liveStyle!==void 0)s[l]=r[l];return s}function MY(e){return window.getComputedStyle(e)}class yb extends Im{constructor(){super(...arguments);this.type="html",this.renderInstance=bb}mount(e){Nr(Boolean(e.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(e,t){if(vo.has(t))return this.projection?.isProjecting?ab(t):vD(e,t);else{let a=MY(e),r=(Xv(t)?a.getPropertyValue(t):a[t])||0;return typeof r==="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return n5(e,t)}build(e,t,a){Oc(e,t,a.transformTemplate)}scrapeMotionValuesFromProps(e,t,a){return zc(e,t,a)}}var wb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var Tm=(e)=>typeof e==="string"&&e.toLowerCase()==="svg";function w5(e,t,a,r){bb(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(!wb.has(n)?af(n):n,t.attrs[n])}function Rm(e,t,a){let r=zc(e,t,a);for(let n in e)if(Lt(e[n])||Lt(t[n])){let s=Pn.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;r[s]=e[n]}return r}class Sb extends Im{constructor(){super(...arguments);this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gb}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(vo.has(t)){let a=tb(t);return a?a.default||0:0}if(tC.includes(t)){let r=getComputedStyle(e)[t];if(typeof r==="string"&&r)return r.trim()}return t=!wb.has(t)?af(t):t,e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,a){return Rm(e,t,a)}build(e,t,a){wm(e,t,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(e,t,a,r){w5(e,t,a,r)}mount(e){this.isSVGTag=Tm(e.tagName),super.mount(e)}}var PY=of.length;function sC(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?sC(e.parent)||{}:{};if(e.props.initial!==void 0)a.initial=e.props.initial;return a}let t={};for(let a=0;a<PY;a++){let r=of[a],n=e.props[r];if(En(n)||n===!1)t[r]=n}return t}function lC(e,t){if(!Array.isArray(t))return!1;let a=t.length;if(a!==e.length)return!1;for(let r=0;r<a;r++)if(t[r]!==e[r])return!1;return!0}var EY=[...hb].reverse(),NY=hb.length;function DY(e){return(t)=>Promise.all(t.map(({animation:a,options:r})=>YD(e,a,r)))}function cC(e){let t=DY(e),a=S5(),r=!0,n=!1,s=(m)=>(g,h)=>{let x=Zr(e,h,m==="exit"?e.presenceContext?.custom:void 0);if(x){let{transition:v,transitionEnd:w,...C}=x;g={...g,...C,...w}}return g};function l(m){t=m(e)}function c(m){let{props:g}=e,h=sC(e.parent)||{},x=[],v=new Set,w={},C=1/0;for(let k=0;k<NY;k++){let I=EY[k],T=a[I],R=g[I]!==void 0?g[I]:h[I],E=En(R),M=I===m?T.isActive:null;if(M===!1)C=k;let P=R===h[I]&&R!==g[I]&&E;if(P&&(r||n)&&e.manuallyAnimateOnMount)P=!1;if(T.protectedKeys={...w},!T.isActive&&M===null||!R&&!T.prevProp||Ri(R)||typeof R==="boolean")continue;if(I==="exit"&&T.isActive&&M!==!0){if(T.prevResolvedValues)w={...w,...T.prevResolvedValues};continue}let O=k5(T.prevProp,R),F=O||I===m&&T.isActive&&!P&&E||k>C&&E,z=!1,Y=Array.isArray(R)?R:[R],q=Y.reduce(s(I),{});if(M===!1)q={};let{prevResolvedValues:G={}}=T,Q={...G,...q},re=(Z)=>{if(F=!0,v.has(Z))z=!0,v.delete(Z);T.needsAnimating[Z]=!0;let te=e.getValue(Z);if(te)te.liveStyle=!1};for(let Z in Q){let te=q[Z],D=G[Z];if(w.hasOwnProperty(Z))continue;let Te=!1;if(vm(te)&&vm(D))Te=!lC(te,D)||O;else Te=te!==D;if(Te)if(te!==void 0&&te!==null)re(Z);else v.add(Z);else if(te!==void 0&&v.has(Z))re(Z);else T.protectedKeys[Z]=!0}if(T.prevProp=R,T.prevResolvedValues=q,T.isActive)w={...w,...q};if((r||n)&&e.blockInitialAnimation)F=!1;let J=P&&O;if(F&&(!J||z))x.push(...Y.map((Z)=>{let te={type:I};if(typeof Z==="string"&&(r||n)&&!J&&e.manuallyAnimateOnMount&&e.parent){let{parent:D}=e,Te=Zr(D,Z);if(D.enteringChildren&&Te){let{delayChildren:Le}=Te.transition||{};te.delay=lb(D.enteringChildren,e,Le)}}return{animation:Z,options:te}}))}if(v.size){let k={};if(typeof g.initial!=="boolean"){let I=Zr(e,Array.isArray(g.initial)?g.initial[0]:g.initial);if(I&&I.transition)k.transition=I.transition}v.forEach((I)=>{let T=e.getBaseTarget(I),R=e.getValue(I);if(R)R.liveStyle=!0;k[I]=T??null}),x.push({animation:k})}let L=Boolean(x.length);if(r&&(g.initial===!1||g.initial===g.animate)&&!e.manuallyAnimateOnMount)L=!1;return r=!1,n=!1,L?t(x):Promise.resolve()}function f(m,g){if(a[m].isActive===g)return Promise.resolve();e.variantChildren?.forEach((x)=>x.animationState?.setActive(m,g)),a[m].isActive=g;let h=c(m);for(let x in a)a[x].protectedKeys={};return h}return{animateChanges:c,setActive:f,setAnimateFunction:l,getState:()=>a,reset:()=>{a=S5(),n=!0}}}function k5(e,t){if(typeof t==="string")return t!==e;else if(Array.isArray(t))return!lC(t,e);return!1}function Bc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function S5(){return{animate:Bc(!0),whileInView:Bc(),whileHover:Bc(),whileTap:Bc(),whileDrag:Bc(),whileFocus:Bc(),exit:Bc()}}function kb(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)}function uC(e){return Lt(e)?e.get():e}var Ai=ht({transformPagePoint:(e)=>e,isStatic:!1,reducedMotion:"never"});function C5(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}function OY(...e){return(t)=>{let a=!1,r=e.map((n)=>{let s=C5(n,t);if(!a&&typeof s==="function")a=!0;return s});if(a)return()=>{for(let n=0;n<r.length;n++){let s=r[n];if(typeof s==="function")s();else C5(e[n],null)}}}}function I5(...e){return j(OY(...e),e)}class L5 extends Kh{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Dc(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let a=t.offsetParent,r=Dc(a)?a.offsetWidth||0:0,n=Dc(a)?a.offsetHeight||0:0,s=getComputedStyle(t),l=this.props.sizeRef.current;l.height=parseFloat(s.height),l.width=parseFloat(s.width),l.top=t.offsetTop,l.left=t.offsetLeft,l.right=r-l.width-l.left,l.bottom=n-l.height-l.top,l.direction=s.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function T5({children:e,isPresent:t,anchorX:a,anchorY:r,root:n,pop:s}){let l=lt(),c=B(null),f=B({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:m}=We(Ai),g=s!==!1?e.props?.ref??e?.ref:void 0,h=I5(c,g);return cs(()=>{let{width:x,height:v,top:w,left:C,right:L,bottom:k,direction:I}=f.current;if(t||s===!1||!c.current||!x||!v)return;let T=I==="rtl",R=a==="left"?T?`right: ${L}`:`left: ${C}`:T?`left: ${C}`:`right: ${L}`,E=r==="bottom"?`bottom: ${k}`:`top: ${w}`;c.current.dataset.motionPopId=l;let M=document.createElement("style");if(m)M.nonce=m;let P=n??document.head;if(P.appendChild(M),M.sheet)M.sheet.insertRule(`
|
|
12
|
+
[data-motion-pop-id="${l}"] {
|
|
13
|
+
position: absolute !important;
|
|
14
|
+
width: ${x}px !important;
|
|
15
|
+
height: ${v}px !important;
|
|
16
|
+
${R}px !important;
|
|
17
|
+
${E}px !important;
|
|
18
|
+
}
|
|
19
|
+
`);return()=>{if(c.current?.removeAttribute("data-motion-pop-id"),P.contains(M))P.removeChild(M)}},[t]),d(L5,{isPresent:t,childRef:c,sizeRef:f,pop:s,children:s===!1?e:Ir(e,{ref:h})})}var R5=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:n,presenceAffectsLayout:s,mode:l,anchorX:c,anchorY:f,root:m})=>{let g=Hs(_Y),h=lt(),x=B(a),v=B(r);Vs(()=>{x.current=a,v.current=r});let w=!0,C=de(()=>(w=!1,{id:h,initial:t,isPresent:a,custom:n,onExitComplete:(L)=>{g.set(L,!0);for(let k of g.values())if(!k)return;r&&r()},register:(L)=>(g.set(L,!1),()=>{g.delete(L),!x.current&&!g.size&&v.current?.()})}),[a,g,r]);if(s&&w)C={...C};return de(()=>{g.forEach((L,k)=>g.set(k,!1))},[a]),U(()=>{!a&&!g.size&&r&&r()},[a]),e=d(T5,{pop:l==="popLayout",isPresent:a,anchorX:c,anchorY:f,root:m,children:e}),d(Ii.Provider,{value:C,children:e})};function _Y(){return new Map}function dC(e=!0){let t=We(Ii);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:n}=t,s=lt();U(()=>{if(e)return n(s)},[e]);let l=j(()=>e&&r&&r(s),[s,r,e]);return!a&&r?[!1,l]:[!0]}function fC(){return zY(We(Ii))}function zY(e){return e===null?!0:e.isPresent}var sf=(e)=>e.key||"";function pC(e){let t=[];return ur.forEach(e,(a)=>{if(Yt(a))t.push(a)}),t}var bo=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:n=!0,mode:s="sync",propagate:l=!1,anchorX:c="left",anchorY:f="top",root:m})=>{let[g,h]=dC(l),x=de(()=>pC(e),[e]),v=l&&!g?[]:x.map(sf),w=B(!0),C=Hs(()=>new Map),L=B(new Set),[k,I]=A(x),[T,R]=A(x);Vs(()=>{if(l&&!g&&!T.length)h?.()},[g,l,T.length,h]),Vs(()=>{w.current=!1;for(let P=0;P<T.length;P++){let O=sf(T[P]);if(!v.includes(O)){if(C.get(O)!==!0)C.set(O,!1)}else C.delete(O),L.current.delete(O)}},[T,v.length,v.join("-")]);let E=[];if(x!==k){let P=[...x],O=0;for(let F of T){let z=v.indexOf(sf(F));if(z===-1)P.splice(O++,0,F),E.push(F);else O=z+E.length+1}if(E.every((F)=>C.get(sf(F))))P=x;else if(s==="wait")P=E;return R(pC(P)),I(x),null}let{forceRender:M}=We(Uv);return d(se,{children:T.map((P)=>{let O=sf(P),F=l&&!g?!1:x===T||v.includes(O),z=()=>{if(L.current.has(O))return;if(C.has(O))L.current.add(O),C.set(O,!0);else return;let Y=!0;if(C.forEach((q)=>{if(!q)Y=!1}),Y)M?.(),I([]),l&&h?.(),r&&r()};return d(R5,{isPresent:F,initial:!w.current||a?void 0:!1,custom:t,presenceAffectsLayout:n,mode:s,root:m,onExitComplete:F?void 0:z,anchorX:c,anchorY:f,children:P},O)})})};var lf=ht({strict:!1});var A5={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},M5=!1;function BY(){if(M5)return;let e={};for(let t in A5)e[t]={isEnabled:(a)=>A5[t].some((r)=>!!a[r])};Cm(e),M5=!0}function Cb(){return BY(),iC()}function Am(e){let t=Cb();for(let a in e)t[a]={...t[a],...e[a]};Cm(t)}function gC({children:e,features:t,strict:a=!1}){let[,r]=A(!mC(t)),n=B(void 0);if(!mC(t)){let{renderer:s,...l}=t;n.current=s,Am(l)}return U(()=>{if(mC(t))t().then(({renderer:s,...l})=>{Am(l),n.current=s,r(!0)})},[]),d(lf.Provider,{value:{renderer:n.current,strict:a},children:e})}function mC(e){return typeof e==="function"}function hC({children:e,...t}){let a=We(Ai);t={...a,...t},t.transition=Ec(t.transition,a.transition),t.isStatic=Hs(()=>t.isStatic);let r=de(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return d(Ai.Provider,{value:r,children:e})}var Qs=ht({});function P5(e,t){if(Ws(e)){let{initial:a,animate:r}=e;return{initial:a===!1||En(a)?a:void 0,animate:En(r)?r:void 0}}return e.inherit!==!1?t:{}}function N5(e){let{initial:t,animate:a}=P5(e,We(Qs));return de(()=>({initial:t,animate:a}),[E5(t),E5(a)])}function E5(e){return Array.isArray(e)?e.join(" "):e}var cf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xC(e,t,a){for(let r in t)if(!Lt(t[r])&&!Lm(r,a))e[r]=t[r]}function FY({transformTemplate:e},t){return de(()=>{let a=cf();return Oc(a,t,e),Object.assign({},a.vars,a.style)},[t])}function UY(e,t){let a=e.style||{},r={};return xC(r,a,e),Object.assign(r,FY(e,t)),r}function D5(e,t){let a={},r=UY(e,t);if(e.drag&&e.dragListener!==!1)a.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`;if(e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap))a.tabIndex=0;return a.style=r,a}var Ib=()=>({...cf(),attrs:{}});function O5(e,t,a,r){let n=de(()=>{let s=Ib();return wm(s,t,Tm(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let s={};xC(s,e.style,e),n.style={...s,...n.style}}return n}var HY=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Mm(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||HY.has(e)}function VY(e,t){return e.startsWith("on")?!Mm(e):t?.(e)??!Mm(e)}function _5(e,t,a,r){let n={};for(let s in e){if(s==="values"&&typeof e.values==="object")continue;if(Lt(e[s]))continue;if(VY(s,r)||a===!0&&Mm(s)||!t&&!Mm(s)||e.draggable&&s.startsWith("onDrag"))n[s]=e[s]}return n}var z5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function uf(e){if(typeof e!=="string"||e.includes("-"))return!1;else if(z5.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}function B5(e,t,a,{latestValues:r},n,s=!1,l,c){let m=(l??uf(e)?O5:D5)(t,r,n,e),g=_5(t,typeof e==="string",s,c),h=e!==Za?{...g,...m,ref:a}:{},{children:x}=t,v=de(()=>Lt(x)?x.get():x,[x]);return Be(e,{...h,children:v})}function jY({scrapeMotionValuesFromProps:e,createRenderState:t},a,r,n){return{latestValues:GY(a,r,n,e),renderState:t()}}function GY(e,t,a,r){let n={},s=r(e,{});for(let x in s)n[x]=uC(s[x]);let{initial:l,animate:c}=e,f=Ws(e),m=Sm(e);if(t&&m&&!f&&e.inherit!==!1){if(l===void 0)l=t.initial;if(c===void 0)c=t.animate}let g=a?a.initial===!1:!1;g=g||l===!1;let h=g?c:l;if(h&&typeof h!=="boolean"&&!Ri(h)){let x=Array.isArray(h)?h:[h];for(let v=0;v<x.length;v++){let w=Nc(e,x[v]);if(w){let{transitionEnd:C,transition:L,...k}=w;for(let I in k){let T=k[I];if(Array.isArray(T)){let R=g?T.length-1:0;T=T[R]}if(T!==null)n[I]=T}for(let I in C)n[I]=C[I]}}}return n}var Lb=(e)=>(t,a)=>{let r=We(Qs),n=We(Ii),s=()=>jY(e,t,r,n);return a?s():Hs(s)};var F5=Lb({scrapeMotionValuesFromProps:zc,createRenderState:cf});var U5=Lb({scrapeMotionValuesFromProps:Rm,createRenderState:Ib});var H5=Symbol.for("motionComponentSymbol");function V5(e,t,a){let r=B(a);cs(()=>{r.current=a});let n=B(null);return j((s)=>{if(s)e.onMount?.(s);if(t)s?t.mount(s):t.unmount();let l=r.current;if(typeof l==="function")if(s){let c=l(s);if(typeof c==="function")n.current=c}else if(n.current)n.current(),n.current=null;else l(s);else if(l)l.current=s},[t])}var j5=ht({});function G5(e){return e&&typeof e==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function q5(e,t,a,r,n,s){let{visualElement:l}=We(Qs),c=We(lf),f=We(Ii),m=We(Ai),{reducedMotion:g,skipAnimations:h}=m,x=B(null),v=B(!1);if(r=r||c.renderer,!x.current&&r){if(x.current=r(e,{visualState:t,parent:l,props:a,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:g,skipAnimations:h,isSVG:s}),v.current&&x.current)x.current.manuallyAnimateOnMount=!0}let w=x.current,C=We(j5);if(w&&!w.projection&&n&&(w.type==="html"||w.type==="svg"))qY(x.current,a,n,C);let L=B(!1);cs(()=>{if(w&&L.current)w.update(a,f)});let k=a[bm],I=B(Boolean(k)&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(k)&&window.MotionHasOptimisedAnimation?.(k));return Vs(()=>{if(!v.current||!w)return;w.animationState?.animateChanges(),w.enteringChildren=void 0},[]),Vs(()=>{if(v.current=!0,!w)return;if(L.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),I.current&&w.animationState)w.animationState.animateChanges()}),U(()=>{if(!w)return;if(!I.current&&w.animationState)w.animationState.animateChanges();if(I.current)queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(k)}),I.current=!1;w.enteringChildren=void 0}),w}function qY(e,t,a,r){let{layoutId:n,layout:s,drag:l,dragConstraints:c,layoutScroll:f,layoutRoot:m,layoutAnchor:g,layoutCrossfade:h}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:K5(e.parent)),e.projection.setOptions({layoutId:n,layout:s,alwaysMeasureLayout:Boolean(l)||c&&G5(c),visualElement:e,animationType:typeof s==="string"?s:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:f,layoutRoot:m,layoutAnchor:g})}function K5(e){if(!e)return;return e.options.allowProjection!==!1?e.projection:K5(e.parent)}function X5(e,{forwardMotionProps:t=!1,type:a}={},r,n){r&&Am(r);let s=a?a==="svg":uf(e),l=s?U5:F5;function c(m,g){let h,x={...We(Ai),...m,layoutId:KY(m)},{isStatic:v,isValidProp:w}=x,C=N5(m),L=l(m,v);if(!v&&typeof window<"u"){XY(x,r);let k=YY(x);h=k.MeasureLayout,C.visualElement=q5(e,L,x,n,k.ProjectionNode,s)}return S(Qs.Provider,{value:C,children:[h&&C.visualElement?d(h,{visualElement:C.visualElement,...x}):null,B5(e,m,V5(L,C.visualElement,g),L,v,t,s,w)]})}c.displayName=`motion.${typeof e==="string"?e:`create(${e.displayName??e.name??""})`}`;let f=ne(c);return f[H5]=e,f}function KY({layoutId:e}){let t=We(Uv).id;return t&&e!==void 0?t+"-"+e:e}function XY(e,t){let a=We(lf).strict}function YY(e){let t=Cb(),{drag:a,layout:r}=t;if(!a&&!r)return{};let n={...a,...r};return{MeasureLayout:a?.isEnabled(e)||r?.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}var Y5=(e,t)=>t.isSVG??uf(e)?new Sb(t):new yb(t,{allowProjection:e!==Za});class vC extends Dr{constructor(e){super(e);e.animationState||(e.animationState=cC(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();if(Ri(e))this.unmountControls=e.subscribe(this.node)}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};if(e!==t)this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}var WY=0;class bC extends Dr{constructor(){super(...arguments);this.id=WY++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===a)return;if(e&&a===!1){if(this.isExitComplete){let{initial:n,custom:s}=this.node.getProps();if(typeof n==="string"||typeof n==="object"&&n!==null&&!Array.isArray(n)){let l=Zr(this.node,n,s);if(l){let{transition:c,transitionEnd:f,...m}=l;for(let g in m)this.node.getValue(g)?.jump(m[g])}}this.node.blockInitialAnimation=!1,this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1,this.exitAnimation=void 0;return}let r=this.exitAnimation=this.node.animationState.setActive("exit",!e);if(t&&!e)r.then(()=>{if(this.exitAnimation!==r)return;this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};if(t)t(this.id);if(e)this.unmount=e(this.id)}unmount(){}}var W5={animation:{Feature:vC},exit:{Feature:bC}};function Tb(e){return{point:{x:e.pageX,y:e.pageY}}}function $5(e,t,a){let{props:r}=e;if(e.animationState&&r.whileHover)e.animationState.setActive("whileHover",a==="Start");let n="onHover"+a,s=r[n];if(s)$t.postRender(()=>s(t,Tb(t)))}class yC extends Dr{mount(){let{current:e}=this.node;if(!e)return;this.unmount=aC(e,(t,a)=>($5(this.node,a,"Start"),(r)=>$5(this.node,r,"End")))}unmount(){}}class wC extends Dr{constructor(){super(...arguments);this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}if(!e||!this.node.animationState)return;this.node.animationState.setActive("whileFocus",!0),this.isActive=!0}onBlur(){if(!this.isActive||!this.node.animationState)return;this.node.animationState.setActive("whileFocus",!1),this.isActive=!1}mount(){this.unmount=Li(kb(this.node.current,"focus",()=>this.onFocus()),kb(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Q5(e,t,a){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;if(e.animationState&&r.whileTap)e.animationState.setActive("whileTap",a==="Start");let n="onTap"+(a==="End"?"":a),s=r[n];if(s)$t.postRender(()=>s(t,Tb(t)))}class SC extends Dr{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:a}=this.node.props;this.unmount=nC(e,(r,n)=>(Q5(this.node,n,"Start"),(s,{success:l})=>Q5(this.node,s,l?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:a?.tap===!1})}unmount(){}}var CC=new WeakMap,kC=new WeakMap,$Y=(e)=>{let t=CC.get(e.target);t&&t(e)},QY=(e)=>{e.forEach($Y)};function ZY({root:e,...t}){let a=e||document;if(!kC.has(a))kC.set(a,{});let r=kC.get(a),n=JSON.stringify(t);if(!r[n])r[n]=new IntersectionObserver(QY,{root:e,...t});return r[n]}function Z5(e,t,a){let r=ZY(t);return CC.set(e,a),r.observe(e),()=>{CC.delete(e),r.unobserve(e)}}var JY={some:0,all:1};class IC extends Dr{constructor(){super(...arguments);this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:a,amount:r="some",once:n}=e,s={root:t?t.current:void 0,rootMargin:a,threshold:typeof r==="number"?r:JY[r]},l=(c)=>{let{isIntersecting:f}=c;if(this.isInView===f)return;if(this.isInView=f,n&&!f&&this.hasEnteredView)return;else if(f)this.hasEnteredView=!0;if(this.node.animationState)this.node.animationState.setActive("whileInView",f);let{onViewportEnter:m,onViewportLeave:g}=this.node.getProps(),h=f?m:g;h&&h(c)};this.stopObserver=Z5(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:e,prevProps:t}=this.node;if(["amount","margin","root"].some(eW(e,t)))this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function eW({viewport:e={}},{viewport:t={}}={}){return(a)=>e[a]!==t[a]}var J5={inView:{Feature:IC},tap:{Feature:SC},focus:{Feature:wC},hover:{Feature:yC}};var LC={renderer:Y5,...W5,...J5};function Pm(){!_c.current&&km();let[e]=A($s.current);return e}function Fc(e,t){return X5(e,t)}var TC=Fc("aside");var ar=Fc("div");var RC=Fc("li");var AC=Fc("section");var Zs=Fc("span");var MC=Fc("path");var e4=(e)=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function t4(e,t,a=[]){if(t==null)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e4(e),size:24,node:t,...a.length>0?{aliases:a}:{}}}var a4=(e)=>{let t="",a=!1;for(let r of e){if(r==="-"||r==="_"||r<=" "){a=t.length>0;continue}if(t.length===0)t+=r.toLowerCase();else t+=a?r.toUpperCase():r;a=!1}return t};var r4=(e)=>{let t=a4(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Em=(...e)=>e.filter((t,a,r)=>Boolean(t)&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var Js={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"};function PC(e){return e!==null&&e!==void 0}function o4(e,t={}){let a=t.attributeNames??{},r=(x)=>a[x]??x,n=e.size??e.width??Js.width,s=e.size??e.height??Js.height,l=e.aliases?.filter((x)=>typeof x==="string"&&x.trim()!=="").map((x)=>`lucide-${x}`)??[],c=[...e.name?[`lucide-${e.name}`]:[],...l],f=t.className?.split(" ").filter(Boolean)??[],m=t.includeDefaultClasses===!1?Em(...f):Em("lucide",...c,...f),g=t.absoluteStrokeWidth?Number(t.strokeWidth??Js["stroke-width"])*Number(e.size??e.width??Js.width)/Number(t.size??t.width??Js.width):t.strokeWidth??Js["stroke-width"];return["svg",{...Object.entries(Js).reduce((x,[v,w])=>(x[r(v)]=w,x),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&PC(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&PC(t.width)&&{[r("width")]:t.width},..."height"in t&&PC(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:g,...m&&{[r("class")]:m},[r("viewBox")]:`0 0 ${n} ${s}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map((x)=>{let[v,w,C]=x,L=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...w}:w;return C?[v,L,C]:[v,L]})]}function n4(e,t={}){return o4(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var i4=(e)=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var tW=ht({});var s4=()=>We(tW);var l4=ne(({color:e,size:t,width:a,height:r,strokeWidth:n,absoluteStrokeWidth:s,nonScalingStroke:l,className:c="",children:f,iconNode:m=[],icon:g={node:m,aliases:[],size:24},...h},x)=>{let{size:v=24,strokeWidth:w=2,absoluteStrokeWidth:C=!1,nonScalingStroke:L=!1,color:k="currentColor",className:I=""}=s4()??{},T=Boolean(f)||i4(h),[R,E,M=[]]=n4(g,{color:e??k,width:a??t??v,height:r??t??v,strokeWidth:n??w,absoluteStrokeWidth:s??C,nonScalingStroke:l??L,className:Em(I,c),hasA11yProp:T,attributes:h});return Be(R,{ref:x,...E},[...M.map(([P,O])=>Be(P,O)),...Array.isArray(f)?f:[f]])});function V(e,t=[],a=[]){let r=typeof e==="string"?t4(e,t,a):e,n=ne(({className:s,...l},c)=>Be(l4,{ref:c,icon:r,className:s,...l}));if(r.name)n.displayName=r4(r.name);return n}var c4={name:"fingerprint-pattern",size:24,node:[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],aliases:["fingerprint"]};c4.node;var rr=V(c4);var u4={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};u4.node;var jo=V(u4);var d4={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};d4.node;var el=V(d4);var f4={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};f4.node;var Nn=V(f4);var p4={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};p4.node;var Go=V(p4);var m4={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};m4.node;var tl=V(m4);var g4={name:"ellipsis-vertical",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aliases:["more-vertical"]};g4.node;var Dn=V(g4);var h4={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};h4.node;var On=V(h4);var x4={name:"file-headphone",size:24,node:[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],aliases:["file-audio","file-audio-2"]};x4.node;var qo=V(x4);var v4={name:"file-play",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],aliases:["file-video"]};v4.node;var al=V(v4);var b4={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};b4.node;var _n=V(b4);var y4={name:"lock-open",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],aliases:["unlock"]};y4.node;var rl=V(y4);var w4={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};w4.node;var ol=V(w4);var S4={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};S4.node;var nl=V(S4);var k4={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};k4.node;var zn=V(k4);var C4={name:"send-horizontal",size:24,node:[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],aliases:["send-horizonal"]};C4.node;var Bn=V(C4);var I4={name:"shield-question-mark",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["shield-question"]};I4.node;var Mi=V(I4);var L4={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};L4.node;var sa=V(L4);var T4={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};T4.node;var yo=V(T4);var R4={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};R4.node;var pa=V(R4);var A4={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};A4.node;var qa=V(A4);var M4={name:"user-round",size:24,node:[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],aliases:["user-2"]};M4.node;var Ko=V(M4);var P4={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};P4.node;var Nm=V(P4);var E4={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};E4.node;var Uc=V(E4);var N4={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};N4.node;var Or=V(N4);var D4={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};D4.node;var Dm=V(D4);var O4={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};O4.node;var Om=V(O4);var _4={name:"bird",size:24,node:[["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20",key:"oj1oa8"}],["path",{d:"m20 7 2 .5-2 .5",key:"12nv4d"}],["path",{d:"M10 18v3",key:"1yea0a"}],["path",{d:"M14 17.75V21",key:"1pymcb"}],["path",{d:"M7 18a6 6 0 0 0 3.84-10.61",key:"1npnn0"}]]};_4.node;var _m=V(_4);var z4={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};z4.node;var zm=V(z4);var B4={name:"cat",size:24,node:[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]]};B4.node;var Bm=V(B4);var F4={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};F4.node;var Ke=V(F4);var U4={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};U4.node;var yt=V(U4);var H4={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};H4.node;var Pi=V(H4);var V4={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};V4.node;var Jt=V(V4);var j4={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};j4.node;var Fm=V(j4);var G4={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};G4.node;var Hc=V(G4);var q4={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};q4.node;var Um=V(q4);var K4={name:"clock-fading",size:24,node:[["path",{d:"M12 2a10 10 0 0 1 7.38 16.75",key:"175t95"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["path",{d:"M2.5 8.875a10 10 0 0 0-.5 3",key:"1vce0s"}],["path",{d:"M2.83 16a10 10 0 0 0 2.43 3.4",key:"o3fkw4"}],["path",{d:"M4.636 5.235a10 10 0 0 1 .891-.857",key:"1szpfk"}],["path",{d:"M8.644 21.42a10 10 0 0 0 7.631-.38",key:"9yhvd4"}]]};K4.node;var Hm=V(K4);var X4={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};X4.node;var Vm=V(X4);var Y4={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};Y4.node;var jm=V(Y4);var W4={name:"coffee",size:24,node:[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]};W4.node;var Gm=V(W4);var $4={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};$4.node;var il=V($4);var Q4={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Q4.node;var gr=V(Q4);var Z4={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};Z4.node;var qm=V(Z4);var J4={name:"delete",size:24,node:[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]};J4.node;var Km=V(J4);var e3={name:"dog",size:24,node:[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]]};e3.node;var Xm=V(e3);var t3={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};t3.node;var Ym=V(t3);var a3={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};a3.node;var Xo=V(a3);var r3={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};r3.node;var Wm=V(r3);var o3={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};o3.node;var $m=V(o3);var n3={name:"file-archive",size:24,node:[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]]};n3.node;var Qm=V(n3);var i3={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};i3.node;var Zm=V(i3);var s3={name:"file-diff",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]};s3.node;var Jm=V(s3);var l3={name:"file-spreadsheet",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]};l3.node;var eg=V(l3);var c3={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};c3.node;var Fn=V(c3);var u3={name:"file",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]};u3.node;var Ei=V(u3);var d3={name:"fish",size:24,node:[["path",{d:"M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z",key:"15baut"}],["path",{d:"M18 12v.5",key:"18hhni"}],["path",{d:"M16 17.93a9.77 9.77 0 0 1 0-11.86",key:"16dt7o"}],["path",{d:"M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33",key:"l9di03"}],["path",{d:"M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4",key:"1kjonw"}],["path",{d:"m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98",key:"1zlm23"}]]};d3.node;var tg=V(d3);var f3={name:"flower-2",size:24,node:[["path",{d:"M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1",key:"3pnvol"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M12 10v12",key:"6ubwww"}],["path",{d:"M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z",key:"9hd38g"}],["path",{d:"M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z",key:"ufn41s"}]]};f3.node;var ag=V(f3);var p3={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};p3.node;var Vc=V(p3);var m3={name:"folder-plus",size:24,node:[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};m3.node;var Yo=V(m3);var g3={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};g3.node;var _t=V(g3);var h3={name:"folders",size:24,node:[["path",{d:"M20 5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h2.5a1.5 1.5 0 0 1 1.2.6l.6.8a1.5 1.5 0 0 0 1.2.6z",key:"a4852j"}],["path",{d:"M3 8.268a2 2 0 0 0-1 1.738V19a2 2 0 0 0 2 2h11a2 2 0 0 0 1.732-1",key:"yxbcw3"}]]};h3.node;var rg=V(h3);var x3={name:"gamepad-2",size:24,node:[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]};x3.node;var og=V(x3);var v3={name:"ghost",size:24,node:[["path",{d:"M15 10v1",key:"oj8wfp"}],["path",{d:"M7.528 20.472a1.6 1.6 0 012.277 0l1.057 1.056a1.6 1.6 0 002.276 0l1.057-1.056a1.6 1.6 0 012.277 0l1.114 1.114a1.4 1.4 0 002.414-1V10a8 8 0 00-16 0v10.586a1.4 1.4 0 002.414 1z",key:"13lou3"}],["path",{d:"M9 10v1",key:"1e14fa"}]]};v3.node;var ng=V(v3);var b3={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};b3.node;var ig=V(b3);var y3={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};y3.node;var Jr=V(y3);var w3={name:"hammer",size:24,node:[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]};w3.node;var jc=V(w3);var S3={name:"image-up",size:24,node:[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};S3.node;var sg=V(S3);var k3={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};k3.node;var Gc=V(k3);var C3={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};C3.node;var lg=V(C3);var I3={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};I3.node;var cg=V(I3);var L3={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};L3.node;var df=V(L3);var T3={name:"laptop",size:24,node:[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]};T3.node;var ug=V(T3);var R3={name:"leaf",size:24,node:[["path",{d:"M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20",key:"1wjnjv"}],["path",{d:"M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13",key:"c1ejpn"}]]};R3.node;var dg=V(R3);var A3={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};A3.node;var qc=V(A3);var M3={name:"list-tree",size:24,node:[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]]};M3.node;var sl=V(M3);var P3={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};P3.node;var fg=V(P3);var E3={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};E3.node;var Ka=V(E3);var N3={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};N3.node;var pg=V(N3);var D3={name:"message-circle-plus",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]};D3.node;var mg=V(D3);var O3={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};O3.node;var gg=V(O3);var _3={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};_3.node;var hg=V(_3);var z3={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};z3.node;var xg=V(z3);var B3={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};B3.node;var Kc=V(B3);var F3={name:"mountain",size:24,node:[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]};F3.node;var vg=V(F3);var U3={name:"panda",size:24,node:[["path",{d:"M11.25 17.25h1.5L12 18z",key:"1wmwwj"}],["path",{d:"m15 12 2 2",key:"k60wz4"}],["path",{d:"M17.902 6.599a8 8 0 0 0-.5-.5",key:"1hpval"}],["path",{d:"M2 14.5C2 19.47 6.48 22 12 22s10-2.53 10-7.5a10 10 0 0 0-1.3-4.83 4.5 4.5 0 1 0-7.05-5.5 8 8 0 0 0-3.3 0 4.5 4.5 0 1 0-7.04 5.5A10 10 0 0 0 2 14.5",key:"fsvxqb"}],["path",{d:"M6.099 6.599a8 8 0 0 1 .5-.5",key:"1mh6nx"}],["path",{d:"m9 12-2 2",key:"326nkw"}]]};U3.node;var bg=V(U3);var H3={name:"panel-right",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]};H3.node;var yg=V(H3);var V3={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};V3.node;var Xc=V(V3);var j3={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};j3.node;var wg=V(j3);var G3={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};G3.node;var Yc=V(G3);var q3={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};q3.node;var Ni=V(q3);var K3={name:"plug",size:24,node:[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]};K3.node;var Wc=V(K3);var X3={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};X3.node;var hr=V(X3);var Y3={name:"qr-code",size:24,node:[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]};Y3.node;var Sg=V(Y3);var W3={name:"rabbit",size:24,node:[["path",{d:"M13 16a3 3 0 0 1 2.24 5",key:"1epib5"}],["path",{d:"M18 12h.01",key:"yjnet6"}],["path",{d:"M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3",key:"ue9ozu"}],["path",{d:"M20 8.54V4a2 2 0 1 0-4 0v3",key:"49iql8"}],["path",{d:"M7.612 12.524a3 3 0 1 0-1.6 4.3",key:"1e33i0"}]]};W3.node;var kg=V(W3);var $3={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};$3.node;var xr=V($3);var Q3={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};Q3.node;var Cg=V(Q3);var Z3={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};Z3.node;var Ig=V(Z3);var J3={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};J3.node;var Lg=V(J3);var eO={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};eO.node;var la=V(eO);var tO={name:"settings-2",size:24,node:[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]};tO.node;var Tg=V(tO);var aO={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};aO.node;var Rg=V(aO);var rO={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};rO.node;var Ag=V(rO);var oO={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};oO.node;var Wo=V(oO);var nO={name:"shield-check",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]};nO.node;var $o=V(nO);var iO={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};iO.node;var Mg=V(iO);var sO={name:"smartphone",size:24,node:[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]};sO.node;var Pg=V(sO);var lO={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};lO.node;var eo=V(lO);var cO={name:"squirrel",size:24,node:[["path",{d:"M15.236 22a3 3 0 0 0-2.2-5",key:"21bitc"}],["path",{d:"M16 20a3 3 0 0 1 3-3h1a2 2 0 0 0 2-2v-2a4 4 0 0 0-4-4V4",key:"oh0fg0"}],["path",{d:"M18 13h.01",key:"9veqaj"}],["path",{d:"M18 6a4 4 0 0 0-4 4 7 7 0 0 0-7 7c0-5 4-5 4-10.5a4.5 4.5 0 1 0-9 0 2.5 2.5 0 0 0 5 0C7 10 3 11 3 17c0 2.8 2.2 5 5 5h10",key:"980v8a"}]]};cO.node;var Eg=V(cO);var uO={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};uO.node;var $c=V(uO);var dO={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};dO.node;var ll=V(dO);var fO={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};fO.node;var Ng=V(fO);var pO={name:"turtle",size:24,node:[["path",{d:"m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z",key:"1lbbv7"}],["path",{d:"M4.82 7.9 8 10",key:"m9wose"}],["path",{d:"M15.18 7.9 12 10",key:"p8dp2u"}],["path",{d:"M16.93 10H20a2 2 0 0 1 0 4H2",key:"12nsm7"}]]};pO.node;var Dg=V(pO);var mO={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};mO.node;var Og=V(mO);var gO={name:"unplug",size:24,node:[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]};gO.node;var _g=V(gO);var hO={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};hO.node;var zg=V(hO);var xO={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};xO.node;var Qc=V(xO);var vO={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};vO.node;var Bg=V(vO);var bO={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};bO.node;var Ft=V(bO);var Rb={cat:{label:"Cat",Icon:Bm,className:"bg-orange-500/15 text-orange-600 dark:text-orange-400"},dog:{label:"Dog",Icon:Xm,className:"bg-amber-500/15 text-amber-700 dark:text-amber-400"},rabbit:{label:"Rabbit",Icon:kg,className:"bg-pink-500/15 text-pink-600 dark:text-pink-400"},panda:{label:"Panda",Icon:bg,className:"bg-zinc-500/15 text-zinc-700 dark:text-zinc-300"},bird:{label:"Bird",Icon:_m,className:"bg-sky-500/15 text-sky-600 dark:text-sky-400"},fish:{label:"Fish",Icon:tg,className:"bg-cyan-500/15 text-cyan-700 dark:text-cyan-400"},turtle:{label:"Turtle",Icon:Dg,className:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400"},squirrel:{label:"Squirrel",Icon:Eg,className:"bg-yellow-500/15 text-yellow-700 dark:text-yellow-400"},rocket:{label:"Rocket",Icon:Cg,className:"bg-violet-500/15 text-violet-600 dark:text-violet-400"},bot:{label:"Robot",Icon:zm,className:"bg-blue-500/15 text-blue-600 dark:text-blue-400"},ghost:{label:"Ghost",Icon:ng,className:"bg-indigo-500/15 text-indigo-600 dark:text-indigo-400"},gamepad:{label:"Gamepad",Icon:og,className:"bg-fuchsia-500/15 text-fuchsia-600 dark:text-fuchsia-400"},flower:{label:"Flower",Icon:ag,className:"bg-rose-500/15 text-rose-600 dark:text-rose-400"},leaf:{label:"Leaf",Icon:dg,className:"bg-lime-500/15 text-lime-700 dark:text-lime-400"},mountain:{label:"Mountain",Icon:vg,className:"bg-teal-500/15 text-teal-700 dark:text-teal-400"},coffee:{label:"Coffee",Icon:Gm,className:"bg-stone-500/15 text-stone-700 dark:text-stone-300"}};class we extends Error{status;code;body;constructor(e,t,a,r){super(a);this.name="ApiError",this.status=e,this.code=t,this.body=r??null}}var EC=null;function yO(e){EC=e}function vr(e){if(e.startsWith("OC_LIST_MODELS_FAILED"))return"Failed to load the model list from the opencode server.";if(e.startsWith("OC_CREATE_SESSION_FAILED"))return"Failed to create the session on the opencode server.";if(e.startsWith("OC_DELETE_SESSION_FAILED"))return"Failed to delete the session on the opencode server.";if(e.startsWith("SKILLS_SEARCH_FAILED")||e.startsWith("SKILLS_AUDIT_FAILED"))return"Couldn't reach skills.sh. Check your connection and try again.";if(e.startsWith("SERVER_START_FAILED"))return"Failed to start the opencode server for this project.";switch(e){case"NAME_REQUIRED":return"Project name is required.";case"NAME_TAKEN":return"That project name is already in use.";case"PATH_TAKEN":return"That path is already used by another project.";case"PATH_OUTSIDE_SANDBOX":return"The path is outside the Sandbox root.";case"INVALID_PATH_CHARS":return"The path contains invalid characters.";case"PROJECT_NOT_FOUND":return"Project not found.";case"PROJECT_DIR_NOT_FOUND":return"The project directory was not found on the server.";case"PROJECT_HAS_SESSIONS":return"The project still has sessions. Delete them first.";case"UNSUPPORTED_AGENT_TYPE":return"This CLI_Agent type is not supported.";case"SESSION_NOT_FOUND":return"Session not found.";case"SESSION_NOT_RUNNING":return"The session is not running.";case"SESSION_ALREADY_RUNNING":return"The session is already running.";case"MODEL_NOT_FOUND":return"The model is not available on this project's opencode server.";case"INVALID_INSTRUCTIONS":return"Instructions must be text.";case"INSTRUCTIONS_TOO_LONG":return"Instructions are too long (max 20,000 characters).";case"INVALID_SKILL_QUERY":return"Type at least 2 characters to search.";case"INVALID_SKILL_ID":return"That skill identifier is not valid.";case"SKILLS_RATE_LIMITED":return"skills.sh is rate limiting requests. Wait a moment and try again.";case"SKILL_INSTALL_IN_PROGRESS":return"Another skill is being installed in this project. Try again when it finishes.";case"SKILL_INSTALL_FAILED":return"Failed to install the skill. See the output for details.";case"SKILL_INSTALL_CANCELLED":return"Installation was cancelled.";case"SKILL_INSTALL_TIMEOUT":return"Installation timed out and was stopped.";case"INSTALL_JOB_NOT_RUNNING":return"That installation has already finished.";case"INSTALL_JOB_LOST":return"The server restarted before the installation finished.";case"INSTALL_JOB_NOT_FOUND":return"That installation is no longer available.";case"AUTH_REQUIRED":return"Your session is locked. Unlock to continue.";case"AUTH_INVALID":return"Incorrect PIN or password.";case"CURRENT_SECRET_INVALID":return"Your current PIN or password is incorrect.";case"AUTH_RATE_LIMITED":return"Too many attempts. Wait a moment and try again.";case"AUTH_NOT_CONFIGURED":return"No lock has been set up yet.";case"WORKSPACE_PATH_REQUIRED":return"Enter a folder path.";case"WORKSPACE_PATH_INVALID":return"That path isn't valid.";case"WORKSPACE_PATH_NOT_ABSOLUTE":return"Use a full path, like ~/code or /srv/projects.";case"WORKSPACE_NOT_FOUND":return`That folder doesn't exist. Tick "Create the folder" to make it.`;case"WORKSPACE_PARENT_NOT_FOUND":return"The folder above it doesn't exist. Only the last folder can be created.";case"WORKSPACE_NOT_DIRECTORY":return"That path is a file, not a folder.";case"WORKSPACE_TOO_BROAD":return"That folder is too broad. Pick a dedicated folder, not your home or a system folder.";case"WORKSPACE_CONTAINS_APP_DATA":return"That folder overlaps KCG Code's own data. Pick a different folder.";case"WORKSPACE_NOT_WRITABLE":return"KCG Code can't write to that folder. Check its permissions.";case"WORKSPACE_PROJECTS_OUTSIDE":return"Some projects are outside the new folder. Remove them or pick a folder that contains them:";case"WORKSPACE_CREATE_FAILED":return"Couldn't create the folder.";case"WORKSPACE_CONFIG_UNREADABLE":case"WORKSPACE_CONFIG_WRITE_FAILED":return"Couldn't save the config file. Check its permissions.";case"PASSKEY_INVALID":return"That passkey wasn't accepted. Try again or use your PIN or password.";case"PASSKEY_NONE":return"No passkey is set up for this address yet.";case"PASSKEY_UNSUPPORTED_ORIGIN":return"Passkeys need a secure address (https or localhost).";case"PASSKEY_CHALLENGE_INVALID":return"The passkey request expired. Try again.";case"PASSKEY_VERIFY_FAILED":return"Couldn't verify the passkey. Try again.";case"PASSKEY_ALREADY_REGISTERED":return"This passkey is already added.";case"PASSKEY_LIMIT":return"You've reached the maximum of 20 passkeys. Remove one first.";case"PASSKEY_LOCK_REQUIRED":return"Set up a PIN or password before adding a passkey.";case"PASSKEY_NAME_INVALID":return"Passkey names must be 1–60 characters.";case"PASSKEY_NOT_FOUND":return"That passkey no longer exists.";case"PIN_DIGITS_ONLY":return"PIN can only contain numbers.";case"PIN_LENGTH":return"PIN must be 6–12 digits.";case"PIN_TOO_SIMPLE":return"That PIN is too easy to guess. Avoid repeated or sequential digits.";case"PASSWORD_TOO_SHORT":return"Password must be at least 8 characters.";case"PASSWORD_TOO_LONG":return"Password must be at most 128 characters.";case"NICKNAME_TOO_LONG":return"Nickname must be at most 40 characters.";case"NICKNAME_INVALID":return"Nickname contains invalid characters.";case"AVATAR_PRESET_INVALID":return"That avatar isn't available.";case"AVATAR_TOO_LARGE":return"The photo exceeds the 2 MB limit.";case"ORIGIN_FORBIDDEN":return"Request blocked: it didn't come from this app.";case"INVALID_JSON":return"The request JSON format is invalid.";case"UNSUPPORTED_IMAGE_MIME":return"Unsupported image format. Use PNG, JPEG, GIF, or WebP.";case"IMAGE_TOO_LARGE":return"The image exceeds the 20 MiB limit.";case"FILE_TOO_LARGE":return"The file exceeds the 20 MiB limit.";case"EMPTY_UPLOAD":return"The file is empty.";case"ATTACHMENT_NOT_FOUND":return"The attachment was not found (it may have been deleted).";case"TUNNEL_LOCK_REQUIRED":return"Set an app lock before turning on remote access.";case"TUNNEL_NOT_CONFIGURED":return"Remote access isn't configured. Set KCG_TUNNEL_API_URL and restart kcgcode.";case"TUNNEL_SIGNED_OUT":return"Connect this machine first.";case"TUNNEL_PAIRING_EXPIRED":return"The code expired before it was approved. Connect again.";case"TUNNEL_PAIRING_DENIED":return"The request was denied on the sign-in page.";case"TUNNEL_DEVICE_REVOKED":return"This machine was disconnected from your account. Connect again.";case"TUNNEL_RATE_LIMITED":return"Too many attempts. Wait a few minutes and try again.";case"TUNNEL_API_UNREACHABLE":return"Couldn't reach the remote access service. Check your connection.";case"TUNNEL_AUTH_FAILED":return"The tunnel server rejected this device. Try rotating the secret.";case"TUNNEL_PROXY_FAILED":return"The tunnel server couldn't publish your address. See the log for details.";case"FRPC_UNSUPPORTED_PLATFORM":return"Remote access isn't supported on this OS or CPU yet.";case"LHR_SSH_MISSING":return"localhost.run needs the ssh command, which wasn't found on this computer.";case"LHR_START_FAILED":return"Couldn't start the connection to localhost.run.";case"LHR_DENIED":return"localhost.run refused the connection. Try again in a moment.";case"INVALID_PROVIDER":return"Unknown remote access option.";case"FRPC_DOWNLOAD_FAILED":case"FRPC_NOT_FOUND":return"Couldn't install the tunnel client (frpc). See the log for details.";case"FRPC_CHECKSUM_MISMATCH":return"The downloaded tunnel client failed verification and was discarded.";case"FRPC_START_FAILED":return"Couldn't start the tunnel client. See the log for details.";default:return`Something went wrong (${e}).`}}async function le(e,t={}){let a=new Headers(t.headers),r=t.body instanceof FormData||t.body instanceof Blob||t.body instanceof URLSearchParams;if(t.body!=null&&!r&&!a.has("content-type"))a.set("content-type","application/json");let n=await fetch(e,{...t,headers:a});if(!n.ok){let s=`HTTP_${n.status}`,l=null;try{let c=await n.json();if(c&&typeof c==="object"){if(l=c,typeof l.error==="string"&&l.error!=="")s=l.error}}catch{}if(n.status===401&&s==="AUTH_REQUIRED")EC?.();throw new we(n.status,s,vr(s),l)}return n}async function wO(e,t){let a=new FormData;a.append("file",t);let r=await fetch(e,{method:"POST",body:a});if(!r.ok){let s=`HTTP_${r.status}`;try{let l=await r.json();if(typeof l.error==="string"&&l.error!=="")s=l.error}catch{}if(r.status===401&&s==="AUTH_REQUIRED")EC?.();throw new we(r.status,s,vr(s))}let n=await r.json();if(typeof n.upload?.id!=="string")throw new we(r.status,"INVALID_UPLOAD_RESPONSE","Invalid upload response.");return n.upload}function NC(e,t){return`/api/uploads/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}var Di={phase:"loading"},DC=new Set;function OC(e){Di=e;for(let t of DC)t()}async function Ut(){try{let e=await fetch("/api/auth/status",{cache:"no-store"});if(!e.ok)throw Error(String(e.status));let t=await e.json();if(Di.phase!=="ready"||JSON.stringify(Di.status)!==JSON.stringify(t))OC({phase:"ready",status:t});return t}catch{if(Di.phase==="loading")OC({phase:"error"});return null}}function Fg(){if(Di.phase==="ready"&&Di.status.protected&&Di.status.authenticated)OC({phase:"ready",status:{...Di.status,authenticated:!1}});Ut()}async function Ug(){try{await le("/api/auth/logout",{method:"POST"})}catch{}Fg()}yO(Fg);function aW(e){return DC.add(e),()=>DC.delete(e)}function SO(){return Di}function ff(){return Eo(aW,SO,SO)}function wo(e){return e==="pin"?"PIN":"password"}function kO(e){if(!e)return"";let t=e.trim().split(/\s+/).filter(Boolean);return(t.length>1?[t[0],t[t.length-1]]:[t[0]]).map((r)=>[...r??""][0]??"").join("").toUpperCase()}function CO(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(a=CO(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function Ab(){for(var e,t,a=0,r="",n=arguments.length;a<n;a++)(e=arguments[a])&&(t=CO(e))&&(r&&(r+=" "),r+=t);return r}var rW=(e,t)=>{let a=Array(e.length+t.length);for(let r=0;r<e.length;r++)a[r]=e[r];for(let r=0;r<t.length;r++)a[e.length+r]=t[r];return a},oW=(e,t)=>({classGroupId:e,validator:t}),MO=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a});var IO=[];var nW=(e)=>{let t=sW(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:(l)=>{if(l.startsWith("[")&&l.endsWith("]"))return iW(l);let c=l.split("-"),f=c[0]===""&&c.length>1?1:0;return PO(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){let f=r[l],m=a[l];if(f){if(m)return rW(m,f);return f}return m||IO}return a[l]||IO}}},PO=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;let n=e[t],s=a.nextPart.get(n);if(s){let m=PO(e,t+1,s);if(m)return m}let l=a.validators;if(l===null)return;let c=t===0?e.join("-"):e.slice(t).join("-"),f=l.length;for(let m=0;m<f;m++){let g=l[m];if(g.validator(c))return g.classGroupId}return},iW=(e)=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),a=t.indexOf(":"),r=t.slice(0,a);return r?"arbitrary.."+r:void 0})(),sW=(e)=>{let{theme:t,classGroups:a}=e;return lW(a,t)},lW=(e,t)=>{let a=MO();for(let r in e){let n=e[r];zC(n,a,r,t)}return a},zC=(e,t,a,r)=>{let n=e.length;for(let s=0;s<n;s++){let l=e[s];cW(l,t,a,r)}},cW=(e,t,a,r)=>{if(typeof e==="string"){uW(e,t,a);return}if(typeof e==="function"){dW(e,t,a,r);return}fW(e,t,a,r)},uW=(e,t,a)=>{let r=e===""?t:EO(t,e);r.classGroupId=a},dW=(e,t,a,r)=>{if(pW(e)){zC(e(r),t,a,r);return}if(t.validators===null)t.validators=[];t.validators.push(oW(a,e))},fW=(e,t,a,r)=>{let n=Object.entries(e),s=n.length;for(let l=0;l<s;l++){let[c,f]=n[l];zC(f,EO(t,c),a,r)}},EO=(e,t)=>{let a=e,r=t.split("-"),n=r.length;for(let s=0;s<n;s++){let l=r[s],c=a.nextPart.get(l);if(!c)c=MO(),a.nextPart.set(l,c);a=c}return a},pW=(e)=>("isThemeGetter"in e)&&e.isThemeGetter===!0,mW=(e)=>{if(e<1)return{get:()=>{return},set:()=>{}};let t=0,a=Object.create(null),r=Object.create(null),n=(s,l)=>{if(a[s]=l,t++,t>e)t=0,r=a,a=Object.create(null)};return{get(s){let l=a[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return n(s,l),l},set(s,l){if(s in a)a[s]=l;else n(s,l)}}};var gW=[],LO=(e,t,a,r,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:r,isExternal:n}),hW=(e)=>{let{prefix:t,experimentalParseClassName:a}=e,r=(n)=>{let s=[],l=0,c=0,f=0,m,g=n.length;for(let C=0;C<g;C++){let L=n[C];if(l===0&&c===0){if(L===":"){s.push(n.slice(f,C)),f=C+1;continue}if(L==="/"){m=C;continue}}if(L==="[")l++;else if(L==="]")l--;else if(L==="(")c++;else if(L===")")c--}let h=s.length===0?n:n.slice(f),x=h,v=!1;if(h.endsWith("!"))x=h.slice(0,-1),v=!0;else if(h.startsWith("!"))x=h.slice(1),v=!0;let w=m&&m>f?m-f:void 0;return LO(s,v,x,w)};if(t){let n=t+":",s=r;r=(l)=>l.startsWith(n)?s(l.slice(n.length)):LO(gW,!1,l,void 0,!0)}if(a){let n=r;r=(s)=>a({className:s,parseClassName:n})}return r},xW=(e)=>{let t=new Map;return e.orderSensitiveModifiers.forEach((a,r)=>{t.set(a,1e6+r)}),(a)=>{let r=[],n=[];for(let s=0;s<a.length;s++){let l=a[s],c=l[0]==="[",f=t.has(l);if(c||f){if(n.length>0)n.sort(),r.push(...n),n=[];r.push(l)}else n.push(l)}if(n.length>0)n.sort(),r.push(...n);return r}},vW=(e)=>({cache:mW(e.cacheSize),parseClassName:hW(e),sortModifiers:xW(e),postfixLookupClassGroupIds:bW(e),...nW(e)}),bW=(e)=>{let t=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let r=0;r<a.length;r++)t[a[r]]=!0;return t},yW=/\s+/,wW=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:n,sortModifiers:s,postfixLookupClassGroupIds:l}=t,c=[],f=e.trim().split(yW),m="";for(let g=f.length-1;g>=0;g-=1){let h=f[g],{isExternal:x,modifiers:v,hasImportantModifier:w,baseClassName:C,maybePostfixModifierPosition:L}=a(h);if(x){m=h+(m.length>0?" "+m:m);continue}let k=!!L,I;if(k){let P=C.substring(0,L);I=r(P);let O=I&&l[I]?r(C):void 0;if(O&&O!==I)I=O,k=!1}else I=r(C);if(!I){if(!k){m=h+(m.length>0?" "+m:m);continue}if(I=r(C),!I){m=h+(m.length>0?" "+m:m);continue}k=!1}let T=v.length===0?"":v.length===1?v[0]:s(v).join(":"),R=w?T+"!":T,E=R+I;if(c.indexOf(E)>-1)continue;c.push(E);let M=n(I,k);for(let P=0;P<M.length;++P){let O=M[P];c.push(R+O)}m=h+(m.length>0?" "+m:m)}return m},SW=(...e)=>{let t=0,a,r,n="";while(t<e.length)if(a=e[t++]){if(r=NO(a))n&&(n+=" "),n+=r}return n},NO=(e)=>{if(typeof e==="string")return e;let t,a="";for(let r=0;r<e.length;r++)if(e[r]){if(t=NO(e[r]))a&&(a+=" "),a+=t}return a},kW=(e,...t)=>{let a,r,n,s,l=(f)=>{let m=t.reduce((g,h)=>h(g),e());return a=vW(m),r=a.cache.get,n=a.cache.set,s=c,c(f)},c=(f)=>{let m=r(f);if(m)return m;let g=wW(f,a);return n(f,g),g};return s=l,(...f)=>s(SW(...f))},CW=[],ma=(e)=>{let t=(a)=>a[e]||CW;return t.isThemeGetter=!0,t},DO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,OO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,IW=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,LW=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TW=/\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$/,RW=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AW=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MW=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cl=(e)=>IW.test(e),et=(e)=>!!e&&!Number.isNaN(Number(e)),Un=(e)=>!!e&&Number.isInteger(Number(e)),_C=(e)=>e.endsWith("%")&&et(e.slice(0,-1)),Oi=(e)=>LW.test(e),_O=()=>!0,PW=(e)=>TW.test(e)&&!RW.test(e),BC=()=>!1,EW=(e)=>AW.test(e),NW=(e)=>MW.test(e),DW=(e)=>!Ae(e)&&!Me(e),OW=(e)=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),_W=(e)=>ul(e,FO,BC),Ae=(e)=>DO.test(e),Zc=(e)=>ul(e,UO,PW),TO=(e)=>ul(e,GW,et),zW=(e)=>ul(e,VO,_O),BW=(e)=>ul(e,HO,BC),RO=(e)=>ul(e,zO,BC),FW=(e)=>ul(e,BO,NW),Mb=(e)=>ul(e,jO,EW),Me=(e)=>OO.test(e),Hg=(e)=>Jc(e,UO),UW=(e)=>Jc(e,HO),AO=(e)=>Jc(e,zO),HW=(e)=>Jc(e,FO),VW=(e)=>Jc(e,BO),Pb=(e)=>Jc(e,jO,!0),jW=(e)=>Jc(e,VO,!0),ul=(e,t,a)=>{let r=DO.exec(e);if(r){if(r[1])return t(r[1]);return a(r[2])}return!1},Jc=(e,t,a=!1)=>{let r=OO.exec(e);if(r){if(r[1])return t(r[1]);return a}return!1},zO=(e)=>e==="position"||e==="percentage",BO=(e)=>e==="image"||e==="url",FO=(e)=>e==="length"||e==="size"||e==="bg-size",UO=(e)=>e==="length",GW=(e)=>e==="number",HO=(e)=>e==="family-name",VO=(e)=>e==="number"||e==="weight",jO=(e)=>e==="shadow";var qW=()=>{let e=ma("color"),t=ma("font"),a=ma("text"),r=ma("font-weight"),n=ma("tracking"),s=ma("leading"),l=ma("breakpoint"),c=ma("container"),f=ma("spacing"),m=ma("radius"),g=ma("shadow"),h=ma("inset-shadow"),x=ma("text-shadow"),v=ma("drop-shadow"),w=ma("blur"),C=ma("perspective"),L=ma("aspect"),k=ma("ease"),I=ma("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...R(),Me,Ae],M=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],O=()=>[Me,Ae,f],F=()=>[cl,"full","auto",...O()],z=()=>[Un,"none","subgrid",Me,Ae],Y=()=>["auto",{span:["full",Un,Me,Ae]},Un,Me,Ae],q=()=>[Un,"auto",Me,Ae],G=()=>["auto","min","max","fr",Me,Ae],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...O()],X=()=>[cl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],Z=()=>[cl,"screen","full","dvw","lvw","svw","min","max","fit",...O()],te=()=>[cl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],D=()=>[e,Me,Ae],Te=()=>[...R(),AO,RO,{position:[Me,Ae]}],Le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",HW,_W,{size:[Me,Ae]}],me=()=>[_C,Hg,Zc],Ce=()=>["","none","full",m,Me,Ae],ge=()=>["",et,Hg,Zc],He=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[et,_C,AO,RO],ue=()=>["","none",w,Me,Ae],K=()=>["none",et,Me,Ae],ee=()=>["none",et,Me,Ae],W=()=>[et,Me,Ae],ve=()=>[cl,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oi],breakpoint:[Oi],color:[_O],container:[Oi],"drop-shadow":[Oi],ease:["in","out","in-out"],font:[DW],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oi],shadow:[Oi],spacing:["px",et],text:[Oi],"text-shadow":[Oi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cl,Ae,Me,L]}],container:["container"],"container-type":[{"@container":["","normal","size",Me,Ae]}],"container-named":[OW],columns:[{columns:[et,Ae,Me,c]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Un,"auto",Me,Ae]}],basis:[{basis:[cl,"full","auto",c,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,cl,"auto","initial","none",Ae]}],grow:[{grow:["",et,Me,Ae]}],shrink:[{shrink:["",et,Me,Ae]}],order:[{order:[Un,"first","last","none",Me,Ae]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mbs:[{mbs:J()}],mbe:[{mbe:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[c,"screen",...X()]}],"min-w":[{"min-w":[c,"screen","none",...X()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",a,Hg,Zc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,jW,zW]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_C,Ae]}],"font-family":[{font:[UW,BW,t]}],"font-features":[{"font-features":[Ae]}],"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:[n,Me,Ae]}],"line-clamp":[{"line-clamp":[et,"none",Me,TO]}],leading:[{leading:[s,...O()]}],"list-image":[{"list-image":["none",Me,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...He(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",Me,Zc]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[et,"auto",Me,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"tab-size":[{tab:[Un,Me,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Te()}],"bg-repeat":[{bg:Le()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Un,Me,Ae],radial:["",Me,Ae],conic:[Un,Me,Ae]},VW,FW]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],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:ge()}],"border-w-x":[{"border-x":ge()}],"border-w-y":[{"border-y":ge()}],"border-w-s":[{"border-s":ge()}],"border-w-e":[{"border-e":ge()}],"border-w-bs":[{"border-bs":ge()}],"border-w-be":[{"border-be":ge()}],"border-w-t":[{"border-t":ge()}],"border-w-r":[{"border-r":ge()}],"border-w-b":[{"border-b":ge()}],"border-w-l":[{"border-l":ge()}],"divide-x":[{"divide-x":ge()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ge()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...He(),"hidden","none"]}],"divide-style":[{divide:[...He(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...He(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,Me,Ae]}],"outline-w":[{outline:["",et,Hg,Zc]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",g,Pb,Mb]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",h,Pb,Mb]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[et,Zc]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":ge()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",x,Pb,Mb]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[et,Me,Ae]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[et]}],"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":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"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":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"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":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"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":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"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":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"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":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"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":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Me,Ae]}],"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":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[et]}],"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":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Te()}],"mask-repeat":[{mask:Le()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Ae]}],filter:[{filter:["","none",Me,Ae]}],blur:[{blur:ue()}],brightness:[{brightness:[et,Me,Ae]}],contrast:[{contrast:[et,Me,Ae]}],"drop-shadow":[{"drop-shadow":["","none",v,Pb,Mb]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",et,Me,Ae]}],"hue-rotate":[{"hue-rotate":[et,Me,Ae]}],invert:[{invert:["",et,Me,Ae]}],saturate:[{saturate:[et,Me,Ae]}],sepia:[{sepia:["",et,Me,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Ae]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[et,Me,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[et,Me,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,Me,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,Me,Ae]}],"backdrop-invert":[{"backdrop-invert":["",et,Me,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[et,Me,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[et,Me,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",et,Me,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",Me,Ae]}],ease:[{ease:["linear","initial",k,Me,Ae]}],delay:[{delay:[et,Me,Ae]}],animate:[{animate:["none",I,Me,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Me,Ae]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:ee()}],"scale-x":[{"scale-x":ee()}],"scale-y":[{"scale-y":ee()}],"scale-z":[{"scale-z":ee()}],"scale-3d":["scale-3d"],skew:[{skew:W()}],"skew-x":[{"skew-x":W()}],"skew-y":[{"skew-y":W()}],transform:[{transform:[Me,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],zoom:[{zoom:[Un,Me,Ae]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",Me,Ae]}],"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":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Me,Ae]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[et,Hg,Zc,TO]}],stroke:[{stroke:["none",...D()]}],"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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var GO=kW(qW);function N(...e){return GO(Ab(e))}function dl({nickname:e,avatarUrl:t,avatarPreset:a=null,className:r,textClassName:n}){let[s,l]=A(null),c=t!==null&&s!==t,f=!c&&a?Rb[a]:null,m=kO(e);return d("span",{className:N("relative flex shrink-0 items-center justify-center overflow-hidden rounded-full",f?f.className:"bg-primary/10 text-primary",r),children:c?d("img",{src:t,alt:"",className:"size-full object-cover",onError:()=>l(t)}):f?d(f.Icon,{className:"size-[55%]",strokeWidth:1.75,"aria-hidden":!0}):m?d("span",{className:N("font-semibold tracking-tight select-none",n),children:m}):d(Qc,{className:"size-1/2","aria-hidden":!0})})}function fe({className:e,...t}){return d(_n,{role:"status","aria-label":"Loading",className:N("size-4 animate-spin",e),...t})}function qO(e){if(e.ctrlKey||e.metaKey||e.altKey)return null;if(/^[0-9]$/.test(e.key))return{type:"digit",digit:e.key};let t=/^Numpad([0-9])$/.exec(e.code??"");if(t?.[1])return{type:"digit",digit:t[1]};if(e.key==="Backspace"||e.key==="Delete")return{type:"backspace"};if(e.key==="Enter")return{type:"submit"};if(e.key==="Escape")return{type:"clear"};return null}function Eb(e,t){switch(t.type){case"digit":return e.length>=12?e:e+t.digit;case"backspace":return e.slice(0,-1);case"clear":return"";case"submit":return e}}function KO(e,t){return(t+e.replace(/\D/g,"")).slice(0,12)}function So(e){let t=new Uint8Array(e),a="";for(let n of t)a+=String.fromCharCode(n);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eu(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=(4-t.length%4)%4,r=t.padEnd(t.length+a,"="),n=atob(r),s=new ArrayBuffer(n.length),l=new Uint8Array(s);for(let c=0;c<n.length;c++)l[c]=n.charCodeAt(c);return s}function Hn(){return KW.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==="function")}var KW={stubThis:(e)=>e};function Nb(e){let{id:t}=e;return{...e,id:eu(t),transports:e.transports,type:e.type}}function Vg(e){return e==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}class ea extends Error{constructor({message:e,code:t,cause:a,name:r}){super(e,{cause:a});Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??a.name,this.code=t}}function XO({error:e,options:t}){let{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ea({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(a.authenticatorSelection?.requireResidentKey===!0)return new ea({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if(t.mediation==="conditional"&&a.authenticatorSelection?.userVerification==="required")return new ea({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if(a.authenticatorSelection?.userVerification==="required")return new ea({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if(e.name==="InvalidStateError")return new ea({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if(e.name==="NotAllowedError")return new ea({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if(e.name==="NotSupportedError"){if(a.pubKeyCredParams.filter((n)=>n.type==="public-key").length===0)return new ea({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e});return new ea({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e})}else if(e.name==="SecurityError"){let r=globalThis.location.hostname;if(!Vg(r))return new ea({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});else if(a.rp.id!==r)return new ea({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new ea({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new ea({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return e}class YO{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let t=Error("Cancelling existing WebAuthn API call for new one");t.name="AbortError",this.controller.abort(t)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}var Db=new YO;var XW=["cross-platform","platform"];function Ob(e){if(!e)return;if(XW.indexOf(e)<0)return;return e}async function WO(e){if(!e.optionsJSON&&e.challenge)console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e};let{optionsJSON:t,useAutoRegister:a=!1}=e;if(!Hn())throw Error("WebAuthn is not supported in this browser");let r={...t,challenge:eu(t.challenge),user:{...t.user,id:eu(t.user.id)},excludeCredentials:t.excludeCredentials?.map(Nb)},n={};if(a)n.mediation="conditional";n.publicKey=r,n.signal=Db.createNewAbortSignal();let s;try{s=await navigator.credentials.create(n)}catch(w){throw XO({error:w,options:n})}if(!s)throw Error("Registration was not completed");let{id:l,rawId:c,response:f,type:m}=s,g=void 0;if(typeof f.getTransports==="function")g=f.getTransports();let h=void 0;if(typeof f.getPublicKeyAlgorithm==="function")try{h=f.getPublicKeyAlgorithm()}catch(w){FC("getPublicKeyAlgorithm()",w)}let x=void 0;if(typeof f.getPublicKey==="function")try{let w=f.getPublicKey();if(w!==null)x=So(w)}catch(w){FC("getPublicKey()",w)}let v;if(typeof f.getAuthenticatorData==="function")try{v=So(f.getAuthenticatorData())}catch(w){FC("getAuthenticatorData()",w)}return{id:l,rawId:So(c),response:{attestationObject:So(f.attestationObject),clientDataJSON:So(f.clientDataJSON),transports:g,publicKeyAlgorithm:h,publicKey:x,authenticatorData:v},type:m,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:Ob(s.authenticatorAttachment)}}function FC(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
|
|
20
|
+
`,t)}function $O(){if(!Hn())return UC.stubThis(new Promise((t)=>t(!1)));let e=globalThis.PublicKeyCredential;if(e?.isConditionalMediationAvailable===void 0)return UC.stubThis(new Promise((t)=>t(!1)));return UC.stubThis(e.isConditionalMediationAvailable())}var UC={stubThis:(e)=>e};function QO({error:e,options:t}){let{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ea({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="NotAllowedError")return new ea({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if(e.name==="SecurityError"){let r=globalThis.location.hostname;if(!Vg(r))return new ea({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});else if(a.rpId!==r)return new ea({message:`The RP ID "${a.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if(e.name==="UnknownError")return new ea({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return e}async function ZO(e){if(!e.optionsJSON&&e.challenge)console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e};let{optionsJSON:t,useBrowserAutofill:a=!1,verifyBrowserAutofillInput:r=!0}=e;if(!Hn())throw Error("WebAuthn is not supported in this browser");let n;if(t.allowCredentials?.length!==0)n=t.allowCredentials?.map(Nb);let s={...t,challenge:eu(t.challenge),allowCredentials:n},l={};if(a){if(!await $O())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');l.mediation="conditional",s.allowCredentials=[]}l.publicKey=s,l.signal=Db.createNewAbortSignal();let c;try{c=await navigator.credentials.get(l)}catch(v){throw QO({error:v,options:l})}if(!c)throw Error("Authentication was not completed");let{id:f,rawId:m,response:g,type:h}=c,x=void 0;if(g.userHandle)x=So(g.userHandle);return{id:f,rawId:So(m),response:{authenticatorData:So(g.authenticatorData),clientDataJSON:So(g.clientDataJSON),signature:So(g.signature),userHandle:x},type:h,clientExtensionResults:c.getClientExtensionResults(),authenticatorAttachment:Ob(c.authenticatorAttachment)}}function _b(){if(typeof window>"u")return!1;return window.isSecureContext&&Hn()}function JO(e){if(e instanceof we)return{ok:!1,cancelled:!1,message:e.message,code:e.code};let t=e instanceof Error?e.name:"";if(t==="NotAllowedError"||t==="AbortError")return{ok:!1,cancelled:!0};if(t==="InvalidStateError")return{ok:!1,cancelled:!1,message:"This device already has a passkey here."};if(t==="SecurityError")return{ok:!1,cancelled:!1,message:"Passkeys aren't allowed on this address. Use https or localhost."};return{ok:!1,cancelled:!1,message:"Something went wrong with the passkey."}}async function e_(){return await(await le("/api/auth/passkeys/availability")).json()}async function t_(){return(await(await le("/api/auth/passkeys")).json()).passkeys}async function a_(e){try{let t=await le("/api/auth/passkeys/register/options",{method:"POST",body:JSON.stringify({current:e})}),{challengeId:a,options:r}=await t.json(),n=await WO({optionsJSON:r});return{ok:!0,data:(await(await le("/api/auth/passkeys/register",{method:"POST",body:JSON.stringify({challengeId:a,response:n})})).json()).passkey}}catch(t){return JO(t)}}async function r_(){try{let e=await le("/api/auth/passkeys/login/options",{method:"POST"}),{challengeId:t,options:a}=await e.json(),r=await ZO({optionsJSON:a});return await le("/api/auth/passkeys/login",{method:"POST",body:JSON.stringify({challengeId:t,response:r})}),{ok:!0,data:null}}catch(e){return JO(e)}}async function o_(e,t){return(await(await le(`/api/auth/passkeys/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({name:t})})).json()).passkey}async function n_(e){await le(`/api/auth/passkeys/${encodeURIComponent(e)}`,{method:"DELETE"})}function s_({status:e}){let t=e.lockKind??"password",[a,r]=A(""),[n,s]=A(!1),[l,c]=A(null),[f,m]=A(!1),[g,h]=A(()=>e.retryAfterSec>0?Date.now()+e.retryAfterSec*1000:0),[x,v]=A(()=>Date.now()),[w,C]=A(!1),[L,k]=A("secret"),[I,T]=A(!1);U(()=>{if(!_b())return;let G=!1;return e_().then((Q)=>{if(G||!Q.supported||Q.count===0)return;C(!0),k("passkey")}).catch(()=>{}),()=>{G=!0}},[]),U(()=>{let G=setInterval(()=>v(Date.now()),1000);return()=>clearInterval(G)},[]);let R=Math.max(0,Math.ceil((g-x)/1000)),E=R>0,M=j((G)=>{c(G),r(""),m(!0),setTimeout(()=>m(!1),450),navigator.vibrate?.(120)},[]),P=j(async(G)=>{if(n||E||G==="")return;s(!0),c(null);try{let Q=await fetch("/api/auth/login",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({secret:G})});if(Q.ok){r(""),await Ut();return}let re=await Q.json().catch(()=>({}));if(Q.status===429){let J=re.retryAfterSec??Number(Q.headers.get("retry-after")??30);h(Date.now()+J*1000),M("Too many attempts.")}else if(re.error==="AUTH_NOT_CONFIGURED")await Ut();else M(t==="pin"?"Wrong PIN. Try again.":"Wrong password. Try again.")}catch{c("Can't reach KCG Code. Check your connection.")}finally{s(!1)}},[n,E,t,M]),O=j(async()=>{if(I||E)return;T(!0),c(null);let G=await r_();if(G.ok){await Ut(),T(!1);return}if(T(!1),G.cancelled)return;if(G.code==="AUTH_RATE_LIMITED"){try{let Q=await(await fetch("/api/auth/status")).json();h(Date.now()+Math.max(1,Q.retryAfterSec)*1000)}catch{h(Date.now()+30000)}M("Too many attempts.");return}M(G.message)},[I,E,M]),F=new Date(x).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),z=new Date(x).toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long"}),Y=e.profile.nickname,q=E?`Too many attempts. Try again in ${R}s.`:l;return d("div",{role:"dialog","aria-modal":"true","aria-labelledby":"lock-title",className:"fixed inset-0 z-[100] flex flex-col items-center overflow-y-auto bg-background",children:S("div",{className:N("relative flex w-full max-w-sm flex-1 flex-col items-center px-6","pt-[max(2.5rem,env(safe-area-inset-top))] pb-[max(1.5rem,env(safe-area-inset-bottom))]","md:my-auto md:max-w-4xl md:flex-none md:grid md:grid-cols-2 md:items-center md:gap-16 md:px-10 md:py-10"),children:[S("div",{className:"mt-auto flex flex-col items-center text-center md:mt-0 md:items-start md:text-left",children:[S("div",{className:"flex flex-col items-center gap-1 md:items-start",children:[d("p",{className:"text-5xl font-light tabular-nums tracking-tight md:text-7xl",children:F}),d("p",{className:"text-sm text-muted-foreground md:text-base",children:z})]}),S("div",{className:"mt-8 flex flex-col items-center gap-3 md:mt-12 md:flex-row md:gap-4",children:[d(dl,{nickname:Y,avatarUrl:e.profile.avatarUrl,avatarPreset:e.profile.avatarPreset,className:"size-20 shadow-lg ring-4 ring-background md:size-16",textClassName:"text-2xl md:text-xl"}),S("div",{className:"flex flex-col items-center gap-0.5 md:items-start",children:[d("h1",{id:"lock-title",className:"text-xl font-semibold tracking-tight",children:Y?`Welcome back, ${Y}`:"KCG Code is locked"}),d("p",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:L==="passkey"?S(se,{children:[d(rr,{className:"size-3.5","aria-hidden":!0}),"Use your passkey to unlock"]}):S(se,{children:[d(Ka,{className:"size-3.5","aria-hidden":!0}),t==="pin"?"Enter your PIN to unlock":"Enter your password to unlock"]})})]})]}),d(i_,{className:"mt-12 hidden md:block"})]}),S("div",{className:N("mt-7 w-full md:mt-0 md:rounded-3xl md:border md:bg-card/50 md:px-8 md:py-9 md:shadow-sm",t==="password"&&"md:py-10",f&&"animate-[lock-shake_0.45s]"),children:[L==="passkey"?d(YW,{busy:I,disabled:I||E,message:q,secretLabel:t==="pin"?"PIN":"password",onUnlock:()=>void O(),onUseSecret:()=>{c(null),k("secret")}}):t==="pin"?d(WW,{value:a,onChange:(G)=>{c(null),r(G)},onSubmit:()=>void P(a),disabled:n||E,busy:n,error:f,message:q}):d(ZW,{value:a,onChange:(G)=>{c(null),r(G)},onSubmit:()=>void P(a),disabled:n||E,busy:n,message:q,invalid:Boolean(l)}),L==="secret"&&w&&d("div",{className:"mt-5 flex justify-center",children:S("button",{type:"button",onClick:()=>{c(null),r(""),k("passkey")},className:"inline-flex h-10 items-center gap-2 rounded-full px-4 text-sm font-medium text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",children:[d(rr,{className:"size-4","aria-hidden":!0}),"Use passkey instead"]})})]}),d(i_,{className:"mt-auto pt-8 text-center md:hidden"})]})})}function i_({className:e}){return S("p",{className:N("text-xs text-muted-foreground/80",e),children:["Forgot it? Run ",d("code",{className:"font-mono",children:"kcgcode reset-lock"})," on the host machine."]})}function YW({busy:e,disabled:t,message:a,secretLabel:r,onUnlock:n,onUseSecret:s}){let l=B(null);return U(()=>{l.current?.focus({preventScroll:!0})},[]),S("div",{className:"flex flex-col items-center gap-5 py-2",children:[S("button",{ref:l,type:"button",onClick:n,disabled:t,"aria-busy":e,"aria-describedby":"lock-passkey-status",className:"group relative flex size-28 items-center justify-center rounded-full outline-none disabled:cursor-not-allowed [@media(min-height:760px)]:size-32",children:[d("span",{"aria-hidden":!0,className:N("absolute inset-0 rounded-full border-2 border-primary/25 transition-colors",e&&"animate-ping border-primary/40 motion-reduce:animate-none")}),d("span",{"aria-hidden":!0,className:N("flex size-full items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg transition-[transform,opacity] duration-150","group-hover:scale-[1.03] group-active:scale-95 group-focus-visible:ring-[4px] group-focus-visible:ring-ring/50 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-background",t&&!e&&"opacity-40"),children:e?d(fe,{className:"size-9"}):d(rr,{className:"size-12",strokeWidth:1.6})}),d("span",{className:"sr-only",children:e?"Waiting for your passkey":"Unlock with passkey"})]}),S("div",{className:"flex flex-col items-center gap-1 text-center",children:[d("p",{className:"text-[15px] font-medium",children:e?"Confirm on your device…":"Unlock with passkey"}),d("p",{id:"lock-passkey-status","aria-live":"polite",className:N("min-h-5 max-w-xs text-sm",a?"text-destructive":"text-muted-foreground"),children:a??(e?"Use your fingerprint, face, or screen lock.":"Tap to continue")})]}),S("button",{type:"button",onClick:s,disabled:e,className:"inline-flex h-10 items-center gap-2 rounded-full px-4 text-sm font-medium text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-40",children:[d(df,{className:"size-4","aria-hidden":!0}),"Use ",r," instead"]})]})}function WW({value:e,onChange:t,onSubmit:a,disabled:r,busy:n,error:s,message:l}){let c=B({value:e,disabled:r,onChange:t,onSubmit:a});c.current={value:e,disabled:r,onChange:t,onSubmit:a},U(()=>{let m=(h)=>{let x=h.target;if(x&&x.tagName==="INPUT"&&x.dataset.pinInput===void 0)return;let v=qO(h);if(!v)return;if(v.type==="submit"&&x?.tagName==="BUTTON")return;h.preventDefault();let w=c.current;if(w.disabled)return;if(v.type==="submit"){w.onSubmit();return}w.onChange(Eb(w.value,v))},g=(h)=>{let x=h.clipboardData?.getData("text")??"";if(!/\d/.test(x))return;h.preventDefault();let v=c.current;if(!v.disabled)v.onChange(KO(x,v.value))};return window.addEventListener("keydown",m),window.addEventListener("paste",g),()=>{window.removeEventListener("keydown",m),window.removeEventListener("paste",g)}},[]);let f=(m)=>{if(r)return;t(Eb(e,{type:"digit",digit:m}))};return S("div",{className:"flex flex-col items-center gap-4",children:[d("p",{className:"sr-only","aria-live":"polite",children:e.length===0?"No digits entered":`${e.length} digits entered`}),d($W,{length:e.length,error:s}),d("p",{"aria-live":"polite",className:N("min-h-5 text-center text-sm",l?"text-destructive":"text-muted-foreground"),children:l??""}),d(QW,{disabled:r,canSubmit:e.length>0,busy:n,onDigit:f,onBackspace:()=>t(Eb(e,{type:"backspace"})),onSubmit:a}),S("p",{className:"hidden items-center gap-1.5 text-xs text-muted-foreground pointer-fine:flex",children:[d(df,{className:"size-3.5","aria-hidden":!0}),"Type your PIN, then press",S("kbd",{className:"inline-flex items-center gap-0.5 rounded border bg-muted px-1.5 py-px font-mono text-[11px]",children:[d(qm,{className:"size-3","aria-hidden":!0}),"Enter"]})]})]})}function $W({length:e,error:t}){let a=Math.max(6,e);return d("div",{className:"flex h-4 items-center gap-3","aria-hidden":!0,children:Array.from({length:a},(r,n)=>d("span",{className:N("size-3 rounded-full border-2 transition-all duration-150",n<e?t?"scale-110 border-destructive bg-destructive":"scale-110 border-foreground bg-foreground":"border-muted-foreground/40")},n))})}function QW({disabled:e,canSubmit:t,busy:a,onDigit:r,onBackspace:n,onSubmit:s}){return S("fieldset",{className:"grid grid-cols-3 gap-x-6 gap-y-3 border-0 p-0 [@media(min-height:760px)]:gap-y-4","aria-label":"PIN keypad",children:[["1","2","3","4","5","6","7","8","9"].map((f)=>d("button",{type:"button",tabIndex:-1,disabled:e,onClick:()=>r(f),className:N("flex size-16 items-center justify-center rounded-full text-2xl [@media(min-height:760px)]:size-[4.5rem] font-medium tabular-nums transition-[background-color,transform] duration-100 select-none outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-40","bg-muted/70 hover:bg-muted active:scale-95 active:bg-accent"),children:f},f)),d("button",{type:"button",tabIndex:-1,disabled:e,onClick:n,"aria-label":"Delete last digit",className:N("flex size-16 items-center justify-center rounded-full text-2xl [@media(min-height:760px)]:size-[4.5rem] font-medium tabular-nums transition-[background-color,transform] duration-100 select-none outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-40","text-muted-foreground hover:text-foreground active:scale-95"),children:d(Km,{className:"size-6"})}),d("button",{type:"button",tabIndex:-1,disabled:e,onClick:()=>r("0"),className:N("flex size-16 items-center justify-center rounded-full text-2xl [@media(min-height:760px)]:size-[4.5rem] font-medium tabular-nums transition-[background-color,transform] duration-100 select-none outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-40","bg-muted/70 hover:bg-muted active:scale-95 active:bg-accent"),children:"0"}),d("button",{type:"button",disabled:e||!t,onClick:s,"aria-label":"Unlock",className:N("flex size-16 items-center justify-center rounded-full text-2xl [@media(min-height:760px)]:size-[4.5rem] font-medium tabular-nums transition-[background-color,transform] duration-100 select-none outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-40","bg-primary text-primary-foreground hover:bg-primary/90 active:scale-95"),children:a?d(fe,{className:"size-6"}):d(Or,{className:"size-6"})})]})}function ZW({value:e,onChange:t,onSubmit:a,disabled:r,busy:n,message:s,invalid:l}){let[c,f]=A(!1),[m,g]=A(!1),h=B(null);U(()=>{if(!r)h.current?.focus()},[r]);let x=(v)=>{g(v.getModifierState?.("CapsLock")??!1)};return S("form",{onSubmit:(v)=>{v.preventDefault(),a()},className:"flex flex-col gap-3",children:[S("div",{className:N("group relative flex items-center rounded-2xl border bg-card shadow-sm transition-[border-color,box-shadow]","focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/40",l&&"border-destructive/60 focus-within:border-destructive focus-within:ring-destructive/20",r&&"opacity-60"),children:[d(Ka,{className:"pointer-events-none absolute left-4 size-4 text-muted-foreground transition-colors group-focus-within:text-foreground","aria-hidden":!0}),d("input",{ref:h,type:c?"text":"password",autoComplete:"current-password",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,"aria-label":"Password","aria-invalid":l||void 0,"aria-describedby":"lock-password-status",placeholder:"Password",value:e,disabled:r,onChange:(v)=>t(v.target.value),onKeyDown:x,onKeyUp:x,onMouseDown:x,onBlur:()=>g(!1),className:"h-14 w-full min-w-0 rounded-2xl bg-transparent pr-12 pl-11 text-base outline-none placeholder:text-muted-foreground/70 disabled:cursor-not-allowed"}),d("button",{type:"button",onClick:()=>{f((v)=>!v),h.current?.focus()},"aria-label":c?"Hide password":"Show password","aria-pressed":c,disabled:r,className:"absolute right-2 flex size-10 items-center justify-center rounded-xl text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",children:c?d(Wm,{className:"size-[18px]"}):d($m,{className:"size-[18px]"})})]}),d("div",{id:"lock-password-status","aria-live":"polite",className:"min-h-5 px-1 text-sm",children:s?d("p",{className:"text-destructive",children:s}):m?S("p",{className:"flex items-center gap-1.5 text-amber-700 dark:text-amber-400",children:[d(qa,{className:"size-3.5","aria-hidden":!0}),"Caps Lock is on"]}):null}),d("button",{type:"submit",disabled:r||e==="",className:"flex h-12 items-center justify-center gap-2 rounded-2xl bg-primary text-[15px] font-medium text-primary-foreground shadow-sm transition-[opacity,transform] outline-none hover:bg-primary/90 focus-visible:ring-[3px] focus-visible:ring-ring/50 active:scale-[0.98] disabled:opacity-40",children:n?S(se,{children:[d(fe,{className:"size-4"}),"Unlocking…"]}):S(se,{children:["Unlock",d(Or,{className:"size-4","aria-hidden":!0})]})})]})}var l_=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,c_=Ab,Ca=(e,t)=>(a)=>{var r;if((t===null||t===void 0?void 0:t.variants)==null)return c_(e,a===null||a===void 0?void 0:a.class,a===null||a===void 0?void 0:a.className);let{variants:n,defaultVariants:s}=t,l=Object.keys(n).map((m)=>{let g=a===null||a===void 0?void 0:a[m],h=s===null||s===void 0?void 0:s[m];if(g===null)return null;let x=l_(g)||l_(h);return n[m][x]}),c=a&&Object.entries(a).reduce((m,g)=>{let[h,x]=g;if(x===void 0)return m;return m[h]=x,m},{}),f=t===null||t===void 0?void 0:(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,g)=>{let{class:h,className:x,...v}=g;return Object.entries(v).every((w)=>{let[C,L]=w;return Array.isArray(L)?L.includes({...s,...c}[C]):{...s,...c}[C]===L})?[...m,h,x]:m},[]);return c_(e,l,f,a===null||a===void 0?void 0:a.class,a===null||a===void 0?void 0:a.className)};var JW=Object.defineProperty,ko=(e,t)=>JW(e,"name",{value:t,configurable:!0});function e$(e,t){let a=ht(t);a.displayName=e+"Context";let r=ko((s)=>{let{children:l,...c}=s,f=de(()=>c,Object.values(c));return d(a.Provider,{value:f,children:l})},"Provider");r.displayName=e+"Provider";function n(s,l={}){let{optional:c=!1}=l,f=We(a);if(f)return f;if(t!==void 0)return t;if(c)return;throw Error(`\`${s}\` must be used within \`${e}\``)}return ko(n,"useContext"),[r,n]}ko(e$,"createContext");function Tt(e,t=[]){let a=[];function r(s,l){let c=ht(l);c.displayName=s+"Context";let f=a.length;a=[...a,l];let m=ko((h)=>{let{scope:x,children:v,...w}=h,C=x?.[e]?.[f]||c,L=de(()=>w,Object.values(w));return d(C.Provider,{value:L,children:v})},"Provider");m.displayName=s+"Provider";function g(h,x,v={}){let{optional:w=!1}=v,C=x?.[e]?.[f]||c,L=We(C);if(L)return L;if(l!==void 0)return l;if(w)return;throw Error(`\`${h}\` must be used within \`${s}\``)}return ko(g,"useContext"),[m,g]}ko(r,"createContext");let n=ko(()=>{let s=a.map((l)=>ht(l));return ko(function(c){let f=c?.[e]||s;return de(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])},"useScope")},"createScope");return n.scopeName=e,[r,u_(n,...t)]}ko(Tt,"createContextScope");function u_(...e){let t=e[0];if(e.length===1)return t;let a=ko(()=>{let r=e.map((n)=>({useScope:n(),scopeName:n.scopeName}));return ko(function(s){let l=r.reduce((c,{useScope:f,scopeName:m})=>{let h=f(s)[`__scope${m}`];return{...c,...h}},{});return de(()=>({[`__scope${t.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return a.scopeName=t.scopeName,a}ko(u_,"composeContextScopes");var t$=Object.defineProperty,VC=(e,t)=>t$(e,"name",{value:t,configurable:!0});function HC(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}VC(HC,"setRef");function d_(...e){return(t)=>{let a=!1,r=e.map((n)=>{let s=HC(n,t);if(!a&&typeof s=="function")a=!0;return s});if(a)return()=>{for(let n=0;n<r.length;n++){let s=r[n];if(typeof s=="function")s();else HC(e[n],null)}}}}VC(d_,"composeRefs");function Oe(...e){return j(d_(...e),e)}VC(Oe,"useComposedRefs");var a$=Object.defineProperty,pf=(e,t)=>a$(e,"name",{value:t,configurable:!0}),f_=!!(typeof window<"u"&&window.document&&window.document.createElement);function ke(e,t,{checkForDefaultPrevented:a=!0}={}){return pf(function(n){if(e?.(n),a===!1||!n||!n.defaultPrevented)return t?.(n)},"handleEvent")}pf(ke,"composeEventHandlers");function r$(e){if(!f_)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}pf(r$,"getOwnerWindow");function jC(e){if(!f_)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}pf(jC,"getOwnerDocument");function p_(e,t=!1){let{activeElement:a}=jC(e);if(!a?.nodeName)return null;if(m_(a)&&a.contentDocument)return p_(a.contentDocument.body,t);if(t){let r=a.getAttribute("aria-activedescendant");if(r){let n=jC(a).getElementById(r);if(n)return n}}return a}pf(p_,"getActiveElement");function m_(e){return e.tagName==="IFRAME"}pf(m_,"isFrame");var nt=globalThis?.document?Vt:()=>{};var o$=Object.defineProperty,n$=(e,t)=>o$(e,"name",{value:t,configurable:!0}),i$=Pe[" useId ".trim().toString()]||(()=>{return}),s$=0;function ga(e){let[t,a]=A(i$());return nt(()=>{if(!e)a((r)=>r??String(s$++))},[e]),e||(t?`radix-${t}`:"")}n$(ga,"useId");var zb=!1;var l$=Object.defineProperty,c$=(e,t)=>l$(e,"name",{value:t,configurable:!0}),g_=Pe[" useEffectEvent ".trim().toString()],h_=Pe[" useInsertionEffect ".trim().toString()];function GC(e){if(typeof g_==="function")return g_(e);let t=B(()=>{throw Error("Cannot call an event handler while rendering.")});if(typeof h_==="function")h_(()=>{t.current=e});else nt(()=>{t.current=e});return de(()=>(...a)=>t.current?.(...a),[])}c$(GC,"useEffectEvent");var u$=Object.defineProperty,jg=(e,t)=>u$(e,"name",{value:t,configurable:!0}),d$=Pe[" useInsertionEffect ".trim().toString()]||nt;function Ia({prop:e,defaultProp:t,onChange:a=jg(()=>{},"onChange"),caller:r}){let[n,s,l]=v_({defaultProp:t,onChange:a}),c=e!==void 0,f=c?e:n;if(zb){let g=B(e!==void 0);U(()=>{let h=g.current;if(h!==c)console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"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.`);g.current=c},[c,r])}let m=j((g)=>{if(c){let h=b_(g)?g(e):g;if(h!==e)l.current?.(h)}else s(g)},[c,e,s,l]);return[f,m]}jg(Ia,"useControllableState");function v_({defaultProp:e,onChange:t}){let[a,r]=A(e),n=B(a),s=B(t);return d$(()=>{s.current=t},[t]),U(()=>{if(n.current!==a)s.current?.(a),n.current=a},[a,n]),[a,r,s]}jg(v_,"useUncontrolledState");function b_(e){return typeof e==="function"}jg(b_,"isFunction");var x_=Symbol("RADIX:SYNC_STATE");function f$(e,t,a,r){let{prop:n,defaultProp:s,onChange:l,caller:c}=t,f=n!==void 0,m=GC(l);if(zb){let L=B(n!==void 0);U(()=>{let k=L.current;if(k!==f)console.warn(`${c} is changing from ${k?"controlled":"uncontrolled"} to ${f?"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.`);L.current=f},[f,c])}let g=[{...a,state:s}];if(r)g.push(r);let[h,x]=us((L,k)=>{if(k.type===x_)return{...L,state:k.state};let I=e(L,k);if(f&&!Object.is(I.state,L.state))m(I.state);return I},...g),v=h.state,w=B(v);U(()=>{if(w.current!==v){if(w.current=v,!f)m(v)}},[v,w,f]);let C=de(()=>{if(n!==void 0)return{...h,state:n};return h},[h,n]);return U(()=>{if(f&&!Object.is(n,h.state))x({type:x_,state:n})},[n,h.state,f]),[C,x]}jg(f$,"useControllableStateReducer");var p$=Object.defineProperty,Qo=(e,t)=>p$(e,"name",{value:t,configurable:!0});function La(e){let t=ne((a,r)=>{let{children:n,...s}=a,l=null,c=!1,f=[];if(qC(n)&&typeof Bb==="function")n=Bb(n._payload);if(ur.forEach(n,(x)=>{if(k_(x)){c=!0;let v=x,w="child"in v.props?v.props.child:v.props.children;if(qC(w)&&typeof Bb==="function")w=Bb(w._payload);l=m$(v,w),f.push(l?.props?.children)}else f.push(x)}),l)l=Ir(l,void 0,f);else if(!c&&ur.count(n)===1&&Yt(n))l=n;let m=l?S_(l):void 0,g=Oe(r,m);if(!l){if(n||n===0)throw Error(c?x$(e):h$(e));return n}let h=w_(s,l.props??{});if(l.type!==Za)h.ref=r?g:m;return Ir(l,h)});return t.displayName=`${e}.Slot`,t}Qo(La,"createSlot");var mf=La("Slot"),y_=Symbol.for("radix.slottable");function KC(e){let t=Qo((a)=>("child"in a)?a.children(a.child):a.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y_,t}Qo(KC,"createSlottable");var m$=Qo((e,t)=>{if("child"in e.props){let a=e.props.child;if(!Yt(a))return null;return Ir(a,void 0,e.props.children(a.props.children))}return Yt(t)?t:null},"getSlottableElementFromSlottable");function w_(e,t){let a={...t};for(let r in t){let n=e[r],s=t[r];if(/^on[A-Z]/.test(r)){if(n&&s)a[r]=(...c)=>{let f=s(...c);return n(...c),f};else if(n)a[r]=n}else if(r==="style")a[r]={...n,...s};else if(r==="className")a[r]=[n,s].filter(Boolean).join(" ")}return{...e,...a}}Qo(w_,"mergeProps");function S_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;if(a)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}Qo(S_,"getElementRef");function k_(e){return Yt(e)&&typeof e.type==="function"&&"__radixId"in e.type&&e.type.__radixId===y_}Qo(k_,"isSlottable");var g$=Symbol.for("react.lazy");function qC(e){return e!=null&&typeof e==="object"&&"$$typeof"in e&&e.$$typeof===g$&&"_payload"in e&&C_(e._payload)}Qo(qC,"isLazyComponent");function C_(e){return typeof e==="object"&&e!==null&&"then"in e}Qo(C_,"isPromiseLike");var h$=Qo((e)=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),x$=Qo((e)=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Bb=Pe[" use ".trim().toString()];var v$=Object.defineProperty,b$=(e,t)=>v$(e,"name",{value:t,configurable:!0}),y$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=y$.reduce((e,t)=>{let a=La(`Primitive.${t}`),r=ne((n,s)=>{let{asChild:l,...c}=n,f=l?a:t;if(typeof window<"u")window[Symbol.for("radix-ui")]=!0;return d(f,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qg(e,t){if(e)ps(()=>e.dispatchEvent(t))}b$(qg,"dispatchDiscreteCustomEvent");var w$=Object.defineProperty,S$=(e,t)=>w$(e,"name",{value:t,configurable:!0});function Ta(e){let t=B(e);return U(()=>{t.current=e}),de(()=>(...a)=>t.current?.(...a),[])}S$(Ta,"useCallbackRef");var k$=Object.defineProperty,Ra=(e,t)=>k$(e,"name",{value:t,configurable:!0}),XC="dismissableLayer.update",C$="dismissableLayer.pointerDownOutside",I$="dismissableLayer.focusOutside",I_,L_=ht({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Vn=ne(Ra(function(t,a){let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:n=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:f,onDismiss:m,...g}=t,h=We(L_),[x,v]=A(null),w=x?.ownerDocument??globalThis?.document,[,C]=A({}),L=Oe(a,v),k=Array.from(h.layers),[I]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),T=I?k.indexOf(I):-1,R=x?k.indexOf(x):-1,E=h.layersWithOutsidePointerEventsDisabled.size>0,M=R>=T,P=B(!1),O=T_((q)=>{if(l?.(q),f?.(q),!q.defaultPrevented)m?.()},{ownerDocument:w,deferPointerDownOutside:n,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:j((q)=>{if(!(q instanceof Node))return!1;let G=[...h.branches].some((Q)=>Q.contains(q));return M&&!G},[h.branches,M])}),F=R_((q)=>{if(n&&P.current)return;let G=q.target;if([...h.branches].some((re)=>re.contains(G)))return;if(c?.(q),f?.(q),!q.defaultPrevented)m?.()},w),z=x?R===k.length-1:!1,Y=Ta((q)=>{if(q.key!=="Escape")return;if(s?.(q),!q.defaultPrevented&&m)q.preventDefault(),m()});return U(()=>{if(!z)return;return w.addEventListener("keydown",Y,{capture:!0}),()=>w.removeEventListener("keydown",Y,{capture:!0})},[w,z,Y]),U(()=>{if(!x)return;if(r){if(h.layersWithOutsidePointerEventsDisabled.size===0)I_=w.body.style.pointerEvents,w.body.style.pointerEvents="none";h.layersWithOutsidePointerEventsDisabled.add(x)}return h.layers.add(x),YC(),()=>{if(r){if(h.layersWithOutsidePointerEventsDisabled.delete(x),h.layersWithOutsidePointerEventsDisabled.size===0)w.body.style.pointerEvents=I_}}},[x,w,r,h]),U(()=>()=>{if(!x)return;h.layers.delete(x),h.layersWithOutsidePointerEventsDisabled.delete(x),YC()},[x,h]),U(()=>{let q=Ra(()=>C({}),"handleUpdate");return document.addEventListener(XC,q),()=>document.removeEventListener(XC,q)},[]),d(_e.div,{...g,ref:L,style:{pointerEvents:E?M?"auto":"none":void 0,...t.style},onFocusCapture:ke(t.onFocusCapture,F.onFocusCapture),onBlurCapture:ke(t.onBlurCapture,F.onBlurCapture),onPointerDownCapture:ke(t.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function WC(){let e=We(L_),[t,a]=A(null);return U(()=>{if(!t)return;return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),a}Ra(WC,"useDismissableLayerSurface");var L$=Ra(()=>!0,"IS_TRUE");function T_(e,t){let{ownerDocument:a=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:n,dismissableSurfaces:s,shouldHandlePointerDownOutside:l=L$}=t,c=Ta(e),f=B(!1),m=B(!1),g=B(new Map),h=B(()=>{});return U(()=>{function x(){m.current=!1,n.current=!1,g.current.clear()}Ra(x,"resetOutsideInteraction");function v(){return Array.from(g.current.values()).some(Boolean)}Ra(v,"isOutsideInteractionIntercepted");function w(T){if(!m.current)return;let R=T.target;if(!(R instanceof Node&&[...s].some((M)=>M.contains(R))))g.current.set(T.type,!0);if(T.type==="click")window.setTimeout(()=>{if(m.current)h.current()},0)}Ra(w,"handleInteractionCapture");function C(T){if(m.current)g.current.set(T.type,!1)}Ra(C,"handleInteractionBubble");let L=Ra((T)=>{if(T.target&&!f.current){let E=function(){a.removeEventListener("click",h.current);let P=v();if(x(),!P)$C(C$,c,M,{discrete:!0})};var R=E;if(Ra(E,"handleAndDispatchPointerDownOutsideEvent"),!l(T.target)){a.removeEventListener("click",h.current),x(),f.current=!1;return}let M={originalEvent:T};if(m.current=!0,n.current=r&&T.button===0,g.current.clear(),!r||T.button!==0)E();else a.removeEventListener("click",h.current),h.current=E,a.addEventListener("click",h.current,{once:!0})}else a.removeEventListener("click",h.current),x();f.current=!1},"handlePointerDown"),k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let T of k)a.addEventListener(T,w,!0),a.addEventListener(T,C);let I=window.setTimeout(()=>{a.addEventListener("pointerdown",L)},0);return()=>{window.clearTimeout(I),a.removeEventListener("pointerdown",L),a.removeEventListener("click",h.current);for(let T of k)a.removeEventListener(T,w,!0),a.removeEventListener(T,C)}},[a,c,r,n,s,l]),{onPointerDownCapture:Ra(()=>f.current=!0,"onPointerDownCapture")}}Ra(T_,"usePointerDownOutside");function R_(e,t=globalThis?.document){let a=Ta(e),r=B(!1);return U(()=>{let n=Ra((s)=>{if(s.target&&!r.current)$C(I$,a,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,a]),{onFocusCapture:Ra(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ra(()=>r.current=!1,"onBlurCapture")}}Ra(R_,"useFocusOutside");function YC(){let e=new CustomEvent(XC);document.dispatchEvent(e)}Ra(YC,"dispatchUpdate");function $C(e,t,a,{discrete:r}){let n=a.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});if(t)n.addEventListener(e,t,{once:!0});if(r)qg(n,s);else n.dispatchEvent(s)}Ra($C,"handleAndDispatchCustomEvent");var T$=Object.defineProperty,br=(e,t)=>T$(e,"name",{value:t,configurable:!0}),QC="focusScope.autoFocusOnMount",ZC="focusScope.autoFocusOnUnmount",A_={bubbles:!1,cancelable:!0},fl=ne(br(function(t,a){let{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=t,[f,m]=A(null),g=Ta(s),h=Ta(l),x=B(null),v=Oe(a,m),w=B({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;U(()=>{if(n){let T=function(P){if(w.paused||!f)return;let O=P.target;if(f.contains(O))x.current=O;else _i(x.current,{select:!0})},R=function(P){if(w.paused||!f)return;let O=P.relatedTarget;if(O===null)return;if(!f.contains(O))_i(x.current,{select:!0})},E=function(P){if(document.activeElement!==document.body)return;for(let F of P)if(F.removedNodes.length>0)_i(f)};var L=T,k=R,I=E;br(T,"handleFocusIn"),br(R,"handleFocusOut"),br(E,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",R);let M=new MutationObserver(E);if(f)M.observe(f,{childList:!0,subtree:!0});return()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",R),M.disconnect()}}},[n,f,w.paused]),U(()=>{if(f){M_.add(w);let L=document.activeElement;if(!f.contains(L)){let I=new CustomEvent(QC,A_);if(f.addEventListener(QC,g),f.dispatchEvent(I),!I.defaultPrevented){if(P_(__(t2(f)),{select:!0}),document.activeElement===L)_i(f)}}return()=>{f.removeEventListener(QC,g),setTimeout(()=>{let I=new CustomEvent(ZC,A_);if(f.addEventListener(ZC,h),f.dispatchEvent(I),!I.defaultPrevented)_i(L??document.body,{select:!0});f.removeEventListener(ZC,h),M_.remove(w)},0)}}},[f,g,h,w]);let C=j((L)=>{if(!r&&!n)return;if(w.paused)return;let k=L.key==="Tab"&&!L.altKey&&!L.ctrlKey&&!L.metaKey,I=document.activeElement;if(k&&I){let T=L.currentTarget,[R,E]=E_(T);if(!(R&&E)){if(I===T)L.preventDefault()}else if(!L.shiftKey&&I===E){if(L.preventDefault(),r)_i(R,{select:!0})}else if(L.shiftKey&&I===R){if(L.preventDefault(),r)_i(E,{select:!0})}}},[r,n,w.paused]);return d(_e.div,{tabIndex:-1,...c,ref:v,onKeyDown:C})},"FocusScope"));function P_(e,{select:t=!1}={}){let a=document.activeElement;for(let r of e)if(_i(r,{select:t}),document.activeElement!==a)return}br(P_,"focusFirst");function E_(e){let t=t2(e),a=JC(t,e),r=JC(t.reverse(),e);return[a,r]}br(E_,"getTabbableEdges");function t2(e){let t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:br((r)=>{let n=r.tagName==="INPUT"&&r.type==="hidden";if(r.disabled||r.hidden||n)return NodeFilter.FILTER_SKIP;return r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});while(a.nextNode())t.push(a.currentNode);return t}br(t2,"getTabbableCandidates");function JC(e,t){let a=typeof t.checkVisibility==="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(a?!r.checkVisibility({checkVisibilityCSS:!0}):N_(r,{upTo:t})))return r}br(JC,"findVisible");function N_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;while(e){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}br(N_,"isHidden");function D_(e){return e instanceof HTMLInputElement&&"select"in e}br(D_,"isSelectableInput");function _i(e,{select:t=!1}={}){if(e&&e.focus){let a=document.activeElement;if(e.focus({preventScroll:!0}),e!==a&&D_(e)&&t)e.select()}}br(_i,"focus");var M_=O_();function O_(){let e=[];return{add(t){let a=e[0];if(t!==a)a?.pause();e=e2(e,t),e.unshift(t)},remove(t){e=e2(e,t),e[0]?.resume()}}}br(O_,"createFocusScopesStack");function e2(e,t){let a=[...e],r=a.indexOf(t);if(r!==-1)a.splice(r,1);return a}br(e2,"arrayRemove");function __(e){return e.filter((t)=>t.tagName!=="A")}br(__,"removeLinks");var R$=Object.defineProperty,A$=(e,t)=>R$(e,"name",{value:t,configurable:!0}),jn=ne(A$(function(t,a){let{container:r,...n}=t,[s,l]=A(!1);nt(()=>l(!0),[]);let c=r||s&&globalThis?.document?.body;return c?fn(d(_e.div,{...n,ref:a}),c):null},"Portal"));var M$=Object.defineProperty,zi=(e,t)=>M$(e,"name",{value:t,configurable:!0});function z_(e,t){return us((a,r)=>t[a][r]??a,e)}zi(z_,"useStateMachine");var Xa=zi((e)=>{let{present:t,children:a}=e,r=B_(t),n=typeof a==="function"?a({present:r.isPresent}):ur.only(a),s=F_(r.ref,U_(n));return typeof a==="function"||r.isPresent?Ir(n,{ref:s}):null},"Presence");function B_(e){let[t,a]=A(),r=B(null),n=B(e),s=B("none"),l=B(void 0),c=e?"mounted":"unmounted",[f,m]=z_(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return U(()=>{if(f==="mounted")s.current=l.current??gf(r.current),l.current=void 0;else s.current="none"},[f]),nt(()=>{let g=r.current,h=n.current;if(h!==e){let v=s.current,w=gf(g);if(e)l.current=w,m("MOUNT");else if(w==="none"||g?.display==="none")m("UNMOUNT");else if(h&&v!==w)m("ANIMATION_OUT");else m("UNMOUNT");n.current=e}},[e,m]),nt(()=>{if(t){let g,h=t.ownerDocument.defaultView??window,x=zi((w)=>{let L=gf(r.current).includes(CSS.escape(w.animationName));if(w.target===t&&L){if(m("ANIMATION_END"),!n.current){let k=t.style.animationFillMode;t.style.animationFillMode="forwards",g=h.setTimeout(()=>{if(t.style.animationFillMode==="forwards")t.style.animationFillMode=k})}}},"handleAnimationEnd"),v=zi((w)=>{if(w.target===t)s.current=gf(r.current)},"handleAnimationStart");return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{h.clearTimeout(g),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:j((g)=>{if(g){let h=getComputedStyle(g);r.current=h,l.current=gf(h)}else r.current=null;a(g)},[])}}zi(B_,"usePresence");function a2(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}zi(a2,"setRef");function F_(...e){let t=B(e);return t.current=e,j((a)=>{let r=t.current,n=!1,s=r.map((l)=>{let c=a2(l,a);if(!n&&typeof c==="function")n=!0;return c});if(n)return()=>{for(let l=0;l<s.length;l++){let c=s[l];if(typeof c==="function")c();else a2(r[l],null)}}},[])}zi(F_,"useStableComposedRefs");function gf(e){return e?.animationName||"none"}zi(gf,"getAnimationName");function U_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;if(a)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}zi(U_,"getElementRef");var P$=Object.defineProperty,o2=(e,t)=>P$(e,"name",{value:t,configurable:!0}),Fb=0,hf=null;function E$(e){return Gn(),e.children}o2(E$,"FocusGuards");function Gn(){U(()=>{if(!hf)hf={start:r2(),end:r2()};let{start:e,end:t}=hf;if(document.body.firstElementChild!==e)document.body.insertAdjacentElement("afterbegin",e);if(document.body.lastElementChild!==t)document.body.insertAdjacentElement("beforeend",t);return Fb++,()=>{if(Fb===1)hf?.start.remove(),hf?.end.remove(),hf=null;Fb=Math.max(0,Fb-1)}},[])}o2(Gn,"useFocusGuards");function r2(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}o2(r2,"createFocusGuard");var _r=function(){return _r=Object.assign||function(t){for(var a,r=1,n=arguments.length;r<n;r++){a=arguments[r];for(var s in a)if(Object.prototype.hasOwnProperty.call(a,s))t[s]=a[s]}return t},_r.apply(this,arguments)};function Ub(e,t){var a={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0)a[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)if(t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n]))a[r[n]]=e[r[n]]}return a}function H_(e,t,a){if(a||arguments.length===2){for(var r=0,n=t.length,s;r<n;r++)if(s||!(r in t)){if(!s)s=Array.prototype.slice.call(t,0,r);s[r]=t[r]}}return e.concat(s||Array.prototype.slice.call(t))}var tu="right-scroll-bar-position",au="width-before-scroll-bar",n2="with-scroll-bars-hidden",i2="--removed-body-scroll-bar-size";function Hb(e,t){if(typeof e==="function")e(t);else if(e)e.current=t;return e}function V_(e,t){var a=A(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(r){var n=a.value;if(n!==r)a.value=r,a.callback(r,n)}}}})[0];return a.callback=t,a.facade}var N$=typeof window<"u"?Vt:U,j_=new WeakMap;function s2(e,t){var a=V_(t||null,function(r){return e.forEach(function(n){return Hb(n,r)})});return N$(function(){var r=j_.get(a);if(r){var n=new Set(r),s=new Set(e),l=a.current;n.forEach(function(c){if(!s.has(c))Hb(c,null)}),s.forEach(function(c){if(!n.has(c))Hb(c,l)})}j_.set(a,e)},[e]),a}function D$(e){return e}function O$(e,t){if(t===void 0)t=D$;var a=[],r=!1,n={read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");if(a.length)return a[a.length-1];return e},useMedium:function(s){var l=t(s,r);return a.push(l),function(){a=a.filter(function(c){return c!==l})}},assignSyncMedium:function(s){r=!0;while(a.length){var l=a;a=[],l.forEach(s)}a={push:function(c){return s(c)},filter:function(){return a}}},assignMedium:function(s){r=!0;var l=[];if(a.length){var c=a;a=[],c.forEach(s),l=a}var f=function(){var g=l;l=[],g.forEach(s)},m=function(){return Promise.resolve().then(f)};m(),a={push:function(g){l.push(g),m()},filter:function(g){return l=l.filter(g),a}}}};return n}function l2(e){if(e===void 0)e={};var t=O$(null);return t.options=_r({async:!0,ssr:!1},e),t}var G_=function(e){var t=e.sideCar,a=Ub(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return Be(r,_r({},a))};G_.isSideCarExport=!0;function c2(e,t){return e.useMedium(t),G_}var Vb=l2();var u2=function(){return},Kg=ne(function(e,t){var a=B(null),r=A({onScrollCapture:u2,onWheelCapture:u2,onTouchMoveCapture:u2}),n=r[0],s=r[1],{forwardProps:l,children:c,className:f,removeScrollBar:m,enabled:g,shards:h,sideCar:x,noRelative:v,noIsolation:w,inert:C,allowPinchZoom:L,as:k}=e,I=k===void 0?"div":k,T=e.gapMode,R=Ub(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=x,M=s2([a,t]),P=_r(_r({},R),n);return Be(Za,null,g&&Be(E,{sideCar:Vb,removeScrollBar:m,shards:h,noRelative:v,noIsolation:w,inert:C,setCallbacks:s,allowPinchZoom:!!L,lockRef:a,gapMode:T}),l?Ir(ur.only(c),_r(_r({},P),{ref:M})):Be(I,_r({},P,{className:f,ref:M}),c))});Kg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Kg.classNames={fullWidth:au,zeroRight:tu};var q_;var K_=function(){if(q_)return q_;if(typeof __webpack_nonce__<"u")return __webpack_nonce__;return};function _$(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=K_();if(t)e.setAttribute("nonce",t);return e}function z$(e,t){if(e.styleSheet)e.styleSheet.cssText=t;else e.appendChild(document.createTextNode(t))}function B$(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var d2=function(){var e=0,t=null;return{add:function(a){if(e==0){if(t=_$())z$(t,a),B$(t)}e++},remove:function(){if(e--,!e&&t)t.parentNode&&t.parentNode.removeChild(t),t=null}}};var f2=function(){var e=d2();return function(t,a){U(function(){return e.add(t),function(){e.remove()}},[t&&a])}};var Xg=function(){var e=f2(),t=function(a){var{styles:r,dynamic:n}=a;return e(r,n),null};return t};var F$={left:0,top:0,right:0,gap:0},p2=function(e){return parseInt(e||"",10)||0},U$=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],n=t[e==="padding"?"paddingRight":"marginRight"];return[p2(a),p2(r),p2(n)]},m2=function(e){if(e===void 0)e="margin";if(typeof window>"u")return F$;var t=U$(e),a=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-a+t[2]-t[0])}};var H$=Xg(),xf="data-scroll-locked",V$=function(e,t,a,r){var{left:n,top:s,right:l,gap:c}=e;if(a===void 0)a="margin";return`
|
|
21
|
+
.`.concat(n2,` {
|
|
22
|
+
overflow: hidden `).concat(r,`;
|
|
23
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
24
|
+
}
|
|
25
|
+
body[`).concat(xf,`] {
|
|
26
|
+
overflow: hidden `).concat(r,`;
|
|
27
|
+
overscroll-behavior: contain;
|
|
28
|
+
`).concat([t&&"position: relative ".concat(r,";"),a==="margin"&&`
|
|
29
|
+
padding-left: `.concat(n,`px;
|
|
30
|
+
padding-top: `).concat(s,`px;
|
|
31
|
+
padding-right: `).concat(l,`px;
|
|
32
|
+
margin-left:0;
|
|
33
|
+
margin-top:0;
|
|
34
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
35
|
+
`),a==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.`).concat(tu,` {
|
|
39
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.`).concat(au,` {
|
|
43
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.`).concat(tu," .").concat(tu,` {
|
|
47
|
+
right: 0 `).concat(r,`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.`).concat(au," .").concat(au,` {
|
|
51
|
+
margin-right: 0 `).concat(r,`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
body[`).concat(xf,`] {
|
|
55
|
+
`).concat(i2,": ").concat(c,`px;
|
|
56
|
+
}
|
|
57
|
+
`)},X_=function(){var e=parseInt(document.body.getAttribute(xf)||"0",10);return isFinite(e)?e:0},j$=function(){U(function(){return document.body.setAttribute(xf,(X_()+1).toString()),function(){var e=X_()-1;if(e<=0)document.body.removeAttribute(xf);else document.body.setAttribute(xf,e.toString())}},[])},g2=function(e){var{noRelative:t,noImportant:a,gapMode:r}=e,n=r===void 0?"margin":r;j$();var s=de(function(){return m2(n)},[n]);return Be(H$,{styles:V$(s,!t,n,!a?"!important":"")})};var h2=!1;if(typeof window<"u")try{vf=Object.defineProperty({},"passive",{get:function(){return h2=!0,!0}}),window.addEventListener("test",vf,vf),window.removeEventListener("test",vf,vf)}catch(e){h2=!1}var vf,ru=h2?{passive:!1}:!1;var G$=function(e){return e.tagName==="TEXTAREA"},Y_=function(e,t){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[t]!=="hidden"&&!(a.overflowY===a.overflowX&&!G$(e)&&a[t]==="visible")},q$=function(e){return Y_(e,"overflowY")},K$=function(e){return Y_(e,"overflowX")},x2=function(e,t){var a=t.ownerDocument,r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot)r=r.host;var n=W_(e,r);if(n){var s=$_(e,r),l=s[1],c=s[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==a.body);return!1},X$=function(e){var{scrollTop:t,scrollHeight:a,clientHeight:r}=e;return[t,a,r]},Y$=function(e){var{scrollLeft:t,scrollWidth:a,clientWidth:r}=e;return[t,a,r]},W_=function(e,t){return e==="v"?q$(t):K$(t)},$_=function(e,t){return e==="v"?X$(t):Y$(t)},W$=function(e,t){return e==="h"&&t==="rtl"?-1:1},Q_=function(e,t,a,r,n){var s=W$(e,window.getComputedStyle(t).direction),l=s*r,c=a.target,f=t.contains(c),m=!1,g=l>0,h=0,x=0;do{if(!c)break;var v=$_(e,c),w=v[0],C=v[1],L=v[2],k=C-L-s*w;if(w||k){if(W_(e,c))h+=k,x+=w}var I=c.parentNode;c=I&&I.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host:I}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));if(g&&(n&&Math.abs(h)<1||!n&&l>h))m=!0;else if(!g&&(n&&Math.abs(x)<1||!n&&-l>x))m=!0;return m};var jb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Z_=function(e){return[e.deltaX,e.deltaY]},J_=function(e){return e&&"current"in e?e.current:e},$$=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Q$=function(e){return`
|
|
58
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
59
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
60
|
+
`)},Z$=0,bf=[];function ez(e){var t=B([]),a=B([0,0]),r=B(),n=A(Z$++)[0],s=A(Xg)[0],l=B(e);U(function(){l.current=e},[e]),U(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(n));var C=H_([e.lockRef.current],(e.shards||[]).map(J_),!0).filter(Boolean);return C.forEach(function(L){return L.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),C.forEach(function(L){return L.classList.remove("allow-interactivity-".concat(n))})}}return},[e.inert,e.lockRef.current,e.shards]);var c=j(function(C,L){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!l.current.allowPinchZoom;var k=jb(C),I=a.current,T="deltaX"in C?C.deltaX:I[0]-k[0],R="deltaY"in C?C.deltaY:I[1]-k[1],E,M=C.target,P=Math.abs(T)>Math.abs(R)?"h":"v";if("touches"in C&&P==="h"&&M.type==="range")return!1;var O=window.getSelection(),F=O&&O.anchorNode,z=F?F===M||F.contains(M):!1;if(z)return!1;var Y=x2(P,M);if(!Y)return!0;if(Y)E=P;else E=P==="v"?"h":"v",Y=x2(P,M);if(!Y)return!1;if(!r.current&&"changedTouches"in C&&(T||R))r.current=E;if(!E)return!0;var q=r.current||E;return Q_(q,L,C,q==="h"?T:R,!0)},[]),f=j(function(C){var L=C;if(!bf.length||bf[bf.length-1]!==s)return;var k="deltaY"in L?Z_(L):jb(L),I=t.current.filter(function(E){return E.name===L.type&&(E.target===L.target||L.target===E.shadowParent)&&$$(E.delta,k)})[0];if(I&&I.should){if(L.cancelable)L.preventDefault();return}if(!I){var T=(l.current.shards||[]).map(J_).filter(Boolean).filter(function(E){return E.contains(L.target)}),R=T.length>0?c(L,T[0]):!l.current.noIsolation;if(R){if(L.cancelable)L.preventDefault()}}},[]),m=j(function(C,L,k,I){var T={name:C,delta:L,target:k,should:I,shadowParent:J$(k)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(R){return R!==T})},1)},[]),g=j(function(C){a.current=jb(C),r.current=void 0},[]),h=j(function(C){m(C.type,Z_(C),C.target,c(C,e.lockRef.current))},[]),x=j(function(C){m(C.type,jb(C),C.target,c(C,e.lockRef.current))},[]);U(function(){return bf.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:x}),document.addEventListener("wheel",f,ru),document.addEventListener("touchmove",f,ru),document.addEventListener("touchstart",g,ru),function(){bf=bf.filter(function(C){return C!==s}),document.removeEventListener("wheel",f,ru),document.removeEventListener("touchmove",f,ru),document.removeEventListener("touchstart",g,ru)}},[]);var{removeScrollBar:v,inert:w}=e;return Be(Za,null,w?Be(s,{styles:Q$(n)}):null,v?Be(g2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J$(e){var t=null;while(e!==null){if(e instanceof ShadowRoot)t=e.host,e=e.host;e=e.parentNode}return t}var tz=c2(Vb,ez);var az=ne(function(e,t){return Be(Kg,_r({},e,{ref:t,sideCar:tz}))});az.classNames=Kg.classNames;var Bi=az;var eQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yf=new WeakMap,Gb=new WeakMap,qb={},v2=0,rz=function(e){return e&&(e.host||rz(e.parentNode))},tQ=function(e,t){return t.map(function(a){if(e.contains(a))return a;var r=rz(a);if(r&&e.contains(r))return r;return console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null}).filter(function(a){return Boolean(a)})},aQ=function(e,t,a,r){var n=tQ(t,Array.isArray(e)?e:[e]);if(!qb[a])qb[a]=new WeakMap;var s=qb[a],l=[],c=new Set,f=new Set(n),m=function(h){if(!h||c.has(h))return;c.add(h),m(h.parentNode)};n.forEach(m);var g=function(h){if(!h||f.has(h))return;Array.prototype.forEach.call(h.children,function(x){if(c.has(x))g(x);else try{var v=x.getAttribute(r),w=v!==null&&v!=="false",C=(yf.get(x)||0)+1,L=(s.get(x)||0)+1;if(yf.set(x,C),s.set(x,L),l.push(x),C===1&&w)Gb.set(x,!0);if(L===1)x.setAttribute(a,"true");if(!w)x.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",x,k)}})};return g(t),c.clear(),v2++,function(){if(l.forEach(function(h){var x=yf.get(h)-1,v=s.get(h)-1;if(yf.set(h,x),s.set(h,v),!x){if(!Gb.has(h))h.removeAttribute(r);Gb.delete(h)}if(!v)h.removeAttribute(a)}),v2--,!v2)yf=new WeakMap,yf=new WeakMap,Gb=new WeakMap,qb={}}},pl=function(e,t,a){if(a===void 0)a="data-aria-hidden";var r=Array.from(Array.isArray(e)?e:[e]),n=t||eQ(e);if(!n)return function(){return null};return r.push.apply(r,Array.from(n.querySelectorAll("[aria-live], script"))),aQ(r,n,a,"aria-hidden")};var rQ=Object.defineProperty,to=(e,t)=>rQ(e,"name",{value:t,configurable:!0}),y2="Dialog",[oz,w2]=Tt(y2),[oQ,Zo]=oz(y2),Wg=to((e)=>{let{__scopeDialog:t,children:a,open:r,defaultOpen:n,onOpenChange:s,modal:l=!0}=e,c=B(null),f=B(null),[m,g]=Ia({prop:r,defaultProp:n??!1,onChange:s,caller:y2}),[h,x]=A(0),[v,w]=A(0);return d(oQ,{scope:t,triggerRef:c,contentRef:f,contentId:ga(),titleId:ga(),descriptionId:ga(),titlePresent:h>0,descriptionPresent:v>0,setTitleCount:x,setDescriptionCount:w,open:m,onOpenChange:g,onOpenToggle:j(()=>g((C)=>!C),[g]),modal:l,children:a})},"Dialog"),nQ="DialogTrigger",S2=ne(to(function(t,a){let{__scopeDialog:r,...n}=t,s=Zo(nQ,r),l=Oe(a,s.triggerRef);return d(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Xb(s.open),...n,ref:l,onClick:ke(t.onClick,s.onOpenToggle)})},"DialogTrigger")),nz="DialogPortal",[iQ,iz]=oz(nz,{forceMount:void 0}),$g=to((e)=>{let{__scopeDialog:t,forceMount:a,children:r,container:n}=e,s=Zo(nz,t);return d(iQ,{scope:t,forceMount:a,children:ur.map(r,(l)=>d(Xa,{present:a||s.open,children:d(jn,{asChild:!0,container:n,children:l})}))})},"DialogPortal"),b2="DialogOverlay",Qg=ne(to(function(t,a){let r=iz(b2,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,l=Zo(b2,t.__scopeDialog);return l.modal?d(Xa,{present:n||l.open,children:d(lQ,{...s,ref:a})}):null},"DialogOverlay")),sQ=La("DialogOverlay.RemoveScroll"),lQ=ne(to(function(t,a){let{__scopeDialog:r,...n}=t,s=Zo(b2,r),l=WC(),c=Oe(a,l);return d(Bi,{as:sQ,allowPinchZoom:!0,shards:[s.contentRef],children:d(_e.div,{"data-state":Xb(s.open),...n,ref:c,style:{pointerEvents:"auto",...n.style}})})},"DialogOverlayImpl")),Yg="DialogContent",Zg=ne(to(function(t,a){let r=iz(Yg,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,l=Zo(Yg,t.__scopeDialog);return d(Xa,{present:n||l.open,children:l.modal?d(cQ,{...s,ref:a}):d(uQ,{...s,ref:a})})},"DialogContent")),cQ=ne(to(function(t,a){let r=Zo(Yg,t.__scopeDialog),n=B(null),s=Oe(a,r.contentRef,n);return U(()=>{let l=n.current;if(l)return pl(l)},[]),d(sz,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ke(t.onCloseAutoFocus,(l)=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ke(t.onPointerDownOutside,(l)=>{let c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;if(c.button===2||f)l.preventDefault()}),onFocusOutside:ke(t.onFocusOutside,(l)=>l.preventDefault())})},"DialogContentModal")),uQ=ne(to(function(t,a){let r=Zo(Yg,t.__scopeDialog),n=B(!1),s=B(!1);return d(sz,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(l)=>{if(t.onCloseAutoFocus?.(l),!l.defaultPrevented){if(!n.current)r.triggerRef.current?.focus();l.preventDefault()}n.current=!1,s.current=!1},onInteractOutside:(l)=>{if(t.onInteractOutside?.(l),!l.defaultPrevented){if(n.current=!0,l.detail.originalEvent.type==="pointerdown")s.current=!0}let c=l.target;if(r.triggerRef.current?.contains(c))l.preventDefault();if(l.detail.originalEvent.type==="focusin"&&s.current)l.preventDefault()}})},"DialogContentNonModal")),sz=ne(to(function(t,a){let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=t,f=Zo(Yg,r);return Gn(),d(se,{children:d(fl,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:l,children:d(Vn,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":Xb(f.open),...c,ref:a,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),dQ="DialogTitle",Jg=ne(to(function(t,a){let{__scopeDialog:r,...n}=t,s=Zo(dQ,r),{setTitleCount:l}=s;return nt(()=>(l((c)=>c+1),()=>l((c)=>c-1)),[l]),d(_e.h2,{id:s.titleId,...n,ref:a})},"DialogTitle")),fQ="DialogDescription",Kb=ne(to(function(t,a){let{__scopeDialog:r,...n}=t,s=Zo(fQ,r),{setDescriptionCount:l}=s;return nt(()=>(l((c)=>c+1),()=>l((c)=>c-1)),[l]),d(_e.p,{id:s.descriptionId,...n,ref:a})},"DialogDescription")),pQ="DialogClose",ml=ne(to(function(t,a){let{__scopeDialog:r,...n}=t,s=Zo(pQ,r);return d(_e.button,{type:"button",...n,ref:a,onClick:ke(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Xb(e){return e?"open":"closed"}to(Xb,"getState");var mQ=Object.defineProperty,Fi=(e,t)=>mQ(e,"name",{value:t,configurable:!0}),gQ="AlertDialog",[hQ,tHa]=Tt(gQ,[w2]),Ui=w2(),xQ=Fi((e)=>{let{__scopeAlertDialog:t,...a}=e,r=Ui(t);return d(Wg,{...r,...a,modal:!0})},"AlertDialog"),aHa=ne(Fi(function(t,a){let{__scopeAlertDialog:r,...n}=t,s=Ui(r);return d(S2,{...s,...n,ref:a})},"AlertDialogTrigger")),vQ=Fi((e)=>{let{__scopeAlertDialog:t,...a}=e,r=Ui(t);return d($g,{...r,...a})},"AlertDialogPortal"),bQ=ne(Fi(function(t,a){let{__scopeAlertDialog:r,...n}=t,s=Ui(r);return d(Qg,{...s,...n,ref:a})},"AlertDialogOverlay")),yQ="AlertDialogContent",[wQ,SQ]=hQ(yQ),kQ=ne(Fi(function(t,a){let{__scopeAlertDialog:r,children:n,...s}=t,l=Ui(r),c=B(null),f=Oe(a,c),m=B(null);return d(wQ,{scope:r,cancelRef:m,children:d(Zg,{role:"alertdialog",...l,...s,ref:f,onOpenAutoFocus:ke(s.onOpenAutoFocus,(g)=>{g.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:(g)=>g.preventDefault(),onInteractOutside:(g)=>g.preventDefault(),children:n})})},"AlertDialogContent")),CQ=ne(Fi(function(t,a){let{__scopeAlertDialog:r,...n}=t,s=Ui(r);return d(Jg,{...s,...n,ref:a})},"AlertDialogTitle")),IQ=ne(Fi(function(t,a){let{__scopeAlertDialog:r,...n}=t,s=Ui(r);return d(Kb,{...s,...n,ref:a})},"AlertDialogDescription")),LQ=ne(Fi(function(t,a){let{__scopeAlertDialog:r,...n}=t,s=Ui(r);return d(ml,{...s,...n,ref:a})},"AlertDialogAction")),TQ="AlertDialogCancel",RQ=ne(Fi(function(t,a){let{__scopeAlertDialog:r,...n}=t,{cancelRef:s}=SQ(TQ,r),l=Ui(r),c=Oe(a,s);return d(ml,{...l,...n,ref:c})},"AlertDialogCancel")),AQ=xQ;var MQ=vQ,PQ=bQ,EQ=kQ,NQ=LQ,DQ=RQ,OQ=CQ,_Q=IQ;var zQ=Object.defineProperty,th=(e,t)=>zQ(e,"name",{value:t,configurable:!0}),k2="Collapsible",[BQ,fHa]=Tt(k2),[FQ,C2]=BQ(k2),UQ=ne(th(function(t,a){let{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:l,onOpenChange:c,...f}=t,[m,g]=Ia({prop:n,defaultProp:s??!1,onChange:c,caller:k2});return d(FQ,{scope:r,disabled:l,contentId:ga(),open:m,onOpenToggle:j(()=>g((h)=>!h),[g]),children:d(_e.div,{"data-state":Yb(m),"data-disabled":l?"":void 0,...f,ref:a})})},"Collapsible")),HQ="CollapsibleTrigger",VQ=ne(th(function(t,a){let{__scopeCollapsible:r,...n}=t,s=C2(HQ,r);return d(_e.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Yb(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:a,onClick:ke(t.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),cz="CollapsibleContent",jQ=ne(th(function(t,a){let{forceMount:r,...n}=t,s=C2(cz,t.__scopeCollapsible);return d(Xa,{present:r||s.open,children:({present:l})=>d(GQ,{...n,ref:a,present:l})})},"CollapsibleContent")),GQ=ne(th(function(t,a){let{__scopeCollapsible:r,present:n,children:s,...l}=t,c=C2(cz,r),[f,m]=A(n),g=B(null),h=Oe(a,g),x=B(0),v=x.current,w=B(0),C=w.current,L=c.open||f,k=B(L),I=B(void 0);return U(()=>{let T=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(T)},[]),nt(()=>{let T=g.current;if(T){I.current=I.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";let R=T.getBoundingClientRect();if(x.current=R.height,w.current=R.width,!k.current)T.style.transitionDuration=I.current.transitionDuration,T.style.animationName=I.current.animationName;m(n)}},[c.open,n]),d(_e.div,{"data-state":Yb(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!L,...l,ref:h,style:{["--radix-collapsible-content-height"]:v?`${v}px`:void 0,["--radix-collapsible-content-width"]:C?`${C}px`:void 0,...t.style},children:L&&s})},"CollapsibleContentImpl"));function Yb(e){return e?"open":"closed"}th(Yb,"getState");var qQ=UQ;var KQ=Object.defineProperty,Aa=(e,t)=>KQ(e,"name",{value:t,configurable:!0});function ou(e){let t=e+"CollectionProvider",[a,r]=Tt(t),[n,s]=a(t,{collectionRef:{current:null},itemMap:new Map}),l=Aa((C)=>{let{scope:L,children:k}=C,I=B(null),T=B(new Map).current;return d(n,{scope:L,itemMap:T,collectionRef:I,children:k})},"CollectionProvider");l.displayName=t;let c=e+"CollectionSlot",f=La(c),m=ne((C,L)=>{let{scope:k,children:I}=C,T=s(c,k),R=Oe(L,T.collectionRef);return d(f,{ref:R,children:I})});m.displayName=c;let g=e+"CollectionItemSlot",h="data-radix-collection-item",x=La(g),v=ne((C,L)=>{let{scope:k,children:I,...T}=C,R=B(null),E=Oe(L,R),M=s(g,k);return U(()=>(M.itemMap.set(R,{ref:R,...T}),()=>void M.itemMap.delete(R))),d(x,{...{[h]:""},ref:E,children:I})});v.displayName=g;function w(C){let L=s(e+"CollectionConsumer",C);return j(()=>{let I=L.collectionRef.current;if(!I)return[];let T=Array.from(I.querySelectorAll(`[${h}]`));return Array.from(L.itemMap.values()).sort((M,P)=>T.indexOf(M.ref.current)-T.indexOf(P.ref.current))},[L.collectionRef,L.itemMap])}return Aa(w,"useCollection"),[{Provider:l,Slot:m,ItemSlot:v},w,r]}Aa(ou,"createCollection");var dz=new WeakMap,I2=class e extends Map{static{Aa(this,"OrderedDict")}#e;constructor(t){super(t);this.#e=[...super.keys()],dz.set(this,!0)}set(t,a){if(dz.get(this))if(this.has(t))this.#e[this.#e.indexOf(t)]=t;else this.#e.push(t);return super.set(t,a),this}insert(t,a,r){let n=this.has(a),s=this.#e.length,l=T2(t),c=l>=0?l:s+l,f=c<0||c>=s?-1:c;if(f===this.size||n&&f===this.size-1||f===-1)return this.set(a,r),this;let m=this.size+(n?0:1);if(l<0)c++;let g=[...this.#e],h,x=!1;for(let v=c;v<m;v++)if(c===v){let w=g[v];if(g[v]===a)w=g[v+1];if(n)this.delete(a);h=this.get(w),this.set(a,r)}else{if(!x&&g[v-1]===a)x=!0;let w=g[x?v:v-1],C=h;h=this.get(w),this.delete(w),this.set(w,C)}return this}with(t,a,r){let n=new e(this);return n.insert(t,a,r),n}before(t){let a=this.#e.indexOf(t)-1;if(a<0)return;return this.entryAt(a)}setBefore(t,a,r){let n=this.#e.indexOf(t);if(n===-1)return this;return this.insert(n,a,r)}after(t){let a=this.#e.indexOf(t);if(a=a===-1||a===this.size-1?-1:a+1,a===-1)return;return this.entryAt(a)}setAfter(t,a,r){let n=this.#e.indexOf(t);if(n===-1)return this;return this.insert(n+1,a,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let a=super.delete(t);if(a)this.#e.splice(this.#e.indexOf(t),1);return a}deleteAt(t){let a=this.keyAt(t);if(a!==void 0)return this.delete(a);return!1}at(t){let a=Wb(this.#e,t);if(a!==void 0)return this.get(a)}entryAt(t){let a=Wb(this.#e,t);if(a!==void 0)return[a,this.get(a)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Wb(this.#e,t)}from(t,a){let r=this.indexOf(t);if(r===-1)return;let n=r+a;if(n<0)n=0;if(n>=this.size)n=this.size-1;return this.at(n)}keyFrom(t,a){let r=this.indexOf(t);if(r===-1)return;let n=r+a;if(n<0)n=0;if(n>=this.size)n=this.size-1;return this.keyAt(n)}find(t,a){let r=0;for(let n of this){if(Reflect.apply(t,a,[n,r,this]))return n;r++}return}findIndex(t,a){let r=0;for(let n of this){if(Reflect.apply(t,a,[n,r,this]))return r;r++}return-1}filter(t,a){let r=[],n=0;for(let s of this){if(Reflect.apply(t,a,[s,n,this]))r.push(s);n++}return new e(r)}map(t,a){let r=[],n=0;for(let s of this)r.push([s[0],Reflect.apply(t,a,[s,n,this])]),n++;return new e(r)}reduce(...t){let[a,r]=t,n=0,s=r??this.at(0);for(let l of this){if(n===0&&t.length===1)s=l;else s=Reflect.apply(a,this,[s,l,n,this]);n++}return s}reduceRight(...t){let[a,r]=t,n=r??this.at(-1);for(let s=this.size-1;s>=0;s--){let l=this.at(s);if(s===this.size-1&&t.length===1)n=l;else n=Reflect.apply(a,this,[n,l,s,this])}return n}toSorted(t){let a=[...this.entries()].sort(t);return new e(a)}toReversed(){let t=new e;for(let a=this.size-1;a>=0;a--){let r=this.keyAt(a),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let a=[...this.entries()];return a.splice(...t),new e(a)}slice(t,a){let r=new e,n=this.size-1;if(t===void 0)return r;if(t<0)t=t+this.size;if(a!==void 0&&a>0)n=a-1;for(let s=t;s<=n;s++){let l=this.keyAt(s),c=this.get(l);r.set(l,c)}return r}every(t,a){let r=0;for(let n of this){if(!Reflect.apply(t,a,[n,r,this]))return!1;r++}return!0}some(t,a){let r=0;for(let n of this){if(Reflect.apply(t,a,[n,r,this]))return!0;r++}return!1}};function Wb(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=fz(e,t);return a===-1?void 0:e[a]}Aa(Wb,"at");function fz(e,t){let a=e.length,r=T2(t),n=r>=0?r:a+r;return n<0||n>=a?-1:n}Aa(fz,"toSafeIndex");function T2(e){return e!==e||e===0?0:Math.trunc(e)}Aa(T2,"toSafeInteger");function XQ(e){let t=e+"CollectionProvider",[a,r]=Tt(t),[n,s]=a(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new I2,setItemMap:Aa(()=>{return},"setItemMap")}),l=Aa(({state:T,...R})=>T?d(f,{...R,state:T}):d(c,{...R}),"CollectionProvider");l.displayName=t;let c=Aa((T)=>{let R=L();return d(f,{...T,state:R})},"CollectionInit");c.displayName=t+"Init";let f=Aa((T)=>{let{scope:R,children:E,state:M}=T,P=B(null),[O,F]=A(null),z=Oe(P,F),[Y,q]=M;return U(()=>{if(!O)return;let G=gz(()=>{});return G.observe(O,{childList:!0,subtree:!0}),()=>{G.disconnect()}},[O]),d(n,{scope:R,itemMap:Y,setItemMap:q,collectionRef:z,collectionRefObject:P,collectionElement:O,children:E})},"CollectionProviderImpl");f.displayName=t+"Impl";let m=e+"CollectionSlot",g=La(m),h=ne((T,R)=>{let{scope:E,children:M}=T,P=s(m,E),O=Oe(R,P.collectionRef);return d(g,{ref:O,children:M})});h.displayName=m;let x=e+"CollectionItemSlot",v="data-radix-collection-item",w=La(x),C=ne((T,R)=>{let{scope:E,children:M,...P}=T,O=B(null),[F,z]=A(null),Y=Oe(R,O,z),q=s(x,E),{setItemMap:G}=q,Q=B(P);if(!pz(Q.current,P))Q.current=P;let re=Q.current;return U(()=>{let J=re;return G((X)=>{if(!F)return X;if(!X.has(F))return X.set(F,{...J,element:F}),X.toSorted(L2);return X.set(F,{...J,element:F}).toSorted(L2)}),()=>{G((X)=>{if(!F||!X.has(F))return X;return X.delete(F),new I2(X)})}},[F,re,G]),d(w,{...{[v]:""},ref:Y,children:M})});C.displayName=x;function L(){return A(new I2)}Aa(L,"useInitCollection");function k(T){let{itemMap:R}=s(e+"CollectionConsumer",T);return R}return Aa(k,"useCollection"),[{Provider:l,Slot:h,ItemSlot:C},{createCollectionScope:r,useCollection:k,useInitCollection:L}]}Aa(XQ,"createCollection");function pz(e,t){if(e===t)return!0;if(typeof e!=="object"||typeof t!=="object")return!1;if(e==null||t==null)return!1;let a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(let n of a){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(e[n]!==t[n])return!1}return!0}Aa(pz,"shallowEqual");function mz(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Aa(mz,"isElementPreceding");function L2(e,t){return!e[1].element||!t[1].element?0:mz(e[1].element,t[1].element)?-1:1}Aa(L2,"sortByDocumentPosition");function gz(e){return new MutationObserver((a)=>{for(let r of a)if(r.type==="childList"){e();return}})}Aa(gz,"getChildListObserver");var YQ=Object.defineProperty,WQ=(e,t)=>YQ(e,"name",{value:t,configurable:!0}),$Q=ht(void 0);function nu(e){let t=We($Q);return e||t||"ltr"}WQ(nu,"useDirection");var vz=["top","right","bottom","left"];var{min:qn,max:Jo,round:rh,floor:oh}=Math,Kn=(e)=>({x:e,y:e}),QQ={left:"right",right:"left",bottom:"top",top:"bottom"};function R2(e,t,a){return Jo(e,qn(t,a))}function Xn(e,t){return typeof e==="function"?e(t):e}function Hi(e){return e.split("-")[0]}function iu(e){return e.split("-")[1]}function Qb(e){return e==="x"?"y":"x"}function Zb(e){return e==="y"?"height":"width"}function en(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Jb(e){return Qb(en(e))}function bz(e,t,a){if(a===void 0)a=!1;let r=iu(e),n=Jb(e),s=Zb(n),l=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(t.reference[s]>t.floating[s])l=ah(l);return[l,ah(l)]}function yz(e){let t=ah(e);return[$b(e),t,$b(t)]}function $b(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var hz=["left","right"],xz=["right","left"],ZQ=["top","bottom"],JQ=["bottom","top"];function eZ(e,t,a){switch(e){case"top":case"bottom":if(a)return t?xz:hz;return t?hz:xz;case"left":case"right":return t?ZQ:JQ;default:return[]}}function wz(e,t,a,r){let n=iu(e),s=eZ(Hi(e),a==="start",r);if(n){if(s=s.map((l)=>l+"-"+n),t)s=s.concat(s.map($b))}return s}function ah(e){let t=Hi(e);return QQ[t]+e.slice(t.length)}function tZ(e){var t,a,r,n;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(r=e.bottom)!=null?r:0,left:(n=e.left)!=null?n:0}}function A2(e){return typeof e!=="number"?tZ(e):{top:e,right:e,bottom:e,left:e}}function su(e){let{x:t,y:a,width:r,height:n}=e;return{width:r,height:n,top:a,left:t,right:t+r,bottom:a+n,x:t,y:a}}function Sz(e,t,a){let{reference:r,floating:n}=e,s=en(t),l=Jb(t),c=Zb(l),f=Hi(t),m=s==="y",g=r.x+r.width/2-n.width/2,h=r.y+r.height/2-n.height/2,x=r[c]/2-n[c]/2,v;switch(f){case"top":v={x:g,y:r.y-n.height};break;case"bottom":v={x:g,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-n.width,y:h};break;default:v={x:r.x,y:r.y}}let w=iu(t);if(w)v[l]+=x*(w==="end"?1:-1)*(a&&m?-1:1);return v}async function Iz(e,t){var a;if(t===void 0)t={};let{x:r,y:n,platform:s,rects:l,elements:c,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:h="floating",altBoundary:x=!1,padding:v=0}=Xn(t,e),w=A2(v),L=c[x?h==="floating"?"reference":"floating":h],k=su(await s.getClippingRect({element:((a=await(s.isElement==null?void 0:s.isElement(L)))!=null?a:!0)?L:L.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:m,rootBoundary:g,strategy:f})),I=h==="floating"?{x:r,y:n,width:l.floating.width,height:l.floating.height}:l.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),R=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},E=su(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:I,offsetParent:T,strategy:f}):I);return{top:(k.top-E.top+w.top)/R.y,bottom:(E.bottom-k.bottom+w.bottom)/R.y,left:(k.left-E.left+w.left)/R.x,right:(E.right-k.right+w.right)/R.x}}var aZ=50,Lz=async(e,t,a)=>{let{placement:r="bottom",strategy:n="absolute",middleware:s=[],platform:l}=a,c=l.detectOverflow?l:{...l,detectOverflow:Iz},f=await(l.isRTL==null?void 0:l.isRTL(t)),m=await l.getElementRects({reference:e,floating:t,strategy:n}),{x:g,y:h}=Sz(m,r,f),x=r,v=0,w={};for(let C=0;C<s.length;C++){let L=s[C];if(!L)continue;let{name:k,fn:I}=L,{x:T,y:R,data:E,reset:M}=await I({x:g,y:h,initialPlacement:r,placement:x,strategy:n,middlewareData:w,rects:m,platform:c,elements:{reference:e,floating:t}});if(g=T!=null?T:g,h=R!=null?R:h,w[k]={...w[k],...E},M&&v<aZ){if(v++,typeof M==="object"){if(M.placement)x=M.placement;if(M.rects)m=M.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:n}):M.rects;({x:g,y:h}=Sz(m,x,f))}C=-1}}return{x:g,y:h,placement:x,strategy:n,middlewareData:w}},Tz=(e)=>({name:"arrow",options:e,async fn(t){let{x:a,y:r,placement:n,rects:s,platform:l,elements:c,middlewareData:f}=t,{element:m,padding:g=0}=Xn(e,t)||{};if(m==null)return{};let h=A2(g),x={x:a,y:r},v=Jb(n),w=Zb(v),C=await l.getDimensions(m),L=v==="y",k=L?"top":"left",I=L?"bottom":"right",T=L?"clientHeight":"clientWidth",R=s.reference[w]+s.reference[v]-x[v]-s.floating[w],E=x[v]-s.reference[v],M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(m)),P=M?M[T]:0;if(!P||!await(l.isElement==null?void 0:l.isElement(M)))P=c.floating[T]||s.floating[w];let O=R/2-E/2,F=P/2-C[w]/2-1,z=qn(h[k],F),Y=qn(h[I],F),q=P-C[w]-Y,G=P/2-C[w]/2+O,Q=R2(z,G,q),re=!f.arrow&&iu(n)!=null&&G!==Q&&s.reference[w]/2-(G<z?z:Y)-C[w]/2<0,J=re?G<z?G-z:G-q:0;return{[v]:x[v]+J,data:{[v]:Q,centerOffset:G-Q-J,...re&&{alignmentOffset:J}},reset:re}}});var Rz=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var a,r;let{placement:n,middlewareData:s,rects:l,initialPlacement:c,platform:f,elements:m}=t,{mainAxis:g=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...L}=Xn(e,t);if((a=s.arrow)!=null&&a.alignmentOffset)return{};let k=Hi(n),I=en(c),T=Hi(c)===c,R=await(f.isRTL==null?void 0:f.isRTL(m.floating)),E=x||(T||!C?[ah(c)]:yz(c)),M=w!=="none";if(!x&&M)E.push(...wz(c,C,w,R));let P=[c,...E],O=await f.detectOverflow(t,L),F=[],z=((r=s.flip)==null?void 0:r.overflows)||[];if(g)F.push(O[k]);if(h){let Q=bz(n,l,R);F.push(O[Q[0]],O[Q[1]])}if(z=[...z,{placement:n,overflows:F}],!F.every((Q)=>Q<=0)){var Y,q;let Q=(((Y=s.flip)==null?void 0:Y.index)||0)+1,re=P[Q];if(re){if(!(h==="alignment"?I!==en(re):!1)||z.every((Z)=>en(Z.placement)===I?Z.overflows[0]>0:!0))return{data:{index:Q,overflows:z},reset:{placement:re}}}let J=(q=z.filter((X)=>X.overflows[0]<=0).sort((X,Z)=>X.overflows[1]-Z.overflows[1])[0])==null?void 0:q.placement;if(!J)switch(v){case"bestFit":{var G;let X=(G=z.filter((Z)=>{if(M){let te=en(Z.placement);return te===I||te==="y"}return!0}).map((Z)=>[Z.placement,Z.overflows.filter((te)=>te>0).reduce((te,D)=>te+D,0)]).sort((Z,te)=>Z[1]-te[1])[0])==null?void 0:G[0];if(X)J=X;break}case"initialPlacement":J=c;break}if(n!==J)return{reset:{placement:J}}}return{}}}};function kz(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Cz(e){return vz.some((t)=>e[t]>=0)}var Az=function(e){if(e===void 0)e={};return{name:"hide",options:e,async fn(t){let{rects:a,platform:r}=t,{strategy:n="referenceHidden",...s}=Xn(e,t);switch(n){case"referenceHidden":{let l=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=kz(l,a.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Cz(c)}}}case"escaped":{let l=await r.detectOverflow(t,{...s,altBoundary:!0}),c=kz(l,a.floating);return{data:{escapedOffsets:c,escaped:Cz(c)}}}default:return{}}}}};var Mz=new Set(["left","top"]);async function rZ(e,t){let{placement:a,platform:r,elements:n}=e,s=await(r.isRTL==null?void 0:r.isRTL(n.floating)),l=Hi(a),c=iu(a),f=en(a)==="y",m=Mz.has(l)?-1:1,g=s&&f?-1:1,h=Xn(t,e),{mainAxis:x,crossAxis:v,alignmentAxis:w}=typeof h==="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};if(c&&typeof w==="number")v=c==="end"?w*-1:w;return f?{x:v*g,y:x*m}:{x:x*m,y:v*g}}var Pz=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var a,r;let{x:n,y:s,placement:l,middlewareData:c}=t,f=await rZ(t,e);if(l===((a=c.offset)==null?void 0:a.placement)&&(r=c.arrow)!=null&&r.alignmentOffset)return{};return{x:n+f.x,y:s+f.y,data:{...f,placement:l}}}}},Ez=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:a,y:r,placement:n,platform:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:(I)=>{let{x:T,y:R}=I;return{x:T,y:R}}},...m}=Xn(e,t),g={x:a,y:r},h=await s.detectOverflow(t,m),x=en(n),v=Qb(x),w=g[v],C=g[x],L=(I,T)=>R2(T+h[I==="y"?"top":"left"],T,T-h[I==="y"?"bottom":"right"]);if(l)w=L(v,w);if(c)C=L(x,C);let k=f.fn({...t,[v]:w,[x]:C});return{...k,data:{x:k.x-a,y:k.y-r,enabled:{[v]:l,[x]:c}}}}}},Nz=function(e){if(e===void 0)e={};return{options:e,fn(t){var a,r;let{x:n,y:s,placement:l,rects:c,middlewareData:f}=t,{offset:m=0,mainAxis:g=!0,crossAxis:h=!0}=Xn(e,t),x={x:n,y:s},v=en(l),w=Qb(v),C=x[w],L=x[v],k=Xn(m,t),I=typeof k==="number"?{mainAxis:k,crossAxis:0}:{mainAxis:(a=k.mainAxis)!=null?a:0,crossAxis:(r=k.crossAxis)!=null?r:0};if(g){let E=w==="y"?"height":"width",M=c.reference[w]-c.floating[E]+I.mainAxis,P=c.reference[w]+c.reference[E]-I.mainAxis;if(C<M)C=M;else if(C>P)C=P}if(h){var T,R;let E=w==="y"?"width":"height",M=Mz.has(Hi(l)),P=c.reference[v]-c.floating[E]+(M?((T=f.offset)==null?void 0:T[v])||0:0)+(M?0:I.crossAxis),O=c.reference[v]+c.reference[E]+(M?0:((R=f.offset)==null?void 0:R[v])||0)-(M?I.crossAxis:0);if(L<P)L=P;else if(L>O)L=O}return{[w]:C,[v]:L}}}},Dz=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:a,rects:r,platform:n,elements:s}=t,{apply:l=()=>{},...c}=Xn(e,t),f=await n.detectOverflow(t,c),m=Hi(a),g=iu(a),h=en(a)==="y",{width:x,height:v}=r.floating,w,C;if(m==="top"||m==="bottom")w=m,C=g===(await(n.isRTL==null?void 0:n.isRTL(s.floating))?"start":"end")?"left":"right";else C=m,w=g==="end"?"top":"bottom";let L=v-f.top-f.bottom,k=x-f.left-f.right,I=qn(v-f[w],L),T=qn(x-f[C],k),R=t.middlewareData.shift,E=!R,M=I,P=T;if(R!=null&&R.enabled.x)P=k;if(R!=null&&R.enabled.y)M=L;if(E&&!g)if(h)P=x-2*Jo(f.left,f.right);else M=v-2*Jo(f.top,f.bottom);await l({...t,availableWidth:P,availableHeight:M});let O=await n.getDimensions(s.floating);if(x!==O.width||v!==O.height)return{reset:{rects:!0}};return{}}}};function e0(){return typeof window<"u"}function uu(e){if(_z(e))return(e.nodeName||"").toLowerCase();return"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yn(e){var t;return(t=(_z(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _z(e){if(!e0())return!1;return e instanceof Node||e instanceof yr(e).Node}function tn(e){if(!e0())return!1;return e instanceof Element||e instanceof yr(e).Element}function Vi(e){if(!e0())return!1;return e instanceof HTMLElement||e instanceof yr(e).HTMLElement}function Oz(e){if(!e0()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function nh(e){let{overflow:t,overflowX:a,overflowY:r,display:n}=an(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+a)&&n!=="inline"&&n!=="contents"}function zz(e){return/^(table|td|th)$/.test(uu(e))}function ih(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var oZ=/transform|translate|scale|rotate|perspective|filter/,nZ=/paint|layout|strict|content/,lu=(e)=>!!e&&e!=="none",M2;function t0(e){let t=tn(e)?an(e):e;return lu(t.transform)||lu(t.translate)||lu(t.scale)||lu(t.rotate)||lu(t.perspective)||!a0()&&(lu(t.backdropFilter)||lu(t.filter))||oZ.test(t.willChange||"")||nZ.test(t.contain||"")}function Bz(e){let t=gl(e);while(Vi(t)&&!wf(t)){if(t0(t))return t;else if(ih(t))return null;t=gl(t)}return null}function a0(){if(M2==null)M2=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return M2}function wf(e){return/^(html|body|#document)$/.test(uu(e))}function an(e){return yr(e).getComputedStyle(e)}function sh(e){if(tn(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gl(e){if(uu(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Oz(e)&&e.host||Yn(e);return Oz(t)?t.host:t}function Fz(e){let t=gl(e);if(wf(t))return(e.ownerDocument||e).body;if(Vi(t)&&nh(t))return t;return Fz(t)}function cu(e,t,a){var r;if(t===void 0)t=[];if(a===void 0)a=!0;let n=Fz(e),s=n===((r=e.ownerDocument)==null?void 0:r.body),l=yr(n);if(s){let c=r0(l);return t.concat(l,l.visualViewport||[],nh(n)?n:[],c&&a?cu(c):[])}else return t.concat(n,cu(n,[],a))}function r0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vz(e){let t=an(e),a=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=Vi(e),s=n?e.offsetWidth:a,l=n?e.offsetHeight:r,c=rh(a)!==s||rh(r)!==l;if(c)a=s,r=l;return{width:a,height:r,$:c}}function E2(e){return!tn(e)?e.contextElement:e}function Sf(e){let t=E2(e);if(!Vi(t))return Kn(1);let a=t.getBoundingClientRect(),{width:r,height:n,$:s}=Vz(t),l=(s?rh(a.width):a.width)/r,c=(s?rh(a.height):a.height)/n;if(!l||!Number.isFinite(l))l=1;if(!c||!Number.isFinite(c))c=1;return{x:l,y:c}}var iZ=Kn(0);function jz(e){let t=yr(e);if(!a0()||!t.visualViewport)return iZ;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sZ(e,t,a){if(t===void 0)t=!1;return!!a&&t&&a===yr(e)}function du(e,t,a,r){if(t===void 0)t=!1;if(a===void 0)a=!1;let n=e.getBoundingClientRect(),s=E2(e),l=Kn(1);if(t)if(r){if(tn(r))l=Sf(r)}else l=Sf(e);let c=sZ(s,a,r)?jz(s):Kn(0),f=(n.left+c.x)/l.x,m=(n.top+c.y)/l.y,g=n.width/l.x,h=n.height/l.y;if(s&&r){let x=yr(s),v=tn(r)?yr(r):r,w=x,C=r0(w);while(C&&v!==w){let L=Sf(C),k=C.getBoundingClientRect(),I=an(C),T=k.left+(C.clientLeft+parseFloat(I.paddingLeft))*L.x,R=k.top+(C.clientTop+parseFloat(I.paddingTop))*L.y;f*=L.x,m*=L.y,g*=L.x,h*=L.y,f+=T,m+=R,w=yr(C),C=r0(w)}}return su({width:g,height:h,x:f,y:m})}function o0(e,t){let a=sh(e).scrollLeft;if(!t)return du(Yn(e)).left+a;return t.left+a}function Gz(e,t){let a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-o0(e,a),n=a.top+t.scrollTop;return{x:r,y:n}}function lZ(e){let{elements:t,rect:a,offsetParent:r,strategy:n}=e,s=n==="fixed",l=Yn(r),c=t?ih(t.floating):!1;if(r===l||c&&s)return a;let f={scrollLeft:0,scrollTop:0},m=Kn(1),g=Kn(0),h=Vi(r);if(h||!s){if(uu(r)!=="body"||nh(l))f=sh(r);if(h){let v=du(r);m=Sf(r),g.x=v.x+r.clientLeft,g.y=v.y+r.clientTop}}let x=l&&!h&&!s?Gz(l,f):Kn(0);return{width:a.width*m.x,height:a.height*m.y,x:a.x*m.x-f.scrollLeft*m.x+g.x+x.x,y:a.y*m.y-f.scrollTop*m.y+g.y+x.y}}function cZ(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function uZ(e){let t=sh(e),a=e.ownerDocument.body,r=Jo(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),n=Jo(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight),s=-t.scrollLeft+o0(e),l=-t.scrollTop;if(an(a).direction==="rtl")s+=Jo(e.clientWidth,a.clientWidth)-r;return{width:r,height:n,x:s,y:l}}var dZ=25;function fZ(e,t,a){if(a===void 0)a="viewport";let r=a==="layoutViewport",n=yr(e),s=Yn(e),l=n.visualViewport,{clientWidth:c,clientHeight:f}=s,m=0,g=0;if(l){let x=!a0()||t==="fixed";if(r){if(!x)m=-l.offsetLeft,g=-l.offsetTop}else if(c=l.width,f=l.height,x)m=l.offsetLeft,g=l.offsetTop}if(o0(s)<=0){let x=s.ownerDocument,v=x.body,w=getComputedStyle(v),C=x.compatMode==="CSS1Compat"?parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0:0,L=Math.abs(s.clientWidth-v.clientWidth-C),k=getComputedStyle(s).scrollbarGutter==="stable both-edges"?L/2:L;if(k<=dZ)c-=k}return{width:c,height:f,x:m,y:g}}function pZ(e,t){let a=du(e,!0,t==="fixed"),r=a.top+e.clientTop,n=a.left+e.clientLeft,s=Sf(e),l=e.clientWidth*s.x,c=e.clientHeight*s.y,f=n*s.x,m=r*s.y;return{width:l,height:c,x:f,y:m}}function Uz(e,t,a){let r;if(t==="viewport"||t==="layoutViewport")r=fZ(e,a,t);else if(t==="document")r=uZ(Yn(e));else if(tn(t))r=pZ(t,a);else{let n=jz(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return su(r)}function mZ(e,t){let a=t.get(e);if(a)return a;let r=cu(e,[],!1).filter((c)=>tn(c)&&uu(c)!=="body"),n=null,s=an(e).position==="fixed",l=s?gl(e):e;while(tn(l)&&!wf(l)){let c=an(l),f=t0(l),m=n?n.position:s?"fixed":"";if(!f&&(m==="fixed"||m==="absolute"&&c.position==="static"))r=r.filter((h)=>h!==l);else n=c;l=gl(l)}return t.set(e,r),r}function gZ(e){let{element:t,boundary:a,rootBoundary:r,strategy:n}=e,l=[...a==="clippingAncestors"?ih(t)?[]:mZ(t,this._c):[].concat(a),r],c=Uz(t,l[0],n),{top:f,right:m,bottom:g,left:h}=c;for(let x=1;x<l.length;x++){let v=Uz(t,l[x],n);f=Jo(v.top,f),m=qn(v.right,m),g=qn(v.bottom,g),h=Jo(v.left,h)}return{width:m-h,height:g-f,x:h,y:f}}function hZ(e){let{width:t,height:a}=Vz(e);return{width:t,height:a}}function xZ(e,t,a){let r=Vi(t),n=Yn(t),s=a==="fixed",l=du(e,!0,s,t),c={scrollLeft:0,scrollTop:0},f=Kn(0);if(r||!s){if(uu(t)!=="body"||nh(n))c=sh(t);if(r){let x=du(t,!0,s,t);f.x=x.x+t.clientLeft,f.y=x.y+t.clientTop}}if(!r&&n)f.x=o0(n);let m=n&&!r&&!s?Gz(n,c):Kn(0),g=l.left+c.scrollLeft-f.x-m.x,h=l.top+c.scrollTop-f.y-m.y;return{x:g,y:h,width:l.width,height:l.height}}function P2(e){return an(e).position==="static"}function Hz(e,t){if(!Vi(e)||an(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;if(Yn(e)===a)a=a.ownerDocument.body;return a}function qz(e,t){let a=yr(e);if(ih(e))return a;if(!Vi(e)){let n=gl(e);while(n&&!wf(n)){if(tn(n)&&!P2(n))return n;n=gl(n)}return a}let r=Hz(e,t);while(r&&zz(r)&&P2(r))r=Hz(r,t);if(r&&wf(r)&&P2(r)&&!t0(r))return a;return r||Bz(e)||a}var vZ=async function(e){let t=this.getOffsetParent||qz,a=this.getDimensions,r=await a(e.floating);return{reference:xZ(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bZ(e){return an(e).direction==="rtl"}var Kz={convertOffsetParentRelativeRectToViewportRelativeRect:lZ,getDocumentElement:Yn,getClippingRect:gZ,getOffsetParent:qz,getElementRects:vZ,getClientRects:cZ,getDimensions:hZ,getScale:Sf,isElement:tn,isRTL:bZ};function Xz(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yZ(e,t,a){let r=null,n,s=Yn(e);function l(){var g;clearTimeout(n),(g=r)==null||g.disconnect(),r=null}function c(g,h){if(g===void 0)g=!1;if(h===void 0)h=1;l();let x=e.getBoundingClientRect(),{left:v,top:w,width:C,height:L}=x;if(!g)t();if(!C||!L)return;let k=oh(w),I=oh(s.clientWidth-(v+C)),T=oh(s.clientHeight-(w+L)),R=oh(v),M={rootMargin:-k+"px "+-I+"px "+-T+"px "+-R+"px",threshold:Jo(0,qn(1,h))||1},P=!0;function O(F){let z=F[0].intersectionRatio;if(!Xz(x,e.getBoundingClientRect()))return c();if(z!==h){if(!P)return c();if(!z)n=setTimeout(()=>{c(!1,0.0000001)},1000);else c(!1,z)}P=!1}try{r=new IntersectionObserver(O,{...M,root:s.ownerDocument})}catch(F){r=new IntersectionObserver(O,M)}r.observe(e)}let f=yr(e),m=()=>c(a);return f.addEventListener("resize",m),c(!0),()=>{f.removeEventListener("resize",m),l()}}function N2(e,t,a,r){if(r===void 0)r={};let{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver==="function",layoutShift:c=typeof IntersectionObserver==="function",animationFrame:f=!1}=r,m=E2(e),g=n||s?[...m?cu(m):[],...t?cu(t):[]]:[];g.forEach((k)=>{n&&k.addEventListener("scroll",a),s&&k.addEventListener("resize",a)});let h=m&&c?yZ(m,a,s):null,x=-1,v=null;if(l){if(v=new ResizeObserver((k)=>{let[I]=k;if(I&&I.target===m&&v&&t)v.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(t)});a()}),m&&!f)v.observe(m);if(t)v.observe(t)}let w,C=f?du(e):null;if(f)L();function L(){let k=du(e);if(C&&!Xz(C,k))a();C=k,w=requestAnimationFrame(L)}return a(),()=>{var k;if(g.forEach((I)=>{n&&I.removeEventListener("scroll",a),s&&I.removeEventListener("resize",a)}),h==null||h(),(k=v)==null||k.disconnect(),v=null,f)cancelAnimationFrame(w)}}var Yz=Pz;var Wz=Ez,$z=Rz,Qz=Dz,Zz=Az,D2=Tz;var Jz=Nz,O2=(e,t,a)=>{let r=new Map,n=a!=null?a:{},s={...Kz,...n.platform,_c:r};return Lz(e,t,{...n,platform:s})};var wZ=typeof document<"u",SZ=function(){},n0=wZ?Vt:SZ;function i0(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let a,r,n;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(r=a;r--!==0;)if(!i0(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),a=n.length,a!==Object.keys(t).length)return!1;for(r=a;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=a;r--!==0;){let s=n[r];if(s==="_owner"&&e.$$typeof)continue;if(!i0(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function t6(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function e6(e,t){let a=t6(e);return Math.round(t*a)/a}function _2(e){let t=B(e);return n0(()=>{t.current=e}),t}function a6(e){if(e===void 0)e={};let{placement:t="bottom",strategy:a="absolute",middleware:r=[],platform:n,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:f,open:m}=e,[g,h]=A({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[x,v]=A(r);if(!i0(x,r))v(r);let[w,C]=A(null),[L,k]=A(null),I=j((Z)=>{if(Z!==M.current)M.current=Z,C(Z)},[]),T=j((Z)=>{if(Z!==P.current)P.current=Z,k(Z)},[]),R=s||w,E=l||L,M=B(null),P=B(null),O=B(g),F=f!=null,z=_2(f),Y=_2(n),q=_2(m),G=j(()=>{if(!M.current||!P.current)return;let Z={placement:t,strategy:a,middleware:x};if(Y.current)Z.platform=Y.current;O2(M.current,P.current,Z).then((te)=>{let D={...te,isPositioned:q.current!==!1};if(Q.current&&!i0(O.current,D))O.current=D,ps(()=>{h(D)})})},[x,t,a,Y,q]);n0(()=>{if(m===!1&&O.current.isPositioned)O.current.isPositioned=!1,h((Z)=>({...Z,isPositioned:!1}))},[m]);let Q=B(!1);n0(()=>(Q.current=!0,()=>{Q.current=!1}),[]),n0(()=>{if(R)M.current=R;if(E)P.current=E;if(R&&E){if(z.current)return z.current(R,E,G);G()}},[R,E,G,z,F]);let re=de(()=>({reference:M,floating:P,setReference:I,setFloating:T}),[I,T]),J=de(()=>({reference:R,floating:E}),[R,E]),X=de(()=>{let Z={position:a,left:0,top:0};if(!J.floating)return Z;let te=e6(J.floating,g.x),D=e6(J.floating,g.y);if(c)return{...Z,transform:"translate("+te+"px, "+D+"px)",...t6(J.floating)>=1.5&&{willChange:"transform"}};return{position:a,left:te,top:D}},[a,c,J.floating,g.x,g.y]);return de(()=>({...g,update:G,refs:re,elements:J,floatingStyles:X}),[g,G,re,J,X])}var kZ=(e)=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){let{element:r,padding:n}=typeof e==="function"?e(a):e;if(r&&t(r)){if(r.current!=null)return D2({element:r.current,padding:n}).fn(a);return{}}if(r)return D2({element:r,padding:n}).fn(a);return{}}}},r6=(e,t)=>{let a=Yz(e);return{name:a.name,fn:a.fn,options:[e,t]}},o6=(e,t)=>{let a=Wz(e);return{name:a.name,fn:a.fn,options:[e,t]}},n6=(e,t)=>({fn:Jz(e).fn,options:[e,t]}),i6=(e,t)=>{let a=$z(e);return{name:a.name,fn:a.fn,options:[e,t]}},s6=(e,t)=>{let a=Qz(e);return{name:a.name,fn:a.fn,options:[e,t]}};var l6=(e,t)=>{let a=Zz(e);return{name:a.name,fn:a.fn,options:[e,t]}};var c6=(e,t)=>{let a=kZ(e);return{name:a.name,fn:a.fn,options:[e,t]}};var CZ=Object.defineProperty,IZ=(e,t)=>CZ(e,"name",{value:t,configurable:!0}),LZ=ne(IZ(function(t,a){let{children:r,width:n=10,height:s=5,...l}=t;return d(_e.svg,{...l,ref:a,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:d("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),u6=LZ;var RZ=Object.defineProperty,AZ=(e,t)=>RZ(e,"name",{value:t,configurable:!0});function lh(e){let[t,a]=A(void 0);return nt(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let r=new ResizeObserver((n)=>{if(!Array.isArray(n))return;if(!n.length)return;let s=n[0],l,c;if("borderBoxSize"in s){let f=s.borderBoxSize,m=Array.isArray(f)?f[0]:f;l=m.inlineSize,c=m.blockSize}else l=e.offsetWidth,c=e.offsetHeight;a({width:l,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else a(void 0)},[e]),t}AZ(lh,"useSize");var MZ=Object.defineProperty,ji=(e,t)=>MZ(e,"name",{value:t,configurable:!0});var d6="Popper",[f6,Co]=Tt(d6),[PZ,p6]=f6(d6),EZ=ji((e)=>{let{__scopePopper:t,children:a}=e,[r,n]=A(null),[s,l]=A(void 0);return d(PZ,{scope:t,anchor:r,onAnchorChange:n,placementState:s,setPlacementState:l,children:a})},"Popper"),NZ="PopperAnchor",DZ=ne(ji(function(t,a){let{__scopePopper:r,virtualRef:n,...s}=t,l=p6(NZ,r),c=B(null),f=l.onAnchorChange,m=j((C)=>{if(c.current=C,C)f(C)},[f]),g=Oe(a,m),h=B(null);U(()=>{if(!n)return;let C=h.current;if(h.current=n.current,C!==h.current)f(h.current)});let x=l.placementState&&s0(l.placementState),v=x?.[0],w=x?.[1];return n?null:d(_e.div,{"data-radix-popper-side":v,"data-radix-popper-align":w,...s,ref:g})},"PopperAnchor")),m6="PopperContent",[OZ,_Z]=f6(m6),zZ=ne(ji(function(t,a){let{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:m=!0,collisionBoundary:g=[],collisionPadding:h=0,sticky:x="partial",hideWhenDetached:v=!1,updatePositionStrategy:w="optimized",onPlaced:C,...L}=t,k=p6(m6,r),[I,T]=A(null),R=Oe(a,T),[E,M]=A(null),P=lh(E),O=P?.width??0,F=P?.height??0,z=n+(l!=="center"?"-"+l:""),Y=typeof h==="number"?h:{top:0,right:0,bottom:0,left:0,...h},q=Array.isArray(g)?g:[g],G=q.length>0,Q={padding:Y,boundary:q.filter(g6),altBoundary:G},{refs:re,floatingStyles:J,placement:X,isPositioned:Z,middlewareData:te}=a6({strategy:"fixed",placement:z,whileElementsMounted:ji((...he)=>N2(...he,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:k.anchor},middleware:[r6({mainAxis:s+F,alignmentAxis:c}),m&&o6({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?n6():void 0,...Q}),m&&i6({...Q}),s6({...Q,apply:ji(({elements:he,rects:ue,availableWidth:K,availableHeight:ee})=>{let{width:W,height:ve}=ue.reference,Ee=he.floating.style;Ee.setProperty("--radix-popper-available-width",`${K}px`),Ee.setProperty("--radix-popper-available-height",`${ee}px`),Ee.setProperty("--radix-popper-anchor-width",`${W}px`),Ee.setProperty("--radix-popper-anchor-height",`${ve}px`)},"apply")}),E&&c6({element:E,padding:f}),HZ({arrowWidth:O,arrowHeight:F}),v&&l6({strategy:"referenceHidden",...Q,boundary:G?Q.boundary:void 0})]}),D=k.setPlacementState;nt(()=>(D(X),()=>{D(void 0)}),[X,D]);let[Te,Le]=s0(X),H=Ta(C);nt(()=>{if(Z)H?.()},[Z,H]);let me=te.arrow?.x,Ce=te.arrow?.y,ge=te.arrow?.centerOffset!==0,[He,ce]=A();return nt(()=>{if(I)ce(window.getComputedStyle(I).zIndex)},[I]),d("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:Z?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:He,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d(OZ,{scope:r,placedSide:Te,placedAlign:Le,onArrowChange:M,arrowX:me,arrowY:Ce,shouldHideArrow:ge,children:d(_e.div,{"data-side":Te,"data-align":Le,...L,ref:R,style:{...L.style,animation:!Z?"none":L.style?.animation}})})})},"PopperContent")),BZ="PopperArrow",FZ={top:"bottom",right:"left",bottom:"top",left:"right"},UZ=ne(ji(function(t,a){let{__scopePopper:r,...n}=t,s=_Z(BZ,r),l=FZ[s.placedSide];return d("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:d(u6,{...n,ref:a,style:{...n.style,display:"block"}})})},"PopperArrow"));function g6(e){return e!==null}ji(g6,"isNotNull");var HZ=ji((e)=>({name:"transformOrigin",options:e,fn(t){let{placement:a,rects:r,middlewareData:n}=t,l=n.arrow?.centerOffset!==0,c=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[m,g]=s0(a),h={start:"0%",center:"50%",end:"100%"}[g],x=(n.arrow?.x??0)+c/2,v=(n.arrow?.y??0)+f/2,w="",C="";if(m==="bottom")w=l?h:`${x}px`,C=`${-f}px`;else if(m==="top")w=l?h:`${x}px`,C=`${r.floating.height+f}px`;else if(m==="right")w=`${-f}px`,C=l?h:`${v}px`;else if(m==="left")w=`${r.floating.width+f}px`,C=l?h:`${v}px`;return{data:{x:w,y:C}}}}),"transformOrigin");function s0(e){let[t,a="center"]=e.split("-");return[t,a]}ji(s0,"getSideAndAlignFromPlacement");var hl=EZ,xl=DZ,vl=zZ,ch=UZ;var VZ=Object.defineProperty,B2=(e,t)=>VZ(e,"name",{value:t,configurable:!0}),z2=!1;function h6(){let[e,t]=A(z2);return U(()=>{if(!z2)z2=!0,t(!0)},[]),e}B2(h6,"useIsHydrated");var x6=Pe[" useSyncExternalStore ".trim().toString()];function v6(){return()=>{}}B2(v6,"subscribe");function b6(){return x6(v6,()=>!0,()=>!1)}B2(b6,"useIsHydratedModern");var y6=typeof x6==="function"?b6:h6;var jZ=Object.defineProperty,fu=(e,t)=>jZ(e,"name",{value:t,configurable:!0}),F2="rovingFocusGroup.onEntryFocus",GZ={bubbles:!1,cancelable:!0},c0="RovingFocusGroup",[U2,w6,qZ]=ou(c0),[KZ,H2]=Tt(c0,[qZ]),[XZ,YZ]=KZ(c0),WZ=ne(fu(function(t,a){return d(U2.Provider,{scope:t.__scopeRovingFocusGroup,children:d(U2.Slot,{scope:t.__scopeRovingFocusGroup,children:d($Z,{...t,ref:a})})})},"RovingFocusGroup")),$Z=ne(fu(function(t,a){let{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:g,preventScrollOnEntryFocus:h=!1,...x}=t,v=B(null),w=Oe(a,v),C=nu(l),[L,k]=Ia({prop:c,defaultProp:f??null,onChange:m,caller:c0}),[I,T]=A(!1),R=Ta(g),E=w6(r),M=B(!1),[P,O]=A(0);return U(()=>{let F=v.current;if(F)return F.addEventListener(F2,R),()=>F.removeEventListener(F2,R)},[R]),d(XZ,{scope:r,orientation:n,dir:C,loop:s,currentTabStopId:L,onItemFocus:j((F)=>k(F),[k]),onItemShiftTab:j(()=>T(!0),[]),onFocusableItemAdd:j(()=>O((F)=>F+1),[]),onFocusableItemRemove:j(()=>O((F)=>F-1),[]),children:d(_e.div,{tabIndex:I||P===0?-1:0,"data-orientation":n,...x,ref:w,style:{outline:"none",...t.style},onMouseDown:ke(t.onMouseDown,()=>{M.current=!0}),onFocus:ke(t.onFocus,(F)=>{let z=!M.current;if(F.target===F.currentTarget&&z&&!I){let Y=new CustomEvent(F2,GZ);if(F.currentTarget.dispatchEvent(Y),!Y.defaultPrevented){let q=E().filter((X)=>X.focusable),G=q.find((X)=>X.active),Q=q.find((X)=>X.id===L),J=[G,Q,...q].filter(Boolean).map((X)=>X.ref.current);V2(J,h)}}M.current=!1}),onBlur:ke(t.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),QZ="RovingFocusGroupItem",ZZ=ne(fu(function(t,a){let{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:l,children:c,...f}=t,m=ga(),g=l||m,h=YZ(QZ,r),x=h.currentTabStopId===g,v=w6(r),{onFocusableItemAdd:w,onFocusableItemRemove:C,currentTabStopId:L}=h,k=y6();return nt(()=>{if(!k||!n)return;return w(),()=>C()},[k,n,w,C]),U(()=>{if(k||!n)return;return w(),()=>C()},[k,n,w,C]),d(U2.ItemSlot,{scope:r,id:g,focusable:n,active:s,children:d(_e.span,{tabIndex:x?0:-1,"data-orientation":h.orientation,...f,ref:a,onMouseDown:ke(t.onMouseDown,(I)=>{if(!n)I.preventDefault();else h.onItemFocus(g)}),onFocus:ke(t.onFocus,()=>h.onItemFocus(g)),onKeyDown:ke(t.onKeyDown,(I)=>{if(I.key==="Tab"&&I.shiftKey){h.onItemShiftTab();return}if(I.target!==I.currentTarget)return;let T=k6(I,h.orientation,h.dir);if(T!==void 0){if(I.metaKey||I.ctrlKey||I.altKey||I.shiftKey)return;I.preventDefault();let E=v().filter((M)=>M.focusable).map((M)=>M.ref.current);if(T==="last")E.reverse();else if(T==="prev"||T==="next"){if(T==="prev")E.reverse();let M=E.indexOf(I.currentTarget);E=h.loop?C6(E,M+1):E.slice(M+1)}setTimeout(()=>V2(E))}}),children:typeof c==="function"?c({isCurrentTabStop:x,hasTabStop:L!=null}):c})})},"RovingFocusGroupItem")),JZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S6(e,t){if(t!=="rtl")return e;return e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}fu(S6,"getDirectionAwareKey");function k6(e,t,a){let r=S6(e.key,a);if(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))return;if(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r))return;return JZ[r]}fu(k6,"getFocusIntent");function V2(e,t=!1){let a=document.activeElement;for(let r of e){if(r===a)return;if(r.focus({preventScroll:t}),document.activeElement!==a)return}}fu(V2,"focusFirst");function C6(e,t){return e.map((a,r)=>e[(t+r)%e.length])}fu(C6,"wrapArray");var I6=WZ,L6=ZZ;var tJ=Object.defineProperty,kt=(e,t)=>tJ(e,"name",{value:t,configurable:!0}),j2=["Enter"," "],aJ=["ArrowDown","PageUp","Home"],R6=["ArrowUp","PageDown","End"],rJ=[...aJ,...R6],EVa={ltr:[...j2,"ArrowRight"],rtl:[...j2,"ArrowLeft"]};var d0="Menu",[G2,oJ,nJ]=ou(d0),[pu,K2]=Tt(d0,[nJ,Co,H2]),X2=Co(),A6=H2(),[iJ,uh]=pu(d0),[sJ,Y2]=pu(d0),lJ=kt((e)=>{let{__scopeMenu:t,open:a=!1,children:r,dir:n,onOpenChange:s,modal:l=!0}=e,c=X2(t),[f,m]=A(null),g=B(!1),h=Ta(s),x=nu(n);return U(()=>{let v=kt(()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},"handleKeyDown"),w=kt(()=>g.current=!1,"handlePointer");return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),U(()=>{if(!a)return;let v=kt(()=>h(!1),"handleBlur");return window.addEventListener("blur",v),()=>window.removeEventListener("blur",v)},[a,h]),d(hl,{...c,children:d(iJ,{scope:t,open:a,onOpenChange:h,content:f,onContentChange:m,children:d(sJ,{scope:t,onClose:j(()=>h(!1),[h]),isUsingKeyboardRef:g,dir:x,modal:l,children:r})})})},"Menu"),cJ=ne(kt(function(t,a){let{__scopeMenu:r,...n}=t,s=X2(r);return d(xl,{...s,...n,ref:a})},"MenuAnchor")),M6="MenuPortal",[uJ,dJ]=pu(M6,{forceMount:void 0}),fJ=kt((e)=>{let{__scopeMenu:t,forceMount:a,children:r,container:n}=e,s=uh(M6,t);return d(uJ,{scope:t,forceMount:a,children:d(Xa,{present:a||s.open,children:d(jn,{asChild:!0,container:n,children:r})})})},"MenuPortal"),bl="MenuContent",[pJ,P6]=pu(bl),mJ=ne(kt(function(t,a){let r=dJ(bl,t.__scopeMenu),{forceMount:n=r.forceMount,...s}=t,l=uh(bl,t.__scopeMenu),c=Y2(bl,t.__scopeMenu);return d(G2.Provider,{scope:t.__scopeMenu,children:d(Xa,{present:n||l.open,children:d(G2.Slot,{scope:t.__scopeMenu,children:c.modal?d(gJ,{...s,ref:a}):d(hJ,{...s,ref:a})})})})},"MenuContent")),gJ=ne(kt(function(t,a){let r=uh(bl,t.__scopeMenu),n=B(null),s=Oe(a,n);return U(()=>{let l=n.current;if(l)return pl(l)},[]),d(E6,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ke(t.onFocusOutside,(l)=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),hJ=ne(kt(function(t,a){let r=uh(bl,t.__scopeMenu);return d(E6,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),xJ=La("MenuContent.ScrollLock"),E6=ne(kt(function(t,a){let{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:f,onEntryFocus:m,onEscapeKeyDown:g,onPointerDownOutside:h,onFocusOutside:x,onInteractOutside:v,onDismiss:w,disableOutsideScroll:C,...L}=t,k=uh(bl,r),I=Y2(bl,r),T=X2(r),R=A6(r),E=oJ(r),[M,P]=A(null),O=B(null),F=Oe(a,O,k.onContentChange),z=B(0),Y=B(""),q=B(0),G=B(null),Q=B("right"),re=B(0),J=C?Bi:Za,X=C?{as:xJ,allowPinchZoom:!0}:void 0,Z=kt((D)=>{let Te=Y.current+D,Le=E().filter((ce)=>!ce.disabled),H=document.activeElement,me=Le.find((ce)=>ce.ref.current===H)?.textValue,Ce=Le.map((ce)=>ce.textValue),ge=z6(Ce,Te,me),He=Le.find((ce)=>ce.textValue===ge)?.ref.current;if(kt(function ce(he){if(Y.current=he,window.clearTimeout(z.current),he!=="")z.current=window.setTimeout(()=>ce(""),1000)},"updateSearch")(Te),He)setTimeout(()=>He.focus())},"handleTypeaheadSearch");U(()=>()=>window.clearTimeout(z.current),[]),Gn();let te=j((D)=>Q.current===G.current?.side&&F6(D,G.current?.area),[]);return d(pJ,{scope:r,searchRef:Y,onItemEnter:j((D)=>{if(te(D))D.preventDefault()},[te]),onItemLeave:j((D)=>{if(te(D))return;O.current?.focus(),P(null)},[te]),onTriggerLeave:j((D)=>{if(te(D))D.preventDefault()},[te]),pointerGraceTimerRef:q,onPointerGraceIntentChange:j((D)=>{G.current=D},[]),children:d(J,{...X,children:d(fl,{asChild:!0,trapped:s,onMountAutoFocus:ke(l,(D)=>{D.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:d(Vn,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:g,onPointerDownOutside:h,onFocusOutside:x,onInteractOutside:v,onDismiss:w,children:d(I6,{asChild:!0,...R,dir:I.dir,orientation:"vertical",loop:n,currentTabStopId:M,onCurrentTabStopIdChange:P,onEntryFocus:ke(m,(D)=>{if(!I.isUsingKeyboardRef.current)D.preventDefault()}),preventScrollOnEntryFocus:!0,children:d(vl,{role:"menu","aria-orientation":"vertical","data-state":N6(k.open),"data-radix-menu-content":"",dir:I.dir,...T,...L,ref:F,style:{outline:"none",...L.style},onKeyDown:ke(L.onKeyDown,(D)=>{let Le=D.target.closest("[data-radix-menu-content]")===D.currentTarget,H=D.ctrlKey||D.altKey||D.metaKey,me=D.key.length===1;if(Le){if(D.key==="Tab")D.preventDefault();if(!H&&me)Z(D.key)}let Ce=O.current;if(D.target!==Ce)return;if(!rJ.includes(D.key))return;D.preventDefault();let He=E().filter((ce)=>!ce.disabled).map((ce)=>ce.ref.current);if(R6.includes(D.key))He.reverse();O6(He)}),onBlur:ke(t.onBlur,(D)=>{if(!D.currentTarget.contains(D.target))window.clearTimeout(z.current),Y.current=""}),onPointerMove:ke(t.onPointerMove,u0((D)=>{let Te=D.target,Le=re.current!==D.clientX;if(D.currentTarget.contains(Te)&&Le){let H=D.clientX>re.current?"right":"left";Q.current=H,re.current=D.clientX}}))})})})})})})},"MenuContentImpl")),vJ=ne(kt(function(t,a){let{__scopeMenu:r,...n}=t;return d(_e.div,{role:"group",...n,ref:a})},"MenuGroup")),bJ=ne(kt(function(t,a){let{__scopeMenu:r,...n}=t;return d(_e.div,{...n,ref:a})},"MenuLabel")),q2="MenuItem",T6="menu.itemSelect",yJ=ne(kt(function(t,a){let{disabled:r=!1,onSelect:n,...s}=t,l=B(null),c=Y2(q2,t.__scopeMenu),f=P6(q2,t.__scopeMenu),m=Oe(a,l),g=B(!1),h=kt(()=>{let x=l.current;if(!r&&x){let v=new CustomEvent(T6,{bubbles:!0,cancelable:!0});if(x.addEventListener(T6,(w)=>n?.(w),{once:!0}),qg(x,v),v.defaultPrevented)g.current=!1;else c.onClose()}},"handleSelect");return d(wJ,{...s,ref:m,disabled:r,onClick:ke(t.onClick,h),onPointerDown:(x)=>{t.onPointerDown?.(x),g.current=!0},onPointerUp:ke(t.onPointerUp,(x)=>{if(!g.current)x.currentTarget?.click()}),onKeyDown:ke(t.onKeyDown,(x)=>{if(r||x.target!==x.currentTarget)return;if(f.searchRef.current!==""&&x.key===" ")return;if(j2.includes(x.key))x.currentTarget.click(),x.preventDefault()})})},"MenuItem")),wJ=ne(kt(function(t,a){let{__scopeMenu:r,disabled:n=!1,textValue:s,...l}=t,c=P6(q2,r),f=A6(r),m=B(null),g=Oe(a,m),[h,x]=A(!1),[v,w]=A("");return U(()=>{let C=m.current;if(C)w((C.textContent??"").trim())},[l.children]),d(G2.ItemSlot,{scope:r,disabled:n,textValue:s??v,children:d(L6,{asChild:!0,...f,focusable:!n,children:d(_e.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...l,ref:g,onPointerMove:ke(t.onPointerMove,u0((C)=>{if(n)c.onItemLeave(C);else if(c.onItemEnter(C),!C.defaultPrevented)C.currentTarget.focus({preventScroll:!0})})),onPointerLeave:ke(t.onPointerLeave,u0((C)=>c.onItemLeave(C))),onFocus:ke(t.onFocus,()=>x(!0)),onBlur:ke(t.onBlur,()=>x(!1))})})})},"MenuItemImpl"));var SJ="MenuRadioGroup",[NVa,DVa]=pu(SJ,{value:void 0,onValueChange:kt(()=>{},"onValueChange")});var kJ="MenuItemIndicator",[OVa,_Va]=pu(kJ,{checked:!1});var CJ=ne(kt(function(t,a){let{__scopeMenu:r,...n}=t;return d(_e.div,{role:"separator","aria-orientation":"horizontal",...n,ref:a})},"MenuSeparator"));var IJ="MenuSub",[zVa,BVa]=pu(IJ);function N6(e){return e?"open":"closed"}kt(N6,"getOpenState");function D6(e){return e==="indeterminate"}kt(D6,"isIndeterminate");function LJ(e){return D6(e)?"indeterminate":e?"checked":"unchecked"}kt(LJ,"getCheckedState");function O6(e){let t=document.activeElement;for(let a of e){if(a===t)return;if(a.focus(),document.activeElement!==t)return}}kt(O6,"focusFirst");function _6(e,t){return e.map((a,r)=>e[(t+r)%e.length])}kt(_6,"wrapArray");function z6(e,t,a){let n=t.length>1&&Array.from(t).every((m)=>m===t[0])?t[0]:t,s=a?e.indexOf(a):-1,l=_6(e,Math.max(s,0));if(n.length===1)l=l.filter((m)=>m!==a);let f=l.find((m)=>m.toLowerCase().startsWith(n.toLowerCase()));return f!==a?f:void 0}kt(z6,"getNextMatch");function B6(e,t){let{x:a,y:r}=e,n=!1;for(let s=0,l=t.length-1;s<t.length;l=s++){let c=t[s],f=t[l],{x:m,y:g}=c,{x:h,y:x}=f;if(g>r!==x>r&&a<(h-m)*(r-g)/(x-g)+m)n=!n}return n}kt(B6,"isPointInPolygon");function F6(e,t){if(!t)return!1;let a={x:e.clientX,y:e.clientY};return B6(a,t)}kt(F6,"isPointerInGraceArea");function u0(e){return(t)=>t.pointerType==="mouse"?e(t):void 0}kt(u0,"whenMouse");var U6=lJ,H6=cJ,V6=fJ,j6=mJ,G6=vJ,q6=bJ,K6=yJ;var X6=CJ;var RJ=Object.defineProperty,yl=(e,t)=>RJ(e,"name",{value:t,configurable:!0}),W2="DropdownMenu",[AJ,tja]=Tt(W2,[K2]),wl=K2(),[MJ,Y6]=AJ(W2),PJ=yl((e)=>{let{__scopeDropdownMenu:t,children:a,dir:r,open:n,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,f=wl(t),m=B(null),[g,h]=Ia({prop:n,defaultProp:s??!1,onChange:l,caller:W2});return d(MJ,{scope:t,triggerId:ga(),triggerRef:m,contentId:ga(),open:g,onOpenChange:h,onOpenToggle:j(()=>h((x)=>!x),[h]),modal:c,children:d(U6,{...f,open:g,onOpenChange:h,dir:r,modal:c,children:a})})},"DropdownMenu"),EJ="DropdownMenuTrigger",NJ=ne(yl(function(t,a){let{__scopeDropdownMenu:r,disabled:n=!1,...s}=t,l=Y6(EJ,r),c=wl(r),f=Oe(a,l.triggerRef);return d(H6,{asChild:!0,...c,children:d(_e.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:f,onPointerDown:ke(t.onPointerDown,(m)=>{if(!n&&m.button===0&&m.ctrlKey===!1){if(l.onOpenToggle(),!l.open)m.preventDefault()}}),onKeyDown:ke(t.onKeyDown,(m)=>{if(n)return;if(["Enter"," "].includes(m.key))l.onOpenToggle();if(m.key==="ArrowDown")l.onOpenChange(!0);if(["Enter"," ","ArrowDown"].includes(m.key))m.preventDefault()})})})},"DropdownMenuTrigger")),DJ=yl((e)=>{let{__scopeDropdownMenu:t,...a}=e,r=wl(t);return d(V6,{...r,...a})},"DropdownMenuPortal"),OJ="DropdownMenuContent",_J=ne(yl(function(t,a){let{__scopeDropdownMenu:r,...n}=t,s=Y6(OJ,r),l=wl(r),c=B(!1);return d(j6,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...n,ref:a,onCloseAutoFocus:ke(t.onCloseAutoFocus,(f)=>{if(!c.current)s.triggerRef.current?.focus();c.current=!1,f.preventDefault()}),onInteractOutside:ke(t.onInteractOutside,(f)=>{let m=f.detail.originalEvent,g=m.button===0&&m.ctrlKey===!0,h=m.button===2||g;if(!s.modal||h)c.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")),zJ=ne(yl(function(t,a){let{__scopeDropdownMenu:r,...n}=t,s=wl(r);return d(G6,{...s,...n,ref:a})},"DropdownMenuGroup")),BJ=ne(yl(function(t,a){let{__scopeDropdownMenu:r,...n}=t,s=wl(r);return d(q6,{...s,...n,ref:a})},"DropdownMenuLabel")),FJ=ne(yl(function(t,a){let{__scopeDropdownMenu:r,...n}=t,s=wl(r);return d(K6,{...s,...n,ref:a})},"DropdownMenuItem"));var UJ=ne(yl(function(t,a){let{__scopeDropdownMenu:r,...n}=t,s=wl(r);return d(X6,{...s,...n,ref:a})},"DropdownMenuSeparator"));var HJ=PJ,VJ=NJ,jJ=DJ,GJ=_J,qJ=zJ,KJ=BJ,XJ=FJ;var YJ=UJ;var WJ=Object.defineProperty,$J=(e,t)=>WJ(e,"name",{value:t,configurable:!0}),QJ=ne($J(function(t,a){return d(_e.label,{...t,ref:a,onMouseDown:(r)=>{if(r.target.closest("button, input, select, textarea"))return;if(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1)r.preventDefault()}})},"Label")),ZJ=QJ;var JJ=Object.defineProperty,Sl=(e,t)=>JJ(e,"name",{value:t,configurable:!0}),$2="Popover",[Q6,yja]=Tt($2,[Co]),Q2=Co(),[eee,kf]=Q6($2),tee=Sl((e)=>{let{__scopePopover:t,children:a,open:r,defaultOpen:n,onOpenChange:s,modal:l=!1}=e,c=Q2(t),f=B(null),[m,g]=A(!1),[h,x]=Ia({prop:r,defaultProp:n??!1,onChange:s,caller:$2});return d(hl,{...c,children:d(eee,{scope:t,contentId:ga(),triggerRef:f,open:h,onOpenChange:x,onOpenToggle:j(()=>x((v)=>!v),[x]),hasCustomAnchor:m,onCustomAnchorAdd:j(()=>g(!0),[]),onCustomAnchorRemove:j(()=>g(!1),[]),modal:l,children:a})})},"Popover");var aee="PopoverTrigger",ree=ne(Sl(function(t,a){let{__scopePopover:r,...n}=t,s=kf(aee,r),l=Q2(r),c=Oe(a,s.triggerRef),f=d(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Z2(s.open),...n,ref:c,onClick:ke(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?f:d(xl,{asChild:!0,...l,children:f})},"PopoverTrigger")),Z6="PopoverPortal",[oee,nee]=Q6(Z6,{forceMount:void 0}),iee=Sl((e)=>{let{__scopePopover:t,forceMount:a,children:r,container:n}=e,s=kf(Z6,t);return d(oee,{scope:t,forceMount:a,children:d(Xa,{present:a||s.open,children:d(jn,{asChild:!0,container:n,children:r})})})},"PopoverPortal"),dh="PopoverContent",see=ne(Sl(function(t,a){let r=nee(dh,t.__scopePopover),{forceMount:n=r.forceMount,...s}=t,l=kf(dh,t.__scopePopover);return d(Xa,{present:n||l.open,children:l.modal?d(cee,{...s,ref:a}):d(uee,{...s,ref:a})})},"PopoverContent")),lee=La("PopoverContent.RemoveScroll"),cee=ne(Sl(function(t,a){let r=kf(dh,t.__scopePopover),n=B(null),s=Oe(a,n),l=B(!1);return U(()=>{let c=n.current;if(c)return pl(c)},[]),d(Bi,{as:lee,allowPinchZoom:!0,children:d(J6,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(t.onCloseAutoFocus,(c)=>{if(c.preventDefault(),!l.current)r.triggerRef.current?.focus()}),onPointerDownOutside:ke(t.onPointerDownOutside,(c)=>{let f=c.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,g=f.button===2||m;l.current=g},{checkForDefaultPrevented:!1}),onFocusOutside:ke(t.onFocusOutside,(c)=>c.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),uee=ne(Sl(function(t,a){let r=kf(dh,t.__scopePopover),n=B(!1),s=B(!1);return d(J6,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(l)=>{if(t.onCloseAutoFocus?.(l),!l.defaultPrevented){if(!n.current)r.triggerRef.current?.focus();l.preventDefault()}n.current=!1,s.current=!1},onInteractOutside:(l)=>{if(t.onInteractOutside?.(l),!l.defaultPrevented){if(n.current=!0,l.detail.originalEvent.type==="pointerdown")s.current=!0}let c=l.target;if(r.triggerRef.current?.contains(c))l.preventDefault();if(l.detail.originalEvent.type==="focusin"&&s.current)l.preventDefault()}})},"PopoverContentNonModal")),J6=ne(Sl(function(t,a){let{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:g,onInteractOutside:h,...x}=t,v=kf(dh,r),w=Q2(r);return Gn(),d(fl,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:l,children:d(Vn,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:h,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:g,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:d(vl,{"data-state":Z2(v.open),role:"dialog",id:v.contentId,...w,...x,ref:a,style:{...x.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 Z2(e){return e?"open":"closed"}Sl(Z2,"getState");var dee=tee;var fee=ree,pee=iee,mee=see;var gee=Object.defineProperty,kl=(e,t)=>gee(e,"name",{value:t,configurable:!0}),J2="Switch",[hee,Rja]=Tt(J2),[xee,eI]=hee(J2);function tB(e){let{__scopeSwitch:t,checked:a,children:r,defaultChecked:n,disabled:s,form:l,name:c,onCheckedChange:f,required:m,value:g="on",internal_do_not_use_render:h}=e,[x,v]=Ia({prop:a,defaultProp:n??!1,onChange:f,caller:J2}),[w,C]=A(null),[L,k]=A(null),I=B(!1),[T,R]=us((P)=>P+1,0),E=w?!!l||!!w.closest("form"):!0,M={checked:x,setChecked:v,disabled:s,control:w,setControl:C,name:c,form:l,value:g,hasConsumerStoppedPropagationRef:I,userInteractionCount:T,onUserInteraction:R,required:m,defaultChecked:n,isFormControl:E,bubbleInput:L,setBubbleInput:k};return d(xee,{scope:t,...M,children:aB(h)?h(M):r})}kl(tB,"SwitchProvider");var vee="SwitchTrigger",bee=ne(kl(function({__scopeSwitch:t,onClick:a,...r},n){let{control:s,form:l,value:c,disabled:f,checked:m,required:g,setControl:h,setChecked:x,hasConsumerStoppedPropagationRef:v,onUserInteraction:w,isFormControl:C,bubbleInput:L}=eI(vee,t),k=Oe(n,h),I=B(m);return U(()=>{let T=l?s?.ownerDocument.getElementById(l):s?.form;if(T instanceof HTMLFormElement){let R=kl(()=>x(I.current),"reset");return T.addEventListener("reset",R),()=>T.removeEventListener("reset",R)}},[s,l,x]),d(_e.button,{type:"button",role:"switch","aria-checked":m,"aria-required":g,"data-state":tI(m),"data-disabled":f?"":void 0,disabled:f,value:c,...r,ref:k,onClick:ke(a,(T)=>{if(w(),x((R)=>!R),L&&C){if(v.current=T.isPropagationStopped(),!v.current)T.stopPropagation()}})})},"SwitchTrigger")),yee=ne(kl(function(t,a){let{__scopeSwitch:r,name:n,checked:s,defaultChecked:l,required:c,disabled:f,value:m,onCheckedChange:g,form:h,...x}=t;return d(tB,{__scopeSwitch:r,checked:s,defaultChecked:l,disabled:f,required:c,onCheckedChange:g,name:n,form:h,value:m,internal_do_not_use_render:({isFormControl:v})=>S(se,{children:[d(bee,{...x,ref:a,__scopeSwitch:r}),v&&d(Cee,{__scopeSwitch:r})]})})},"Switch")),wee="SwitchThumb",See=ne(kl(function(t,a){let{__scopeSwitch:r,...n}=t,s=eI(wee,r);return d(_e.span,{"data-state":tI(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:a})},"SwitchThumb")),kee="SwitchBubbleInput",Cee=ne(kl(function({__scopeSwitch:t,onClick:a,...r},n){let{control:s,hasConsumerStoppedPropagationRef:l,userInteractionCount:c,checked:f,defaultChecked:m,required:g,disabled:h,name:x,value:v,form:w,bubbleInput:C,setBubbleInput:L}=eI(kee,t),k=Oe(n,L),I=lh(s),T=B(!1),R=B(f),E=B(c);U(()=>{let P=C;if(!P)return;let O=window.HTMLInputElement.prototype,z=Object.getOwnPropertyDescriptor(O,"checked").set,Y=c!==E.current;E.current=c;let q=R.current!==f;R.current=f;let G=!(Y&&l.current);if(q&&z){T.current=!Y;let Q=new Event("click",{bubbles:G});z.call(P,f),P.dispatchEvent(Q),T.current=!1}},[C,f,l,c]);let M=B(f);return d(_e.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??M.current,required:g,disabled:h,name:x,value:v,form:w,...r,tabIndex:-1,ref:k,onClick:ke(a,(P)=>{if(T.current)P.stopPropagation()}),style:{...r.style,...I,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function aB(e){return typeof e==="function"}kl(aB,"isFunction");function tI(e){return e?"checked":"unchecked"}kl(tI,"getState");var Iee=Object.defineProperty,Lee=(e,t)=>Iee(e,"name",{value:t,configurable:!0}),aI=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"}),Tee=ne(Lee(function(t,a){return d(_e.span,{...t,ref:a,style:{...aI,...t.style}})},"VisuallyHidden")),oB=Tee;var Aee=Object.defineProperty,ha=(e,t)=>Aee(e,"name",{value:t,configurable:!0}),[nI,Gja]=Tt("Tooltip",[Co]),f0=Co(),Mee="TooltipProvider",Pee=700,rI="tooltip.open",[Eee,iI]=nI(Mee),Nee=ha((e)=>{let{__scopeTooltip:t,delayDuration:a=Pee,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=e,l=B(!0),c=B(!1),f=B(0);return U(()=>{let m=f.current;return()=>window.clearTimeout(m)},[]),d(Eee,{scope:t,isOpenDelayedRef:l,delayDuration:a,onOpen:j(()=>{if(r<=0)return;window.clearTimeout(f.current),l.current=!1},[r]),onClose:j(()=>{if(r<=0)return;window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:j((m)=>{c.current=m},[]),disableHoverableContent:n,children:s})},"TooltipProvider"),oI="Tooltip",[Dee,ph]=nI(oI),Oee=ha((e)=>{let{__scopeTooltip:t,children:a,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,f=iI(oI,e.__scopeTooltip),m=f0(t),[g,h]=A(null),[x,v]=A(void 0),w=ga(),C=B(0),L=l??f.disableHoverableContent,k=c??f.delayDuration,I=B(!1),[T,R]=Ia({prop:r,defaultProp:n??!1,onChange:ha((z)=>{if(z)f.onOpen(),document.dispatchEvent(new CustomEvent(rI));else f.onClose();s?.(z)},"onChange"),caller:oI}),E=de(()=>T?I.current?"delayed-open":"instant-open":"closed",[T]),M=j(()=>{window.clearTimeout(C.current),C.current=0,I.current=!1,R(!0)},[R]),P=j(()=>{window.clearTimeout(C.current),C.current=0,R(!1)},[R]),O=j(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{I.current=!0,R(!0),C.current=0},k)},[k,R]);return U(()=>()=>{if(C.current)window.clearTimeout(C.current),C.current=0},[]),d(hl,{...m,children:d(Dee,{scope:t,contentId:x??w,setContentId:v,open:T,stateAttribute:E,trigger:g,onTriggerChange:h,onTriggerEnter:j(()=>{if(f.isOpenDelayedRef.current)O();else M()},[f.isOpenDelayedRef,O,M]),onTriggerLeave:j(()=>{if(L)P();else window.clearTimeout(C.current),C.current=0},[P,L]),onOpen:M,onClose:P,disableHoverableContent:L,children:a})})},"Tooltip"),nB="TooltipTrigger",_ee=ne(ha(function(t,a){let{__scopeTooltip:r,...n}=t,s=ph(nB,r),l=iI(nB,r),c=f0(r),f=B(null),m=Oe(a,f,s.onTriggerChange),g=B(!1),h=B(!1),x=j(()=>g.current=!1,[]);return U(()=>()=>document.removeEventListener("pointerup",x),[x]),d(xl,{asChild:!0,...c,children:d(_e.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:m,onPointerMove:ke(t.onPointerMove,(v)=>{if(v.pointerType==="touch")return;if(!h.current&&!l.isPointerInTransitRef.current)s.onTriggerEnter(),h.current=!0}),onPointerLeave:ke(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:ke(t.onPointerDown,()=>{if(s.open)s.onClose();g.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:ke(t.onFocus,()=>{if(!g.current)s.onOpen()}),onBlur:ke(t.onBlur,s.onClose),onClick:ke(t.onClick,s.onClose)})})},"TooltipTrigger")),iB="TooltipPortal",[zee,Bee]=nI(iB,{forceMount:void 0}),Fee=ha((e)=>{let{__scopeTooltip:t,forceMount:a,children:r,container:n}=e,s=ph(iB,t);return d(zee,{scope:t,forceMount:a,children:d(Xa,{present:a||s.open,children:d(jn,{asChild:!0,container:n,children:r})})})},"TooltipPortal"),fh="TooltipContent",Uee=ne(ha(function(t,a){let r=Bee(fh,t.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...l}=t,c=ph(fh,t.__scopeTooltip);return d(Xa,{present:n||c.open,children:c.disableHoverableContent?d(sB,{side:s,...l,ref:a}):d(Hee,{side:s,...l,ref:a})})},"TooltipContent")),Hee=ne(ha(function(t,a){let r=ph(fh,t.__scopeTooltip),n=iI(fh,t.__scopeTooltip),s=B(null),l=Oe(a,s),[c,f]=A(null),{trigger:m,onClose:g}=r,h=s.current,{onPointerInTransitChange:x}=n,v=j(()=>{f(null),x(!1)},[x]),w=j((C,L)=>{let k=C.currentTarget,I={x:C.clientX,y:C.clientY},T=lB(I,k.getBoundingClientRect()),R=cB(I,T),E=uB(L.getBoundingClientRect()),M=fB([...R,...E]);f(M),x(!0)},[x]);return U(()=>()=>v(),[v]),U(()=>{if(m&&h){let C=ha((k)=>w(k,h),"handleTriggerLeave"),L=ha((k)=>w(k,m),"handleContentLeave");return m.addEventListener("pointerleave",C),h.addEventListener("pointerleave",L),()=>{m.removeEventListener("pointerleave",C),h.removeEventListener("pointerleave",L)}}},[m,h,w,v]),U(()=>{if(c){let C=ha((L)=>{let k=L.target,I={x:L.clientX,y:L.clientY},T=m?.contains(k)||h?.contains(k),R=!dB(I,c);if(T)v();else if(R)v(),g()},"handleTrackPointerGrace");return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[m,h,c,g,v]),d(sB,{...t,ref:l})},"TooltipContentHoverable")),Vee=KC("TooltipContent"),sB=ne(ha(function(t,a){let{__scopeTooltip:r,children:n,"aria-label":s,id:l,onEscapeKeyDown:c,onPointerDownOutside:f,...m}=t,g=ph(fh,r),h=f0(r),{onClose:x}=g;U(()=>(document.addEventListener(rI,x),()=>document.removeEventListener(rI,x)),[x]),U(()=>{if(g.trigger){let w=ha((C)=>{if(C.target instanceof Node&&C.target.contains(g.trigger))x()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[g.trigger,x]);let{setContentId:v}=g;return nt(()=>(v(l),()=>{v(void 0)}),[l,v]),d(Vn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:(w)=>w.preventDefault(),onDismiss:x,children:S(vl,{"data-state":g.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:g.contentId,...h,...m,ref:a,style:{...m.style,...{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}},children:[d(Vee,{children:n}),s?d(oB,{id:g.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),jee=ne(ha(function(t,a){let{__scopeTooltip:r,...n}=t,s=f0(r);return d(ch,{...s,...n,ref:a})},"TooltipArrow"));function lB(e,t){let a=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),n=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(a,r,n,s)){case s:return"left";case n:return"right";case a:return"top";case r:return"bottom";default:throw Error("unreachable")}}ha(lB,"getExitSideFromRect");function cB(e,t,a=5){let r=[];switch(t){case"top":r.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":r.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":r.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":r.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return r}ha(cB,"getPaddedExitPoints");function uB(e){let{top:t,right:a,bottom:r,left:n}=e;return[{x:n,y:t},{x:a,y:t},{x:a,y:r},{x:n,y:r}]}ha(uB,"getPointsFromRect");function dB(e,t){let{x:a,y:r}=e,n=!1;for(let s=0,l=t.length-1;s<t.length;l=s++){let c=t[s],f=t[l],{x:m,y:g}=c,{x:h,y:x}=f;if(g>r!==x>r&&a<(h-m)*(r-g)/(x-g)+m)n=!n}return n}ha(dB,"isPointInPolygon");function fB(e){let t=e.slice();return t.sort((a,r)=>{if(a.x<r.x)return-1;else if(a.x>r.x)return 1;else if(a.y<r.y)return-1;else if(a.y>r.y)return 1;else return 0}),pB(t)}ha(fB,"getHull");function pB(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r<e.length;r++){let n=e[r];while(t.length>=2){let s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}t.pop();let a=[];for(let r=e.length-1;r>=0;r--){let n=e[r];while(a.length>=2){let s=a[a.length-1],l=a[a.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))a.pop();else break}a.push(n)}if(a.pop(),t.length===1&&a.length===1&&t[0].x===a[0].x&&t[0].y===a[0].y)return t;else return t.concat(a)}ha(pB,"getHullPresorted");var Gee=Nee,qee=Oee,Kee=_ee,Xee=Fee,Yee=Uee,Wee=jee;var $ee=Ca("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 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/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ae({className:e,variant:t="default",size:a="default",asChild:r=!1,...n}){let s=r?mf:"button";return d(s,{"data-slot":"button","data-variant":t,"data-size":a,className:N($ee({variant:t,size:a,className:e})),...n})}var p0=["welcome","profile","lock","done"];function m0(e){return p0.indexOf(e)}function gB(e){return p0[Math.min(m0(e)+1,p0.length-1)]??"done"}function hB(e){return p0[Math.max(m0(e)-1,0)]??"welcome"}function xB(e,t){return m0(t)>=m0(e)?1:-1}var g0=["profile","lock"];function vB(e){if(e<5)return"Good evening";if(e<12)return"Good morning";if(e<18)return"Good afternoon";return"Good evening"}var sI=[0.32,0.72,0,1];function yB({status:e,onFinished:t}){let[a,r]=A("welcome"),[n,s]=A(1),[l,c]=A(e.profile.nickname??""),[f,m]=A(null),[g,h]=A(!1),x=(w)=>{s(xB(a,w)),r(w)},v=async()=>{h(!0);try{await le("/api/auth/onboarding/complete",{method:"POST"})}catch{}await Ut(),t()};return S("div",{role:"dialog","aria-modal":"true","aria-labelledby":"welcome-title",className:"fixed inset-0 z-[90] flex flex-col overflow-y-auto bg-background",children:[d("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-x-0 top-0 h-[60dvh] bg-[radial-gradient(60%_50%_at_50%_0%,rgba(109,92,251,0.10),transparent_70%)] dark:bg-[radial-gradient(60%_50%_at_50%_0%,rgba(109,92,251,0.18),transparent_70%)]"}),S("div",{className:"relative mx-auto flex w-full max-w-md flex-1 flex-col px-6 pt-[max(2rem,env(safe-area-inset-top))] pb-[max(1.5rem,env(safe-area-inset-bottom))]",children:[S("div",{className:"flex h-8 items-center justify-between",children:[a!=="welcome"&&a!=="done"?d(ae,{type:"button",variant:"ghost",size:"icon",onClick:()=>x(hB(a)),"aria-label":"Back",className:"-ml-2 size-9 rounded-full",children:d(Uc,{className:"size-4"})}):d("span",{}),d(Qee,{step:a}),d("span",{className:"size-9"})]}),d("div",{className:"flex flex-1 flex-col justify-center py-6",children:d(bo,{mode:"wait",initial:!1,custom:n,children:S(ar,{custom:n,initial:{opacity:0,x:n*28},animate:{opacity:1,x:0,transition:{duration:0.32,ease:sI}},exit:{opacity:0,x:n*-28,transition:{duration:0.18,ease:"easeIn"}},children:[a==="welcome"&&d(Zee,{onStart:()=>x("profile"),onSkip:()=>void v(),finishing:g}),a==="profile"&&d(Jee,{value:l,onChange:c,onNext:()=>x(gB("profile"))}),a==="lock"&&d(ete,{onDone:(w)=>{m(w),x("done")}}),a==="done"&&d(tte,{nickname:l.trim()||null,lockSet:f,finishing:g,onFinish:()=>void v()})]},a)})})]})]})}function Qee({step:e}){if(e==="welcome"||e==="done")return d("span",{});let t=g0.indexOf(e);return d("ol",{className:"flex items-center gap-1.5","aria-label":"Setup progress",children:g0.map((a,r)=>d("li",{"aria-current":r===t?"step":void 0,className:N("h-1.5 rounded-full transition-all duration-300",r===t?"w-6 bg-primary":r<t?"w-1.5 bg-primary/50":"w-1.5 bg-muted"),children:S("span",{className:"sr-only",children:["Step ",r+1," of ",g0.length]})},a))})}function Cl({i:e,children:t}){return d(ar,{initial:{opacity:0,y:10},animate:{opacity:1,y:0,transition:{delay:0.15+e*0.08,duration:0.4,ease:sI}},children:t})}function Zee({onStart:e,onSkip:t,finishing:a}){let r=B(null);return U(()=>{let n=setTimeout(()=>r.current?.focus({preventScroll:!0}),400);return()=>clearTimeout(n)},[]),S("div",{className:"flex flex-col items-center text-center",children:[d(Zs,{initial:{opacity:0,scale:0.8,y:12},animate:{opacity:1,scale:1,y:0,transition:{type:"spring",stiffness:260,damping:22}},className:"flex size-24 items-center justify-center rounded-[1.75rem] border bg-card p-5 shadow-sm sm:size-28",children:d("img",{src:Cr,alt:"",className:"size-full"})}),d(Cl,{i:0,children:d("p",{className:"mt-8 text-sm font-medium text-muted-foreground",children:vB(new Date().getHours())})}),d(Cl,{i:1,children:d("h1",{id:"welcome-title",className:"mt-1 text-3xl font-semibold tracking-tight sm:text-4xl",children:"Welcome to KCG Code"})}),d(Cl,{i:2,children:d("p",{className:"mt-3 max-w-xs text-[15px] leading-relaxed text-pretty text-muted-foreground",children:"Run your AI coding agents from any device. Let's get you set up. It takes less than a minute."})}),d(Cl,{i:3,children:d("ul",{className:"mt-8 flex flex-col gap-3 text-left",children:[{icon:Ko,text:"Pick a name for this workspace"},{icon:Ka,text:"Protect it with a PIN or password"},{icon:sa,text:"Start your first session"}].map(({icon:n,text:s})=>S("li",{className:"flex items-center gap-3 text-[14px]",children:[d("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:d(n,{className:"size-4","aria-hidden":!0})}),s]},s))})}),d(Cl,{i:4,children:S("div",{className:"mt-10 flex w-full flex-col items-center gap-2",children:[S(ae,{ref:r,type:"button",onClick:e,className:"h-12 w-64 max-w-full rounded-full text-[15px]",children:["Get started",d(Or,{"data-icon":"inline-end"})]}),S(ae,{type:"button",variant:"ghost",onClick:t,disabled:a,className:"h-10 rounded-full text-muted-foreground",children:[a&&d(fe,{"data-icon":"inline-start"}),"Skip for now"]})]})})]})}function wB({icon:e,title:t,description:a}){return S("div",{className:"flex flex-col items-center gap-3 text-center",children:[d("span",{className:"flex size-14 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:d(e,{className:"size-7","aria-hidden":!0})}),S("div",{className:"flex flex-col gap-1.5",children:[d("h1",{id:"welcome-title",className:"text-2xl font-semibold tracking-tight",children:t}),d("p",{className:"max-w-xs text-[14px] leading-snug text-pretty text-muted-foreground",children:a})]})]})}function Jee({value:e,onChange:t,onNext:a}){let r=lt(),n=B(null),[s,l]=A(!1),[c,f]=A(null);return U(()=>{let g=setTimeout(()=>n.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(g)},[]),S("form",{onSubmit:async(g)=>{g.preventDefault(),l(!0),f(null);try{await le("/api/auth/profile",{method:"PATCH",body:JSON.stringify({nickname:e.trim()||null})}),a()}catch(h){f(h instanceof we?h.message:"Couldn't save your name.")}finally{l(!1)}},className:"flex flex-col gap-8",children:[d(wB,{icon:Ko,title:"What should we call you?",description:"Your name appears on the lock screen and in the sidebar. You can change it later."}),S("div",{className:"flex flex-col gap-2",children:[d("div",{className:"overflow-hidden rounded-xl border bg-card shadow-xs focus-within:ring-[3px] focus-within:ring-ring/30",children:S("div",{className:"flex flex-col px-4 py-2.5",children:[d("label",{htmlFor:r,className:"text-[12px] leading-4 text-muted-foreground",children:"Nickname"}),d("input",{ref:n,id:r,value:e,maxLength:40,autoComplete:"nickname",placeholder:"e.g. Irsyad",onChange:(g)=>{t(g.target.value),f(null)},"aria-invalid":c?!0:void 0,className:"h-8 w-full bg-transparent text-base outline-none placeholder:text-muted-foreground/60 sm:text-[15px]"})]})}),c&&d("p",{role:"alert",className:"px-1 text-sm text-destructive",children:c})]}),S(ae,{type:"submit",disabled:s,className:"h-12 rounded-full text-[15px]",children:[s&&d(fe,{"data-icon":"inline-start"}),e.trim()?"Continue":"Skip",!s&&d(Or,{"data-icon":"inline-end"})]})]})}function ete({onDone:e}){let[t,a]=A("pin"),[r,n]=A(""),[s,l]=A(""),[c,f]=A(!1),[m,g]=A(null),h=lt(),x=lt(),v=B(null);U(()=>{let T=setTimeout(()=>v.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(T)},[]);let w=t==="pin"?"PIN":"password",C=t==="pin"?"6–12 digits. Avoid repeated or sequential digits.":"At least 8 characters. A short phrase works well.",L=(T)=>t==="pin"?T.replace(/\D/g,""):T,k=async(T)=>{if(T.preventDefault(),t==="pin"&&(r.length<6||r.length>12)){g("PIN must be 6–12 digits.");return}if(t==="password"&&r.length<8){g("Password must be at least 8 characters.");return}if(r!==s){g(`The ${w}s don't match.`);return}f(!0),g(null);try{await le("/api/auth/lock",{method:"PUT",body:JSON.stringify({kind:t,secret:r})}),e(t)}catch(R){g(R instanceof we?R.message:"Couldn't save the lock.")}finally{f(!1)}},I=(T,R,E,M,P)=>S("div",{className:"flex flex-col px-4 py-2.5 focus-within:bg-muted/30",children:[d("label",{htmlFor:T,className:"text-[12px] leading-4 text-muted-foreground",children:R}),d("input",{ref:P,id:T,type:"password",inputMode:t==="pin"?"numeric":void 0,autoComplete:"new-password",maxLength:t==="pin"?12:128,value:E,disabled:c,onChange:(O)=>{M(L(O.target.value)),g(null)},className:N("h-8 w-full bg-transparent text-base outline-none sm:text-[15px]",t==="pin"&&"tracking-[0.3em]")})]});return S("form",{onSubmit:k,className:"flex flex-col gap-7",children:[d(wB,{icon:$o,title:"Lock your workspace",description:"Anyone who can open this page can control your agents. A lock keeps it yours, especially when you use Remote access."}),d("fieldset",{"aria-label":"Lock type",className:"grid grid-cols-2 gap-1 rounded-lg border-0 bg-muted p-1",children:["pin","password"].map((T)=>S("label",{className:N("cursor-pointer rounded-md px-3 py-1.5 text-center text-sm font-medium transition-colors has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-ring/50",t===T?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[d("input",{type:"radio",name:"welcome-lock-kind",value:T,checked:t===T,onChange:()=>{a(T),n(""),l(""),g(null)},className:"sr-only"}),T==="pin"?"PIN":"Password"]},T))}),S("div",{className:"flex flex-col gap-2",children:[d("div",{className:"overflow-hidden rounded-xl border bg-card shadow-xs",children:S("div",{className:"flex flex-col divide-y",children:[I(h,`New ${w}`,r,n,v),I(x,`Confirm ${w}`,s,l)]})}),d("p",{className:"px-1 text-[12px] text-muted-foreground",children:C}),m&&d("p",{role:"alert",className:"px-1 text-sm text-destructive",children:m})]}),S("div",{className:"flex flex-col gap-2",children:[S(ae,{type:"submit",disabled:c||r===""||s==="",className:"h-12 rounded-full text-[15px]",children:[c?d(fe,{"data-icon":"inline-start"}):d(Ka,{"data-icon":"inline-start"}),"Turn on lock"]}),d(ae,{type:"button",variant:"ghost",disabled:c,onClick:()=>e(null),className:"h-10 rounded-full text-muted-foreground",children:"Skip, I'll do it later"})]})]})}function tte({nickname:e,lockSet:t,finishing:a,onFinish:r}){let n=B(null);return U(()=>{let s=setTimeout(()=>n.current?.focus({preventScroll:!0}),450);return()=>clearTimeout(s)},[]),S("div",{className:"flex flex-col items-center text-center",children:[d(Zs,{initial:{scale:0.6,opacity:0},animate:{scale:1,opacity:1,transition:{type:"spring",stiffness:280,damping:18}},className:"flex size-20 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg",children:d("svg",{viewBox:"0 0 24 24",className:"size-10",fill:"none","aria-hidden":"true",children:d(MC,{d:"M5 12.5l4.5 4.5L19 7.5",stroke:"currentColor",strokeWidth:2.4,strokeLinecap:"round",strokeLinejoin:"round",initial:{pathLength:0},animate:{pathLength:1,transition:{delay:0.2,duration:0.45,ease:sI}}})})}),d(Cl,{i:1,children:d("h1",{id:"welcome-title",className:"mt-7 text-2xl font-semibold tracking-tight",children:e?`You're all set, ${e}`:"You're all set"})}),d(Cl,{i:2,children:S("ul",{className:"mt-6 flex flex-col gap-2.5 text-left text-[14px]",children:[d(bB,{ok:!0,text:e?`Name set to ${e}`:"Name skipped",muted:!e}),d(bB,{ok:t!==null,text:t?`Protected with a ${t==="pin"?"PIN":"password"}`:"No lock yet. You can add one in Settings → Security.",muted:t===null})]})}),d(Cl,{i:3,children:S(ae,{ref:n,type:"button",onClick:r,disabled:a,className:"mt-10 h-12 w-64 max-w-full rounded-full text-[15px]",children:[a?d(fe,{"data-icon":"inline-start"}):null,"Open KCG Code",!a&&d(Or,{"data-icon":"inline-end"})]})})]})}function bB({ok:e,text:t,muted:a}){return S("li",{className:N("flex items-start gap-2.5",a&&"text-muted-foreground"),children:[d("span",{className:N("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full",e&&!a?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-muted"),children:e&&!a?d(Ke,{className:"size-3",strokeWidth:3,"aria-hidden":!0}):d("span",{className:"size-1.5 rounded-full bg-muted-foreground/50","aria-hidden":!0})}),t]})}var ate=60000,SB=["pointerdown","keydown","wheel","touchstart"];function kB({children:e}){let t=ff();U(()=>{Ut()},[]);let a=t.phase==="ready"?t.status:null,r=a!==null&&(!a.protected||a.authenticated),[n,s]=A(!1);if(a?.needsOnboarding&&!n)s(!0);let l=a?.protected&&a.autoLockMinutes>0?a.autoLockMinutes*60000:0,c=B(Date.now());if(U(()=>{if(!r||!a?.protected)return;c.current=Date.now();let g=()=>{c.current=Date.now()};for(let w of SB)window.addEventListener(w,g,{passive:!0});let h=setInterval(()=>{if(l>0&&Date.now()-c.current>=l)Ug()},5000),x=setInterval(()=>void Ut(),ate),v=()=>{if(document.visibilityState!=="visible")return;if(l>0&&Date.now()-c.current>=l)Ug();else Ut()};return document.addEventListener("visibilitychange",v),()=>{for(let w of SB)window.removeEventListener(w,g);clearInterval(h),clearInterval(x),document.removeEventListener("visibilitychange",v)}},[r,a?.protected,l]),t.phase==="loading")return S("div",{className:"flex h-dvh items-center justify-center bg-background",role:"status",children:[d(fe,{className:"size-6 text-muted-foreground"}),d("span",{className:"sr-only",children:"Loading…"})]});if(t.phase==="error")return S("div",{className:"flex h-dvh flex-col items-center justify-center gap-4 bg-background px-6 text-center",children:[d("p",{className:"text-sm text-muted-foreground",children:"Can't reach the KCG Code server."}),d(ae,{type:"button",variant:"outline",onClick:()=>void Ut(),children:"Try again"})]});let f=!r&&a!==null,m=!f&&(n||a?.needsOnboarding===!0);return S(se,{children:[d(bo,{initial:!1,children:f?d(ar,{className:"fixed inset-0 z-[100] shadow-[0_24px_48px_-12px_rgb(0_0_0/0.45)]",initial:{y:"-100%"},animate:{y:0,transition:{duration:0.55,ease:lI}},exit:{y:"-100%",transition:{duration:0.45,ease:lI}},children:d(s_,{status:a})},"lock"):m?null:d(ote,{children:e},"app")}),d(bo,{children:m&&a&&d(ar,{className:"fixed inset-0 z-[90]",initial:{opacity:0},animate:{opacity:1,transition:{duration:0.4,ease:"easeOut"}},exit:{opacity:0,scale:1.03,transition:{duration:0.45,ease:lI}},children:d(yB,{status:a,onFinished:()=>s(!1)})},"welcome")})]})}var lI=[0.32,0.72,0,1],rte=0.55;function ote({children:e}){let t=fC(),a=Pm();return d(ar,{className:"contents",inert:!t,exit:{opacity:0,transition:{delay:a?0:rte,duration:0}},children:e})}function Ma({...e}){return d(Wg,{"data-slot":"dialog",...e})}function nte({...e}){return d($g,{"data-slot":"dialog-portal",...e})}function CB({...e}){return d(ml,{"data-slot":"dialog-close",...e})}function ite({className:e,...t}){return d(Qg,{"data-slot":"dialog-overlay",className:N("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function or({className:e,children:t,showCloseButton:a=!0,...r}){return S(nte,{"data-slot":"dialog-portal",children:[d(ite,{}),S(Zg,{"data-slot":"dialog-content",className:N("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,a&&S(ml,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[d(Ft,{}),d("span",{className:"sr-only",children:"Close"})]})]})]})}function zr({className:e,...t}){return d("div",{"data-slot":"dialog-header",className:N("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ao({className:e,showCloseButton:t=!1,children:a,...r}){return S("div",{"data-slot":"dialog-footer",className:N("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[a,t&&d(ml,{asChild:!0,children:d(ae,{variant:"outline",children:"Close"})})]})}function nr({className:e,...t}){return d(Jg,{"data-slot":"dialog-title",className:N("min-w-0 wrap-anywhere text-lg leading-none font-semibold",e),...t})}function ir({className:e,...t}){return d(Kb,{"data-slot":"dialog-description",className:N("min-w-0 wrap-anywhere text-sm text-muted-foreground",e),...t})}var ste=["profile","security","workspace","remote","about"],IB={devices:{section:"security",anchor:"devices"}};function lte(e){return ste.includes(e)}function Br(){return"/"}function Gi(e){return`/projects/${e}`}function Wn(e,t){return`/projects/${e}/sessions/${t}`}function Il(e){return e?`/skills?project=${encodeURIComponent(e)}`:"/skills"}function xa(e){return e?`/settings/${e}`:"/settings"}function cI(e){let t=new URLSearchParams(e).get("project");return t!==null&&t.length>0?t:null}function LB(e){let t=e.replace(/\/+$/,"").split("/").filter((r)=>r.length>0);if(t.length===0)return{name:"projects"};if(t[0]==="skills"&&t.length===1)return{name:"skills"};if(t[0]==="settings"){if(t.length===1)return{name:"settings",section:"profile",root:!0};let r=t[1];if(t.length===2&&r!==void 0&<e(r))return{name:"settings",section:r};let n=t.length===2&&r!==void 0&&Object.hasOwn(IB,r)?IB[r]:void 0;if(n)return{name:"settings",section:n.section,anchor:n.anchor};return{name:"not-found"}}if(t[0]!=="projects")return{name:"not-found"};let a=t[1];if(a===void 0||a.length===0)return{name:"not-found"};if(t.length===2)return{name:"project",projectId:a};if(t[2]==="sessions"&&t.length===4){let r=t[3];if(r!==void 0&&r.length>0)return{name:"session",projectId:a,sessionId:r}}return{name:"not-found"}}var $n={running:"bg-emerald-500",stopped:"bg-muted-foreground/50",crashed:"bg-destructive"},Io={running:"Running",stopped:"Stopped",crashed:"Crashed"};function h0(e){switch(e){case"connected":return"connected";case"connecting":return"connecting…";case"reconnecting":return"reconnecting…";default:return"disconnected"}}var cte=new Set(["KCG Code Session","KCG Code Session (resumed)"]),ute=/^(New session - |Child session - )\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function dte(e){return ute.test(e.trim())}function fte(e){if(e===null||e===void 0)return!0;let t=e.trim();if(t==="")return!0;return cte.has(t)||dte(t)}function Ll(e){if(fte(e??null))return"New session";return e.trim()}var TB={running:0,crashed:1,stopped:2};function x0(e){return[...e].sort((t,a)=>{let r=TB[t.status]-TB[a.status];if(r!==0)return r;if(a.updatedAt!==t.updatedAt)return a.updatedAt-t.updatedAt;return t.id.localeCompare(a.id)})}function RB(e){let t={total:e.length,running:0,stopped:0,crashed:0};for(let a of e)if(a.status==="running")t.running+=1;else if(a.status==="stopped")t.stopped+=1;else t.crashed+=1;return t}function AB(e){if(e.total===0)return"No sessions yet";let t=[`${e.total} session${e.total===1?"":"s"}`];if(e.running>0)t.push(`${e.running} running`);if(e.crashed>0)t.push(`${e.crashed} crashed`);return t.join(" · ")}function MB(e){return e.model?e.model.modelID:"default model"}function PB(e,t){let a=new Map;for(let n of t){let s=a.get(n.projectId);if(s===void 0)a.set(n.projectId,[n]);else s.push(n)}return e.map((n)=>{let s=a.get(n.id)??[],l=n.createdAt,c=0;for(let f of s){if(f.status==="running")c+=1;if(f.updatedAt>l)l=f.updatedAt}return{group:{project:n,sessions:x0(s),runningCount:c},lastActivity:l}}).sort((n,s)=>{if(s.lastActivity!==n.lastActivity)return s.lastActivity-n.lastActivity;return n.group.project.name.localeCompare(s.group.project.name,void 0,{sensitivity:"base"})}).map((n)=>n.group)}function EB(e,t,a){let r=t.trim().toLowerCase();if(r==="")return[...e];let n=[];for(let s of e){if(s.project.name.toLowerCase().includes(r)){n.push(s);continue}let l=s.sessions.filter((c)=>a(c).toLowerCase().includes(r));if(l.length>0)n.push({...s,sessions:l})}return n}var pte=50;function NB({open:e,onOpenChange:t,groups:a,onSelect:r}){let[n,s]=A(""),[l,c]=A(0),f=B(null);U(()=>{if(e)s(""),c(0)},[e]);let m=de(()=>{let w=(k)=>Ll(k.title),L=EB(a,n,w).flatMap((k)=>k.sessions.map((I)=>({session:I,projectName:k.project.name,title:w(I)})));return L.sort((k,I)=>I.session.updatedAt-k.session.updatedAt),L.slice(0,pte)},[a,n]);U(()=>{c(0)},[n]),U(()=>{f.current?.querySelector(`[data-index="${l}"]`)?.scrollIntoView({block:"nearest"})},[l]);let g=(w)=>{if(!w)return;t(!1),r(Wn(w.session.projectId,w.session.id))},h=(w)=>{if(w.key==="ArrowDown")w.preventDefault(),c((C)=>Math.min(C+1,m.length-1));else if(w.key==="ArrowUp")w.preventDefault(),c((C)=>Math.max(C-1,0));else if(w.key==="Enter")w.preventDefault(),g(m[l])},x=n.trim(),v=m[l]?`search-result-${l}`:void 0;return d(Ma,{open:e,onOpenChange:t,children:S(or,{showCloseButton:!1,className:"top-[15%] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-xl",children:[d(nr,{className:"sr-only",children:"Search sessions"}),d(ir,{className:"sr-only",children:"Type to filter sessions by title or project name."}),S("div",{className:"flex items-center gap-2 border-b px-4",children:[d(la,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),d("input",{autoFocus:!0,type:"text",role:"combobox","aria-expanded":!0,"aria-controls":"search-results","aria-activedescendant":v,"aria-label":"Search sessions",value:n,onChange:(w)=>s(w.target.value),onKeyDown:h,placeholder:"Search sessions…",className:"h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),d("kbd",{className:"hidden shrink-0 rounded border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground sm:inline",children:"Esc"})]}),d("div",{ref:f,id:"search-results",role:"listbox","aria-label":"Results",className:"max-h-[min(60vh,420px)] overflow-y-auto p-2",children:m.length===0?d("p",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:x===""?"No sessions yet.":`No matches for “${x}”.`}):S(se,{children:[d("p",{className:"px-2 pt-1 pb-2 text-xs font-medium text-muted-foreground",children:x===""?"Recent":"Results"}),m.map((w,C)=>S("div",{id:`search-result-${C}`,"data-index":C,role:"option","aria-selected":C===l,tabIndex:-1,onMouseMove:()=>c(C),onClick:()=>g(w),onKeyDown:()=>{},className:N("flex cursor-pointer items-center gap-3 rounded-md px-2 py-2 text-sm",C===l&&"bg-accent text-accent-foreground"),children:[d(gg,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),d("span",{className:"min-w-0 flex-1 truncate",children:w.title}),S("span",{className:"flex max-w-[40%] shrink-0 items-center gap-1 truncate text-xs text-muted-foreground",children:[d(_t,{className:"size-3 shrink-0","aria-hidden":!0}),d("span",{className:"truncate",children:w.projectName})]}),d("span",{"aria-hidden":!0,className:N("size-2 shrink-0 rounded-full",$n[w.session.status])}),d("span",{className:"sr-only",children:Io[w.session.status]})]},w.session.id))]})})]})})}function v0({delayDuration:e=0,...t}){return d(Gee,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function rn({...e}){return d(qee,{"data-slot":"tooltip",...e})}function on({...e}){return d(Kee,{"data-slot":"tooltip-trigger",...e})}function nn({className:e,sideOffset:t=0,children:a,...r}){return d(Xee,{children:S(Yee,{"data-slot":"tooltip-content",sideOffset:t,className:N("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 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]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...r,children:[a,d(Wee,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function DB({active:e,onNavigate:t}){let a=ff(),r=a.phase==="ready"?a.status:null,n=r?.profile.nickname??null,s=r?.profile.avatarUrl??null,l=r?.profile.avatarPreset??null,c=r?.protected??!1,f="flex size-8 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/70 transition-colors outline-none hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring";return S("div",{className:"flex flex-col gap-1",children:[r&&!c&&S("button",{type:"button",onClick:()=>t(xa("security")),className:"flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2.5 py-2 text-left text-xs text-amber-800 transition-colors hover:bg-amber-500/15 dark:text-amber-300",children:[d(Wo,{className:"size-4 shrink-0","aria-hidden":!0}),S("span",{className:"min-w-0",children:[d("span",{className:"block font-medium",children:"Not protected"}),d("span",{className:"block text-amber-800/80 dark:text-amber-300/80",children:"Set a lock before exposing this app."})]})]}),S("div",{className:"flex min-w-0 items-center gap-1",children:[S("a",{href:xa(),onClick:(m)=>{if(m.metaKey||m.ctrlKey||m.shiftKey||m.button!==0)return;m.preventDefault(),t(xa())},"aria-current":e?"page":void 0,className:N("flex min-w-0 flex-1 items-center gap-2.5 rounded-md p-1.5 text-left transition-colors outline-none hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-sidebar-ring",e&&"bg-sidebar-accent"),children:[d(dl,{nickname:n,avatarUrl:s,avatarPreset:l,className:"size-8",textClassName:"text-xs"}),S("span",{className:"flex min-w-0 flex-col leading-tight",children:[d("span",{className:"truncate text-sm font-medium",children:n??"Set up profile"}),d("span",{className:"truncate text-xs text-muted-foreground",children:c?`Locked with ${r?.lockKind==="pin"?"PIN":"password"}`:"Settings"})]})]}),S(rn,{children:[d(on,{asChild:!0,children:d("button",{type:"button",onClick:()=>t(xa()),"aria-label":"Settings",className:N("flex size-8 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/70 transition-colors outline-none hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring",e&&"text-sidebar-accent-foreground"),children:d(Rg,{className:"size-4"})})}),d(nn,{side:"top",children:"Settings"})]}),c&&S(rn,{children:[d(on,{asChild:!0,children:d("button",{type:"button",onClick:()=>void Ug(),"aria-label":"Lock now",className:"flex size-8 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/70 transition-colors outline-none hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:d(Ka,{className:"size-4"})})}),d(nn,{side:"top",children:"Lock now"})]})]})]})}function mte(e){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}var gte=(e)=>{switch(e){case"success":return vte;case"info":return yte;case"warning":return bte;case"error":return wte;default:return null}},hte=Array(12).fill(0),xte=({visible:e,className:t})=>Be("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Be("div",{className:"sonner-spinner"},hte.map((a,r)=>Be("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),vte=Be("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Be("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),bte=Be("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Be("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),yte=Be("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Be("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),wte=Be("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Be("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ste=Be("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Be("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Be("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),kte=()=>{let[e,t]=A(document.hidden);return U(()=>{let a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},[]),e},Cte=1,Ite=100,OB=(e)=>{var t;return typeof(e==null?void 0:e.id)==="number"||(e==null?void 0:(t=e.id)==null?void 0:t.length)>0?e.id:Cte++};class BB{constructor(){this.subscribe=(e)=>(this.subscribers.push(e),this.getActiveToasts().forEach((t)=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=(e)=>{this.subscribers.forEach((t)=>t(e))},this.addToast=(e)=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Ite;if(e<=0)return;this.toasts=this.toasts.filter((t)=>{if(e>0&&this.dismissedToasts.has(t.id))return this.dismissedToasts.delete(t.id),e--,!1;return!0})},this.create=(e)=>{let{message:t,...a}=e,r=OB(e),n=this.pendingDismissals.get(r);if(n!==void 0)cancelAnimationFrame(n),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r);let s=this.dismissedToasts.has(r),l=e.dismissible===void 0?!0:e.dismissible;if(s)this.dismissedToasts.delete(r),this.toasts=this.toasts.filter((f)=>f.id!==r);if(s?void 0:this.toasts.find((f)=>f.id===r))this.toasts=this.toasts.map((f)=>{if(f.id===r)return this.publish({...f,...e,id:r,title:t}),{...f,...e,id:r,dismissible:l,title:t};return f});else this.addToast({title:t,...a,dismissible:l,id:r});return r},this.dismiss=(e)=>{if(e===void 0||e===null)return this.getActiveToasts().forEach((a)=>{this.dismissedToasts.add(a.id),this.subscribers.forEach((r)=>r({id:a.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);if(t!==void 0)cancelAnimationFrame(t);return this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach((a)=>a({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let a=void 0;if(t.loading!==void 0)a=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!=="function"?t.description:void 0});let r=Promise.resolve(e instanceof Function?e():e),n=a!==void 0,s,l=r.then(async(f)=>{if(s=["resolve",f],Yt(f))n=!1,this.create({id:a,type:"default",message:f});else if(Tte(f)&&!f.ok){n=!1;let g=typeof t.error==="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,h=typeof t.description==="function"?await t.description(`HTTP error! status: ${f.status}`):t.description,v=typeof g==="object"&&!Yt(g)?g:{message:g};this.create({id:a,type:"error",description:h,...v})}else if(f instanceof Error){n=!1;let g=typeof t.error==="function"?await t.error(f):t.error,h=typeof t.description==="function"?await t.description(f):t.description,v=typeof g==="object"&&!Yt(g)?g:{message:g};this.create({id:a,type:"error",description:h,...v})}else if(t.success!==void 0){n=!1;let g=typeof t.success==="function"?await t.success(f):t.success,h=typeof t.description==="function"?await t.description(f):t.description,v=typeof g==="object"&&!Yt(g)?g:{message:g};this.create({id:a,type:"success",description:h,...v})}}).catch(async(f)=>{if(s=["reject",f],t.error!==void 0){n=!1;let m=typeof t.error==="function"?await t.error(f):t.error,g=typeof t.description==="function"?await t.description(f):t.description,x=typeof m==="object"&&!Yt(m)?m:{message:m};this.create({id:a,type:"error",description:g,...x})}}).finally(()=>{if(n)this.dismiss(a),a=void 0;t.finally==null||t.finally.call(t)}),c=()=>new Promise((f,m)=>l.then(()=>s[0]==="reject"?m(s[1]):f(s[1])).catch(m));if(typeof a!=="string"&&typeof a!=="number")return{unwrap:c};else return Object.assign(a,{unwrap:c})},this.custom=(e,t)=>{let a=OB(t);return this.create({...t,jsx:e(a),id:a,type:void 0}),a},this.getActiveToasts=()=>this.toasts.filter((e)=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}var Fr=new BB,Lte=(e,t)=>Fr.message(e,t),Tte=(e)=>e&&typeof e==="object"&&("ok"in e)&&typeof e.ok==="boolean"&&("status"in e)&&typeof e.status==="number",Rte=Lte,Ate=()=>Fr.toasts,Mte=()=>Fr.getActiveToasts(),De=Object.assign(Rte,{success:Fr.success,info:Fr.info,warning:Fr.warning,error:Fr.error,custom:Fr.custom,message:Fr.message,promise:Fr.promise,dismiss:Fr.dismiss,loading:Fr.loading},{getHistory:Ate,getToasts:Mte});mte("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function b0(e){return e.label!==void 0}var Pte=3,Ete="24px",Nte="16px",_B=4000,Dte=356,Ote=14,_te=45,zte=200;function Qn(...e){return e.filter(Boolean).join(" ")}function Bte(e){let[t,a]=e.split("-"),r=[];if(t)r.push(t);if(a)r.push(a);return r}var Fte=(e)=>{var t,a,r,n,s,l,c,f,m;let{invert:g,toast:h,unstyled:x,interacting:v,setHeights:w,visibleToasts:C,heights:L,index:k,toasts:I,expanded:T,removeToast:R,defaultRichColors:E,closeButton:M,style:P,cancelButtonStyle:O,actionButtonStyle:F,className:z="",descriptionClassName:Y="",duration:q,position:G,gap:Q,expandByDefault:re,classNames:J,icons:X,closeButtonAriaLabel:Z="Close toast"}=e,[te,D]=A(null),[Te,Le]=A(null),[H,me]=A(!1),[Ce,ge]=A(!1),[He,ce]=A(!1),[he,ue]=A(!1),[K,ee]=A(!1),[W,ve]=A(0),[Ee,xe]=A(0),ye=B(h.duration||q||_B),ft=B(null),zt=B(null),$a=k===0,Mo=k+1<=C,Dt=h.type,jl=Dt!=null?Dt:"default",Po=h.dismissible!==!1,Gu=h.className||"",oe=h.descriptionClassName||"",be=de(()=>L.findIndex((qe)=>qe.toastId===h.id)||0,[L,h.id]),Ve=de(()=>{var qe;return(qe=h.closeButton)!=null?qe:M},[h.closeButton,M]),$e=de(()=>h.duration||q||_B,[h.duration,q]),Se=B(0),Ne=B(0),Qe=B(0),pt=B(null),[Hr,aa]=G.split("-"),Qa=de(()=>L.reduce((qe,ua,Na)=>{if(Na>=be)return qe;return qe+ua.height},0),[L,be]),si=kte(),ra=de(()=>{var qe;return(qe=e.swipeDirections)!=null?qe:Bte(G)},[e.swipeDirections,G]),gj=h.invert||g,fw=Dt==="loading";Ne.current=de(()=>be*Q+Qa,[be,Qa]),U(()=>{ye.current=$e},[$e]),U(()=>{me(!0)},[]),U(()=>{let qe=zt.current;if(qe){let ua=qe.getBoundingClientRect().height;return xe(ua),w((Na)=>[{toastId:h.id,height:ua,position:h.position},...Na]),()=>w((Na)=>Na.filter((kr)=>kr.toastId!==h.id))}},[w,h.id]),Vt(()=>{if(!H)return;let qe=zt.current,ua=qe.style.height;qe.style.height="auto";let Na=qe.getBoundingClientRect().height;qe.style.height=ua,xe(Na),w((kr)=>{if(!kr.find((Da)=>Da.toastId===h.id))return[{toastId:h.id,height:Na,position:h.position},...kr];else return kr.map((Da)=>Da.toastId===h.id?{...Da,height:Na}:Da)})},[H,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);let ls=j(()=>{ge(!0),ve(Ne.current),w((qe)=>qe.filter((ua)=>ua.toastId!==h.id)),setTimeout(()=>{R(h)},zte)},[h,R,w,Ne]);U(()=>{if(h.promise&&Dt==="loading"||h.duration===1/0||h.type==="loading")return;let qe,ua=()=>{if(Qe.current<Se.current){let kr=new Date().getTime()-Se.current;ye.current=ye.current-kr}Qe.current=new Date().getTime()},Na=()=>{if(ye.current===1/0)return;Se.current=new Date().getTime(),qe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),ls()},ye.current)};if(T||v||si)ua();else Na();return()=>clearTimeout(qe)},[T,v,h,Dt,si,ls]),U(()=>{if(h.delete)ls(),h.onDismiss==null||h.onDismiss.call(h,h)},[ls,h.delete]);function aR(){var qe;if(X==null?void 0:X.loading){var ua;return Be("div",{className:Qn(J==null?void 0:J.loader,h==null?void 0:(ua=h.classNames)==null?void 0:ua.loader,"sonner-loader"),"data-visible":Dt==="loading"},X.loading)}return Be(xte,{className:Qn(J==null?void 0:J.loader,h==null?void 0:(qe=h.classNames)==null?void 0:qe.loader),visible:Dt==="loading"})}let hj=h.icon||(X==null?void 0:X[Dt])||gte(Dt);var rR,oR;return Be("li",{tabIndex:0,ref:zt,className:Qn(z,Gu,J==null?void 0:J.toast,h==null?void 0:(t=h.classNames)==null?void 0:t.toast,J==null?void 0:J[jl],h==null?void 0:(a=h.classNames)==null?void 0:a[jl]),"data-sonner-toast":"","data-rich-colors":(rR=h.richColors)!=null?rR:E,"data-styled":!Boolean(h.jsx||h.unstyled||x),"data-mounted":H,"data-promise":Boolean(h.promise),"data-swiped":K,"data-removed":Ce,"data-visible":Mo,"data-y-position":Hr,"data-x-position":aa,"data-index":k,"data-front":$a,"data-swiping":He,"data-dismissible":Po,"data-type":Dt,"data-invert":gj,"data-swipe-out":he,"data-swipe-direction":Te,"data-expanded":Boolean(T||re&&H),"data-testid":h.testId,style:{"--index":k,"--toasts-before":k,"--z-index":I.length-k,"--offset":`${Ce?W:Ne.current}px`,"--initial-height":re?"auto":`${Ee}px`,...P,...h.style},onDragEnd:()=>{ce(!1),D(null),pt.current=null},onPointerDown:(qe)=>{if(qe.button===2)return;if(fw||!Po)return;if(ft.current=new Date,ve(Ne.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName==="BUTTON")return;ce(!0),pt.current={x:qe.clientX,y:qe.clientY}},onPointerUp:()=>{var qe,ua,Na;if(he||!Po)return;pt.current=null;let kr=Number(((qe=zt.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xf=Number(((ua=zt.current)==null?void 0:ua.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Da=new Date().getTime()-((Na=ft.current)==null?void 0:Na.getTime()),no=te==="x"?kr:Xf,cn=Math.abs(no)/Da;if((te==="x"?ra.includes(kr>0?"right":"left"):ra.includes(Xf>0?"bottom":"top"))&&(Math.abs(no)>=_te||cn>0.11)){if(ve(Ne.current),h.onDismiss==null||h.onDismiss.call(h,h),te==="x")Le(kr>0?"right":"left");else Le(Xf>0?"down":"up");ls(),ue(!0);return}else{var un,mw;(un=zt.current)==null||un.style.setProperty("--swipe-amount-x","0px"),(mw=zt.current)==null||mw.style.setProperty("--swipe-amount-y","0px")}ee(!1),ce(!1),D(null)},onPointerMove:(qe)=>{var ua,Na,kr;if(!pt.current||!Po)return;if(((ua=window.getSelection())==null?void 0:ua.toString().length)>0)return;let Da=qe.clientY-pt.current.y,no=qe.clientX-pt.current.x;if(!te&&(Math.abs(no)>1||Math.abs(Da)>1))D(Math.abs(no)>Math.abs(Da)?"x":"y");let cn={x:0,y:0},pw=(un)=>1/(1.5+Math.abs(un)/20);if(te==="y"){if(ra.includes("top")||ra.includes("bottom"))if(ra.includes("top")&&Da<0||ra.includes("bottom")&&Da>0)cn.y=Da;else{let un=Da*pw(Da);cn.y=Math.abs(un)<Math.abs(Da)?un:Da}}else if(te==="x"){if(ra.includes("left")||ra.includes("right"))if(ra.includes("left")&&no<0||ra.includes("right")&&no>0)cn.x=no;else{let un=no*pw(no);cn.x=Math.abs(un)<Math.abs(no)?un:no}}if(Math.abs(cn.x)>0||Math.abs(cn.y)>0)ee(!0);(Na=zt.current)==null||Na.style.setProperty("--swipe-amount-x",`${cn.x}px`),(kr=zt.current)==null||kr.style.setProperty("--swipe-amount-y",`${cn.y}px`)}},Ve&&!h.jsx&&Dt!=="loading"?Be("button",{"aria-label":Z,"data-disabled":fw,"data-close-button":!0,onClick:fw||!Po?()=>{}:()=>{ls(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Qn(J==null?void 0:J.closeButton,h==null?void 0:(r=h.classNames)==null?void 0:r.closeButton)},(oR=X==null?void 0:X.close)!=null?oR:Ste):null,(Dt||h.icon||h.promise)&&h.icon!==null&&((X==null?void 0:X[Dt])!==null||h.icon)?Be("div",{"data-icon":"",className:Qn(J==null?void 0:J.icon,h==null?void 0:(n=h.classNames)==null?void 0:n.icon)},Dt==="loading"?h.icon||aR():h.promise?aR():null,Dt!=="loading"?hj:null):null,Be("div",{"data-content":"",className:Qn(J==null?void 0:J.content,h==null?void 0:(s=h.classNames)==null?void 0:s.content)},Be("div",{"data-title":"",className:Qn(J==null?void 0:J.title,h==null?void 0:(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title==="function"?h.title():h.title),h.description?Be("div",{"data-description":"",className:Qn(Y,oe,J==null?void 0:J.description,h==null?void 0:(c=h.classNames)==null?void 0:c.description)},typeof h.description==="function"?h.description():h.description):null),Yt(h.cancel)?h.cancel:h.cancel&&b0(h.cancel)?Be("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||O,onClick:(qe)=>{if(!b0(h.cancel))return;if(!Po)return;h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,qe),ls()},className:Qn(J==null?void 0:J.cancelButton,h==null?void 0:(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Yt(h.action)?h.action:h.action&&b0(h.action)?Be("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||F,onClick:(qe)=>{if(!b0(h.action))return;if(h.action.onClick==null||h.action.onClick.call(h.action,qe),qe.defaultPrevented)return;ls()},className:Qn(J==null?void 0:J.actionButton,h==null?void 0:(m=h.classNames)==null?void 0:m.actionButton)},h.action.label):null)};function zB(){if(typeof window>"u")return"ltr";if(typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");if(e==="auto"||!e)return window.getComputedStyle(document.documentElement).direction;return e}function Ute(e,t){let a={};return[e,t].forEach((r,n)=>{let s=n===1,l=s?"--mobile-offset":"--offset",c=s?Nte:Ete;function f(m){["top","right","bottom","left"].forEach((g)=>{a[`${l}-${g}`]=typeof m==="number"?`${m}px`:m})}if(typeof r==="number"||typeof r==="string")f(r);else if(typeof r==="object")["top","right","bottom","left"].forEach((m)=>{if(r[m]===void 0)a[`${l}-${m}`]=c;else a[`${l}-${m}`]=typeof r[m]==="number"?`${r[m]}px`:r[m]});else f(c)}),a}var FB=ne(function(t,a){let{id:r,invert:n,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:m,offset:g,mobileOffset:h,theme:x="light",richColors:v,duration:w,style:C,visibleToasts:L=Pte,toastOptions:k,dir:I=zB(),gap:T=Ote,icons:R,customAriaLabel:E,containerAriaLabel:M="Notifications"}=t,[P,O]=A([]),F=de(()=>{if(r)return P.filter((me)=>me.toasterId===r);return P.filter((me)=>!me.toasterId)},[P,r]),z=de(()=>Array.from(new Set([s].concat(F.filter((me)=>me.position).map((me)=>me.position)))),[F,s]),[Y,q]=A([]),[G,Q]=A(!1),[re,J]=A(!1),[X,Z]=A(x!=="system"?x:typeof window<"u"?window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"light"),te=B(null),D=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),Te=B(null),Le=B(!1),H=j((me)=>{O((Ce)=>{var ge;if(!((ge=Ce.find((He)=>He.id===me.id))==null?void 0:ge.delete))Fr.dismiss(me.id);return Ce.filter(({id:He})=>He!==me.id)})},[]);return U(()=>Fr.subscribe((me)=>{if(me.dismiss){requestAnimationFrame(()=>{O((Ce)=>Ce.map((ge)=>ge.id===me.id?{...ge,delete:!0}:ge))});return}setTimeout(()=>{ps(()=>{O((Ce)=>{let ge=Ce.findIndex((He)=>He.id===me.id);if(ge!==-1)return[...Ce.slice(0,ge),{...Ce[ge],...me},...Ce.slice(ge+1)];return[me,...Ce]})})})}),[]),U(()=>{if(x!=="system"){Z(x);return}if(x==="system")if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)Z("dark");else Z("light");if(typeof window>"u")return;let me=window.matchMedia("(prefers-color-scheme: dark)");try{me.addEventListener("change",({matches:Ce})=>{if(Ce)Z("dark");else Z("light")})}catch(Ce){me.addListener(({matches:ge})=>{try{if(ge)Z("dark");else Z("light")}catch(He){console.error(He)}})}},[x]),U(()=>{if(P.length<=1)Q(!1)},[P]),U(()=>{let me=(Ce)=>{var ge;if(l.length>0&&l.every((he)=>Ce[he]||Ce.code===he)){var ce;Q(!0),(ce=te.current)==null||ce.focus()}if(Ce.code==="Escape"&&(document.activeElement===te.current||((ge=te.current)==null?void 0:ge.contains(document.activeElement))))Q(!1)};return document.addEventListener("keydown",me),()=>document.removeEventListener("keydown",me)},[l]),U(()=>{if(te.current)return()=>{if(Te.current)Te.current.focus({preventScroll:!0}),Te.current=null,Le.current=!1}},[te.current]),Be("section",{ref:a,"aria-label":E!=null?E:`${M} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},z.map((me,Ce)=>{var ge;let[He,ce]=me.split("-");if(!F.length)return null;return Be("ol",{key:me,dir:I==="auto"?zB():I,tabIndex:-1,ref:te,className:m,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":He,"data-x-position":ce,style:{"--front-toast-height":`${((ge=Y[0])==null?void 0:ge.height)||0}px`,"--width":`${Dte}px`,"--gap":`${T}px`,...C,...Ute(g,h)},onBlur:(he)=>{if(Le.current&&!he.currentTarget.contains(he.relatedTarget)){if(Le.current=!1,Te.current)Te.current.focus({preventScroll:!0}),Te.current=null}},onFocus:(he)=>{if(he.target instanceof HTMLElement&&he.target.dataset.dismissible==="false")return;if(!Le.current)Le.current=!0,Te.current=he.relatedTarget},onMouseEnter:()=>Q(!0),onMouseMove:()=>Q(!0),onMouseLeave:()=>{if(!re)Q(!1)},onDragEnd:()=>Q(!1),onPointerDown:(he)=>{if(he.target instanceof HTMLElement&&he.target.dataset.dismissible==="false")return;J(!0)},onPointerUp:()=>J(!1)},F.filter((he)=>!he.position&&Ce===0||he.position===me).map((he,ue)=>{var K,ee;return Be(Fte,{key:he.id,icons:R,index:ue,toast:he,defaultRichColors:v,duration:(K=k==null?void 0:k.duration)!=null?K:w,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:n,visibleToasts:L,closeButton:(ee=k==null?void 0:k.closeButton)!=null?ee:f,interacting:re,position:me,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:H,toasts:F.filter((W)=>W.position==he.position),heights:Y.filter((W)=>W.position==he.position),setHeights:q,expandByDefault:c,gap:T,expanded:G,swipeDirections:t.swipeDirections})}))}))});function qi({...e}){return d(AQ,{"data-slot":"alert-dialog",...e})}function Hte({...e}){return d(MQ,{"data-slot":"alert-dialog-portal",...e})}function Vte({className:e,...t}){return d(PQ,{"data-slot":"alert-dialog-overlay",className:N("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function Ki({className:e,size:t="default",...a}){return S(Hte,{children:[d(Vte,{}),d(EQ,{"data-slot":"alert-dialog-content","data-size":t,className:N("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",e),...a})]})}function Xi({className:e,...t}){return d("div",{"data-slot":"alert-dialog-header",className:N("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-6 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]",e),...t})}function Yi({className:e,...t}){return d("div",{"data-slot":"alert-dialog-footer",className:N("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function Wi({className:e,...t}){return d(OQ,{"data-slot":"alert-dialog-title",className:N("min-w-0 wrap-anywhere text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function $i({className:e,...t}){return d(_Q,{"data-slot":"alert-dialog-description",className:N("min-w-0 wrap-anywhere text-sm text-muted-foreground",e),...t})}function Qi({className:e,variant:t="default",size:a="default",...r}){return d(ae,{variant:t,size:a,asChild:!0,children:d(NQ,{"data-slot":"alert-dialog-action",className:N(e),...r})})}function Zi({className:e,variant:t="outline",size:a="default",...r}){return d(ae,{variant:t,size:a,asChild:!0,children:d(DQ,{"data-slot":"alert-dialog-cancel",className:N(e),...r})})}function UB(e,t){let a=new Set(e);if(a.has(t))a.delete(t);else a.add(t);return a}function HB(e,t){let a=new Set(t.map((n)=>n.id)),r=new Set([...e].filter((n)=>a.has(n)));return r.size===e.size?e:r}function VB(e,t){if(e===0)return"Tap sessions to select them";return`${e} of ${t} selected`}function Tl(e){return`${e} session${e===1?"":"s"}`}function gu({open:e,onOpenChange:t,deleting:a,onConfirm:r,count:n=1,progress:s=null}){let[l,c]=A(n);if(e&&n!==l)c(n);let f=l>1;return d(qi,{open:e,onOpenChange:(m)=>{if(!a)t(m)},children:S(Ki,{children:[S(Xi,{children:[d(Wi,{children:f?`Delete ${Tl(l)}?`:"Delete this session?"}),S($i,{children:[f?"Their conversation histories":"The conversation history"," will also be permanently deleted from the agent. This action cannot be undone."]})]}),S(Yi,{children:[d(Zi,{disabled:a,children:"Cancel"}),d(Qi,{variant:"destructive",onClick:(m)=>{m.preventDefault(),r()},disabled:a,children:a?S(se,{children:[d(fe,{"data-icon":"inline-start"}),s&&s.total>1?`Deleting ${Math.min(s.done+1,s.total)} of ${s.total}…`:"Deleting…"]}):f?`Delete ${Tl(l)}`:"Delete permanently"})]})]})})}function Zn({...e}){return d(HJ,{"data-slot":"dropdown-menu",...e})}function Jn({...e}){return d(VJ,{"data-slot":"dropdown-menu-trigger",...e})}function ei({className:e,sideOffset:t=4,...a}){return d(jJ,{children:d(GJ,{"data-slot":"dropdown-menu-content",sideOffset:t,className:N("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...a})})}function uI({...e}){return d(qJ,{"data-slot":"dropdown-menu-group",...e})}function Pa({className:e,inset:t,variant:a="default",...r}){return d(XJ,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:N("relative flex min-h-9 cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive",e),...r})}function jB({className:e,inset:t,...a}){return d(KJ,{"data-slot":"dropdown-menu-label","data-inset":t,className:N("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function ti({className:e,...t}){return d(YJ,{"data-slot":"dropdown-menu-separator",className:N("-mx-1 my-1 h-px bg-border",e),...t})}function Ya(){if(typeof window>"u")return;window.dispatchEvent(new Event("kcg-data-changed"))}function GB(e){if(typeof window>"u")return()=>{};return window.addEventListener("kcg-data-changed",e),()=>window.removeEventListener("kcg-data-changed",e)}function qB(e,t){return e instanceof we?e.message:t}function KB({session:e,title:t,onDeleted:a}){let[r,n]=A(!1),[s,l]=A(null),[c,f]=A(!1),[m,g]=A(!1),h=e.status==="running",x=()=>le(`/api/sessions/${e.id}/stop`,{method:"POST"}),v=()=>le(`/api/sessions/${e.id}`,{method:"POST"}),w=async(L)=>{l(L);try{if(L==="stop")await x(),De.success("Session stopped.");else if(L==="start")await v(),De.success("Session started.");else await x(),await v(),De.success("Session restarted.");Ya()}catch(k){De.error(qB(k,L==="stop"?"Couldn't stop the session.":L==="start"?"Couldn't start the session.":"Couldn't restart the session."))}finally{l(null)}},C=async()=>{g(!0);try{await le(`/api/sessions/${e.id}`,{method:"DELETE"}),f(!1),De.success("Session deleted."),Ya(),a?.()}catch(L){De.error(qB(L,"Couldn't delete the session."))}finally{g(!1)}};return S(se,{children:[S(Zn,{open:r,onOpenChange:n,children:[d(Jn,{asChild:!0,children:d("button",{type:"button","aria-label":`Session actions: ${t}`,disabled:s!==null,className:N("absolute top-1/2 -right-6 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md text-sidebar-foreground/60 outline-hidden transition-opacity","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring","opacity-0 group-focus-within/menu-sub-item:opacity-100 group-hover/menu-sub-item:opacity-100 data-[state=open]:opacity-100",s!==null&&"opacity-100","[&>svg]:size-4"),children:s!==null?d(fe,{className:"size-3.5"}):d(Dn,{})})}),S(ei,{side:"right",align:"start",className:"min-w-40",children:[h?S(se,{children:[S(Pa,{onSelect:()=>void w("stop"),children:[d(eo,{}),"Stop"]}),S(Pa,{onSelect:()=>void w("restart"),children:[d(Ig,{}),"Restart"]})]}):S(Pa,{onSelect:()=>void w("start"),children:[d(Ni,{}),e.status==="crashed"?"Restart":"Start"]}),d(ti,{}),S(Pa,{variant:"destructive",onSelect:()=>f(!0),children:[d(pa,{}),"Delete"]})]})]}),d(gu,{open:c,onOpenChange:f,deleting:m,onConfirm:()=>void C()})]})}var pI="kcg-theme",jte="(prefers-color-scheme: dark)";function Gte(e){return e==="dark"?"light":"dark"}function qte(e){let t=e.getItem(pI);return t==="dark"||t==="light"||t==="system"?t:"system"}function WB(e,t){if(e==="system")return t()?"dark":"light";return e}function $B(e,t){e.classList.toggle("dark",t==="dark")}var mI=typeof window<"u"&&typeof document<"u",QB=mI?window.matchMedia?.(jte):void 0,ZB=()=>Boolean(QB?.matches);function JB(){try{return typeof localStorage<"u"?qte(localStorage):"system"}catch{return"system"}}var hu=(()=>{let e=JB();return{preference:e,theme:WB(e,ZB)}})(),dI=new Set;function fI(e,t){let a={preference:e,theme:WB(e,ZB)};if(mI)$B(document.documentElement,a.theme);if(t)try{localStorage.setItem(pI,e)}catch{}if(a.preference===hu.preference&&a.theme===hu.theme)return;hu=a;for(let r of dI)r()}if(mI)$B(document.documentElement,hu.theme),QB?.addEventListener?.("change",()=>{if(hu.preference==="system")fI("system",!1)}),window.addEventListener("storage",(e)=>{if(e.key===pI)fI(JB(),!1)});function XB(e){fI(e,!0)}function Kte(e){return dI.add(e),()=>dI.delete(e)}function YB(){return hu}function Cf(){let e=Eo(Kte,YB,YB),t=j(()=>XB(Gte(hu.theme)),[]);return{theme:e.theme,preference:e.preference,setPreference:XB,toggleTheme:t}}var Xte=[{value:"light",label:"Light",Icon:$c},{value:"dark",label:"Dark",Icon:Kc},{value:"system",label:"System",Icon:xg}];function e8({className:e}){let{preference:t,setPreference:a}=Cf(),r=lt(),n=lt();return S("div",{className:N("flex items-center justify-between gap-3 px-2",e),children:[d("span",{id:n,className:"text-sm text-sidebar-foreground/80",children:"Theme"}),d("fieldset",{"aria-labelledby":n,className:"flex shrink-0 items-center gap-0.5 rounded-lg border border-sidebar-border bg-sidebar-accent/60 p-0.5",children:Xte.map(({value:s,label:l,Icon:c})=>{let f=t===s;return S("label",{title:s==="system"?"System (match device)":l,className:N("flex size-7 cursor-pointer items-center justify-center rounded-md transition-colors select-none","has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-sidebar-ring",f?"bg-sidebar text-sidebar-foreground shadow-sm":"text-sidebar-foreground/55 hover:text-sidebar-foreground"),children:[d("input",{type:"radio",name:r,value:s,checked:f,onChange:()=>a(s),className:"sr-only"}),d(c,{className:"size-4 shrink-0","aria-hidden":!0}),d("span",{className:"sr-only",children:l})]},s)})})]})}function Lo({...e}){return d(qQ,{"data-slot":"collapsible",...e})}function ai({...e}){return d(VQ,{"data-slot":"collapsible-trigger",...e})}function To({...e}){return d(jQ,{"data-slot":"collapsible-content",...e})}function y0({className:e,type:t,...a}){return d("input",{type:t,"data-slot":"input",className:N("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}function Rl({...e}){return d(Wg,{"data-slot":"sheet",...e})}function t8({...e}){return d(S2,{"data-slot":"sheet-trigger",...e})}function Yte({...e}){return d($g,{"data-slot":"sheet-portal",...e})}function Wte({className:e,...t}){return d(Qg,{"data-slot":"sheet-overlay",className:N("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function Al({className:e,children:t,side:a="right",showCloseButton:r=!0,...n}){return S(Yte,{children:[d(Wte,{}),S(Zg,{"data-slot":"sheet-content",className:N("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",a==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",a==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",a==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",a==="bottom"&&"inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-2xl data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...n,children:[a==="bottom"&&d("div",{className:"mx-auto mt-2 h-1.5 w-10 shrink-0 rounded-full bg-muted-foreground/30","aria-hidden":!0}),t,r&&a!=="bottom"&&S(ml,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[d(Ft,{className:"size-4"}),d("span",{className:"sr-only",children:"Close"})]})]})]})}function Ml({className:e,...t}){return d("div",{"data-slot":"sheet-header",className:N("flex flex-col gap-1.5 p-4",e),...t})}function Pl({className:e,...t}){return d(Jg,{"data-slot":"sheet-title",className:N("font-semibold text-foreground",e),...t})}function El({className:e,...t}){return d(Kb,{"data-slot":"sheet-description",className:N("text-sm text-muted-foreground",e),...t})}function Fe({className:e,...t}){return d("div",{"data-slot":"skeleton",className:N("animate-pulse rounded-md bg-accent",e),...t})}var $te=639,Qte=`(max-width: ${$te}px)`;function Ji(e){let[t,a]=A(()=>{if(typeof window>"u"||typeof window.matchMedia!=="function")return!1;return window.matchMedia(e).matches});return U(()=>{if(typeof window>"u"||typeof window.matchMedia!=="function")return;let r=window.matchMedia(e);a(r.matches);let n=(s)=>a(s.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[e]),t}function a8(){return Ji(Qte)}var Zte=768;function r8(){return Ji(`(max-width: ${Zte-1}px)`)}var o8="kcg-sidebar-open";function eae(e){if(typeof localStorage>"u")return e;let t=localStorage.getItem(o8);return t===null?e:t==="true"}var tae="16rem",aae="18rem",rae="3rem",oae="b",n8=ht(null);function xu(){let e=We(n8);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}function i8({defaultOpen:e=!0,open:t,onOpenChange:a,className:r,style:n,children:s,...l}){let c=r8(),[f,m]=A(!1),[g,h]=A(()=>eae(e)),x=t??g,v=j((k)=>{let I=typeof k==="function"?k(x):k;if(a)a(I);else h(I);if(typeof localStorage<"u")localStorage.setItem(o8,String(I))},[a,x]),w=j(()=>c?m((k)=>!k):v((k)=>!k),[c,v]);U(()=>{let k=(I)=>{if(I.key===oae&&(I.metaKey||I.ctrlKey))I.preventDefault(),w()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[w]);let C=x?"expanded":"collapsed",L=de(()=>({state:C,open:x,setOpen:v,isMobile:c,openMobile:f,setOpenMobile:m,toggleSidebar:w}),[C,x,v,c,f,w]);return d(n8.Provider,{value:L,children:d(v0,{delayDuration:0,children:d("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":tae,"--sidebar-width-icon":rae,...n},className:N("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...l,children:s})})})}function s8({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:r,children:n,...s}){let{isMobile:l,state:c,openMobile:f,setOpenMobile:m}=xu();if(a==="none")return d("div",{"data-slot":"sidebar",className:N("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...s,children:n});if(l)return d(Rl,{open:f,onOpenChange:m,...s,children:S(Al,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":aae},side:e,children:[S(Ml,{className:"sr-only",children:[d(Pl,{children:"Sidebar"}),d(El,{children:"Displays the mobile sidebar."})]}),d("div",{className:"flex h-full w-full flex-col",children:n})]})});return S("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?a:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[d("div",{"data-slot":"sidebar-gap",className:N("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),d("div",{"data-slot":"sidebar-container",className:N("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:d("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:n})})]})}function w0({className:e,onClick:t,...a}){let{toggleSidebar:r}=xu();return S(ae,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:N("size-7",e),onClick:(n)=>{t?.(n),r()},...a,children:[d(nl,{}),d("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function l8({className:e,...t}){let{toggleSidebar:a}=xu();return d("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:N("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function c8({className:e,...t}){return d("main",{"data-slot":"sidebar-inset",className:N("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function u8({className:e,...t}){return d("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:N("flex flex-col gap-2 p-2",e),...t})}function d8({className:e,...t}){return d("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:N("flex flex-col gap-2 p-2",e),...t})}function f8({className:e,...t}){return d("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:N("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function p8({className:e,...t}){return d("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:N("relative flex w-full min-w-0 flex-col p-2",e),...t})}function m8({className:e,asChild:t=!1,...a}){let r=t?mf:"div";return d(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:N("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})}function g8({className:e,...t}){return d("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:N("w-full text-sm",e),...t})}function mh({className:e,...t}){return d("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:N("flex w-full min-w-0 flex-col gap-1",e),...t})}function vu({className:e,...t}){return d("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:N("group/menu-item relative",e),...t})}var nae=Ca("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function If({asChild:e=!1,isActive:t=!1,variant:a="default",size:r="default",tooltip:n,className:s,...l}){let c=e?mf:"button",{isMobile:f,state:m}=xu(),g=d(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:N(nae({variant:a,size:r}),s),...l});if(!n)return g;if(typeof n==="string")n={children:n};return S(rn,{children:[d(on,{asChild:!0,children:g}),d(nn,{side:"right",align:"center",hidden:m!=="collapsed"||f,...n})]})}function h8({className:e,...t}){return d("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:N("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t})}function x8({className:e,showIcon:t=!1,...a}){let r=de(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return S("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:N("flex h-8 items-center gap-2 rounded-md px-2",e),...a,children:[t&&d(Fe,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),d(Fe,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function v8({className:e,...t}){return d("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:N("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function S0({className:e,...t}){return d("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:N("group/menu-sub-item relative",e),...t})}function gI({asChild:e=!1,size:t="md",isActive:a=!1,className:r,...n}){let s=e?mf:"a";return d(s,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:N("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...n})}var hI="kcg-code-route-change",xI=new Set;function b8(e){window.history.pushState({},"",e),window.dispatchEvent(new Event(hI));for(let t of xI)t()}function iae(){return typeof document.startViewTransition==="function"&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}function sae(e,t={}){if(typeof window>"u"||typeof window.history>"u")return;let{transition:a}=t;if(!a||!iae()){b8(e);return}let r=document.documentElement;r.dataset.vt=a,document.startViewTransition(()=>{ps(()=>b8(e))}).finished.finally(()=>{if(r.dataset.vt===a)delete r.dataset.vt})}function wt(){let[e,t]=A(()=>window.location.pathname);U(()=>{let r=()=>t(window.location.pathname);return window.addEventListener("popstate",r),window.addEventListener(hI,r),xI.add(r),()=>{window.removeEventListener("popstate",r),window.removeEventListener(hI,r),xI.delete(r)}},[]);let a=j((r,n)=>sae(r,n),[]);return{pathname:e,navigate:a}}var vI="pl-4",lae=5;function y8({route:e,data:t}){let{navigate:a}=wt(),{isMobile:r,setOpenMobile:n}=xu(),[s,l]=A(!1);U(()=>{let g=(h)=>{if((h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k")h.preventDefault(),l((x)=>!x)};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[]);let c=(g)=>(h)=>{if(h.metaKey||h.ctrlKey||h.shiftKey||h.button!==0)return;if(h.preventDefault(),a(g),r)n(!1)},f=e.name==="project"||e.name==="session"?e.projectId:null,m=e.name==="session"?e.sessionId:null;return S(s8,{collapsible:"offcanvas",children:[S(u8,{children:[d(mh,{children:d(vu,{children:d(If,{size:"lg",asChild:!0,children:S("a",{href:Br(),onClick:c(Br()),children:[d("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-[#EEEBFF] p-1.5 ring-1 ring-[#6D5CFB]/20 dark:bg-[#6D5CFB]/15 dark:ring-[#6D5CFB]/30",children:d("img",{src:Cr,alt:"",className:"size-full"})}),d("span",{className:"truncate font-semibold",children:"KCG Code"})]})})})}),S(mh,{className:"mt-1",children:[d(vu,{children:d(If,{asChild:!0,isActive:e.name==="projects",className:vI,children:S("a",{href:Br(),onClick:c(Br()),children:[d(mg,{}),d("span",{children:"New session"})]})})}),d(vu,{children:S(If,{type:"button",onClick:()=>{if(r)n(!1);l(!0)},"aria-haspopup":"dialog","aria-keyshortcuts":"Control+K Meta+K",className:vI,children:[d(la,{}),d("span",{children:"Search"}),d("kbd",{className:"ml-auto hidden rounded border bg-sidebar px-1.5 font-mono text-[10px] text-muted-foreground md:inline",children:"Ctrl K"})]})}),d(vu,{children:d(If,{asChild:!0,isActive:e.name==="skills",className:vI,children:S("a",{href:Il(f),onClick:c(Il(f)),children:[d(sa,{}),d("span",{children:"Skills"})]})})})]})]}),d(f8,{children:S(p8,{children:[d(m8,{children:"Projects"}),d(g8,{children:d(cae,{data:t,activeProjectId:f,activeSessionId:m,go:c,navigate:(g)=>{if(a(g),r)n(!1)}})})]})}),S(d8,{className:"gap-3 border-t",children:[d(e8,{}),d(DB,{active:e.name==="settings",onNavigate:(g)=>{if(a(g),r)n(!1)}})]}),d(l8,{}),d(NB,{open:s,onOpenChange:l,groups:t.groups,onSelect:a})]})}function cae({data:e,activeProjectId:t,activeSessionId:a,go:r,navigate:n}){if(e.initialLoading)return d(mh,{"aria-busy":"true","aria-label":"Loading sessions",children:["a","b","c","d"].map((s)=>d(vu,{children:d(x8,{showIcon:!0})},s))});if(e.loadError&&e.projectCount===0)return S("div",{className:"flex flex-col items-start gap-2 px-2 py-1 text-xs text-muted-foreground",children:[d("p",{role:"alert",children:e.loadError}),S(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>void e.refresh(),children:[d(xr,{"data-icon":"inline-start"}),"Retry"]})]});if(e.projectCount===0)return d("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No projects yet."});return d(mh,{children:e.groups.map((s)=>d(uae,{group:s,active:s.project.id===t,activeSessionId:a,go:r,navigate:n},s.project.id))})}function uae({group:e,active:t,activeSessionId:a,go:r,navigate:n}){let{isMobile:s}=xu(),[l,c]=A(t||e.sessions.length>0),f=B("mouse"),{project:m,sessions:g,runningCount:h}=e,x=g.slice(0,lae),v=a!==null&&!x.some((I)=>I.id===a)&&g.find((I)=>I.id===a),w=v?[...x,v]:x,C=g.length-w.length,L=Gi(m.id),k=(I)=>{if(I.detail>=2&&f.current==="mouse")I.preventDefault(),c(!0),n(L)};return d(Lo,{asChild:!0,open:l,onOpenChange:c,className:"group/collapsible",children:S(vu,{children:[d(ai,{asChild:!0,children:S(If,{isActive:t&&a===null,tooltip:m.name,"aria-label":`${m.name}, ${g.length} sessions`,onPointerDown:(I)=>{f.current=I.pointerType},onClick:k,title:s?void 0:"Click to expand · Double-click to open project",className:"select-none",children:[d(Jt,{className:"transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),t?d(Vc,{}):d(_t,{}),d("span",{children:m.name})]})}),h>0&&d(h8,{"aria-label":`${h} running`,children:h}),d(To,{children:S(v8,{children:[w.length===0&&d(S0,{children:d("span",{className:"block px-2 py-1 text-xs text-muted-foreground",children:"No sessions yet"})}),w.map((I)=>{let T=Ll(I.title),R=Wn(m.id,I.id),E=I.id===a;return S(S0,{children:[S(gI,{href:R,onClick:r(R),isActive:E,"aria-current":E?"page":void 0,title:T,className:"h-9 md:h-7",children:[d("span",{"aria-hidden":!0,className:N("size-2 shrink-0 rounded-full",$n[I.status])}),S("span",{className:"sr-only",children:[Io[I.status],":"]}),d("span",{children:T})]}),!s&&d(KB,{session:I,title:T,onDeleted:()=>{if(E)n(L)}})]},I.id)}),d(S0,{children:S(gI,{href:L,onClick:r(L),size:"sm",isActive:t&&a===null,"aria-current":t&&a===null?"page":void 0,className:"group/detail h-8 w-fit gap-0.5 pr-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-foreground data-[active=true]:font-medium data-[active=true]:text-foreground md:h-6 [&>svg]:size-3 [&>svg]:text-current",children:[d("span",{children:C>0?`Show all ${g.length}`:"Project details"}),d(Jt,{className:"transition-transform group-hover/detail:translate-x-0.5","aria-hidden":!0})]})})]})})]})})}var Nt=["opencode","claude-code"],Ht={opencode:"OpenCode","claude-code":"Claude Code"};function gh(){try{return(typeof localStorage>"u"?null:localStorage.getItem("kcg-home-agent-type"))==="claude-code"?"claude-code":"opencode"}catch{return"opencode"}}function k0(e){try{localStorage.setItem("kcg-home-agent-type",e)}catch{}}function ri(e){return e==="claude-code"?"?agent=claude-code":""}var dae=700,fae=3000,pae=1800000,w8=500,sr=[],wI=new Set,SI=new Set,bI=new Set;function C0(){for(let e of wI)e()}function es(e,t){let a=!1;if(sr=sr.map((r)=>{if(r.job.id!==e)return r;return a=!0,t(r)}),a)C0()}function mae(e){sr=sr.some((a)=>a.job.id===e.job.id)?sr.map((a)=>a.job.id===e.job.id?e:a):[e,...sr],C0()}function k8(e,t,a=!1){return{job:e,lines:[],next:0,truncated:!1,dismissed:a,expanded:t,pollError:null,cancelling:!1}}var C8="kcg-skill-installs-ui";function I8(){try{let e=localStorage.getItem(C8);if(!e)return{dismissed:[],expanded:[]};let t=JSON.parse(e),a=(r)=>Array.isArray(r)?r.filter((n)=>typeof n==="string"):[];return{dismissed:a(t.dismissed),expanded:a(t.expanded)}}catch{return{dismissed:[],expanded:[]}}}var I0=new Set(I8().dismissed);function Lf(){let e={dismissed:[...new Set([...I0,...sr.filter((t)=>t.dismissed).map((t)=>t.job.id)])],expanded:sr.filter((t)=>t.expanded).map((t)=>t.job.id)};try{localStorage.setItem(C8,JSON.stringify(e))}catch{}}function gae(e,t,a){let r=new Set(t.dismissed),n=new Set(t.expanded);return e.filter((s)=>!a.has(s.id)).filter((s)=>s.status==="running"||!r.has(s.id)).map((s)=>k8(s,n.has(s.id),r.has(s.id)))}function hae(e,t){let a=Math.max(0,e.next-t.from),r=t.lines.slice(a),n=r.length>0?[...e.lines,...r]:e.lines,s=e.truncated||t.truncated;if(n.length>w8)n=n.slice(n.length-w8),s=!0;return{...e,job:t.job,lines:n,next:Math.max(e.next,t.from+t.lines.length),truncated:s,pollError:null}}async function L8(e){if(bI.has(e))return;bI.add(e);try{for(;;){let t=sr.find((a)=>a.job.id===e);if(!t)return;try{let r=await(await le(`/api/skills/installs/${e}?from=${t.next}`)).json(),n=t.job.status==="running";if(es(e,(s)=>hae(s,r)),r.job.status!=="running"){if(n)for(let l of SI)l(r.job);if(!(r.job.status==="succeeded"&&r.job.refreshed===!1&&Date.now()-(r.job.finishedAt??Date.now())<pae))return;await new Promise((l)=>setTimeout(l,fae));continue}}catch(a){if(a instanceof we&&a.status===404){if(t.job.status==="succeeded"){es(e,(r)=>({...r,job:{...r.job,refreshed:!0}}));return}es(e,(r)=>({...r,job:{...r.job,status:"failed",error:"INSTALL_JOB_LOST",finishedAt:Date.now()},pollError:null}));return}es(e,(r)=>({...r,pollError:"Connection lost — retrying…"}))}await new Promise((a)=>setTimeout(a,dae))}}finally{bI.delete(e)}}async function T8(e,t,a,r=["opencode"]){let n=await le(`/api/projects/${e}/skills/install`,{method:"POST",body:JSON.stringify({source:t,skill:a,agents:r})}),{job:s}=await n.json();return mae(k8(s,!0)),Lf(),L8(s.id),s}var yI=!1;async function R8(){if(yI)return;yI=!0;try{let e=await le("/api/skills/installs"),{jobs:t}=await e.json(),a=I8(),r=gae(t,a,new Set(sr.map((s)=>s.job.id))),n=new Set(t.map((s)=>s.id));if(I0=new Set(a.dismissed.filter((s)=>n.has(s))),r.length>0)sr=[...sr,...r],C0();Lf();for(let s of r)L8(s.job.id)}catch{yI=!1}}function A8(e){es(e,(a)=>({...a,dismissed:!0}));let t=sr.find((a)=>a.job.id===e);if(t&&t.job.status!=="running")I0.add(e),sr=sr.filter((a)=>a.job.id!==e),C0();Lf()}async function M8(e){es(e,(t)=>({...t,cancelling:!0,expanded:!0})),Lf();try{await le(`/api/skills/installs/${e}/cancel`,{method:"POST"})}catch(t){if(!(t instanceof we&&t.status===409))es(e,(a)=>({...a,cancelling:!1,pollError:"Couldn't cancel — try again."}))}}function P8(e){es(e,(t)=>({...t,expanded:!t.expanded})),Lf()}function E8(e){I0.delete(e),es(e,(t)=>({...t,dismissed:!1,expanded:!0})),Lf()}function N8(e){return SI.add(e),()=>SI.delete(e)}function xae(e){return wI.add(e),()=>wI.delete(e)}function S8(){return sr}function L0(){return Eo(xae,S8,S8)}function D8(e,t,a,r){return e.find((n)=>n.job.status==="running"&&n.job.projectId===t&&n.job.source===a&&n.job.skillId===r)}var vae=3;function _8(){let e=L0();U(()=>{R8()},[]);let t=e.filter((s)=>!s.dismissed),a=t.slice(0,vae),r=t.length-a.length,n=e.filter((s)=>s.job.status==="running").length;return S(se,{children:[d("p",{className:"sr-only","aria-live":"polite",children:n>0?`${n} skill installation${n>1?"s":""} in progress.`:""}),a.length>0&&S("section",{"aria-label":"Skill installations",className:"pointer-events-none fixed inset-x-3 bottom-3 z-50 flex flex-col-reverse gap-2 sm:inset-x-auto sm:right-4 sm:bottom-4 sm:w-[26rem]",children:[a.map((s)=>d(wae,{entry:s},s.job.id)),r>0&&S("p",{className:"pointer-events-auto self-end rounded-full border bg-popover px-3 py-1 text-xs text-muted-foreground shadow-md",children:["+",r," more"]})]})]})}function bae(e){let[t,a]=A(()=>Date.now());return U(()=>{if(!e)return;let r=setInterval(()=>a(Date.now()),1000);return()=>clearInterval(r)},[e]),t}function O8(e){let t=Math.max(0,Math.round(e/1000));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}var yae=15000;function wae({entry:e}){let{job:t,lines:a,expanded:r,pollError:n,truncated:s,cancelling:l}=e,c=t.status==="running",f=t.status==="failed",m=t.status==="cancelled",g=bae(c),h=O8((t.finishedAt??g)-t.startedAt),x=c?g-t.lastOutputAt:0,v=`install-log-${t.id}`,w=c?l?`Cancelling ${t.skillId}…`:`Installing ${t.skillId}`:m?`Cancelled ${t.skillId}`:f?`Couldn't install ${t.skillId}`:`Installed ${t.skillId}`,C=t.status==="succeeded"&&t.refreshed===!1,L=m?`Nothing was added to ${t.projectName}.`:f?vr(t.error??"SKILL_INSTALL_FAILED"):C?`Added to ${t.projectName}. Activates automatically when the running chat finishes.`:`${c?"into":"Added to"} ${t.projectName} · ${(t.agentTypes??["opencode"]).map((k)=>Ht[k]).join(" + ")}${t.status==="succeeded"?" · active":""}`;return S("article",{"aria-label":w,className:N("pointer-events-auto overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-lg","animate-in fade-in-0 slide-in-from-bottom-2",f&&"border-destructive/40"),children:[S("div",{className:"flex items-start gap-3 p-3.5",children:[d("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center","aria-hidden":!0,children:c?d(fe,{className:"size-4 text-primary"}):m?d(Om,{className:"size-5 text-muted-foreground"}):f?d(tl,{className:"size-5 text-destructive"}):C?d(Vm,{className:"size-5 text-amber-600 dark:text-amber-400"}):d(Nn,{className:"size-5 text-emerald-600 dark:text-emerald-400"})}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[S("p",{className:"flex min-w-0 items-baseline gap-2",children:[d("span",{className:"truncate text-sm font-semibold",children:w}),d("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:h})]}),d("p",{className:N("line-clamp-2 text-xs",f?"text-destructive":"text-muted-foreground"),children:L}),C&&S("span",{className:"mt-0.5 flex w-fit items-center gap-1.5 rounded-full bg-amber-500/10 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:text-amber-400",children:[d("span",{className:"size-1.5 animate-pulse rounded-full bg-current","aria-hidden":!0}),"Waiting for chat to finish"]}),n&&d("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:n}),c&&!l&&x>=yae&&S("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:["No output for ",O8(x)," — still downloading, or you can cancel."]}),d("span",{className:"truncate font-mono text-[11px] text-muted-foreground/80",children:t.source})]}),S("div",{className:"-mt-0.5 -mr-1 flex shrink-0 items-center gap-0.5",children:[c&&S("button",{type:"button",onClick:()=>void M8(t.id),disabled:l,"aria-label":`Cancel installing ${t.skillId}`,title:"Cancel installation",className:"flex h-7 items-center gap-1 rounded-md px-2 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50",children:[d(eo,{className:"size-3 fill-current","aria-hidden":!0}),"Cancel"]}),d("button",{type:"button",onClick:()=>A8(t.id),"aria-label":c?"Hide (installation continues)":"Dismiss",title:c?"Hide — installation continues in the background":"Dismiss",className:"flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",children:d(Ft,{className:"size-4"})})]})]}),c&&d("div",{className:"h-0.5 w-full overflow-hidden bg-muted","aria-hidden":!0,children:d("div",{className:"h-full w-1/3 animate-[install-progress_1.4s_ease-in-out_infinite] rounded-full bg-primary"})}),S("div",{className:"border-t",children:[S("button",{type:"button",onClick:()=>P8(t.id),"aria-expanded":r,"aria-controls":v,className:"flex w-full items-center gap-2 px-3.5 py-2 text-xs font-medium text-muted-foreground hover:bg-muted/50 hover:text-foreground",children:[d(ll,{className:"size-3.5","aria-hidden":!0}),r?"Hide output":"Show output",d("span",{className:"tabular-nums text-muted-foreground/70",children:a.length>0&&`· ${a.length} lines`}),d(yt,{className:N("ml-auto size-3.5 transition-transform",r&&"rotate-180"),"aria-hidden":!0})]}),r&&d(Sae,{id:v,lines:a,running:c,truncated:s})]})]})}function Sae({id:e,lines:t,running:a,truncated:r}){let n=B(null),s=B(!0),[l,c]=A(!1);U(()=>{let m=n.current;if(m&&s.current)m.scrollTop=m.scrollHeight},[t.length]);let f=async()=>{try{await navigator.clipboard.writeText(t.join(`
|
|
61
|
+
`)),c(!0),setTimeout(()=>c(!1),1500)}catch{}};return S("div",{className:"relative",children:[S("pre",{ref:n,id:e,role:"log","aria-live":"off",tabIndex:0,"aria-label":"Installation output",onScroll:(m)=>{let g=m.currentTarget;s.current=g.scrollHeight-g.scrollTop-g.clientHeight<24},className:"max-h-56 overflow-auto bg-zinc-950 px-3.5 py-3 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words text-zinc-200 outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[r&&S("span",{className:"text-zinc-500",children:["… earlier output trimmed",`
|
|
62
|
+
`]}),t.length===0?d("span",{className:"text-zinc-500",children:"Waiting for output…"}):t.map((m,g)=>S("span",{className:kae(m),children:[m,`
|
|
63
|
+
`]},g)),a&&d("span",{className:"animate-pulse text-zinc-400",children:"▍"})]}),t.length>0&&S("button",{type:"button",onClick:()=>void f(),"aria-label":"Copy output",className:"absolute top-2 right-2 flex h-6 items-center gap-1 rounded-md bg-zinc-800/90 px-2 text-[11px] text-zinc-300 hover:bg-zinc-700",children:[d(gr,{className:"size-3","aria-hidden":!0}),l?"Copied":"Copy"]})]})}function kae(e){if(e.startsWith("$ "))return"text-sky-300";if(e.startsWith("✓"))return"text-emerald-400";if(e.startsWith("✗")||/^(error|■)/i.test(e.trimStart()))return"text-red-400";return}function T0(e,t){let a=B(!1),r=B(!1),n=B(t);n.current=t,U(()=>{if(e==="connected"){if(a.current&&r.current)n.current();a.current=!0,r.current=!1}else if(a.current)r.current=!0},[e])}var Cae=4401;function Iae(){if(typeof location>"u")return null;return`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`}function Tf(e={}){let{onMessage:t,reconnectDelayMs:a=1500,url:r}=e,[n,s]=A("idle"),l=B(null),c=B(null),f=B(!1),m=B(null),g=B(!1),h=B(0),x=B(t);x.current=t;let v=j(()=>r??Iae(),[r]),w=j(()=>{if(l.current)return;let I=v();if(!I)return;f.current=!1,s("connecting");let T=new WebSocket(I);l.current=T,T.onopen=()=>{if(l.current!==T)return;g.current=!0,h.current=0,s("connected");let R=c.current;if(R!==null)T.send(JSON.stringify({type:"attach",sessionId:R}))},T.onmessage=(R)=>{if(l.current!==T)return;try{let E=JSON.parse(String(R.data));x.current?.(E)}catch{}},T.onerror=()=>{},T.onclose=(R)=>{if(l.current!==T)return;if(l.current=null,f.current){s("closed");return}if(R.code===Cae){s("reconnecting"),Ut().then((E)=>{if(f.current)return;if(E?.protected&&!E.authenticated){f.current=!0,s("closed"),Fg();return}w()});return}if(!g.current){if(h.current+=1,h.current>=2)Ut().then((E)=>{if(E?.protected&&!E.authenticated)f.current=!0,s("closed"),Fg()})}g.current=!1,s("reconnecting"),m.current=setTimeout(()=>{m.current=null,w()},a)}},[v,a]),C=j((I)=>{let T=l.current;if(!T||T.readyState!==WebSocket.OPEN)return!1;return T.send(JSON.stringify(I)),!0},[]),L=j((I)=>{if(c.current=I,!l.current){w();return}if(l.current.readyState===WebSocket.OPEN)l.current.send(JSON.stringify({type:"attach",sessionId:I}))},[w]),k=j(()=>{if(f.current=!0,m.current)clearTimeout(m.current),m.current=null;l.current?.close(),l.current=null,s("closed")},[]);return U(()=>()=>{if(f.current=!0,m.current)clearTimeout(m.current);l.current?.close(),l.current=null},[]),{status:n,attach:L,send:C,disconnect:k}}function z8(e){let[t,a]=A([]),[r,n]=A([]),[s,l]=A(!1),[c,f]=A(null),m=B(0),g=j(async()=>{let v=++m.current;try{let[w,C]=await Promise.all([le("/api/projects"),le("/api/sessions")]),[L,k]=await Promise.all([w.json(),C.json()]);if(v!==m.current)return;a(L.projects),n(k.sessions),f(null)}catch(w){if(v!==m.current)return;f(w instanceof we?w.message:"Failed to load sessions")}finally{if(v===m.current)l(!0)}},[]);U(()=>{g()},[g,e]),U(()=>GB(()=>void g()),[g]);let h=Tf({onMessage:(v)=>{if(v.type==="session_title")n((w)=>w.map((C)=>C.id===v.sessionId?{...C,title:v.title}:C));else if(v.type==="session_status")n((w)=>w.map((C)=>C.id===v.sessionId&&C.status!==v.status?{...C,status:v.status}:C));else if(v.type==="session_deleted")n((w)=>w.filter((C)=>C.id!==v.sessionId));else if(v.type==="data_changed")g()}});return U(()=>(h.attach(""),()=>h.disconnect()),[h.attach,h.disconnect]),T0(h.status,g),{groups:de(()=>PB(t,r),[t,r]),projectCount:t.length,initialLoading:!s,loadError:c,refresh:g}}function Ze({id:e,title:t,description:a,suffix:r,toolbar:n,children:s}){let l=lt();return S("section",{id:e,"aria-labelledby":t?l:void 0,className:"flex scroll-mt-6 flex-col gap-2.5",children:[(t||r)&&S("div",{className:"flex flex-col gap-0.5 px-1",children:[S("div",{className:"flex min-h-8 items-center justify-between gap-3",children:[t&&d("h2",{id:l,className:"min-w-0 text-[15px] font-semibold tracking-tight",children:t}),r&&d("div",{className:"-mr-2 ml-auto shrink-0",children:r})]}),a&&d("p",{className:"text-[13px] text-muted-foreground",children:a})]}),n,d("div",{className:"overflow-hidden rounded-xl border bg-card shadow-xs",children:d("ul",{className:"flex flex-col divide-y",children:s})})]})}function it({title:e,subtitle:t,prefix:a,suffix:r,onActivate:n,destructive:s,disabled:l,htmlFor:c,stack:f,className:m}){let g=N("text-[15px] leading-5",s&&"text-destructive"),h=S(se,{children:[a&&d("span",{className:"flex shrink-0 items-center",children:a}),S("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2",children:[S("span",{className:N("flex min-w-[min(100%,10rem)] flex-1 flex-col gap-0.5 py-0.5",f&&"basis-full sm:basis-0"),children:[c?d("label",{htmlFor:c,className:g,children:e}):d("span",{className:g,children:e}),t&&d("span",{className:"text-[13px] leading-snug text-muted-foreground",children:t})]}),r&&d("span",{className:"flex shrink-0 items-center gap-2",children:r})]}),n&&d(Jt,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0})]}),x="flex min-h-14 w-full items-center gap-3 px-4 py-2.5 text-left";return d("li",{className:m,children:n?d("button",{type:"button",onClick:n,disabled:l,className:N("flex min-h-14 w-full items-center gap-3 px-4 py-2.5 text-left","transition-colors outline-none hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/40 focus-visible:ring-inset active:bg-muted disabled:pointer-events-none disabled:opacity-50"),children:h}):d("div",{className:"flex min-h-14 w-full items-center gap-3 px-4 py-2.5 text-left",children:h})})}function B8({title:e,value:t,placeholder:a,maxLength:r,autoComplete:n,onSave:s}){let l=lt(),[c,f]=A(t),[m,g]=A(!1),[h,x]=A(null),[v,w]=A(t);if(t!==v)w(t),f(t);let C=c.trim()!==t,L=async()=>{if(!C||m)return;g(!0),x(await s(c.trim())),g(!1)};return d("li",{children:S("form",{className:"flex min-h-14 items-center gap-3 px-4 py-2 focus-within:bg-muted/30",onSubmit:(k)=>{k.preventDefault(),L()},children:[S("div",{className:"flex min-w-0 flex-1 flex-col",children:[d("label",{htmlFor:l,className:"text-[12px] leading-4 text-muted-foreground",children:e}),d("input",{id:l,value:c,maxLength:r,placeholder:a,autoComplete:n,"aria-invalid":h?!0:void 0,"aria-describedby":h?`${l}-err`:void 0,onChange:(k)=>{f(k.target.value),x(null)},onKeyDown:(k)=>{if(k.key==="Escape")f(t),x(null)},className:"h-7 w-full min-w-0 bg-transparent text-base outline-none placeholder:text-muted-foreground/70 sm:text-[15px]"}),h&&d("span",{id:`${l}-err`,role:"alert",className:"text-[12px] text-destructive",children:h})]}),C&&d("button",{type:"submit","aria-label":`Save ${e.toLowerCase()}`,disabled:m,className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-xs transition-opacity outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-60",children:m?d(fe,{className:"size-4"}):d(Ke,{className:"size-4"})})]})})}function R0({title:e,subtitle:t,prefix:a,suffix:r,children:n,className:s}){let[l,c]=A(!1),f=lt(),m=n!==void 0&&n!==null&&n!==!1;return S("li",{className:s,children:[S("button",{type:"button",onClick:()=>m&&c((g)=>!g),"aria-expanded":m?l:void 0,"aria-controls":m?f:void 0,disabled:!m,className:"flex min-h-14 w-full items-center gap-3 px-4 py-2.5 text-left transition-colors outline-none hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/40 focus-visible:ring-inset active:bg-muted disabled:cursor-default disabled:hover:bg-transparent",children:[a&&d("span",{className:"flex shrink-0 items-center",children:a}),S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 py-0.5",children:[d("span",{className:"flex min-w-0 items-center gap-2 text-[15px] leading-5",children:e}),t&&d("span",{className:"truncate text-[13px] leading-snug text-muted-foreground",children:t})]}),r&&d("span",{className:"flex shrink-0 items-center gap-2",children:r}),m&&d(yt,{className:N("size-4 shrink-0 text-muted-foreground transition-transform duration-200",l&&"rotate-180"),"aria-hidden":!0})]}),m&&l&&d("div",{id:f,className:"border-t bg-muted/30 px-4 py-3",children:n})]})}function Nl({tone:e="muted",children:t}){return d("span",{className:N("rounded-full px-2 py-0.5 text-[12px] font-medium",e==="success"&&"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",e==="warning"&&"bg-amber-500/15 text-amber-800 dark:text-amber-300",e==="muted"&&"bg-muted text-muted-foreground"),children:t})}var Lae=Ca("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function ro({className:e,variant:t,...a}){return d("div",{"data-slot":"alert",role:"alert",className:N(Lae({variant:t}),e),...a})}function ts({className:e,...t}){return d("div",{"data-slot":"alert-title",className:N("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function oo({className:e,...t}){return d("div",{"data-slot":"alert-description",className:N("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function A0({className:e,...t}){return d("textarea",{"data-slot":"textarea",className:N("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var F8=20000;function U8({project:e,onSaved:t}){let[a,r]=A(!1),n=e.instructions??"",s=n.length>0;return S(se,{children:[d(Ze,{title:"Instructions",description:"Sent with every prompt in this project, for both OpenCode and Claude Code.",children:d(it,{prefix:d(Lg,{className:"size-[18px] text-muted-foreground","aria-hidden":!0}),title:s?"Custom instructions":"Add instructions",subtitle:s?d("span",{className:"line-clamp-2 whitespace-pre-line",children:n}):"Like the language to reply in or tools to prefer",onActivate:()=>r(!0)})}),d(Tae,{open:a,onOpenChange:r,project:e,onSaved:(l)=>{t(l),r(!1)}})]})}function Tae({open:e,onOpenChange:t,project:a,onSaved:r}){let n=lt(),s=lt(),[l,c]=A(a.instructions??""),[f,m]=A(!1),[g,h]=A(null);U(()=>{if(!e)return;c(a.instructions??""),h(null)},[e,a.instructions]);let x=l.length>F8,v=l.trim()===(a.instructions??""),w=async()=>{m(!0),h(null);try{let L=await(await le(`/api/projects/${a.id}`,{method:"PATCH",body:JSON.stringify({instructions:l})})).json();r(L.project),De.success(L.project.instructions?"Instructions saved.":"Instructions cleared.")}catch(C){h(C instanceof we?C.message:"Failed to save instructions")}finally{m(!1)}};return d(Ma,{open:e,onOpenChange:(C)=>!f&&t(C),children:S(or,{className:"sm:max-w-xl",children:[S(zr,{children:[d(nr,{children:"Custom instructions"}),S(ir,{children:["Sent to the agent with every prompt in ",a.name,", on top of AGENTS.md / CLAUDE.md. Changes apply from the next message."]})]}),S("form",{id:`${n}-form`,onSubmit:(C)=>{if(C.preventDefault(),!x&&!v)w()},className:"flex flex-col gap-2",children:[d("label",{htmlFor:n,className:"sr-only",children:"Instructions"}),d(A0,{id:n,value:l,onChange:(C)=>c(C.target.value),onKeyDown:(C)=>{if(C.key==="Enter"&&(C.metaKey||C.ctrlKey))C.preventDefault(),C.currentTarget.form?.requestSubmit()},placeholder:`e.g.
|
|
64
|
+
- Reply in Bahasa Indonesia
|
|
65
|
+
- Use Bun, not Node
|
|
66
|
+
- Keep commits small`,"aria-describedby":s,"aria-invalid":x||void 0,disabled:f,className:"max-h-[50dvh] min-h-40 font-mono text-sm leading-relaxed",autoFocus:!0}),S("p",{id:s,className:N("text-right text-xs tabular-nums text-muted-foreground",x&&"text-destructive"),children:[l.length.toLocaleString()," / ",F8.toLocaleString()]}),g&&d(ro,{variant:"destructive",children:d(oo,{children:g})})]}),S(ao,{className:"gap-2 sm:justify-between",children:[a.instructions?d(ae,{type:"button",variant:"ghost",className:"text-muted-foreground sm:mr-auto",disabled:f,onClick:()=>c(""),children:"Clear"}):d("span",{className:"hidden sm:block"}),S("div",{className:"flex flex-col-reverse gap-2 sm:flex-row",children:[d(ae,{type:"button",variant:"outline",disabled:f,onClick:()=>t(!1),children:"Cancel"}),S(ae,{type:"submit",form:`${n}-form`,disabled:f||x||v,children:[f&&d(fe,{"data-icon":"inline-start"}),"Save"]})]})]})]})})}var Rae="m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z";function wr({agentType:e,className:t}){if(e==="claude-code")return d("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:N("size-4 shrink-0",t),fill:"#D97757",children:d("path",{d:Rae})});return S("svg",{viewBox:"96 96 320 320","aria-hidden":"true",className:N("size-4 shrink-0",t),fill:"currentColor",children:[d("path",{d:"M320 224V352H192V224H320Z",opacity:0.4}),d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M384 416H128V96H384V416ZM320 160H192V352H320V160Z"})]})}var P0={connected:"Connected",disabled:"Disabled",failed:"Failed",needs_auth:"Needs auth",needs_client_registration:"Needs registration",unknown:"Unknown"},E0={connected:"bg-emerald-500",disabled:"bg-muted-foreground/40",failed:"bg-destructive",needs_auth:"bg-amber-500",needs_client_registration:"bg-amber-500",unknown:"bg-muted-foreground/40"};var M0={failed:0,needs_auth:1,needs_client_registration:1,connected:2,unknown:3,disabled:4};function H8(e){let t=new Map;for(let a of Nt)for(let r of e[a]??[]){let n=t.get(r.name)??{name:r.name,byAgent:{},agents:[],status:r.status};if(n.byAgent[a]=r,n.agents.push(a),M0[r.status]<M0[n.status])n.status=r.status;t.set(r.name,n)}return[...t.values()].sort((a,r)=>M0[a.status]-M0[r.status]||a.name.localeCompare(r.name))}function V8(e){if(e.length===0)return"None configured";return`${e.filter((a)=>Object.values(a.byAgent).some((r)=>r?.status==="connected")).length} of ${e.length} connected`}var kI={project:"This project",global:"Global",builtin:"Built-in"};function j8(e){return["project","global","builtin"].map((a)=>({source:a,label:kI[a],skills:e.filter((r)=>r.source===a)})).filter((a)=>a.skills.length>0)}function G8(e,t){let a=t.trim().toLowerCase();if(a==="")return[...e];return e.filter((r)=>r.name.toLowerCase().includes(a)||(r.description??"").toLowerCase().includes(a))}var CI="kcg-skills-project",q8=["react","nextjs","testing","typescript","python","design","docs","git"];function K8(e,t,a){for(let r of[t,a]){if(r===null)continue;let n=e.find((s)=>s.id===r);if(n)return n}return e.length===1?e[0]??null:null}function X8(e){let[t,a,...r]=e.split("/");if(!t||!a||r.length>0)return null;return t}function N0(e){let t=new Map;for(let a of Nt)for(let r of e[a]??[]){let n=`${r.source}:${r.name.toLowerCase()}`,s=t.get(n);if(!s){t.set(n,{...r,agents:[a]});continue}if(!s.agents.includes(a))s.agents.push(a);if(s.description===null)s.description=r.description}return[...t.values()].sort((a,r)=>a.name.localeCompare(r.name))}function II(e,t){let a=new Set([e.skillId.toLowerCase(),e.name.toLowerCase()]),r=new Set;for(let n of t)if(n.source==="project"&&a.has(n.name.toLowerCase()))for(let s of n.agents)r.add(s);return Nt.filter((n)=>r.has(n))}function LI(e,t){let a=t.trim().toLowerCase(),r=(n)=>a===""||n.name.toLowerCase().includes(a)||(n.description??"").toLowerCase().includes(a);return[...e.filter((n)=>n.source==="project"&&r(n)),...e.filter((n)=>n.source==="global"&&r(n))]}function D0(e){if(e<1000)return String(e);let t=(a,r)=>`${a>=100?Math.round(a).toString():a.toFixed(1).replace(/\.0$/,"")}${r}`;if(e<1e6)return t(e/1000,"K");return t(e/1e6,"M")}var TI={pass:"Passed",warn:"Review",fail:"Flagged"},RI={pass:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",warn:"bg-amber-500/10 text-amber-700 dark:text-amber-400",fail:"bg-destructive/10 text-destructive"};function AI({label:e,children:t}){return d("ul",{"aria-label":e,className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:t})}function Y8({className:e,children:t}){return d("li",{className:N("flex h-full min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 shadow-xs transition-colors",e),children:t})}function MI({source:e}){let t=X8(e);return S("span",{className:"relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-muted-foreground",children:[d(sa,{className:"size-4","aria-hidden":!0}),t&&d("img",{src:`https://github.com/${encodeURIComponent(t)}.png?size=80`,alt:"",loading:"lazy",referrerPolicy:"no-referrer",className:"absolute inset-0 size-full object-cover",onError:(a)=>{a.currentTarget.style.display="none"}})]})}function O0({agents:e,size:t="md"}){if(e.length===0)return null;let a=`Installed for ${e.map((r)=>Ht[r]).join(" and ")}`;return d("span",{role:"img","aria-label":a,title:a,className:N("flex shrink-0 items-center",t==="sm"?"gap-0.5":"gap-1"),children:e.map((r)=>d("span",{className:N("flex items-center justify-center border bg-background text-foreground",t==="sm"?"size-5 rounded":"size-6 rounded-md"),children:d(wr,{agentType:r,className:t==="sm"?"size-3":"size-3.5"})},r))})}function W8({skill:e,installedAgents:t,installing:a,onInstall:r,onShowProgress:n}){let s=t.length===Nt.length;return S(Y8,{className:"hover:border-foreground/20",children:[S("div",{className:"flex min-w-0 items-start gap-3",children:[d(MI,{source:e.source}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[S("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.name,className:"group/link flex min-w-0 items-center gap-1 text-sm font-semibold leading-5 hover:underline",children:[d("span",{className:"truncate",children:e.name}),d(Xo,{className:"size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/link:opacity-100 group-focus-visible/link:opacity-100","aria-hidden":!0}),d("span",{className:"sr-only",children:" on skills.sh (opens in a new tab)"})]}),d("span",{className:"truncate font-mono text-xs text-muted-foreground",title:e.source,children:e.source})]}),d(O0,{agents:t})]}),S("div",{className:"mt-auto flex items-center justify-between gap-2",children:[S("span",{className:"flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[d(Ym,{className:"size-3.5","aria-hidden":!0}),d("span",{className:"sr-only",children:"Installs:"}),D0(e.installs),d("span",{"aria-hidden":!0,children:" installs"})]}),a?S(ae,{type:"button",variant:"secondary",size:"sm",onClick:n,"aria-label":`Installing ${e.name}. Show progress`,children:[d(fe,{"data-icon":"inline-start"}),"Installing…"]}):s?S("span",{className:"flex h-8 items-center gap-1 rounded-md bg-emerald-500/10 px-2.5 text-xs font-medium text-emerald-700 dark:text-emerald-400",children:[d(Ke,{className:"size-3.5","aria-hidden":!0}),"Installed"]}):S(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>r(e),"aria-label":`Install ${e.name}`,children:[d(hr,{"data-icon":"inline-start"}),"Install"]})]})]})}function $8({skill:e}){let t=e.source==="project";return d(Y8,{children:S("div",{className:"flex min-w-0 items-start gap-3",children:[d("span",{className:N("flex size-10 shrink-0 items-center justify-center rounded-lg",t?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:d(sa,{className:"size-4","aria-hidden":!0})}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[S("span",{className:"flex min-w-0 items-center gap-1.5",children:[d("span",{className:"truncate text-sm font-semibold leading-5",title:e.name,children:e.name}),d("span",{className:N("shrink-0 rounded px-1.5 text-[10px] leading-4 font-medium",t?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:kI[e.source]})]}),d("p",{className:N("line-clamp-3 text-xs leading-relaxed",e.description?"text-muted-foreground":"text-muted-foreground/60 italic"),title:e.description??void 0,children:e.description??"No description"})]}),d(O0,{agents:e.agents})]})})}function PI({count:e=4}){return S("div",{role:"status","aria-busy":"true",className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[d("span",{className:"sr-only",children:"Loading skills…"}),Array.from({length:e},(t,a)=>S("div",{className:"flex flex-col gap-3 rounded-xl border bg-card p-4","aria-hidden":!0,children:[S("div",{className:"flex items-start gap-3",children:[d(Fe,{className:"size-10 shrink-0 rounded-lg"}),S("div",{className:"flex flex-1 flex-col gap-1.5",children:[d(Fe,{className:"h-4",style:{width:`${75-a%3*15}%`}}),d(Fe,{className:"h-3 w-1/2"})]})]}),S("div",{className:"flex items-center justify-between",children:[d(Fe,{className:"h-3 w-20"}),d(Fe,{className:"h-8 w-20 rounded-md"})]})]},a))]})}function Rf({label:e,value:t,options:a,onChange:r,disabled:n=!1,className:s}){return d("div",{role:"group","aria-label":e,className:N("grid shrink-0 auto-cols-fr grid-flow-col gap-0.5 rounded-[10px] bg-black/[0.06] p-[3px] dark:bg-white/[0.07]",s),children:a.map((l)=>{let c=l.value===t;return S("button",{type:"button","aria-pressed":c,"aria-label":l.ariaLabel,title:l.title,disabled:n,onClick:()=>r(l.value),className:N("flex h-8 min-w-0 items-center justify-center gap-2 rounded-[7px] px-2 text-sm font-medium transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/60 disabled:opacity-60",c?"bg-white text-foreground shadow-sm dark:bg-white/[0.15] dark:shadow-none":"text-foreground/70 hover:bg-black/[0.04] hover:text-foreground dark:hover:bg-white/[0.05]"),children:[l.icon,d("span",{className:"truncate",children:l.label})]},l.value)})})}function _0({value:e,onValueChange:t,className:a,onKeyDown:r,ref:n,...s}){let l=B(null);return S("div",{className:N("relative",a),children:[d(la,{className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground","aria-hidden":!0}),d("input",{ref:(c)=>{if(l.current=c,typeof n==="function")n(c);else if(n)n.current=c},type:"search",value:e,onChange:(c)=>t(c.target.value),onKeyDown:(c)=>{if(r?.(c),c.defaultPrevented)return;if(c.key==="Escape"&&e!=="")c.preventDefault(),t("")},className:"h-9 w-full rounded-lg bg-black/[0.06] pr-9 pl-9 text-base outline-none transition-shadow placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/60 sm:text-sm dark:bg-white/[0.08] [&::-webkit-search-cancel-button]:hidden",...s}),e!==""&&d("button",{type:"button",onClick:()=>{t(""),l.current?.focus()},"aria-label":"Clear search",className:"absolute top-1/2 right-1.5 flex size-6 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground dark:hover:bg-white/10",children:d(Ft,{className:"size-3.5"})})]})}var Q8=5,Aae=8;function Z8(e,t,a){let[r,n]=A({phase:"loading"});return U(()=>{let s=!1;return n({phase:"loading"}),Promise.allSettled(Nt.map((l)=>le(`${e}${ri(l)}`).then(async(c)=>(await c.json())[t]??[]))).then((l)=>{if(s)return;let c={byAgent:{},failed:[]};if(l.forEach((f,m)=>{let g=Nt[m];if(f.status==="fulfilled")c.byAgent[g]=f.value;else{let h=f.reason instanceof we?f.reason.message:"Failed to load";c.failed.push({agent:g,message:h})}}),c.failed.length===Nt.length)n({phase:"error",message:c.failed[0]?.message??"Failed to load"});else n({phase:"ready",data:c})}),()=>{s=!0}},[e,t,a]),r}function J8({project:e,onProjectChange:t}){let[a,r]=A(0),n=j(()=>r((c)=>c+1),[]),s=Z8(`/api/projects/${e.id}/mcp`,"mcp",a),l=Z8(`/api/projects/${e.id}/skills`,"skills",a);return S("div",{className:"flex flex-col gap-6",children:[d(U8,{project:e,onSaved:t}),d(Nae,{state:s,onReload:n}),d(Oae,{state:l,projectId:e.id})]})}function eF({label:e,onClick:t,disabled:a,children:r}){return d(ae,{type:"button",variant:"ghost",size:"icon",onClick:t,disabled:a,"aria-label":e,title:e,className:"size-8 rounded-full text-foreground/80",children:r})}function tF({rows:e}){return Array.from({length:e},(t,a)=>S("li",{className:"flex min-h-14 flex-col justify-center gap-1.5 px-4 py-2.5","aria-hidden":!0,children:[d(Fe,{className:"h-4",style:{width:`${60-a*12}%`}}),d(Fe,{className:"h-3 w-1/3"})]},a))}function aF({message:e,onRetry:t}){return d(it,{prefix:d(qa,{className:"size-[18px] text-destructive","aria-hidden":!0}),title:"Couldn't load",subtitle:e,suffix:t&&d(ae,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Retry"})})}function rF({failed:e}){if(e.length===0)return null;return d(it,{prefix:d(qa,{className:"size-[18px] text-amber-600 dark:text-amber-400","aria-hidden":!0}),title:`Couldn't read ${e.map((t)=>Ht[t.agent]).join(", ")}`,subtitle:e[0]?.message})}var Mae={connected:"text-emerald-700 dark:text-emerald-400",failed:"text-destructive",needs_auth:"text-amber-700 dark:text-amber-400",needs_client_registration:"text-amber-700 dark:text-amber-400",disabled:"text-muted-foreground",unknown:"text-muted-foreground"},Pae={connected:"text-emerald-600 dark:text-emerald-400",failed:"text-destructive",needs_auth:"text-amber-600 dark:text-amber-400",needs_client_registration:"text-amber-600 dark:text-amber-400",disabled:"text-muted-foreground/60",unknown:"text-muted-foreground"};function Eae(e,t){if(e==="claude-code"&&t==="unknown")return"Not checked";return P0[t]}function Nae({state:e,onReload:t}){let a=de(()=>e.phase==="ready"?H8(e.data.byAgent):[],[e]);return d(Ze,{title:"MCP servers",description:e.phase==="ready"?V8(a):"Loading…",suffix:d(eF,{label:"Reload MCP servers and skills",onClick:t,disabled:e.phase==="loading",children:d(xr,{className:N(e.phase==="loading"&&"animate-spin")})}),children:e.phase==="loading"?d(tF,{rows:2}):e.phase==="error"?d(aF,{message:e.message,onRetry:t}):S(se,{children:[a.length===0?d(it,{title:"No MCP servers",subtitle:S(se,{children:["Add them under ",d("code",{className:"font-mono",children:"mcp"})," in opencode.json, or in"," ",d("code",{className:"font-mono",children:".mcp.json"})," for Claude Code, then reload."]})}):a.map((r)=>d(Dae,{entry:r},r.name)),d(rF,{failed:e.data.failed})]})})}function Dae({entry:e}){let t=e.agents.map((a)=>({agent:a,error:e.byAgent[a]?.error??null})).filter((a)=>a.error!==null);return d(it,{prefix:d(Wc,{className:N("size-[18px]",Pae[e.status]),"aria-hidden":!0}),title:d("span",{className:"block truncate",children:e.name}),subtitle:S("span",{className:"flex flex-col gap-1",children:[d("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5",children:e.agents.map((a)=>{let r=e.byAgent[a]?.status??"unknown",n=Eae(a,r);return S("span",{className:N("inline-flex items-center gap-1.5",Mae[r]),title:a==="claude-code"&&r==="unknown"?"Configured for Claude Code. Status appears once a Claude Code session runs in this project.":`${Ht[a]}: ${n}`,children:[d(wr,{agentType:a,className:"size-3"}),S("span",{className:"sr-only",children:[Ht[a],":"]}),n]},a)})}),t.map((a)=>S("span",{className:"line-clamp-2 font-mono text-[11.5px] leading-relaxed break-all text-destructive/90",title:a.error,children:[e.agents.length>1&&`${Ht[a.agent]}: `,a.error]},a.agent))]})})}var EI={all:"All",project:"Project",global:"Global",builtin:"Built-in"};function Oae({state:e,projectId:t}){let{navigate:a}=wt(),[r,n]=A(""),[s,l]=A("all"),[c,f]=A(!1),m=de(()=>e.phase==="ready"?N0(e.data.byAgent):[],[e]),g=de(()=>j8(m),[m]),h=de(()=>g.flatMap((M)=>M.skills),[g]),x=de(()=>g.map((M)=>M.source),[g]),v=de(()=>s==="all"?h:h.filter((M)=>M.source===s),[h,s]),w=de(()=>G8(v,r),[v,r]),C=r.trim()!=="",L=C||c?w:w.slice(0,Q8),k=w.length-L.length,I=()=>a(Il(t)),T=m.length>=Aae,R=x.length>1,E=e.phase==="ready"&&(T||R)?S("div",{className:"flex flex-col gap-2",children:[T&&d(_0,{value:r,onValueChange:n,placeholder:`Search ${m.length} skills`,"aria-label":"Search skills"}),R&&d(Rf,{label:"Filter skills by source",value:s,onChange:(M)=>{l(M),f(!1)},options:["all",...x].map((M)=>{let P=M==="all"?m.length:m.filter((O)=>O.source===M).length;return{value:M,label:EI[M],title:`${EI[M]}: ${P}`,ariaLabel:`${EI[M]}, ${P} skills`}}),className:"[&_button]:text-[13px]"})]}):void 0;return d(Ze,{title:"Skills",description:e.phase==="ready"?m.length===0?"None installed":`${m.length} available${s!=="all"||C?` · ${w.length} shown`:""}`:"Loading…",suffix:d(eF,{label:"Browse and install skills",onClick:I,children:d(hr,{})}),toolbar:E,children:e.phase==="loading"?d(tF,{rows:3}):e.phase==="error"?d(aF,{message:e.message}):S(se,{children:[m.length===0?d(it,{prefix:d(sa,{className:"size-[18px] text-muted-foreground","aria-hidden":!0}),title:"Browse skills",subtitle:"Install one from skills.sh for OpenCode, Claude Code, or both",onActivate:I}):L.length===0?S("li",{className:"px-4 py-4 text-center text-[13px] text-muted-foreground",children:["No skills match “",r.trim(),"”."]}):L.map((M)=>d(_ae,{skill:M,showSource:s==="all"},`${M.source}:${M.name}`)),!C&&w.length>Q8&&d("li",{children:d("button",{type:"button",onClick:()=>f((M)=>!M),"aria-expanded":c,className:"flex min-h-12 w-full items-center justify-center px-4 text-[15px] transition-colors outline-none hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/40 focus-visible:ring-inset active:bg-muted",children:c?"Show less":`Show ${k} more`})}),d(rF,{failed:e.data.failed})]})})}function _ae({skill:e,showSource:t}){let a=e.description||e.location?S("div",{className:"flex flex-col gap-2",children:[e.description&&d("p",{className:"text-[13px] leading-relaxed whitespace-pre-line",children:e.description}),e.location&&d("p",{className:"truncate font-mono text-[11.5px] text-muted-foreground",title:e.location,children:e.location})]}):void 0;return d(R0,{title:S(se,{children:[d("span",{className:"truncate",children:e.name}),t&&e.source!=="global"&&d(Nl,{children:e.source==="project"?"Project":"Built-in"})]}),subtitle:e.description??void 0,suffix:d(O0,{agents:e.agents,size:"sm"}),children:a})}function oF({open:e,onOpenChange:t,projectName:a,sessionTotal:r,deleting:n,onConfirm:s}){return d(qi,{open:e,onOpenChange:(l)=>{if(!n)t(l)},children:S(Ki,{children:[S(Xi,{children:[S(Wi,{children:["Delete project “",a,"”?"]}),S($i,{children:[r>0?`${r} session${r===1?"":"s"} of this project will also be permanently deleted, including their conversation history on the opencode server. `:"","The working folder on the server is not deleted — only the project registration in KCG Code. This action cannot be undone."]})]}),S(Yi,{children:[d(Zi,{disabled:n,children:"Cancel"}),d(Qi,{variant:"destructive",onClick:(l)=>{l.preventDefault(),s()},disabled:n,children:n?S(se,{children:[d(fe,{"data-icon":"inline-start"}),"Deleting…"]}):"Delete project"})]})]})})}function z0({title:e,subtitle:t,start:a,end:r,closeDisabled:n=!1,bodyClassName:s,children:l}){let c=B(null),f=a!==void 0||r!==void 0;return S(or,{ref:c,showCloseButton:!1,onOpenAutoFocus:(m)=>{m.preventDefault();let g=window.matchMedia("(min-width: 640px)").matches,h=c.current?.querySelector('input[type="search"]');(g&&h?h:c.current)?.focus()},onEscapeKeyDown:(m)=>{let g=document.activeElement;if(g instanceof HTMLInputElement&&g.type==="search"&&g.value!=="")m.preventDefault()},className:N("flex h-[min(640px,85dvh)] flex-col gap-0 overflow-hidden rounded-2xl p-0 sm:max-w-md","max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:h-[85dvh] max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none max-sm:border-x-0 max-sm:border-b-0","max-sm:data-[state=closed]:slide-out-to-bottom-8 max-sm:data-[state=open]:slide-in-from-bottom-8"),children:[d("span",{"aria-hidden":!0,className:"mx-auto mt-2 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30 sm:hidden"}),S(zr,{className:N("grid shrink-0 items-center gap-2 px-3 pt-2.5 pb-2 sm:pt-3",f?"grid-cols-[1fr_auto_1fr]":"grid-cols-[2rem_1fr_2rem]"),children:[d("div",{className:"flex min-w-0 justify-start",children:a}),S("div",{className:"flex min-w-0 flex-col items-center gap-0.5 text-center",children:[d(nr,{className:"truncate text-[15px] leading-5 font-bold",children:e}),t&&d(ir,{className:"truncate text-xs leading-4",children:t})]}),d("div",{className:"flex min-w-0 justify-end",children:r??d(CB,{disabled:n,"aria-label":"Close",className:"flex size-7 items-center justify-center rounded-full bg-black/[0.06] text-foreground/80 transition-colors outline-none hover:bg-black/10 focus-visible:ring-2 focus-visible:ring-ring/60 disabled:opacity-50 dark:bg-white/[0.08] dark:hover:bg-white/15",children:d(Ft,{className:"size-3.5",strokeWidth:2.5})})})]}),d("div",{className:N("flex min-h-0 flex-1 flex-col gap-3 px-4 pt-1 pb-[max(1rem,env(safe-area-inset-bottom))]",s),children:l})]})}var NI="default";function nF(e,t){return`${e}\x00${t}`}function B0(e){return nF(e.providerID,e.modelID)}function F0(e){return e?nF(e.providerID,e.modelID):"default"}function iF(e){let t=new Map;for(let a of e){let r=t.get(a.providerID);if(!r)r={providerID:a.providerID,providerName:a.providerName,models:[]},t.set(a.providerID,r);r.models.push(a)}return[...t.values()]}function sF(e,t){let a=t.toLowerCase().split(/\s+/).filter((r)=>r.length>0);if(a.length===0)return[...e];return e.filter((r)=>{let n=`${r.name} ${r.modelID} ${r.providerName}`.toLowerCase();return a.every((s)=>n.includes(s))})}function lF(e,t){if(e===null)return"Default model";return t.find((r)=>r.providerID===e.providerID&&r.modelID===e.modelID)?.name??e.modelID}var zae=22;function cF(e,t=zae){let r=e.split("/").filter((n)=>n.trim().length>0).at(-1)?.trim()??"";if(t<=0)return"";if(r.length<=t)return r;return`${r.slice(0,Math.max(0,t-1)).trimEnd()}…`}function uF(e){if(e===0)return"No matching models";return e===1?"1 model":`${e} models`}function U0({models:e,loading:t,activeKey:a,pendingKey:r=null,onSelect:n,disabled:s=!1,className:l}){let[c,f]=A(""),m=de(()=>sF(e??[],c),[e,c]),g=de(()=>iF(m),[m]),h=de(()=>{let C=c.trim().toLowerCase();return C===""||"model default".includes(C)},[c]),x=!t&&!h&&g.length===0,v=e?.[0]?.providerID==="claude-code",w=()=>{if(t||s)return;if(h)return n(null);let C=g[0]?.models[0];if(C)n({providerID:C.providerID,modelID:C.modelID})};return S("div",{className:N("flex min-h-0 flex-col gap-3",l),children:[d(_0,{className:"shrink-0",value:c,onValueChange:f,onKeyDown:(C)=>{if(C.key==="Enter")C.preventDefault(),w()},placeholder:e&&e.length>0?`Search ${e.length} models…`:"Search models…","aria-label":"Search models or providers","aria-describedby":"model-search-count"}),d("span",{id:"model-search-count",className:"sr-only","aria-live":"polite",children:t?"Loading models":uF(m.length)}),d("div",{className:"-mx-1 min-h-0 flex-1 overflow-y-auto overscroll-contain px-1 pb-1",children:t?S("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-3 text-sm text-muted-foreground",children:[d(fe,{className:"size-6"}),"Loading models…"]}):x?S("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 px-6 text-center",children:[d(la,{className:"mb-2 size-12 text-muted-foreground/40","aria-hidden":!0}),d("p",{className:"text-lg font-semibold",children:"No Results Found"}),S("p",{className:"text-sm text-muted-foreground",children:["No model matches “",c.trim(),"”. Try a different search."]})]}):S("div",{className:"flex flex-col gap-5",children:[h&&d(fF,{label:"Default",children:d(dF,{name:"Default model",hint:v?"Follows your Claude Code settings":"Follows opencode configuration",selected:a===NI,pending:r===NI,disabled:s,onSelect:()=>n(null)})}),g.map((C)=>d(Bae,{title:C.providerName,children:C.models.map((L)=>d(dF,{name:L.name,hint:L.modelID,selected:a===B0(L),pending:r===B0(L),disabled:s,onSelect:()=>n({providerID:L.providerID,modelID:L.modelID})},B0(L)))},C.providerID))]})})]})}function fF({label:e,children:t}){return d("ul",{"aria-label":e,className:"flex flex-col divide-y overflow-hidden rounded-xl border bg-card shadow-xs",children:t})}function Bae({title:e,children:t}){return S("section",{className:"flex flex-col gap-2",children:[d("h3",{className:"px-1 text-[13px] font-semibold",children:e}),d(fF,{label:e,children:t})]})}function dF({name:e,hint:t,selected:a,pending:r,disabled:n,onSelect:s}){return d("li",{children:S("button",{type:"button",onClick:s,disabled:n,"aria-current":a,"aria-busy":r||void 0,className:N("flex min-h-13 w-full items-center gap-3 px-4 py-2 text-left transition-colors outline-none hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset active:bg-muted disabled:pointer-events-none",r?"bg-muted/60":"disabled:opacity-50"),children:[S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d("span",{className:"truncate text-[15px] leading-5",children:e}),d("span",{className:"truncate text-[13px] leading-snug text-muted-foreground",children:t})]}),r?d(fe,{className:"size-[18px] shrink-0 text-muted-foreground"}):a&&d(Ke,{className:"size-[18px] shrink-0 text-primary",strokeWidth:2.5,"aria-hidden":!0})]})})}function pF({open:e,onOpenChange:t,projectId:a,projectName:r,onCreated:n}){let[s,l]=A(gh),[c,f]=A(null),[m,g]=A(null),[h,x]=A(!1),[v,w]=A(null),[C,L]=A(!1),[k,I]=A(null);U(()=>{if(!e)return;l(gh()),I(null)},[e]),U(()=>{if(!e)return;let R=!1;return x(!0),w(null),le(`/api/projects/${a}/models${ri(s)}`).then(async(E)=>{let M=await E.json();if(!R)g(M.models)}).catch((E)=>{if(R)return;w(E instanceof we?E.message:"Failed to load models"),g([])}).finally(()=>{if(!R)x(!1)}),()=>{R=!0}},[e,a,s]);let T=async(R)=>{if(C)return;L(!0),f(F0(R)),I(null);try{let E=await le("/api/sessions",{method:"POST",body:JSON.stringify({agentType:s,projectId:a,model:R})}),{session:M}=await E.json();k0(s),t(!1),n(M),De.success("Session created.")}catch(E){I(E instanceof we?E.message:"Failed to create session")}finally{L(!1),f(null)}};return d(Ma,{open:e,onOpenChange:(R)=>{if(C)return;t(R)},children:S(z0,{title:"New Session",subtitle:C?"Starting…":r,closeDisabled:C,children:[d(Rf,{label:"Agent",value:s,disabled:C,onChange:l,options:Nt.map((R)=>({value:R,label:Ht[R],icon:d(wr,{agentType:R})}))}),k&&S(ro,{variant:"destructive",children:[d(ts,{children:"Failed to create session"}),d(oo,{children:k})]}),v?S(ro,{variant:"destructive",children:[d(ts,{children:"Failed to load models"}),d(oo,{children:v})]}):d(U0,{models:m,loading:h,pendingKey:c,onSelect:(R)=>void T(R),disabled:C,className:"flex-1"})]})})}function mF(e,t){let a=new Map;for(let n of t){let s=a.get(n.projectId);if(s===void 0)a.set(n.projectId,[n]);else s.push(n)}return e.map((n)=>{let s=a.get(n.id)??[],l=s.filter((m)=>m.status==="running").length,c=[...s].sort((m,g)=>g.updatedAt-m.updatedAt).slice(0,3),f=c[0]??null;return{project:n,sessionCount:s.length,runningCount:l,lastSession:f,recentSessions:c,lastActivityAt:f?.updatedAt??n.createdAt}}).sort((n,s)=>{if(s.lastActivityAt!==n.lastActivityAt)return s.lastActivityAt-n.lastActivityAt;return n.project.name.localeCompare(s.project.name,void 0,{sensitivity:"base"})})}function gF(e,t){let a=t.trim().toLowerCase();if(a==="")return[...e];return e.filter(({project:r})=>r.name.toLowerCase().includes(a)||r.path.toLowerCase().includes(a))}function hF(e){return e.reduce((t,a)=>t+a.runningCount,0)}function bu(e,t=Date.now()){let a=t-e;if(a<0)return"just now";let r=60000,n=60*r,s=24*n;if(a<r)return"just now";if(a<n)return`${Math.floor(a/r)} minutes ago`;if(a<s)return`${Math.floor(a/n)} hours ago`;if(a<7*s)return`${Math.floor(a/s)} days ago`;return new Date(e).toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"})}function Fae({checked:e}){return d("span",{"aria-hidden":!0,className:N("flex size-[18px] shrink-0 items-center justify-center rounded-[5px] border-2 transition-colors",e?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/45"),children:e&&d(Ke,{className:"size-3",strokeWidth:3.5})})}var Uae={running:"text-emerald-700 dark:text-emerald-400",crashed:"text-destructive",stopped:"text-muted-foreground"};function Hae({session:e,busy:t}){if(t)return S("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[d(fe,{className:"size-3"}),"Working…"]});if(e.status==="stopped")return null;let a=e.status==="running";return S("span",{className:N("inline-flex shrink-0 items-center gap-1.5",Uae[e.status]),children:[S("span",{className:"relative flex size-1.5","aria-hidden":!0,children:[a&&d("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-500 opacity-60"}),d("span",{className:N("relative inline-flex size-1.5 rounded-full",$n[e.status])})]}),Io[e.status]]})}function xF(){return d("span",{className:"opacity-50","aria-hidden":!0,children:"·"})}function vF({session:e,busy:t,onOpen:a,onStop:r,onStart:n,onDelete:s,selectionMode:l=!1,selected:c=!1,onToggleSelect:f}){let m=e.status==="running",g=Ll(e.title),h=Ht[e.agentType],x=t||e.status!=="stopped";return S("div",{className:N("group relative flex min-h-14 items-center gap-3 pr-4 pl-4 transition-colors hover:bg-muted/60 has-focus-visible:bg-muted/60 has-[button:active]:bg-muted",l&&c&&"bg-primary/[0.06]"),children:[l&&d(Fae,{checked:c}),d(wr,{agentType:e.agentType,className:"size-[18px] text-muted-foreground"}),S("button",{type:"button",onClick:l?f:a,disabled:t,"aria-pressed":l?c:void 0,title:`${g} — ${h}`,className:"flex min-w-0 flex-1 flex-col gap-0.5 py-2.5 text-left outline-none after:absolute after:inset-0 focus-visible:after:ring-[3px] focus-visible:after:ring-ring/40 focus-visible:after:ring-inset disabled:opacity-60","aria-label":`${l?"Select":"Open"} session ${g}, ${h}, ${Io[e.status]}`,children:[d("span",{className:"truncate text-[15px] leading-5",children:g}),S("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug text-muted-foreground",children:[d(Hae,{session:e,busy:t}),S("span",{className:N("contents",x&&"max-sm:hidden"),children:[x&&d(xF,{}),d("span",{className:"truncate",children:MB(e)})]}),d(xF,{}),d("span",{className:"shrink-0 tabular-nums",children:bu(e.updatedAt)})]})]}),!l&&S(se,{children:[S(Zn,{children:[d(Jn,{asChild:!0,children:d(ae,{type:"button",variant:"ghost",size:"icon-sm",disabled:t,"aria-label":`Session actions ${g}`,className:"relative z-10 shrink-0 rounded-full text-muted-foreground transition-opacity pointer-fine:opacity-0 pointer-fine:group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100",children:d(On,{})})}),S(ei,{align:"end",children:[m?S(Pa,{onSelect:r,children:[d(eo,{}),"Stop"]}):S(Pa,{onSelect:n,children:[d(Ni,{}),"Start"]}),d(ti,{}),S(Pa,{variant:"destructive",onSelect:s,children:[d(pa,{}),"Delete permanently"]})]})]}),d(Jt,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0})]})]})}function H0(){return S("div",{className:"flex flex-col gap-2.5","aria-hidden":!0,children:[S("div",{className:"flex flex-col gap-1.5 px-1",children:[d(Fe,{className:"h-4 w-20"}),d(Fe,{className:"h-3 w-36"})]}),d("div",{className:"flex flex-col divide-y overflow-hidden rounded-xl border bg-card",children:[0,1,2].map((e)=>S("div",{className:"flex min-h-14 items-center gap-3 px-4 py-2.5",children:[d(Fe,{className:"size-[18px] shrink-0 rounded"}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[d(Fe,{className:"h-4",style:{width:`${55-e*10}%`}}),d(Fe,{className:"h-3 w-40"})]})]},e))})]})}function bF({projectId:e,onDeleted:t}){let[a,r]=A([]),[n,s]=A(!0),[l,c]=A(null),[f,m]=A(null),[g,h]=A(null),[x,v]=A(null),[w,C]=A(null),[L,k]=A(!1),[I,T]=A(!1),[R,E]=A(!1),[M,P]=A(()=>new Set),[O,F]=A(!1),[z,Y]=A(null),q=j(async({silent:W=!1}={})=>{if(!W)s(!0);c(null);try{let Ee=await(await le("/api/sessions")).json();r(Ee.sessions.filter((xe)=>xe.projectId===e))}catch(ve){c(ve instanceof we?ve.message:"Failed to load sessions")}finally{s(!1)}},[e]);U(()=>{q()},[q]);let G=Tf({onMessage:(W)=>{if(W.type==="session_title")r((ve)=>ve.map((Ee)=>Ee.id===W.sessionId?{...Ee,title:W.title}:Ee));else if(W.type==="session_status")r((ve)=>ve.map((Ee)=>Ee.id===W.sessionId&&Ee.status!==W.status?{...Ee,status:W.status}:Ee));else if(W.type==="session_deleted")r((ve)=>ve.filter((Ee)=>Ee.id!==W.sessionId));else if(W.type==="data_changed")q({silent:!0})}});U(()=>(G.attach(""),()=>G.disconnect()),[G.attach,G.disconnect]);let Q=j(()=>q({silent:!0}),[q]);T0(G.status,Q);let re=de(()=>x0(a),[a]),J=de(()=>RB(a),[a]),X=de(()=>HB(M,a),[M,a]),Z=j(async(W)=>{m(W);try{await le(`/api/sessions/${W}/stop`,{method:"POST"}),De.success("Session stopped."),await q(),Ya()}catch(ve){De.error(ve instanceof we?ve.message:"Couldn't stop the session.")}finally{m(null)}},[q]),te=j(async(W)=>{h(W);try{await le(`/api/sessions/${W}`,{method:"POST"}),De.success("Session resumed."),await q(),Ya()}catch(ve){De.error(ve instanceof we?ve.message:"Couldn't resume the session.")}finally{h(null)}},[q]),D=j((W)=>C(W),[]),Te=j(()=>C(null),[]),Le=j(async()=>{let W=w;if(!W)return;v(W.id);try{await le(`/api/sessions/${W.id}`,{method:"DELETE"}),C(null),De.success("Session deleted."),await q(),Ya()}catch(ve){De.error(ve instanceof we?ve.message:"Couldn't delete the session.")}finally{v(null)}},[w,q]),H=j(()=>{P(new Set),E(!0)},[]),me=j(()=>{E(!1),P(new Set)},[]),Ce=j((W)=>P((ve)=>UB(ve,W)),[]),ge=j(()=>{P((W)=>a.length>0&&a.every((ve)=>W.has(ve.id))?new Set:new Set(a.map((ve)=>ve.id)))},[a]),He=j(()=>F(!0),[]),ce=j(()=>F(!1),[]),he=j(async()=>{let W=[...X];if(W.length===0)return;let ve=[];Y({done:0,total:W.length});for(let[xe,ye]of W.entries()){v(ye);try{await le(`/api/sessions/${ye}`,{method:"DELETE"})}catch{ve.push(ye)}Y({done:xe+1,total:W.length})}v(null),Y(null),F(!1);let Ee=W.length-ve.length;if(ve.length===0)De.success(`Deleted ${Tl(Ee)}.`),E(!1),P(new Set);else De.error(`Couldn't delete ${ve.length} of ${Tl(W.length)}.`),P(new Set(ve));await q({silent:!0}),Ya()},[X,q]),ue=j(()=>k(!0),[]),K=j(()=>k(!1),[]),ee=j(async()=>{T(!0);try{await le(`/api/projects/${e}`,{method:"DELETE"}),k(!1),De.success("Project removed."),Ya(),t?.()}catch(W){De.error(W instanceof we?W.message:"Couldn't remove the project.")}finally{T(!1)}},[t,e]);return{sessions:a,loading:n,loadError:l,ordered:re,summary:J,refresh:q,stopping:f,stop:Z,starting:g,start:te,deleting:x,pendingDelete:w,requestDelete:D,cancelDelete:Te,confirmRemove:Le,selecting:R,startSelecting:H,stopSelecting:me,selected:X,toggleSelect:Ce,toggleSelectAll:ge,bulkDeleteOpen:O,requestBulkDelete:He,cancelBulkDelete:ce,bulkProgress:z,confirmBulkRemove:he,projectDeleteOpen:L,openProjectDelete:ue,closeProjectDelete:K,deletingProject:I,confirmRemoveProject:ee}}var Vae="(min-width: 1024px)";function jae({path:e}){let[t,a]=A(!1);U(()=>{if(!t)return;let n=setTimeout(()=>a(!1),1500);return()=>clearTimeout(n)},[t]);let r=async()=>{try{await navigator.clipboard.writeText(e),a(!0),De.success("Path copied.")}catch{De.error("Couldn't copy. Select the path and copy it manually.")}};return S("button",{type:"button",onClick:()=>void r(),title:e,"aria-label":t?"Path copied":`Copy path ${e}`,className:"group/path -mx-1 flex max-w-full min-w-0 items-center gap-1.5 rounded px-1 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",children:[d("span",{className:"truncate",children:e}),t?d(Ke,{className:"size-3 shrink-0 text-emerald-500","aria-hidden":!0}):d(gr,{className:"size-3 shrink-0 opacity-0 transition-opacity group-hover/path:opacity-100 group-focus-visible/path:opacity-100","aria-hidden":!0})]})}function yF({loading:e,onReload:t,onDelete:a,className:r}){return S(Zn,{children:[S(rn,{children:[d(on,{asChild:!0,children:d(Jn,{asChild:!0,children:d(ae,{type:"button",variant:"secondary",size:"icon","aria-label":"More project actions",className:N("rounded-full",r),children:d(On,{})})})}),d(nn,{children:"More"})]}),S(ei,{align:"end",className:"min-w-44",children:[S(Pa,{onSelect:t,disabled:e,children:[d(xr,{className:N(e&&"animate-spin")}),"Reload sessions"]}),d(ti,{}),S(Pa,{variant:"destructive",onSelect:a,children:[d(pa,{}),"Delete project"]})]})]})}function Gae({projectName:e,onStart:t}){return S("div",{className:"flex flex-col items-center gap-6 px-6 py-12 text-center sm:py-20",children:[d(hg,{className:"size-16 text-muted-foreground/50",strokeWidth:1.5,"aria-hidden":!0}),S("div",{className:"flex max-w-sm flex-col gap-2",children:[d("h2",{className:"text-2xl font-bold tracking-tight",children:"No Sessions Yet"}),S("p",{className:"text-[15px] leading-relaxed text-muted-foreground",children:["A session is a conversation with the agent inside"," ",d("span",{className:"font-medium text-foreground",children:e}),". It can read and edit files here for you."]})]}),S(ae,{type:"button",onClick:t,className:"h-10 rounded-full px-6",children:[d(hr,{"data-icon":"inline-start"}),"New session"]})]})}function wF({project:e,onOpenSession:t,onDeleted:a}){let[r,n]=A(e);U(()=>n(e),[e]);let s=bF({projectId:r.id,onDeleted:a}),[l,c]=A(!1),f=()=>c(!0),m=!s.loading&&!s.loadError&&s.ordered.length>0,g=s.sessions.length>0&&s.sessions.every((I)=>s.selected.has(I.id)),{selecting:h,stopSelecting:x,bulkDeleteOpen:v}=s;U(()=>{if(!h)return;let I=(T)=>{if(T.key!=="Escape"||v||T.defaultPrevented)return;if(document.querySelector("[role=dialog],[role=alertdialog]"))return;x()};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[h,x,v]),U(()=>{if(h&&!s.loading&&s.sessions.length===0)x()},[h,x,s.loading,s.sessions.length]);let w=Ji(Vae),[C,L]=A(!1),k=d(J8,{project:r,onProjectChange:n});return S("div",{className:"grid grid-cols-1 gap-x-10 gap-y-8 pt-4 sm:pt-8 lg:h-full lg:min-h-0 lg:grid-cols-[minmax(0,1fr)_20rem] xl:grid-cols-[minmax(0,1fr)_22rem]",children:[S("div",{className:"flex min-w-0 flex-col gap-8 lg:min-h-0 lg:gap-0",children:[S("header",{className:"flex shrink-0 flex-col gap-4 lg:pb-6",children:[S("div",{className:"flex items-start justify-between gap-4",children:[S("div",{className:"flex min-w-0 flex-col gap-1.5",children:[d("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:r.name}),d(jae,{path:r.path})]}),w&&S("div",{className:"flex shrink-0 items-center gap-2",children:[d(yF,{loading:s.loading,onReload:()=>void s.refresh(),onDelete:s.openProjectDelete}),S(ae,{type:"button",onClick:f,className:"rounded-full px-4",children:[d(hr,{"data-icon":"inline-start"}),"New session"]})]})]}),!w&&S("div",{className:"flex items-center justify-between gap-2",children:[S(ae,{type:"button",variant:"secondary",onClick:()=>L(!0),"aria-label":"Project details: instructions, MCP servers, skills",className:"h-10 rounded-full px-3.5",children:[d(yg,{"data-icon":"inline-start"}),"Details"]}),d(yF,{className:"size-10",loading:s.loading,onReload:()=>void s.refresh(),onDelete:s.openProjectDelete})]})]}),d("section",{"aria-label":"Sessions",className:"-mx-3 px-3 pb-24 lg:min-h-0 lg:flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pb-16",children:s.loading?d(H0,{}):s.loadError?d(Ze,{title:"Sessions",children:d(it,{prefix:d(qa,{className:"size-[18px] text-destructive","aria-hidden":!0}),title:"Failed to load sessions",subtitle:s.loadError,suffix:S(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>void s.refresh(),children:[d(xr,{"data-icon":"inline-start"}),"Retry"]})})}):m?S(se,{children:[d(Ze,{title:"Sessions",description:s.selecting?VB(s.selected.size,s.sessions.length):AB(s.summary),suffix:s.selecting?d(ae,{type:"button",variant:"ghost",size:"sm",onClick:s.toggleSelectAll,disabled:s.bulkProgress!==null,children:g?"Deselect All":"Select All"}):S(ae,{type:"button",variant:"ghost",size:"sm",onClick:s.startSelecting,"aria-label":"Select sessions",children:[d(qc,{"data-icon":"inline-start"}),"Select"]}),children:s.ordered.map((I)=>d("li",{children:d(vF,{session:I,busy:s.stopping===I.id||s.starting===I.id||s.deleting===I.id,onOpen:()=>t(I),onStop:()=>void s.stop(I.id),onStart:()=>void s.start(I.id),onDelete:()=>s.requestDelete(I),selectionMode:s.selecting,selected:s.selected.has(I.id),onToggleSelect:()=>s.toggleSelect(I.id)})},I.id))}),s.selecting&&S("div",{className:"sticky bottom-[max(1rem,env(safe-area-inset-bottom))] z-20 mt-4 flex items-center gap-2 rounded-2xl border bg-popover py-2 pr-2 pl-4 shadow-lg",children:[d("span",{className:"min-w-0 truncate text-sm font-medium","aria-live":"polite",children:s.selected.size===0?"None selected":`${Tl(s.selected.size)} selected`}),d(ae,{type:"button",variant:"ghost",size:"sm",className:"ml-auto",onClick:s.stopSelecting,disabled:s.bulkProgress!==null,children:"Cancel"}),S(ae,{type:"button",variant:"destructive",size:"sm",className:"rounded-full px-3.5",onClick:s.requestBulkDelete,disabled:s.selected.size===0||s.bulkProgress!==null,children:[d(pa,{"data-icon":"inline-start"}),"Delete"]})]})]}):d(Gae,{projectName:r.name,onStart:f})})]}),w?d("aside",{"aria-label":"Project details",className:"-mr-2 min-h-0 overflow-y-auto overscroll-contain pr-2 pb-6 [scrollbar-width:thin]",children:k}):d(Rl,{open:C,onOpenChange:L,children:S(Al,{side:"right",className:"w-[88vw] gap-0 overflow-y-auto sm:max-w-sm",children:[S(Ml,{className:"pb-2",children:[d(Pl,{children:r.name}),d(El,{children:"Instructions, MCP servers, and skills."})]}),d("div",{className:"px-4 pt-2 pb-6",children:k})]})}),!w&&!s.selecting&&S(ae,{type:"button",onClick:f,className:"fixed right-4 bottom-[max(1rem,env(safe-area-inset-bottom))] z-30 h-12 rounded-full px-5 text-[15px] shadow-lg shadow-primary/25 sm:right-6 sm:bottom-6",children:[d(hr,{"data-icon":"inline-start",className:"size-5"}),"New session"]}),d(pF,{open:l,onOpenChange:c,projectId:r.id,projectName:r.name,onCreated:(I)=>{s.refresh(),Ya(),t(I)}}),d(gu,{open:s.pendingDelete!==null,onOpenChange:(I)=>{if(!I)s.cancelDelete()},deleting:s.deleting!==null,onConfirm:()=>void s.confirmRemove()}),d(gu,{open:s.bulkDeleteOpen,onOpenChange:(I)=>{if(!I)s.cancelBulkDelete()},count:s.selected.size,deleting:s.bulkProgress!==null,progress:s.bulkProgress,onConfirm:()=>void s.confirmBulkRemove()}),d(oF,{open:s.projectDeleteOpen,onOpenChange:(I)=>I?s.openProjectDelete():s.closeProjectDelete(),projectName:r.name,sessionTotal:s.summary.total,deleting:s.deletingProject,onConfirm:()=>void s.confirmRemoveProject()})]})}function SF({projectId:e}){let{navigate:t}=wt(),[a,r]=A({phase:"loading"}),n=j(async()=>{r({phase:"loading"});try{let c=(await(await le("/api/projects")).json()).projects.find((f)=>f.id===e);if(c===void 0)r({phase:"error",code:"PROJECT_NOT_FOUND"});else r({phase:"ready",project:c})}catch(s){r({phase:"error",code:s instanceof we?s.code:"INTERNAL_ERROR"})}},[e]);if(U(()=>{n()},[n]),a.phase==="loading")return S("div",{className:"grid grid-cols-1 gap-x-10 gap-y-8 pt-4 sm:pt-8 lg:grid-cols-[minmax(0,1fr)_20rem] xl:grid-cols-[minmax(0,1fr)_22rem]","aria-hidden":!0,children:[S("div",{className:"flex flex-col gap-8",children:[S("div",{className:"flex flex-col gap-4",children:[S("div",{className:"flex items-start justify-between gap-4",children:[S("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[d(Fe,{className:"h-8 w-48"}),d(Fe,{className:"h-3 w-64"})]}),d(Fe,{className:"h-8 w-28 rounded-full"})]}),d(Fe,{className:"h-4 w-36"})]}),d(H0,{})]}),d("div",{className:"hidden flex-col gap-6 self-start lg:flex",children:[1,2,3].map((s,l)=>S("div",{className:"flex flex-col gap-2.5",children:[S("div",{className:"flex flex-col gap-1.5 px-1",children:[d(Fe,{className:"h-4 w-28"}),d(Fe,{className:"h-3 w-40"})]}),d("div",{className:"flex flex-col divide-y overflow-hidden rounded-xl border bg-card",children:Array.from({length:s},(c,f)=>S("div",{className:"flex min-h-14 flex-col justify-center gap-1.5 px-4",children:[d(Fe,{className:"h-4",style:{width:`${60-f*12}%`}}),d(Fe,{className:"h-3 w-1/3"})]},f))})]},l))})]});if(a.phase==="error")return S("div",{className:"flex flex-col items-center gap-4 py-10 text-center",children:[d("p",{className:"text-sm text-muted-foreground",children:vr(a.code)}),d("a",{href:Br(),onClick:(s)=>{s.preventDefault(),t(Br())},className:"text-sm font-medium underline underline-offset-4",children:"Back to projects"})]});return d(wF,{project:a.project,onOpenSession:(s)=>t(Wn(e,s.id)),onDeleted:()=>t(Br())},a.project.id)}function kF({overview:e,className:t}){let{navigate:a}=wt(),{project:r,recentSessions:n,sessionCount:s}=e;if(n.length===0)return null;let l=(f,m)=>{if(f.metaKey||f.ctrlKey||f.shiftKey||f.button!==0)return;f.preventDefault(),a(m)},c=Gi(r.id);return S("section",{"aria-label":`Recent sessions in ${r.name}`,className:N("flex flex-col",t),children:[S("div",{className:"flex items-center gap-3 px-3 pb-2",children:[d("h2",{className:"shrink-0 text-xs font-medium text-muted-foreground",children:"Recent sessions"}),d("span",{"aria-hidden":!0,className:"h-px flex-1 bg-border"}),s>n.length&&S("a",{href:c,onClick:(f)=>l(f,c),className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["View all ",s,d(Or,{className:"size-3"})]})]}),d("ul",{className:"flex flex-col",children:n.map((f)=>{let m=Wn(r.id,f.id),g=Ll(f.title);return d("li",{children:S("a",{href:m,onClick:(h)=>l(h,m),"aria-label":`Open session ${g}, ${Io[f.status]}`,className:"group flex min-h-10 items-center gap-3 rounded-lg px-3 py-2 transition-colors hover:bg-muted/50 focus-visible:bg-muted/50 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",children:[d("span",{"aria-hidden":!0,className:N("size-2 shrink-0 rounded-full",$n[f.status])}),d("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground group-hover:text-foreground group-focus-visible:text-foreground",children:g}),d(wr,{agentType:f.agentType,className:"size-3.5 text-muted-foreground"}),d("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:bu(f.updatedAt)})]})},f.id)})})]})}function CF(e,t){let a=e.toLowerCase();if(a==="build")return jc;if(a==="plan")return sl;return t==="primary"?il:sl}function IF(e){return e.mode!=="subagent"&&Boolean(e.description)}function LF(e){return e.charAt(0).toUpperCase()+e.slice(1)}function V0({agents:e,loading:t,error:a,activeAgent:r,saving:n=!1,disabled:s=!1,onPick:l,className:c,variant:f="popover"}){let m=f==="sheet",g=e??[],h=g.filter(IF),x=g.filter((I)=>!IF(I)),[v,w]=A(!1),C=x.some((I)=>I.name===r),L=v||C;if(t)return S("div",{className:"flex items-center gap-2 px-3 py-2.5 text-sm text-muted-foreground",children:[d(fe,{className:"size-3.5"}),"Loading agents…"]});if(a)return d("div",{className:"px-3 py-2.5 text-sm text-destructive",children:a});let k=(I,T)=>d(qae,{...T,sheet:m,disabled:s||n},I);return S("div",{className:N("flex flex-col gap-0.5",c),children:[k("__default",{icon:il,label:"Default",description:"Let KCG Code choose (usually Build)",selected:r===null,onClick:()=>l(null)}),h.map((I)=>k(I.name,{icon:CF(I.name,I.mode),label:LF(I.name),description:I.description,selected:I.name===r,accent:I.name.toLowerCase()==="plan",onClick:()=>l(I.name)})),x.length>0&&S(se,{children:[S("button",{type:"button",onClick:()=>!C&&w((I)=>!I),"aria-expanded":L,className:"mt-1 flex w-full items-center gap-1.5 rounded-lg px-3 py-2.5 text-left text-xs font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",children:[d(yt,{className:N("size-3.5 transition-transform",!L&&"-rotate-90"),"aria-hidden":!0}),"More modes",d("span",{className:"tabular-nums opacity-70",children:x.length})]}),L&&x.map((I)=>k(I.name,{icon:CF(I.name,I.mode),label:LF(I.name),description:I.description,selected:I.name===r,compact:!0,onClick:()=>l(I.name)}))]}),g.length===0&&d("div",{className:"px-3 py-2.5 text-sm text-muted-foreground",children:"No agents found."})]})}function qae({icon:e,label:t,description:a,selected:r,accent:n,compact:s,onClick:l,sheet:c,disabled:f}){if(!c)return S("button",{type:"button","aria-pressed":r,disabled:f,onClick:l,className:N("group/row flex w-full items-center gap-2.5 rounded-lg px-2 text-left transition-colors outline-none","hover:bg-accent focus-visible:bg-accent disabled:opacity-50",s?"min-h-9 py-1.5":"min-h-12 py-2",r&&"bg-accent/60"),children:[d("span",{className:N("flex shrink-0 items-center justify-center rounded-md",s?"size-6":"size-8",r?"bg-primary/15 text-primary dark:bg-primary/25":n?"bg-amber-500/10 text-amber-600 dark:text-amber-400":"bg-muted text-muted-foreground group-hover/row:bg-background/60"),"aria-hidden":!0,children:d(e,{className:s?"size-3.5":"size-4"})}),S("span",{className:"flex min-w-0 flex-1 flex-col",children:[d("span",{className:N("truncate text-sm leading-5",r&&"font-medium"),children:t}),a&&!s&&d("span",{className:"truncate text-xs text-muted-foreground",title:a,children:a})]}),d(Ke,{className:N("size-4 shrink-0 text-primary",!r&&"invisible"),"aria-hidden":!0})]});return S("button",{type:"button","aria-pressed":r,disabled:f,onClick:l,className:N("flex w-full items-center gap-3 rounded-xl px-3 text-left transition-colors outline-none","active:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50",s?"min-h-11 py-2":"min-h-14 py-2.5",r?"bg-primary/10 dark:bg-primary/15":"hover:bg-muted/60"),children:[d("span",{className:N("flex shrink-0 items-center justify-center rounded-lg",s?"size-7":"size-9",r?"bg-primary/15 text-primary dark:bg-primary/25":n?"bg-amber-500/10 text-amber-600 dark:text-amber-400":"bg-muted text-muted-foreground"),"aria-hidden":!0,children:d(e,{className:s?"size-3.5":"size-[18px]"})}),S("span",{className:"flex min-w-0 flex-1 flex-col",children:[d("span",{className:N("text-[15px] leading-5",r&&"font-medium"),children:t}),a&&!s&&d("span",{className:"line-clamp-1 text-[13px] leading-snug text-muted-foreground",children:a})]}),d("span",{className:N("flex size-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors",r?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40"),"aria-hidden":!0,children:r&&d(Ke,{className:"size-3",strokeWidth:3})})]})}function Af({...e}){return d(dee,{"data-slot":"popover",...e})}function Mf({...e}){return d(fee,{"data-slot":"popover-trigger",...e})}function Pf({className:e,align:t="center",sideOffset:a=4,...r}){return d(pee,{children:d(mee,{"data-slot":"popover-content",align:t,sideOffset:a,className:N("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95","data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2","z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-1 shadow-md outline-hidden",e),...r})})}function j0(e,t,a,r="opencode"){let[n,s]=A(null),[l,c]=A(!1),[f,m]=A(!1),[g,h]=A(null),x=B(!1),v=B(!1),w=B(a);w.current=a;let C=j(()=>{if(x.current)return;x.current=!0,c(!0),h(null),(async()=>{try{let I=await(await le(`/api/projects/${e}/agents${ri(r)}`)).json();s(I.agents)}catch(k){h(k instanceof we?k.message:"Failed to load agent list"),s([])}finally{x.current=!1,c(!1)}})()},[e,r]),L=j(async(k)=>{if(v.current)return;v.current=!0,m(!0),h(null);try{if(t!==null)await le(`/api/sessions/${t}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({agent:k})});w.current(k)}catch(I){h(I instanceof we?I.message:"Failed to change agent")}finally{v.current=!1,m(!1)}},[t]);return{agents:n,loading:l,saving:f,error:g,load:C,pick:L}}function G0({projectId:e,agentType:t="opencode",sessionId:a,agent:r,onChanged:n,disabled:s=!1,className:l}){let[c,f]=A(!1),{agents:m,loading:g,saving:h,error:x,load:v,pick:w}=j0(e,a,(I)=>{n(I),f(!1)},t),C=r?.toLowerCase()==="plan",L=r?r.charAt(0).toUpperCase()+r.slice(1):"Default",k=C?sl:r?.toLowerCase()==="build"?jc:il;return U(()=>{if(c)v()},[c,v]),S(Af,{open:c,onOpenChange:(I)=>f(I),children:[d(Mf,{asChild:!0,children:S(ae,{type:"button",variant:"ghost",size:"sm",disabled:s,"aria-label":`Agent mode: ${L}`,title:"Change mode",className:N("group h-8 shrink-0 gap-1.5 rounded-full border border-transparent px-2.5 text-[13px] font-medium text-muted-foreground","hover:bg-muted hover:text-foreground data-[state=open]:bg-muted data-[state=open]:text-foreground",C&&"border-amber-500/30 bg-amber-500/10 text-amber-700 hover:bg-amber-500/15 hover:text-amber-700 data-[state=open]:bg-amber-500/15 data-[state=open]:text-amber-700 dark:text-amber-400 dark:hover:text-amber-400 dark:data-[state=open]:text-amber-400",l),children:[h?d(fe,{className:"size-4"}):d(k,{className:"size-3.5"}),d("span",{className:"inline max-w-24 truncate sm:max-w-32",children:L}),d(yt,{className:"size-3.5 opacity-60 transition-transform group-data-[state=open]:rotate-180","aria-hidden":!0})]})}),S(Pf,{align:"end",side:"top",sideOffset:8,collisionPadding:12,className:"flex max-h-[min(26rem,var(--radix-popover-content-available-height))] w-80 flex-col overflow-hidden p-0",children:[S("div",{className:"shrink-0 border-b px-3 pt-2.5 pb-2",children:[d("p",{className:"text-sm font-medium",children:"Mode"}),d("p",{className:"text-xs text-muted-foreground",children:"How the agent handles your next message"})]}),d("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain p-1.5 [scrollbar-width:thin]",children:d(V0,{agents:m,loading:g,error:x,activeAgent:r,saving:h,disabled:s,onPick:(I)=>void w(I)})})]})]})}function q0({projectId:e,agentType:t="opencode",sessionId:a,model:r,onChanged:n,variant:s="chip",onAgentTypeChange:l}){let[c,f]=A(!1),[m,g]=A(null),[h,x]=A(!1),[v,w]=A(!1),[C,L]=A(null),k=lF(r,m??[]),I=cF(k),T=l&&r===null?Ht[t]:I;U(()=>{if(!c)return;let E=!1;return x(!0),L(null),le(`/api/projects/${e}/models${ri(t)}`).then(async(M)=>{let P=await M.json();if(!E)g(P.models)}).catch((M)=>{if(E)return;L(M instanceof we?M.message:"Failed to load model list"),g([])}).finally(()=>{if(!E)x(!1)}),()=>{E=!0}},[c,e,t]);let R=async(E)=>{w(!0),L(null);try{if(a!==null)await le(`/api/sessions/${a}`,{method:"PUT",body:JSON.stringify({model:E})});n(E),f(!1)}catch(M){L(M instanceof we?M.message:"Failed to change model")}finally{w(!1)}};return S(se,{children:[s==="heading"?S(ae,{type:"button",variant:"ghost",onClick:()=>f(!0),disabled:v,className:"h-8 max-w-full min-w-0 gap-1 px-2 text-base font-semibold","aria-label":`Model: ${k}. Tap to change model`,title:`Model: ${k}`,children:[d("span",{className:"min-w-0 truncate",children:I}),v?d(fe,{className:"size-4 shrink-0"}):d(yt,{className:"size-4 shrink-0 text-muted-foreground"})]}):s==="inline"?S(ae,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(!0),disabled:v,className:"h-9 max-w-full min-w-0 gap-1 px-2 font-normal text-muted-foreground hover:text-foreground","aria-label":l?`${Ht[t]}, model: ${k}. Tap to change`:`Model: ${k}. Tap to change`,title:l?`${Ht[t]} · ${k}`:k,children:[l&&d(wr,{agentType:t}),d("span",{className:"min-w-0 truncate",children:T}),v?d(fe,{"data-icon":"inline-end"}):d(yt,{"data-icon":"inline-end"})]}):S(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!0),disabled:v,className:"h-9 max-w-full min-w-0 justify-between gap-1.5 px-2.5 font-normal","aria-label":`Model: ${k}. Tap to change`,title:k,children:[d(sa,{className:"size-4 shrink-0 text-muted-foreground"}),d("span",{className:"min-w-0 truncate text-sm",children:k}),v?d(fe,{className:"size-4 shrink-0"}):d(Hc,{className:"size-4 shrink-0 text-muted-foreground"})]}),d(Ma,{open:c,onOpenChange:(E)=>{if(v)return;if(f(E),!E)L(null)},children:S(z0,{title:l?"Agent & Model":"Model",subtitle:a===null?"For the new session":"Applies to the next message",closeDisabled:v,children:[l&&d(Rf,{label:"Agent",value:t,disabled:v,onChange:l,options:Nt.map((E)=>({value:E,label:Ht[E],icon:d(wr,{agentType:E})}))}),C&&S(ro,{variant:"destructive",children:[d(ts,{children:"Failed"}),d(oo,{children:C})]}),d(U0,{models:m,loading:h,activeKey:F0(r),onSelect:(E)=>void R(E),disabled:v,className:"flex-1"})]})})]})}function TF({className:e,...t}){return d("div",{"data-slot":"input-group",role:"group",className:N("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] 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-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}var Kae=Ca("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-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function RF({className:e,align:t="inline-start",...a}){return d("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:N(Kae({align:t}),e),onClick:(r)=>{if(!r.currentTarget.contains(r.target))return;if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input, textarea")?.focus()},...a})}var Xae=Ca("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function AF({className:e,type:t="button",variant:a="ghost",size:r="xs",...n}){return d(ae,{type:t,"data-size":r,variant:a,className:N(Xae({size:r}),e),...n})}function MF({className:e,...t}){return d(A0,{"data-slot":"input-group-control",className:N("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",e),...t})}var Yae=["What are we building today?","Ready when you are.","Let's ship something great.","What should we tackle next?","Got a bug? Let's hunt it down.","Describe it, I'll code it.","Pick a project and let's go.","Where were we?","Time to make the code purr.","What's on your mind?"];function PF(e=Yae,t=Math.random){if(e.length===0)return"";let a=Math.min(e.length-1,Math.floor(t()*e.length));return e[Math.max(0,a)]??""}function DI(){return typeof sessionStorage>"u"?null:sessionStorage}function K0(e,t,a=DI()){let r=t.trim();if(a===null||r==="")return;a.setItem("kcg-pending-prompt:"+e,r)}function EF(e,t=DI()){if(t===null)return null;let a=t.getItem("kcg-pending-prompt:"+e);return a!==null&&a.trim()!==""?a:null}function NF(e,t=DI()){if(t===null)return null;let a="kcg-pending-prompt:"+e,r=t.getItem(a);if(r!==null)t.removeItem(a);return r!==null&&r.trim()!==""?r:null}var OI=new Map;function DF(e){OI.set(e.id,e)}function _I(e){return OI.get(e)??null}function OF(e){OI.delete(e)}var _F="kcg-home-project";function Wae(){return typeof localStorage>"u"?null:localStorage.getItem(_F)}function zF({overviews:e,onNewProject:t}){let{navigate:a}=wt(),[r]=A(()=>PF()),[n,s]=A(""),[l,c]=A(Wae),[f,m]=A(gh),[g,h]=A(!1),[x,v]=A(null),[w,C]=A(null),[L,k]=A(null),I=B(null),T=e.find((F)=>F.project.id===l)??e[0]??null,R=T?.project??null;U(()=>{I.current?.focus()},[]);let E=(F)=>{if(F!==R?.id)C(null),k(null);if(c(F),typeof localStorage<"u")localStorage.setItem(_F,F);requestAnimationFrame(()=>I.current?.focus())},M=(F)=>{if(F!==f)C(null),k(null);m(F),k0(F)},P=R!==null&&n.trim()!==""&&!g,O=async(F)=>{if(F?.preventDefault(),!P||R===null)return;h(!0),v(null);try{let z=await le("/api/sessions",{method:"POST",body:JSON.stringify({agentType:f,projectId:R.id,model:w,agent:L})}),{session:Y}=await z.json();K0(Y.id,n),DF(Y),Ya(),a(Wn(R.id,Y.id),{transition:"to-session"})}catch(z){v(z instanceof we?z.message:"Failed to start a new session"),h(!1)}};return S("div",{className:"mx-auto flex w-full max-w-2xl flex-1 flex-col justify-center gap-6 pb-[10dvh]",children:[S("div",{"data-vt-name":"home-headline",className:"flex flex-col items-center justify-center gap-3 px-2 sm:flex-row",children:[d("img",{src:Cr,alt:"","aria-hidden":!0,className:"size-10 shrink-0 sm:size-12"}),d("h1",{className:"text-balance text-center text-2xl font-semibold tracking-tight sm:text-left sm:text-3xl",children:r})]}),S("form",{onSubmit:O,className:"flex flex-col gap-3",children:[S("div",{"data-vt-name":"session-surface",className:"flex flex-col rounded-2xl border",children:[S(TF,{className:"-m-px w-auto rounded-2xl bg-card shadow-sm dark:bg-card",children:[d(MF,{ref:I,value:n,onChange:(F)=>s(F.target.value),onKeyDown:(F)=>{if(F.key==="Enter"&&!F.shiftKey&&!F.nativeEvent.isComposing)F.preventDefault(),O()},placeholder:R?`Ask anything in ${R.name}…`:"Pick a project first","aria-label":"Message",disabled:g,rows:2,className:"max-h-60 min-h-20 px-4 text-base leading-6 md:text-base"}),S(RF,{align:"block-end",className:"gap-2 px-2 pb-2",children:[R&&d(G0,{projectId:R.id,agentType:f,sessionId:null,agent:L,onChanged:k,disabled:g}),d(AF,{type:"submit",size:"icon-sm",variant:"default",className:"ml-auto size-9 rounded-full",disabled:!P,"aria-label":"Send",children:g?d(fe,{}):d(Bn,{})})]})]}),S("div",{className:"flex min-w-0 items-center justify-between gap-2 px-1.5 py-1",children:[d("div",{className:"flex min-w-0 items-center",children:S(Zn,{children:[d(Jn,{asChild:!0,children:S(ae,{type:"button",variant:"ghost",size:"sm",className:"h-9 min-w-0 gap-1.5 px-2 font-normal text-muted-foreground hover:text-foreground","aria-label":`Project: ${R?.name??"none"}. Change project`,disabled:g,children:[d(_t,{"data-icon":"inline-start"}),d("span",{className:"truncate",children:R?.name??"Select project"}),d(yt,{"data-icon":"inline-end"})]})}),S(ei,{align:"start",className:"max-h-72 w-64",children:[d(jB,{children:"Project"}),d(uI,{children:e.map(({project:F})=>S(Pa,{onSelect:()=>E(F.id),children:[d(_t,{}),S("span",{className:"flex min-w-0 flex-1 flex-col",children:[d("span",{className:"truncate",children:F.name}),d("span",{className:"truncate text-xs text-muted-foreground",children:F.path})]}),F.id===R?.id&&d(Ke,{})]},F.id))}),d(ti,{}),d(uI,{children:S(Pa,{onSelect:t,children:[d(Yo,{}),"New project"]})})]})]})}),R&&d("div",{className:"flex max-w-[60%] shrink-0 justify-end",children:d(q0,{projectId:R.id,agentType:f,sessionId:null,model:w,onChanged:C,onAgentTypeChange:M,variant:"inline"})})]})]}),x&&d(ro,{variant:"destructive",children:d(oo,{children:x})})]}),T&&d(kF,{overview:T,className:"hidden sm:mt-6 sm:flex"})]})}function $ae(e,t){return e===""?t:`${e}/${t}`}function BF({path:e,onNavigate:t}){let[a,r]=A([]),[n,s]=A(!1),[l,c]=A(null),f=j(async(g)=>{s(!0),c(null);try{let x=await(await le(`/api/fs?path=${encodeURIComponent(g)}`)).json();r(x.entries)}catch(h){r([]),c(h instanceof we?h.message:"Failed to load directory")}finally{s(!1)}},[]);U(()=>{f(e)},[e,f]);let m=e===""?[]:e.split("/");return S("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[S("div",{className:"flex shrink-0 flex-wrap items-center gap-1 text-sm",children:[d(ae,{type:"button",variant:"ghost",size:"sm",className:N("h-7 px-2 font-medium",e===""&&"text-foreground"),onClick:()=>t(""),children:"Sandbox"}),m.map((g,h)=>{let x=m.slice(0,h+1).join("/");return S("span",{className:"flex items-center gap-1",children:[d(Jt,{className:"size-3.5 text-muted-foreground","data-icon":"inline-start"}),d(ae,{type:"button",variant:"ghost",size:"sm",className:N("h-7 px-2 font-medium",h===m.length-1&&"text-foreground"),onClick:()=>t(x),children:g})]},x)})]}),d("div",{className:"min-h-0 flex-1 overflow-y-auto rounded-lg border bg-card p-2",children:n?S("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[d(fe,{className:"size-4"}),"Loading directories…"]}):l?d("p",{className:"px-2 py-4 text-sm text-destructive",children:l}):a.length===0?d("p",{className:"px-2 py-4 text-sm text-muted-foreground",children:"No subdirectories."}):S("div",{className:"flex flex-col gap-1",children:[e!==""&&S(ae,{type:"button",variant:"ghost",size:"sm",className:"h-8 justify-start gap-2 px-2 text-muted-foreground",onClick:()=>t(m.slice(0,-1).join("/")),children:[d(Og,{"data-icon":"inline-start"}),"Back"]}),a.map((g)=>S(ae,{type:"button",variant:"ghost",size:"sm",className:"h-8 justify-start gap-2 px-2",onClick:()=>t($ae(e,g)),children:[d(_t,{"data-icon":"inline-start"}),d("span",{className:"truncate",children:g})]},g))]})}),S("div",{className:"flex min-w-0 shrink-0 items-center gap-1.5 text-sm",children:[d("span",{className:"shrink-0 text-muted-foreground",children:"Current directory:"}),d("span",{className:"min-w-0 flex-1 truncate font-mono",children:e===""?"/":e})]})]})}function FF({className:e,...t}){return d(ZJ,{"data-slot":"label",className:N("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",e),...t})}function UF({className:e,...t}){return d("div",{"data-slot":"field-group",className:N("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),...t})}var Qae=Ca("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function zI({className:e,orientation:t="vertical",...a}){return d("div",{role:"group","data-slot":"field","data-orientation":t,className:N(Qae({orientation:t}),e),...a})}function BI({className:e,...t}){return d(FF,{"data-slot":"field-label",className:N("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",e),...t})}function Zae(e){return e.split("/").filter((a)=>a.length>0).at(-1)??""}function HF({open:e,onOpenChange:t,onCreated:a}){let[r,n]=A(1),[s,l]=A(""),[c,f]=A(""),[m,g]=A(!1),[h,x]=A(!1),[v,w]=A(null),[C,L]=A(null),{navigate:k}=wt();U(()=>{if(!e)return;let P=!1;return le("/api/workspace").then((O)=>O.json()).then((O)=>{if(!P)L(O.workspace)}).catch(()=>{}),()=>{P=!0}},[e]);let I=()=>{n(1),l(""),f(""),g(!1),w(null),x(!1)},T=(P)=>{if(!P)I();t(P)},R=()=>{if(w(null),!m)f(Zae(s));n(2)},E=()=>{w(null),n(1)},M=async(P)=>{P.preventDefault(),x(!0),w(null);try{await le("/api/projects",{method:"POST",body:JSON.stringify({name:c,path:s})}),await a(),T(!1),De.success(`Project "${c.trim()}" created.`)}catch(O){w(O instanceof we?O.message:"Failed to create project")}finally{x(!1)}};return d(Ma,{open:e,onOpenChange:T,children:S(or,{className:"flex h-[560px] max-h-[85vh] flex-col sm:max-w-lg",children:[S(zr,{children:[S("div",{className:"mt-4 flex flex-col gap-1.5",children:[S("div",{className:"flex items-center gap-1.5",children:[d("span",{className:N("h-1.5 flex-1 rounded-full transition-colors",r>=1?"bg-primary":"bg-muted")}),d("span",{className:N("h-1.5 flex-1 rounded-full transition-colors",r>=2?"bg-primary":"bg-muted")})]}),S("span",{className:"text-xs font-medium text-muted-foreground",children:["Step ",r," of 2"]})]}),d(nr,{children:r===1?"Choose working directory":"Name your project"}),d(ir,{children:r===1?"Browse the Sandbox and pick the folder to use as the working directory.":"This name identifies the project in the list."})]}),r===1?S(se,{children:[d("div",{className:"min-h-0 flex-1",children:d(BF,{path:s,onNavigate:l})}),C&&S("p",{className:"flex min-w-0 items-center gap-1.5 text-[12px] text-muted-foreground",children:[d("span",{className:"shrink-0",children:"Projects live in"}),d("code",{className:"min-w-0 truncate font-mono",title:C.root,children:C.display}),d("span",{"aria-hidden":!0,children:"·"}),d("a",{href:xa("workspace"),onClick:(P)=>{if(P.metaKey||P.ctrlKey||P.shiftKey||P.button!==0)return;P.preventDefault(),T(!1),k(xa("workspace"))},className:"shrink-0 font-medium text-foreground underline underline-offset-2",children:"Change"})]}),d(ao,{children:S(ae,{type:"button",onClick:R,children:["Next",d(Or,{"data-icon":"inline-end"})]})})]}):S("form",{onSubmit:M,className:"flex min-h-0 flex-1 flex-col gap-4",children:[S("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto",children:[S(UF,{children:[S(zI,{children:[d(BI,{htmlFor:"project-name",children:"Project name"}),d(y0,{id:"project-name",value:c,onChange:(P)=>{f(P.target.value),g(!0)},placeholder:"e.g. web-app",maxLength:120,autoFocus:!0})]}),S(zI,{children:[d(BI,{children:"Working directory"}),S("div",{className:"flex items-center gap-2 rounded-md border bg-muted/40 px-3 py-2 text-sm",children:[d(_t,{className:"size-4 shrink-0 text-muted-foreground"}),d("span",{className:"min-w-0 flex-1 truncate font-mono text-muted-foreground",children:s===""?"/":s}),d(ae,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2",onClick:E,disabled:h,children:"Change"})]})]})]}),v&&S(ro,{variant:"destructive",children:[d(ts,{children:"Failed to create project"}),d(oo,{children:v})]})]}),S(ao,{children:[S(ae,{type:"button",variant:"ghost",onClick:E,disabled:h,children:[d(Uc,{"data-icon":"inline-start"}),"Back"]}),d(ae,{type:"submit",disabled:h||c.trim()==="",children:h?S(se,{children:[d(fe,{"data-icon":"inline-start"}),"Creating…"]}):S(se,{children:[d(Yo,{"data-icon":"inline-start"}),"Create project"]})})]})]})]})})}function yu({className:e,...t}){return d("div",{"data-slot":"empty",className:N("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...t})}function wu({className:e,...t}){return d("div",{"data-slot":"empty-header",className:N("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}var Jae=Ca("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function Su({className:e,variant:t="default",...a}){return d("div",{"data-slot":"empty-icon","data-variant":t,className:N(Jae({variant:t,className:e})),...a})}function ku({className:e,...t}){return d("div",{"data-slot":"empty-title",className:N("text-xl font-medium tracking-tight",e),...t})}function Cu({className:e,...t}){return d("div",{"data-slot":"empty-description",className:N("text-base/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}function hh({className:e,...t}){return d("div",{"data-slot":"empty-content",className:N("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-base text-balance",e),...t})}var ere=5;function VF(){let[e,t]=A([]),[a,r]=A(!0),[n,s]=A(null),[l,c]=A(!1),[f,m]=A(""),g=j(async()=>{r(!0),s(null);try{let[w,C]=await Promise.all([le("/api/projects"),le("/api/sessions")]),[{projects:L},{sessions:k}]=await Promise.all([w.json(),C.json()]);t(mF(L,k))}catch(w){t([]),s(w instanceof we?w.message:"Failed to load projects")}finally{r(!1)}},[]);U(()=>{g()},[g]);let h=de(()=>gF(e,f),[e,f]),x=hF(e),v=e.length>=ere;return{overviews:e,loading:a,loadError:n,refresh:g,visible:h,running:x,showSearch:v,dialogOpen:l,setDialogOpen:c,query:f,setQuery:m}}function jF(){let{overviews:e,loading:t,loadError:a,refresh:r,dialogOpen:n,setDialogOpen:s}=VF();return S("div",{className:"mx-auto flex w-full max-w-2xl flex-1 flex-col",children:[d(HF,{open:n,onOpenChange:s,onCreated:()=>{r(),Ya()}}),t&&e.length===0?d(tre,{}):a?d("div",{className:"flex flex-1 flex-col justify-center",children:S(ro,{variant:"destructive",children:[d(ts,{children:"Failed to load projects"}),S(oo,{className:"flex flex-col items-start gap-3",children:[a,S(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>void r(),children:[d(xr,{"data-icon":"inline-start"}),"Retry"]})]})]})}):e.length===0?d("div",{className:"flex flex-1 flex-col justify-center",children:d(yu,{className:"rounded-xl border border-dashed bg-card",children:S(wu,{children:[d(Su,{variant:"icon",children:d(rg,{})}),d(ku,{children:"No projects yet"}),d(Cu,{children:"Add a project first — pick a working directory in the Sandbox, then run CLI_Agent inside it."}),d(hh,{children:S(ae,{type:"button",onClick:()=>s(!0),children:[d(Yo,{"data-icon":"inline-start"}),"New project"]})})]})})}):d(zF,{overviews:e,onNewProject:()=>s(!0)})]})}function tre(){return S("div",{className:"flex flex-1 flex-col justify-center gap-6 pb-[10dvh]","aria-hidden":!0,children:[S("div",{className:"flex items-center justify-center gap-3",children:[d(Fe,{className:"size-12 rounded-full"}),d(Fe,{className:"h-8 w-64"})]}),d(Fe,{className:"h-32 w-full rounded-2xl"})]})}var as="max-w-[46rem]",X0="max-w-[48rem]";var are=[{user:"w-[46%]",lines:["w-[92%]","w-[84%]","w-[58%]"]},{user:"w-[32%]",lines:["w-[88%]","w-[70%]"]}];function Y0({className:e}){return S("div",{role:"status","aria-live":"polite","aria-label":"Loading conversation",className:N("min-h-0 flex-1 overflow-hidden","animate-in fade-in fill-mode-both delay-150 duration-300 motion-reduce:animate-none",e),children:[d("div",{className:N("mx-auto flex w-full flex-col gap-6 px-3 py-4 sm:gap-8 sm:px-4",X0),children:are.map((t,a)=>S("div",{className:"flex flex-col gap-4",children:[d(Fe,{className:N("ml-auto h-11 rounded-2xl rounded-br-md",t.user)}),d("div",{className:"flex flex-col gap-2.5 px-1",children:t.lines.map((r,n)=>d(Fe,{className:N("h-3.5 rounded-full",r)},n))})]},a))}),d("span",{className:"sr-only",children:"Loading conversation…"})]})}function W0(){return d("div",{className:"shrink-0 scrollbar-gutter-stable overflow-y-hidden px-3 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] sm:px-4",children:S("div",{className:N("mx-auto flex w-full items-center gap-2 rounded-xl border bg-card/80 p-2 shadow-sm",as),children:[d(Fe,{className:"size-9 shrink-0 rounded-md"}),d(Fe,{className:"h-3.5 flex-1 rounded-full"}),d(Fe,{className:"size-9 shrink-0 rounded-md"})]})})}function Iu(e){return typeof e.text==="string"?e.text:null}function $0(e){return e.filter((t)=>t.type==="text").map(Iu).filter((t)=>t!==null).join(`
|
|
67
|
+
`)}function xh(e){let t=[];for(let a of e)a.parts.forEach((r,n)=>{let s=`${a.id}:${r.id??n}`;if(r.type==="reasoning"||r.type==="error"){t.push({kind:r.type,key:s,part:r});return}if(r.type==="tool"||r.type==="shell"||r.type==="file"){t.push({kind:"tool",key:s,part:r});return}if(r.type!=="text")return;let l=Iu(r)??"",c=t[t.length-1];if(c?.kind==="text")c.text=c.text===""?l:`${c.text}
|
|
68
|
+
${l}`;else t.push({kind:"text",key:s,text:l,final:!1})});for(let a=t.length-1;a>=0;a--){let r=t[a];if(r?.kind!=="text")continue;if(r.text.trim()!=="")r.final=!0;break}return t}var rre=["filePath","path","file","dir","directory","pattern","query","url","command","description"];function FI(e){if(e.type==="file"&&typeof e.filename==="string"&&e.filename.trim()!=="")return e.filename;let t=e.state;if(typeof t!=="object"||t===null)return null;let a=t.input;if(typeof a!=="object"||a===null)return null;for(let r of rre){let n=a[r];if(typeof n==="string"&&n.trim()!=="")return n}return null}function UI(e){let t=typeof e.tool==="string"&&e.tool.trim()!==""?e.tool:e.type,a=FI(e);return a===null?t:`${t} ${a}`}function Q0(e){let t=[];for(let a of e){let r=t[t.length-1];if(a.role==="assistant")if(r?.kind==="assistant")r.messages.push(a);else t.push({kind:"assistant",id:a.id,messages:[a]});else t.push({kind:"user",message:a})}return t}function ore(e){return e.some((t)=>t.kind==="tool"||t.kind==="error"||t.kind==="reasoning"&&(Iu(t.part)??"").trim()!==""||t.kind==="text"&&t.text.trim()!=="")}function GF(e,t){if(!t||e.length===0)return null;let a=xh(e);if(!ore(a))return"Working…";for(let r=a.length-1;r>=0;r--){let n=a[r];if(!n)continue;if(n.kind==="text")return"Writing…";if(n.kind==="reasoning")return"Thinking…";if(n.kind==="tool")return UI(n.part);return null}return"Working…"}function qF(e){let t=null,a=null;for(let r of e)for(let n of r.parts){if(n.type!=="reasoning")continue;let s=n.time;if(!s)continue;let l=s.start??s.created;if(typeof l==="number"){if(t===null||l<t)t=l}let c=s.end;if(typeof c==="number"){if(a===null||c>a)a=c}}if(t!==null&&a!==null&&a>t)return a-t;return null}function Z0(e){let t=[],a=[];for(let n of e)if(n.kind==="reasoning"||n.kind==="tool")a.push(n);else if(n.kind==="text"||n.kind==="error")t.push({key:a[0]?.key??n.key,steps:a,content:n}),a=[];let r=a[0];if(r)t.push({key:r.key,steps:a,content:null});return t}function KF(e,t,a,r){let n=e.findIndex((m)=>m.id===a);if(n===-1)return[...e,{id:a,sessionId:t,role:"assistant",parts:[r],createdAt:Date.now(),streaming:!0}];let s=e[n];if(!s)return e;let l=s.parts.findIndex((m)=>m.id!==void 0&&m.id===r.id),c=l===-1?[...s.parts,r]:s.parts.map((m,g)=>g===l?r:m),f={...s,parts:c,streaming:!0};return e.map((m,g)=>g===n?f:m)}function XF(e,t,a,r,n){if(n==="")return e;let s=e.findIndex((x)=>x.id===t),l=s===-1?void 0:e[s];if(!l)return e;let c=l.parts.findIndex((x)=>x.id===a),f=c===-1?void 0:l.parts[c];if(!f)return e;let m=f[r];if(m!==void 0&&typeof m!=="string")return e;let g={...f,[r]:(m??"")+n},h={...l,parts:l.parts.map((x,v)=>v===c?g:x),streaming:!0};return e.map((x,v)=>v===s?h:x)}function YF(e,t){let a=e.findIndex((r)=>r.id===t.id);if(a===-1)return[...e,t];return e.map((r,n)=>n===a?t:r)}function WF(e){for(let t=e.length-1;t>=0;t--){let a=e[t];if(a?.kind==="assistant")return a}return null}var nre=new Set(["read"]);function QF(e){return e.split("/").filter(Boolean).pop()??e}function ire(e){return e.endsWith("/")||/[*?{}[\]]/.test(e)}function $F(e,t){let a=e.trim();if(a===""||ire(a))return null;let r=a;if(a.startsWith("/")){if(t===null||t==="")return null;let n=t.endsWith("/")?t:`${t}/`;if(!a.startsWith(n))return null;r=a.slice(n.length)}if(r=r.replace(/^\.\//,""),r===""||r.startsWith("../"))return null;return r}function ZF(e,t=null){let a=new Map;for(let r of e)for(let n of r.parts){let s=sre(n,t);if(s===null)continue;a.delete(s),a.set(s,{path:s})}return[...a.values()].reverse()}function sre(e,t){if(e.type==="file"){if(typeof e.attachmentId==="string")return null;let n=typeof e.filename==="string"?e.filename:"";return $F(n,t)}if(e.type!=="tool")return null;let a=typeof e.tool==="string"?e.tool.toLowerCase():"";if(!nre.has(a))return null;let r=FI(e);return r===null?null:$F(r,t)}function HI({onOpen:e}){return d(ae,{type:"button",variant:"outline",size:"icon",onClick:e,"aria-label":"Show session context",title:"Show context","aria-expanded":!1,className:"absolute end-3 top-2 z-30 size-9 rounded-full bg-background/80 shadow-sm backdrop-blur-sm sm:end-4",children:d(pg,{})})}function t7({context:e,references:t,loading:a,reserveClose:r=!1}){if(a&&e===null)return d(yre,{});return S("div",{className:N("flex flex-col gap-4",r&&"[&>*:first-child>button]:pe-7"),children:[d(lre,{context:e}),d(pre,{todos:e?.todos??[],live:e?.live??!1}),d(ure,{servers:e?.mcp??[],live:e?.live??!1}),d(mre,{references:t})]})}function a7({context:e,references:t,loading:a,onClose:r}){return U(()=>{let n=(s)=>{if(s.key==="Escape")r()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r]),S(TC,{"aria-label":"Session context",initial:{opacity:0,x:10},animate:{opacity:1,x:0},transition:{type:"spring",visualDuration:0.25,bounce:0.1},className:"relative flex max-h-full flex-col overflow-hidden rounded-2xl border bg-background shadow-xs",children:[d(ae,{type:"button",variant:"ghost",size:"icon",onClick:r,"aria-label":"Hide session context",title:"Hide context (Esc)",className:"absolute end-1.5 top-1.5 z-10 size-6 rounded-full [&_svg]:size-3.5",children:d(Ft,{})}),d("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-2.5 pt-2 pb-3 [scrollbar-width:thin]",children:d(t7,{context:e,references:t,loading:a,reserveClose:!0})})]})}function r7({open:e,onOpenChange:t,context:a,references:r,loading:n}){return d(Rl,{open:e,onOpenChange:t,children:S(Al,{side:"bottom",className:"max-h-[80dvh] gap-0 pb-[max(0.75rem,env(safe-area-inset-bottom))]",children:[S(Ml,{className:"sr-only",children:[d(Pl,{children:"Session context"}),d(El,{children:"Environment, MCP servers, task list, and files read by the agent."})]}),d("div",{className:"min-h-0 overflow-y-auto overscroll-contain px-3 pt-2 pb-1",children:d(t7,{context:a,references:r,loading:n})})]})})}function lre({context:e}){let t=e?.changes??[],a=t.reduce((s,l)=>s+l.added,0),r=t.reduce((s,l)=>s+l.removed,0),n=e?.git;return d(J0,{title:"Environment",children:S(ey,{children:[d(vh,{icon:d(Jm,{}),label:t.length===0?"No changes":`${t.length} ${t.length===1?"file":"files"} changed`,value:t.length>0?d(xre,{added:a,removed:r}):void 0}),d(vh,{icon:d(ig,{}),label:n?.branch??"Not a git repository",muted:!n?.branch,mono:Boolean(n?.branch)}),n?.branch&&d(vh,{icon:d(zg,{}),label:gre(n.ahead,n.behind,n.hasRemote),muted:!0})]})})}var cre=["needs_auth","needs_client_registration"];function ure({servers:e,live:t}){let a=e.filter((f)=>f.status==="connected").length,r=e.filter((f)=>f.status==="failed").length,n=(f,m)=>f.name.localeCompare(m.name),s=e.filter((f)=>cre.includes(f.status)).sort(n),l=e.filter((f)=>f.status==="disabled"||f.status==="unknown").sort(n),c=[...e.filter((f)=>f.status==="failed").sort(n),...e.filter((f)=>f.status==="connected").sort(n),...s.length===1?s:[],...l.length===1?l:[]];return d(J0,{title:"MCP",summary:e.length>0?S("span",{className:N(r>0&&"text-amber-700 dark:text-amber-400"),children:[a,"/",e.length," connected"]}):void 0,children:e.length===0?d(VI,{children:t?"No MCP servers configured":"Start the session to see MCP servers"}):S(ey,{children:[c.map((f)=>d(dre,{server:f},f.name)),s.length>1&&d(JF,{label:`${s.length} need sign-in`,dotClass:E0.needs_auth,servers:s}),l.length>1&&d(JF,{label:`${l.length} inactive`,dotClass:E0.disabled,servers:l})]})})}function dre({server:e}){return d(vh,{icon:d(Wc,{}),label:e.name,hint:e.error??void 0,hintTone:e.error?"error":void 0,title:e.error??void 0,value:d(fre,{status:e.status})})}function fre({status:e}){return S("span",{className:"flex items-center gap-1.5 text-[11.5px] text-muted-foreground",children:[d("span",{"aria-hidden":!0,className:N("size-1.5 rounded-full",E0[e])}),P0[e]]})}function JF({label:e,dotClass:t,servers:a}){let[r,n]=A(!1);return S("li",{children:[S("button",{type:"button",onClick:()=>n((s)=>!s),"aria-expanded":r,className:"flex min-h-9 w-full min-w-0 items-center gap-2 px-2.5 py-1.5 text-left text-[12.5px] outline-none transition-colors hover:bg-muted/50 focus-visible:bg-muted/50",children:[d("span",{"aria-hidden":!0,className:"flex w-3.5 shrink-0 justify-center",children:d("span",{className:N("size-1.5 rounded-full",t)})}),d("span",{className:"min-w-0 flex-1 truncate leading-5 text-muted-foreground",children:e}),d(yt,{"aria-hidden":!0,className:N("size-3.5 shrink-0 text-muted-foreground transition-transform duration-200",r&&"rotate-180")})]}),r&&d("ul",{className:"border-t bg-muted/30 py-1",children:a.map((s)=>d("li",{title:s.error??s.name,className:"truncate px-2.5 py-1 ps-8 text-[12px] leading-5 text-muted-foreground",children:s.name},s.name))})]})}function pre({todos:e,live:t}){let a=e.filter((n)=>n.status.toLowerCase()==="completed").length,r=e.filter((n)=>n.status.toLowerCase()!=="cancelled").length;return d(J0,{title:"Task list",summary:e.length>0?`${a}/${r} done`:void 0,children:e.length===0?d(VI,{children:t?"The agent hasn't planned any tasks yet":"Session is not running"}):S("div",{className:"flex flex-col gap-2",children:[r>0&&d("div",{role:"progressbar","aria-label":"Task progress","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":a,className:"mx-1 h-1 overflow-hidden rounded-full bg-muted",children:d("div",{className:"h-full rounded-full bg-emerald-500 transition-[width] duration-500",style:{width:`${a/r*100}%`}})}),d(ey,{children:e.map((n,s)=>d(bre,{todo:n},`${s}-${n.content}`))})]})})}var e7=8;function mre({references:e}){let[t,a]=A(!1),r=Math.max(0,e.length-e7),n=t?e:e.slice(0,e7);return d(J0,{title:"Reference",summary:e.length>0?String(e.length):void 0,children:e.length===0?d(VI,{children:"Files the agent reads will appear here"}):S(se,{children:[d(ey,{children:n.map((s)=>d(vh,{icon:d(Fn,{}),label:QF(s.path),hint:hre(s.path),title:s.path},s.path))}),r>0&&S("button",{type:"button",onClick:()=>a((s)=>!s),"aria-expanded":t,className:"mt-1.5 flex w-full items-center justify-center gap-1 rounded-lg py-1.5 text-[12px] text-muted-foreground outline-none transition-colors hover:bg-muted/50 hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/40",children:[t?"Show less":`Show ${r} more`,d(yt,{"aria-hidden":!0,className:N("size-3 transition-transform duration-200",t&&"rotate-180")})]})]})})}function gre(e,t,a){if(!a)return"No remote";if(e===null)return"Not pushed yet";let r=t??0;if(e===0&&r===0)return"Up to date";let n=[];if(e>0)n.push(`${e} to push`);if(r>0)n.push(`${r} to pull`);return n.join(" · ")}function hre(e){let t=e.lastIndexOf("/");return t>0?e.slice(0,t):void 0}function J0({title:e,summary:t,children:a}){let[r,n]=A(!0);return S(Lo,{open:r,onOpenChange:n,className:"flex flex-col gap-1.5",children:[d(ai,{asChild:!0,children:S("button",{type:"button",className:"group/section flex min-h-7 items-center gap-1 rounded-md px-1 text-left outline-none hover:bg-muted/50 focus-visible:ring-[3px] focus-visible:ring-ring/40",children:[d(yt,{"aria-hidden":!0,className:N("size-3 shrink-0 text-muted-foreground transition-transform duration-200",!r&&"-rotate-90")}),d("span",{className:"text-[13px] font-semibold tracking-tight text-foreground",children:e}),t!==void 0&&d("span",{className:"ml-auto truncate ps-2 text-[11px] text-muted-foreground",children:t})]})}),d(To,{children:a})]})}function ey({children:e}){return d("ul",{className:"flex flex-col divide-y overflow-hidden rounded-xl border bg-card shadow-xs",children:e})}function vh({icon:e,label:t,hint:a,hintTone:r,value:n,muted:s,mono:l,title:c}){return S("li",{title:c,className:"flex min-h-9 min-w-0 items-center gap-2 px-2.5 py-1.5 text-[12.5px]",children:[d("span",{"aria-hidden":!0,className:"flex shrink-0 items-center text-muted-foreground [&>svg]:size-3.5",children:e}),S("span",{className:"flex min-w-0 flex-1 flex-col",children:[d("span",{className:N("truncate leading-5",s&&"text-muted-foreground",l&&"font-mono text-[12px]"),children:t}),a&&d("span",{className:N("truncate text-[11px] leading-4",r==="error"?"text-destructive/90":"text-muted-foreground"),children:a})]}),n!==void 0&&d("span",{className:"shrink-0",children:n})]})}function xre({added:e,removed:t}){return S("span",{className:"flex items-center gap-1.5 font-mono text-[11.5px] tabular-nums",children:[S("span",{className:"text-emerald-600 dark:text-emerald-400",children:["+",e]}),S("span",{className:"text-destructive",children:["-",t]})]})}var vre={completed:"Completed",in_progress:"In progress",pending:"Pending",cancelled:"Cancelled"};function bre({todo:e}){let t=e.status.toLowerCase(),a=t==="completed",r=t==="cancelled",n=t==="in_progress";return S("li",{className:"flex min-w-0 items-start gap-2 px-2.5 py-2 text-[12.5px] leading-snug",children:[d("span",{"aria-hidden":!0,className:"mt-0.5 flex shrink-0 items-center",children:a?d("span",{className:"flex size-3.5 items-center justify-center rounded-full bg-emerald-500 text-white",children:d(Ke,{className:"size-2",strokeWidth:4})}):n?d(fg,{className:"size-3.5 animate-spin text-sky-600 motion-reduce:animate-none dark:text-sky-400"}):d(Um,{className:"size-3.5 text-muted-foreground/60"})}),S("span",{className:"sr-only",children:[vre[t]??"Pending",": "]}),d("span",{className:N("min-w-0 break-words",a&&"text-muted-foreground line-through decoration-muted-foreground/50",r&&"text-muted-foreground/60 line-through",n&&"font-medium"),children:e.content})]})}function VI({children:e}){return d("p",{className:"rounded-xl border border-dashed px-2.5 py-2.5 text-[12px] leading-snug text-muted-foreground",children:e})}function yre(){return d("div",{className:"flex flex-col gap-3","aria-hidden":!0,children:[3,2,2].map((e,t)=>S("div",{className:"flex flex-col gap-1.5",children:[d(Fe,{className:"mx-1 h-3.5 w-24"}),d("div",{className:"flex flex-col gap-1.5 px-1",children:Array.from({length:e},(a,r)=>d(Fe,{className:"h-6"},r))})]},t))})}function ty(e){return e.dataTransfer?.types.includes("Files")??!1}function o7({accepting:e,blockedReason:t,onDropFiles:a}){let[r,n]=A("idle"),s=B(null),l=B({accepting:e,onDropFiles:a});l.current={accepting:e,onDropFiles:a},U(()=>{let f=0,m=!1,g=()=>{m=!0},h=()=>{m=!1},x=(k)=>{if(m||!ty(k))return;f++,n("dragging")},v=(k)=>{if(m||!ty(k))return;if(k.preventDefault(),k.dataTransfer)k.dataTransfer.dropEffect=l.current.accepting?"copy":"none"},w=(k)=>{if(m||!ty(k))return;if(f=Math.max(0,f-1),f===0)n("idle")},C=(k)=>{if(m||!ty(k))return;k.preventDefault(),f=0;let I=k.dataTransfer?[...k.dataTransfer.files]:[];if(I.length===0||!l.current.accepting){n("idle");return}let T=s.current?.getBoundingClientRect()??null;n("dropped"),l.current.onDropFiles(I,T)},L=()=>{f=0,m=!1,n("idle")};return window.addEventListener("dragstart",g),window.addEventListener("dragend",h),window.addEventListener("dragenter",x),window.addEventListener("dragover",v),window.addEventListener("dragleave",w),window.addEventListener("drop",C),window.addEventListener("blur",L),()=>{window.removeEventListener("dragstart",g),window.removeEventListener("dragend",h),window.removeEventListener("dragenter",x),window.removeEventListener("dragover",v),window.removeEventListener("dragleave",w),window.removeEventListener("drop",C),window.removeEventListener("blur",L)}},[]),U(()=>{if(r!=="dropped")return;let f=requestAnimationFrame(()=>n("idle"));return()=>cancelAnimationFrame(f)},[r]);let c=r==="dropped";return fn(d(bo,{custom:c,children:r==="dragging"&&d(ar,{"aria-hidden":!0,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:0.2}},transition:{duration:0.15},className:"pointer-events-none fixed inset-0 z-40 flex items-center justify-center bg-background/70 p-6 backdrop-blur-[2px]",children:S(ar,{ref:s,custom:c,initial:{opacity:0,y:120,scale:0.96},animate:{opacity:1,y:0,scale:1},variants:{exit:(f)=>f?{opacity:0,transition:{duration:0}}:{opacity:0,y:72,scale:0.97,transition:{duration:0.18,ease:"easeIn"}}},exit:"exit",transition:{type:"spring",stiffness:340,damping:30,mass:0.9,opacity:{duration:0.18}},className:N("flex aspect-[5/4] w-full max-w-md flex-col items-center justify-center gap-5 rounded-[28px] border bg-popover px-8 text-center shadow-2xl",!e&&"opacity-90"),children:[d(wre,{muted:!e}),S("div",{className:"flex flex-col gap-1.5",children:[d("p",{className:"text-xl font-semibold tracking-tight",children:e?"Add anything":"Can't add files right now"}),d("p",{className:"text-[14px] text-muted-foreground",children:e?"Drop any file here to add it to the conversation":t??"Try again when the session is ready."})]}),e&&d("span",{className:"rounded-full bg-muted px-2.5 py-0.5 text-[12px] text-muted-foreground",children:"Up to 20 MB per file"})]})},"file-drop-overlay")}),document.body)}function wre({muted:e}){let t={type:"spring",stiffness:380,damping:22},a="absolute flex size-14 items-center justify-center rounded-2xl shadow-lg ring-1 ring-black/5";return S("div",{className:N("relative h-20 w-36",e&&"grayscale"),children:[d(Zs,{initial:{opacity:0,x:18,rotate:0},animate:{opacity:1,x:0,rotate:-14},transition:{...t,delay:0.05},className:N("absolute flex size-14 items-center justify-center rounded-2xl shadow-lg ring-1 ring-black/5","top-2 left-3 bg-indigo-200 text-indigo-900"),children:d(yo,{className:"size-7",strokeWidth:2.25})}),d(Zs,{initial:{opacity:0,x:-18,rotate:0},animate:{opacity:1,x:0,rotate:12},transition:{...t,delay:0.08},className:N("absolute flex size-14 items-center justify-center rounded-2xl shadow-lg ring-1 ring-black/5","top-0 right-3 bg-indigo-400 text-white"),children:d(Fn,{className:"size-7",strokeWidth:2.25})}),d(Zs,{initial:{opacity:0,y:14,scale:0.9},animate:{opacity:1,y:[0,-4,0],scale:1},transition:{opacity:{duration:0.15},scale:t,y:{duration:2.4,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut",delay:0.3}},className:N("absolute flex size-14 items-center justify-center rounded-2xl shadow-lg ring-1 ring-black/5","top-5 left-1/2 -ml-7 size-16 bg-indigo-600 text-white"),children:d(Gc,{className:"size-8",strokeWidth:2.25})})]})}function n7({disabled:e,onPickImage:t,agentPicker:a,activeAgent:r,onPickAgent:n}){return S(Al,{side:"bottom",className:"max-h-[80dvh] gap-0 pb-[max(0.75rem,env(safe-area-inset-bottom))]",children:[S(Ml,{className:"sr-only",children:[d(Pl,{children:"Message options"}),d(El,{children:"Attach files or choose how the agent works."})]}),S("div",{className:"flex min-h-0 flex-col gap-4 overflow-y-auto overscroll-contain px-3 pt-1 pb-1",children:[S("section",{"aria-labelledby":"sheet-attach",className:"flex flex-col gap-1",children:[d("h3",{id:"sheet-attach",className:"px-3 pb-1 text-xs font-medium text-muted-foreground",children:"Add to message"}),S("button",{type:"button",disabled:e,onClick:t,className:"flex min-h-14 w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left transition-colors outline-none hover:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/50 active:bg-muted disabled:opacity-50",children:[d("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-sky-500/10 text-sky-600 dark:text-sky-400","aria-hidden":!0,children:d(Xc,{className:"size-[18px]"})}),S("span",{className:"flex min-w-0 flex-1 flex-col",children:[d("span",{className:"text-[15px] leading-5",children:"Photos and files"}),d("span",{className:"text-[13px] leading-snug text-muted-foreground",children:"Images, documents, code, and more"})]}),d(Jt,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0})]})]}),d("div",{className:"mx-3 border-t"}),S("section",{"aria-labelledby":"sheet-mode",className:"flex flex-col gap-1",children:[S("div",{className:"flex flex-col px-3 pb-1",children:[d("h3",{id:"sheet-mode",className:"text-xs font-medium text-muted-foreground",children:"Mode"}),d("p",{className:"text-[12px] text-muted-foreground/80",children:"How the agent handles your next message"})]}),d("div",{children:d(V0,{variant:"sheet",agents:a.agents,loading:a.loading,error:a.error,activeAgent:r,saving:a.saving,disabled:e,onPick:n})})]})]})]})}var i7=20971520,Sre=new Set(["image/png","image/jpeg","image/gif","image/webp"]),kre=new Set(["txt","md","markdown","mdx","rst","log","csv","tsv","json","jsonc","json5","ndjson","yaml","yml","toml","ini","cfg","conf","env","xml","html","htm","css","scss","sass","less","svg","js","mjs","cjs","jsx","ts","mts","cts","tsx","vue","svelte","astro","py","rb","php","java","kt","kts","scala","go","rs","c","h","cc","cpp","hpp","cs","swift","m","dart","lua","pl","r","jl","ex","exs","erl","hs","clj","sql","graphql","gql","proto","sh","bash","zsh","fish","ps1","bat","dockerfile","makefile","gradle","tf","hcl","nix","lock","diff","patch","tex","bib","srt","vtt"]),Cre=new Set(["dockerfile","makefile","readme","license","gemfile"]);function ay(e){let t=e.split(/[\\/]/).pop()??"",a=t.lastIndexOf(".");return a>0?t.slice(a+1).toLowerCase():""}function Ire(e){return e.startsWith("text/")||e==="application/json"||e==="application/xml"||e==="application/javascript"||e==="application/x-sh"||e==="application/sql"||e==="application/yaml"||e==="application/toml"||e.endsWith("+json")||e.endsWith("+xml")}function bh(e){return Sre.has(e)}function s7(e,t){let a=e.toLowerCase();if(bh(a))return"image";if(a==="application/pdf")return"pdf";let r=ay(t),n=(t.split(/[\\/]/).pop()??"").toLowerCase();if(kre.has(r)||r===""&&Cre.has(n))return"text";if(Ire(a))return"text";return"binary"}function l7(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB"],a=e/1024,r=0;while(a>=1024&&r<t.length-1)a/=1024,r++;return`${a<10?a.toFixed(1):Math.round(a)} ${t[r]}`}var Lre=new Set(["js","mjs","cjs","jsx","ts","mts","cts","tsx","vue","svelte","astro","py","rb","php","java","kt","kts","scala","go","rs","c","h","cc","cpp","hpp","cs","swift","m","dart","lua","pl","r","jl","ex","exs","erl","hs","clj","sql","sh","bash","zsh","fish","ps1","bat","html","htm","css","scss","sass","less","json","jsonc","yaml","yml","toml","xml","graphql","gql","proto","tf","hcl","nix","svg"]),Tre=new Set(["csv","tsv","xls","xlsx","ods","numbers"]),Rre=new Set(["zip","tar","gz","tgz","bz2","xz","7z","rar","zst"]);function Are(e,t){let a=ay(t),r=s7(e,t);if(r==="image")return{Icon:Gc,tone:"bg-sky-500/15 text-sky-600 dark:text-sky-400"};if(r==="pdf")return{Icon:Fn,tone:"bg-red-500/15 text-red-600 dark:text-red-400"};if(Tre.has(a))return{Icon:eg,tone:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400"};if(Lre.has(a))return{Icon:Zm,tone:"bg-violet-500/15 text-violet-600 dark:text-violet-400"};if(Rre.has(a))return{Icon:Qm,tone:"bg-amber-500/15 text-amber-700 dark:text-amber-400"};if(e.startsWith("audio/"))return{Icon:qo,tone:"bg-pink-500/15 text-pink-600 dark:text-pink-400"};if(e.startsWith("video/"))return{Icon:al,tone:"bg-indigo-500/15 text-indigo-600 dark:text-indigo-400"};if(r==="text")return{Icon:Fn,tone:"bg-muted text-muted-foreground"};return{Icon:Ei,tone:"bg-muted text-muted-foreground"}}function Mre(e,t){let a=ay(e),r=a?a.toUpperCase():"File";return t!==void 0&&t>0?`${r} · ${l7(t)}`:r}function ry({filename:e,mime:t,size:a,className:r}){let{Icon:n,tone:s}=Are(t,e);return S("span",{className:N("flex min-w-0 items-center gap-2.5 rounded-lg border bg-card px-2.5 text-left",r),children:[d("span",{className:N("flex size-10 shrink-0 items-center justify-center rounded-md",s),children:d(n,{className:"size-5","aria-hidden":!0})}),S("span",{className:"flex min-w-0 flex-col",children:[d("span",{className:"truncate text-[13px] leading-5 font-medium",children:e}),d("span",{className:"truncate text-[11.5px] leading-4 text-muted-foreground",children:Mre(e,a)})]})]})}var Pre=50;function oy({images:e,index:t,onIndexChange:a}){let r=t!==null&&e[t]!==void 0,n=r?e[t]:void 0,s=e.length>1,l=B(null),c=(g)=>{if(t===null||!s)return;a((t+g+e.length)%e.length)};U(()=>{if(!r||!s)return;let g=(h)=>{if(h.key==="ArrowLeft")h.preventDefault(),c(-1);else if(h.key==="ArrowRight")h.preventDefault(),c(1)};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[r,s,t,e.length]);let f=n!==void 0&&!n.src.startsWith("blob:"),m="flex size-10 items-center justify-center rounded-full bg-white/10 text-white backdrop-blur transition-colors outline-none hover:bg-white/20 focus-visible:ring-[3px] focus-visible:ring-white/50";return d(Wg,{open:r,onOpenChange:(g)=>!g&&a(null),children:S($g,{children:[d(Qg,{className:"fixed inset-0 z-[110] bg-black/90 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),S(Zg,{"aria-describedby":void 0,className:"fixed inset-0 z-[110] flex flex-col outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",onTouchStart:(g)=>{l.current=g.touches[0]?.clientX??null},onTouchEnd:(g)=>{let h=l.current,x=g.changedTouches[0]?.clientX;if(l.current=null,h===null||x===void 0)return;if(Math.abs(x-h)>=Pre)c(x<h?1:-1)},children:[S("div",{className:"flex shrink-0 items-center gap-3 px-3 pt-[max(0.75rem,env(safe-area-inset-top))] pb-2 text-white sm:px-4",children:[S(Jg,{className:"min-w-0 flex-1 truncate text-sm font-medium",children:[n?.alt??"Image",s&&t!==null&&S("span",{className:"ml-2 font-normal tabular-nums text-white/60",children:[t+1," / ",e.length]})]}),f&&n&&d("a",{href:n.src,target:"_blank",rel:"noopener noreferrer","aria-label":"Open original in new tab",title:"Open original",className:m,children:d(Xo,{className:"size-[18px]","aria-hidden":!0})}),d(ml,{"aria-label":"Close preview",className:m,children:d(Ft,{className:"size-5","aria-hidden":!0})})]}),S("div",{className:"relative flex min-h-0 flex-1 items-center justify-center px-3 pb-[max(1rem,env(safe-area-inset-bottom))] sm:px-16",onClick:(g)=>{if(g.target===g.currentTarget)a(null)},children:[n&&d("img",{src:n.src,alt:n.alt,className:"max-h-full max-w-full rounded-lg object-contain shadow-2xl animate-in fade-in-0 zoom-in-95 duration-200 select-none",draggable:!1},n.src),s&&S(se,{children:[d("button",{type:"button",onClick:()=>c(-1),"aria-label":"Previous image",className:N(m,"absolute top-1/2 left-3 hidden -translate-y-1/2 sm:flex"),children:d(Pi,{className:"size-5","aria-hidden":!0})}),d("button",{type:"button",onClick:()=>c(1),"aria-label":"Next image",className:N(m,"absolute top-1/2 right-3 hidden -translate-y-1/2 sm:flex"),children:d(Jt,{className:"size-5","aria-hidden":!0})})]})]}),s&&t!==null&&d("div",{className:"flex shrink-0 justify-center gap-1.5 pb-[max(1rem,env(safe-area-inset-bottom))] sm:hidden","aria-hidden":!0,children:e.map((g,h)=>d("span",{className:N("size-1.5 rounded-full transition-colors",h===t?"bg-white":"bg-white/30")},g.src))})]})]})})}var Ere="size-16 sm:size-[4.5rem]",Nre="h-16 w-48 sm:h-[4.5rem]";function ny({item:e}){if(e.previewUrl)return d("span",{className:N("block overflow-hidden rounded-lg border bg-muted",Ere),children:d("img",{src:e.previewUrl,alt:"",className:"size-full object-cover",draggable:!1})});return d(ry,{filename:e.file.name,mime:e.file.type,size:e.file.size,className:Nre})}function c7({items:e,onRemove:t,hiddenKeys:a,registerEl:r}){let[n,s]=A(null),l=e.filter((c)=>c.previewUrl!==null);return S(se,{children:[d("ul",{"aria-label":`${e.length} ${e.length===1?"attachment":"attachments"}`,className:"flex gap-2 overflow-x-auto px-1 pt-1 pb-2 [scrollbar-width:thin]",children:d(bo,{initial:!1,children:e.map((c)=>{let f=a?.has(c.key)??!1,m=c.previewUrl?l.indexOf(c):-1;return S(RC,{ref:(g)=>r?.(c.key,g),initial:f?!1:{opacity:0,scale:0.85},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0.85,transition:{duration:0.15}},transition:{type:"spring",stiffness:500,damping:32},className:N("relative shrink-0",f&&"invisible"),children:[c.previewUrl?d("button",{type:"button",onClick:()=>s(m),"aria-label":`Preview ${c.file.name}`,className:"block rounded-lg outline-none transition-opacity hover:opacity-90 focus-visible:ring-[3px] focus-visible:ring-ring/50",children:d(ny,{item:c})}):d("span",{title:c.file.name,className:"block",children:d(ny,{item:c})}),d("button",{type:"button",onClick:()=>t(c.key),"aria-label":`Remove ${c.file.name}`,title:"Remove",className:"absolute top-1 right-1 flex size-6 items-center justify-center rounded-full bg-black/60 text-white shadow-sm backdrop-blur-sm transition-colors outline-none hover:bg-black/80 focus-visible:ring-[3px] focus-visible:ring-white/60",children:d(Ft,{className:"size-3.5","aria-hidden":!0})})]},c.key)})})}),d(oy,{images:l.map((c)=>({src:c.previewUrl,alt:c.file.name})),index:n,onIndexChange:s})]})}function Dre(e){let t=Math.min(...e.map((s)=>s.left)),a=Math.min(...e.map((s)=>s.top)),r=Math.max(...e.map((s)=>s.right)),n=Math.max(...e.map((s)=>s.bottom));return{x:t,y:a,w:r-t,h:n-a}}var iy=0.12,sy=0.55,Ore=0.42,u7=3,d7=0.035,f7=0.12;function p7({from:e,items:t,box:a,onDone:r}){let n=Pm();U(()=>{if(n)r()},[n,r]);let s=(iy+Math.min((t.length-1)*d7,f7)+sy)*1000+60;if(U(()=>{let m=setTimeout(r,s);return()=>clearTimeout(m)},[r,s]),n||t.length===0)return null;let l=e.left+e.width/2,c=e.top+e.height/2,f=a?{x:a.left,y:a.top,w:a.width,h:a.height}:Dre(t.map((m)=>m.rect));return fn(S("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0 z-50",children:[d(ar,{className:"absolute top-0 left-0 border bg-popover shadow-2xl will-change-transform",initial:{x:e.left,y:e.top,width:e.width,height:e.height,borderRadius:28,opacity:1},animate:{x:f.x,y:f.y,width:f.w,height:f.h,borderRadius:12,opacity:0},transition:{default:{type:"spring",visualDuration:sy,bounce:0,delay:iy},opacity:{duration:0.18,delay:iy+sy*0.8,ease:"easeOut"}}}),t.map(({item:m,rect:g},h)=>{let x=Math.min(2.6,Math.max(1.3,Math.min(e.width,e.height)*Ore/Math.max(g.width,g.height))),v=Math.min(h,u7-1)-(Math.min(t.length,u7)-1)/2,w=v*26,C=Math.abs(v)*6,L=v*7,k=l+w-(g.left+g.width/2),I=c+C-(g.top+g.height/2)-e.height*0.06,T=iy+Math.min(h*d7,f7);return d(ar,{className:"absolute will-change-transform",style:{left:g.left,top:g.top,width:g.width,height:g.height,zIndex:t.length-h},initial:{x:k,y:I,scale:x,rotate:L,opacity:0},animate:{x:0,y:0,scale:1,rotate:0,opacity:1},transition:{default:{type:"spring",visualDuration:sy,bounce:0.12,delay:T},opacity:{duration:0.1}},children:d("div",{className:"size-full shadow-lg [&>*]:shadow-none",style:{borderRadius:10},children:d(ny,{item:m})})},m.key)})]}),document.body)}function m7({loading:e,error:t,suggestions:a,highlighted:r,onPick:n}){return d("div",{className:"absolute bottom-full left-0 right-0 z-10 mb-2 overflow-hidden rounded-xl border bg-popover shadow-md",children:S("div",{className:"max-h-56 overflow-y-auto",children:[e&&d("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Searching files…"}),!e&&t&&d("div",{className:"px-3 py-2 text-xs text-destructive",children:t}),a.map((s,l)=>d("button",{type:"button",className:`block w-full truncate px-3 py-2 text-left font-mono text-base ${l===r?"bg-accent text-accent-foreground":""}`,onMouseDown:(c)=>{c.preventDefault(),n(l)},children:s},s))]})})}function jI(e){if(e===void 0)return!0;return/[\s]/.test(e)||"()[]{}<>,'\"`".includes(e)}function _re(e,t){if(t<0||t>e.length)return null;let a=-1;for(let s=t-1;s>=0;s--){let l=e[s];if(l==="@"){a=s;break}if(jI(l))return null}if(a<0)return null;let r=e[a-1];if(r!==void 0&&!jI(r))return null;let n=e.slice(a+1,t);if(n.length>200)return null;return{query:n,start:a,end:t}}function zre(e,t,a){let r=`@${a}`,n=e[t.end],s=n!==void 0&&!jI(n)?" ":"";return e.slice(0,t.start)+r+s+e.slice(t.end)}function g7(e,t=(a)=>fetch(a)){let{endpoint:a,debounceMs:r=150,limit:n=8}=e,[s,l]=A(null),[c,f]=A([]),[m,g]=A(0),[h,x]=A(!1),[v,w]=A(null),C=B(""),L=B(0),k=j(()=>{f([]),l(null),g(0),w(null)},[]),I=j((P)=>{E.current=P},[]);U(()=>{if(!s)return;let P=new AbortController,O=setTimeout(()=>{x(!0),w(null),t(`${a}?q=${encodeURIComponent(s.query)}`).then(async(F)=>{if(!F.ok)throw Error(`HTTP ${F.status}`);let z=await F.json(),Y=Array.isArray(z.files)?z.files.filter((q)=>typeof q==="string"):[];f(Y.slice(0,n)),g(0)}).catch((F)=>{if(F.name==="AbortError")return;w("Failed to search files"),f([])}).finally(()=>{if(!P.signal.aborted)x(!1)})},r);return()=>{clearTimeout(O),P.abort()}},[s?.start,s?.query]);let T=j((P,O)=>{C.current=P,L.current=O;let F=_re(P,O);if(F)l(F);else k()},[k]),R=j((P)=>{if(!s||c[P]===void 0)return null;let O=zre(C.current,s,c[P]);return k(),O},[s,c,k]),E=B(null),M=j((P)=>{if(!s||c.length===0)return!1;if(P.key==="ArrowDown")return P.preventDefault(),g((O)=>(O+1)%c.length),!0;if(P.key==="ArrowUp")return P.preventDefault(),g((O)=>(O-1+c.length)%c.length),!0;if(P.key==="Enter"||P.key==="Tab"){P.preventDefault();let O=R(m);if(O!==null)E.current?.(O);return O!==null}if(P.key==="Escape")return P.preventDefault(),k(),!0;return!1},[s,c,m,R,k]);return{suggestions:c,highlighted:m,mention:s,loading:h,error:v,onInputChange:T,pick:R,handleKeyDown:M,setOnPick:I,close:k}}function h7(e){if(e.busy)return e.compact?"Responding…":"Model is responding…";if(!e.canInput)return"Session is not active";if(e.hasAttachments)return"Add a message…";return e.compact?"Type a message…":"Type a message… type @ for file references, or drop files here"}function x7(e,t){let a=[];for(let r of e.matchAll(/(^|\s)@([^\s]+)/g)){let n=r[2]??"";if(n.length>0&&(t.has(n)||n.includes("/")))a.push(n)}return a}function ly(e,t){let a=[],r=0;for(let n of e.matchAll(/(^|\s)@([^\s]+)/g)){let s=n[2]??"";if(s.length===0||!(t.has(s)||s.includes("/")))continue;let l=(n.index??0)+(n[1]?.length??0);if(l>r)a.push({kind:"text",text:e.slice(r,l)});a.push({kind:"mention",text:`@${s}`,path:s}),r=l+1+s.length}if(r<e.length)a.push({kind:"text",text:e.slice(r)});return a}function GI({ref:e,session:t,inputAllowed:a,busy:r,generating:n,wsStatus:s,send:l,reportError:c,onInterrupt:f}){let m=a8(),[g,h]=A(""),[x,v]=A([]),[w,C]=A(null),L=B(null),k=B(new Map),[I,T]=A(!1),[R,E]=A(!1),[M,P]=A(!1),[O,F]=A(t.agent),z=j0(t.projectId,t.id,F,t.agentType);U(()=>{if(M)z.load()},[M,z.load]);let Y=g7({endpoint:`/api/sessions/${t.id}/files`}),q=j((ue)=>{h(ue),requestAnimationFrame(()=>Q.current?.focus())},[]);U(()=>Y.setOnPick(q),[Y,q]);let G=B(null),Q=B(null),re=B(null),J=B(null),X=B(null),Z=m?88:192,te=j(()=>{let ue=X.current,K=J.current;if(ue===null||K===null)return;let ee=K.clientWidth-16-16-Z;E(ue.scrollWidth>ee)},[Z]),D=j((ue)=>{if(ue.style.height="auto",ue.value==="")return;ue.style.height=`${ue.scrollHeight}px`},[]);Vt(()=>{let ue=X.current;if(ue!==null)ue.textContent=g;if(te(),Q.current)D(Q.current)},[g,x.length,te,D]),U(()=>{let ue=J.current;if(ue===null||typeof ResizeObserver>"u")return;let K=new ResizeObserver(te);return K.observe(ue),()=>K.disconnect()},[te]);let Te=B(new Set);if(Y.suggestions.length>0)for(let ue of Y.suggestions)Te.current.add(ue);let Le=j((ue,K)=>{let ee=[];for(let W of ue){if(W.size===0){c(`"${W.name}" is empty or is a folder.`);continue}if(W.size>i7){c(`"${W.name}" exceeds the 20 MiB limit.`);continue}ee.push({key:crypto.randomUUID(),file:W,previewUrl:bh(W.type)?URL.createObjectURL(W):null})}if(ee.length===0)return;if(v((W)=>[...W,...ee]),K)C({from:K,keys:ee.map((W)=>W.key),targets:null,box:null})},[c]);Yh(e,()=>({addFiles:Le}),[Le]),Vt(()=>{if(!w||w.targets)return;k.current.get(w.keys[0]??"")?.scrollIntoView({block:"nearest",inline:"nearest"});let K=w.keys.flatMap((ee)=>{let W=x.find((Ee)=>Ee.key===ee),ve=k.current.get(ee);return W&&ve?[{item:W,rect:ve.getBoundingClientRect()}]:[]});if(K.length===0)C(null);else C({...w,targets:K,box:L.current?.getBoundingClientRect()??null})},[w,x]);let H=j((ue,K)=>{if(K)k.current.set(ue,K);else k.current.delete(ue)},[]),me=j(()=>C(null),[]),Ce=j((ue)=>{v((K)=>{let ee=K.find((W)=>W.key===ue);if(ee?.previewUrl)URL.revokeObjectURL(ee.previewUrl);return K.filter((W)=>W.key!==ue)})},[]),ge=a&&!I,He=ge&&(g.trim()!==""||x.length>0),ce=async(ue)=>{if(ue.preventDefault(),!ge||I)return;if(g.trim()===""&&x.length===0)return;T(!0);try{let K=x7(g,Te.current),ee=[];for(let W of x){let ve=await wO(`/api/sessions/${t.id}/uploads`,W.file);ee.push(ve.id)}l({type:"input",sessionId:t.id,text:g.trim(),files:K,images:ee});for(let W of x)if(W.previewUrl)URL.revokeObjectURL(W.previewUrl);v([]),h(""),Y.close()}catch(K){c(K instanceof we?K.message:vr("ERROR"))}finally{T(!1)}},he=j((ue)=>{let K=[...ue.clipboardData.files];if(K.length===0)return;ue.preventDefault(),Le(K)},[Le]);return d("footer",{className:"shrink-0 scrollbar-gutter-stable overflow-y-hidden px-3 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] sm:px-4",children:S("form",{ref:J,onSubmit:ce,className:N("relative mx-auto flex w-full flex-col",as),children:[d("span",{ref:X,"aria-hidden":!0,className:"pointer-events-none absolute top-0 invisible whitespace-pre text-base leading-6"}),S("div",{ref:L,className:N("rounded-xl border bg-card/80 p-2 shadow-sm transition-colors","focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/20",!ge&&"opacity-70"),children:[x.length>0&&d(c7,{items:x,onRemove:Ce,hiddenKeys:w?new Set(w.keys):void 0,registerEl:H}),w?.targets&&d(p7,{from:w.from,items:w.targets,box:w.box,onDone:me}),Y.mention!==null&&(Y.suggestions.length>0||Y.loading)&&d(m7,{loading:Y.loading,error:Y.error,suggestions:Y.suggestions,highlighted:Y.highlighted,onPick:(ue)=>{let K=Y.pick(ue);if(K!==null)q(K)}}),(()=>{let ue=R,K=ly(g,Te.current),ee=K.some((ye)=>ye.kind==="mention"),W=S("div",{className:N("relative min-w-0",ue?"w-full":"flex-1 self-center"),children:[ee&&S("div",{ref:re,"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden px-2 py-1.5 text-base leading-6 break-words whitespace-pre-wrap text-transparent",children:[K.map((ye,ft)=>ye.kind==="mention"?d("mark",{className:"rounded-[3px] bg-primary/10 text-transparent dark:bg-primary/15",children:ye.text},ft):d("span",{children:ye.text},ft)),""]}),d("textarea",{ref:Q,value:g,onChange:(ye)=>{h(ye.target.value),Y.onInputChange(ye.target.value,ye.target.selectionStart??ye.target.value.length)},onKeyDown:(ye)=>{if(Y.handleKeyDown(ye))return;if(ye.key==="Enter"&&!ye.shiftKey)ye.preventDefault(),ye.currentTarget.form?.requestSubmit()},onPaste:he,onScroll:(ye)=>{if(re.current)re.current.scrollTop=ye.currentTarget.scrollTop},onBlur:()=>Y.close(),placeholder:h7({busy:r,canInput:ge,compact:m,hasAttachments:x.length>0}),"aria-label":"Free-form input",disabled:!ge,rows:1,className:"relative block max-h-40 min-h-9 w-full min-w-0 resize-none border-0 bg-transparent px-2 py-1.5 text-base leading-6 break-words shadow-none outline-none placeholder:truncate placeholder:text-muted-foreground focus-visible:ring-0 disabled:cursor-not-allowed placeholder-shown:overflow-hidden"})]},"composer-textarea"),ve=n?d(ae,{type:"button",variant:"outline",size:"icon",onClick:f,disabled:s!=="connected","aria-label":"Stop response",title:"Stop the model response",className:"size-9 shrink-0 border-destructive/60 text-destructive hover:bg-destructive/10 hover:text-destructive",children:d(eo,{className:"size-3.5"})},"composer-stop"):(g.trim()!==""||x.length>0)&&d(ae,{type:"submit",size:"icon",disabled:!He,"aria-label":"Send message",className:"size-9 shrink-0",children:I?d(fe,{className:"size-4"}):d(Bn,{})},"composer-send");if(m){let ye=d(t8,{asChild:!0,children:d(ae,{type:"button",variant:"ghost",size:"icon",disabled:!ge,"aria-label":"More actions",title:"Attach files or change agent mode",className:"size-9 shrink-0 text-muted-foreground hover:text-foreground",children:d(hr,{"data-icon":"inline-start"})})},"composer-actions-trigger");return S(Rl,{open:M,onOpenChange:P,children:[d("div",{className:N("flex gap-1",ue?"flex-col":"items-center"),children:ue?S(se,{children:[W,S("div",{className:"flex items-center justify-between gap-1",children:[ye,ve]})]}):S(se,{children:[ye,W,ve]})}),d(n7,{disabled:!ge,onPickImage:()=>{P(!1),G.current?.click()},agentPicker:z,activeAgent:O,onPickAgent:(ft)=>{P(!1),z.pick(ft)}})]})}let Ee=d(ae,{type:"button",variant:"ghost",size:"icon",onClick:()=>G.current?.click(),disabled:!ge,"aria-label":"Attach files",title:"Attach files (or drop them here, max 20 MiB each)",className:"size-9 shrink-0 text-muted-foreground hover:text-foreground",children:d(Xc,{"data-icon":"inline-start"})}),xe=d(G0,{projectId:t.projectId,agentType:t.agentType,sessionId:t.id,agent:O,onChanged:F,disabled:!ge});if(ue)return S("div",{className:"flex flex-col gap-1",children:[W,S("div",{className:"flex items-center justify-between gap-1",children:[Ee,S("div",{className:"flex items-center gap-1",children:[xe,ve]})]})]});return S("div",{className:"flex items-center gap-1",children:[Ee,W,xe,ve]})})()]}),d("input",{ref:G,type:"file",multiple:!0,className:"sr-only",tabIndex:-1,"aria-hidden":!0,onChange:(ue)=>{let K=ue.target.files?[...ue.target.files]:[];Le(K),ue.target.value=""}})]})})}function v7({session:e,status:t,wsStatus:a,onStop:r,onStart:n,onRequestDelete:s,stopping:l,starting:c}){let{theme:f,toggleTheme:m}=Cf(),g=f==="dark",[h,x]=A(e.model);return d("header",{className:"shrink-0",children:S("div",{className:"flex w-full items-center gap-1 px-3 py-3 sm:gap-2 sm:px-4",children:[d(w0,{className:"size-9 shrink-0"}),S("div",{className:"flex min-w-0 flex-1 flex-col items-start",children:[d(q0,{projectId:e.projectId,agentType:e.agentType,sessionId:e.id,model:h,onChanged:x,variant:"heading"}),S("span",{className:"hidden truncate px-2 font-mono text-[11px] text-muted-foreground sm:block",children:[e.agentType," · ",e.id.slice(0,8),a!=="connected"&&` · ${h0(a)}`]})]}),S("span",{role:"status",className:"flex shrink-0 items-center gap-1.5 px-1 text-xs font-medium text-muted-foreground",title:`Session ${Io[t].toLowerCase()}`,children:[S("span",{className:"relative flex size-2","aria-hidden":!0,children:[t==="running"&&d("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-500/60 motion-reduce:hidden"}),d("span",{className:N("relative inline-flex size-2 rounded-full",$n[t])})]}),d("span",{className:"sr-only sm:not-sr-only",children:Io[t]})]}),t==="running"?S(ae,{type:"button",variant:"outline",size:"sm",onClick:r,disabled:l,"aria-label":"Stop session",className:"relative size-8 shrink-0 rounded-full px-0 after:absolute after:-inset-1 hover:border-destructive/40 hover:bg-destructive/10 hover:text-destructive sm:h-8 sm:w-auto sm:px-3 sm:after:hidden dark:hover:bg-destructive/15",children:[l?d(fe,{"data-icon":"inline-start"}):d(eo,{"data-icon":"inline-start",className:"size-3.5 fill-current"}),d("span",{className:"hidden sm:inline",children:l?"Stopping…":"Stop"})]}):S(ae,{type:"button",size:"sm",onClick:n,disabled:c,"aria-label":t==="crashed"?"Restart session":"Start session",className:"relative size-8 shrink-0 rounded-full px-0 after:absolute after:-inset-1 sm:h-8 sm:w-auto sm:px-3 sm:after:hidden",children:[c?d(fe,{"data-icon":"inline-start"}):d(Ni,{"data-icon":"inline-start",className:"size-3.5 fill-current"}),d("span",{className:"hidden sm:inline",children:c?"Starting…":t==="crashed"?"Restart":"Start"})]}),S(Zn,{children:[d(Jn,{asChild:!0,children:d(ae,{type:"button",variant:"ghost",size:"icon","aria-label":"Session actions",className:"size-10 shrink-0 sm:size-9",children:d(Dn,{})})}),S(ei,{align:"end",children:[S(Pa,{onSelect:m,children:[g?d($c,{}):d(Kc,{}),g?"Light mode":"Dark mode"]}),d(ti,{}),S(Pa,{variant:"destructive",onSelect:s,children:[d(pa,{}),"Delete session"]})]})]})]})})}function b7({defaultTagName:e,props:t,render:a,state:r={},stateAttributesMapping:n}){let s=cy(Bre(r,n),t);if(!a)return Be(e,s);if(typeof a=="function")return a(s,r);if(!Yt(a))return null;let l=a.props,c={...cy(s,l),ref:Ef(s.ref,l.ref)};return Ir(a,c)}function cy(...e){let t={};for(let a of e){if(!a)continue;let r=a;for(let n of Object.keys(r)){let s=r[n];if(s===void 0)continue;let l=t[n];n==="className"?t[n]=[l,s].filter(Boolean).join(" "):n==="style"?t[n]={...l,...s}:n==="ref"?t[n]=Ef(l,s):Ure(n)&&typeof l=="function"&&typeof s=="function"?t[n]=Fre(s,l):t[n]=s}}return t}function Bre(e,t){let a={};for(let r of Object.keys(e)){let n=e[r],s=t?.[r]?.(n);if(s){Object.assign(a,s);continue}if(r==="slot"){a["data-slot"]=n;continue}let l=`data-${String(r).replace(/[A-Z]/g,(c)=>`-${c.toLowerCase()}`)}`;typeof n=="boolean"?a[l]=n?"":void 0:n!=null&&(a[l]=String(n))}return a}function Fre(e,t){return function(a){e(a),a.defaultPrevented||t(a)}}function Ure(e){return/^on[A-Z]/.test(e)}function Ef(...e){let t=e.filter(Boolean);if(t.length!==0)return(a)=>{for(let r of t)typeof r=="function"?r(a):r&&(r.current=a)}}var Hre=8,Vre=64,jre=0,fy=0.5,Gre=180,qre=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),S7={start:!1,end:!1},Kre=[],py={currentAnchorId:null,visibleMessageIds:Kre};function Xre({content:e,scrollEdgeThreshold:t,spacer:a,viewport:r}){if(!r||!e)return S7;let n=KI({content:e,spacer:a,viewport:r});return{start:r.scrollTop>t,end:n-r.scrollTop-r.clientHeight>t}}function Yre({content:e,scrollMargin:t,scrollPreviousItemPeek:a,spacer:r,viewport:n,visibleMessageIds:s}){if(!e||!n)return py;let l=n.getBoundingClientRect(),c=l.top+t+a,f=typeof IntersectionObserver>"u",m=[],g=null;for(let h of yh(e,r)){let x=h.dataset.messageId;if(!x)continue;let v=h.dataset.scrollAnchor==="true",w=v||f?h.getBoundingClientRect():null;(f&&w?w.bottom>c&&w.top<l.bottom:s.has(x))&&m.push(x),v&&w&&w.top<=c+fy&&(g=x)}return m.length===0&&g===null?py:{currentAnchorId:g,visibleMessageIds:m}}function yh(e,t){return Array.from(e.children).filter((a)=>a instanceof HTMLElement&&a!==t)}function Wre(e,t){for(let a=t;a<e.length;a++){let r=e[a];if(r?.dataset.scrollAnchor==="true")return r}return null}function $re(e,t){for(let a of e)if(a.dataset.scrollAnchor==="true"&&!t.has(a))return a;return null}function Qre(e,t){let a=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor==="true"&&(a+=1,a>1))return!0;return!1}function Zre(e){for(let t=e.length-1;t>=0;t--){let a=e[t];if(a?.dataset.scrollAnchor==="true")return a}return null}function Jre({content:e,spacer:t,viewport:a}){let r=a.getBoundingClientRect();for(let n of yh(e,t)){if(!n.dataset.messageId)continue;let s=n.getBoundingClientRect();if(s.bottom>r.top&&s.top<r.bottom)return n}return null}function eoe({align:e,element:t,scrollMargin:a,spacer:r,viewport:n}){let s=k7(t,n),l=t.getBoundingClientRect().height,c=roe(r);if(e==="center"){let f=Math.max(0,n.clientHeight-c.start-c.end);return s-c.start-(f-l)/2-a}if(e==="end")return s-n.clientHeight+l+c.end+a;if(e==="nearest"){let f=s+l,m=n.scrollTop+c.start,g=n.scrollTop+n.clientHeight-c.end;return s>=m&&f<=g?n.scrollTop:s<m?s-c.start-a:f-n.clientHeight+c.end+a}return s-c.start-a}function k7(e,t){let a=e.getBoundingClientRect(),r=t.getBoundingClientRect();return a.top-r.top+t.scrollTop}function uy(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function toe({content:e,scrollTop:t,spacer:a,viewport:r}){let n=KI({content:e,spacer:a,viewport:r});return t+r.clientHeight-n}function KI({content:e,spacer:t,viewport:a}){let r=yh(e,t),n=C7(e),s=a.getBoundingClientRect(),l=a.scrollTop,c=n.start+n.end;for(let f of r){let m=f.getBoundingClientRect();c=Math.max(c,m.bottom-s.top+l+n.end)}return c}function aoe(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function C7(e){let t=window.getComputedStyle(e);return{end:qI(t.paddingBlockEnd||t.paddingBottom),start:qI(t.paddingBlockStart||t.paddingTop)}}function roe(e){let t=e?.parentElement;return t?C7(t):{end:0,start:0}}function ooe(e){if(!e)return 0;let t=window.getComputedStyle(e),a=t.rowGap==="normal"?t.gap:t.rowGap;return qI(a)}function qI(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function I7(e,t){let a=e,r=new Set;return{getSnapshot:()=>a,hasListeners:()=>r.size>0,setSnapshot:(n)=>{t(a,n)||(a=n,r.forEach((s)=>s()))},subscribe:(n,s,l)=>{let c=r.size===0;return r.add(n),c&&s?.(),()=>{r.delete(n),r.size===0&&l?.()}}}}function y7(e,t){return I7(e,t)}function noe(){return I7(py,soe)}function ioe(e,t){return e.start===t.start&&e.end===t.end}function soe(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((a,r)=>a===t.visibleMessageIds[r])}function loe({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:a,scrollMargin:r,scrollPreviousItemPeek:n}){let s=B(e),l=B(!1),c=B(null),f=B(!1),m=B(a),g=B(0),h=B(null),x=B(0),v=B(e?"following-bottom":"free-scrolling"),w=B(new Map),C=B(null),L=B(null),k=B(null),I=B(n),T=B(!0),R=B(null),E=B(r),M=B(null),P=B(0),O=B(0),F=B(null),z=B(null),Y=B(null),q=B(null),G=B(null),Q=B(null),re=B(null),J=B(null),X=B(null),Z=B(new Set),te=B(new WeakSet);return Y.current===null&&(Y.current=y7(t==="end"||t==="last-anchor",(D,Te)=>D===Te)),q.current===null&&(q.current=y7(S7,ioe)),X.current===null&&(X.current=noe()),s.current=e,m.current=a,E.current=r,I.current=n,{autoScrollRef:s,autoscrollingRef:l,autoscrollingTimeoutRef:G,streamingTurnRef:k,contentRef:c,defaultScrollPositionAppliedRef:f,firstItemRef:h,itemCountRef:g,lastScrollTopRef:x,messageElementsRef:w,modeRef:v,pendingScrollFrameRef:M,pendingScrollToMessageRef:C,prependRestoreRef:L,preserveScrollOnPrependRef:T,pendingDefaultScrollStore:Y.current,rootRef:R,scrollEdgeThresholdRef:m,scrollMarginRef:E,scrollPreviousItemPeekRef:I,spacerGapRef:P,spacerHeightRef:O,spacerRef:F,stateFrameRef:z,stateStore:q.current,viewportRef:Q,visibilityFrameRef:re,visibilityObserverRef:J,visibilityStore:X.current,visibleMessageIdsRef:Z,handledScrollAnchorsRef:te}}function L7(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function dy(e){e.defaultScrollPositionAppliedRef.current=!0,L7(e)}function coe({refs:e,commitScrollState:t,scheduleStateCommit:a,scheduleVisibilitySync:r}){let{streamingTurnRef:n,autoScrollRef:s,autoscrollingRef:l,autoscrollingTimeoutRef:c,contentRef:f,itemCountRef:m,messageElementsRef:g,modeRef:h,pendingScrollToMessageRef:x,prependRestoreRef:v,scrollMarginRef:w,scrollPreviousItemPeekRef:C,spacerGapRef:L,spacerHeightRef:k,spacerRef:I,viewportRef:T}=e,R=j((q)=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null),l.current!==q&&(l.current=q,t()),q&&(c.current=window.setTimeout(()=>{c.current=null,l.current=!1,t()},Gre))},[t]),E=j((q)=>{let G=I.current;if(!G)return;let Q=Math.max(0,Math.ceil(q));k.current!==Q&&(k.current=Q,G.hidden=Q===0,G.style.height=`${Q}px`,G.style.marginTop=Q>0?`${-L.current}px`:"")},[]),M=j((q,{behavior:G="auto",autoscrolling:Q=!1}={})=>{let re=T.current;if(!re)return;let J=Math.max(0,q);if(Math.abs(re.scrollTop-J)<=fy){re.scrollTop=J,t();return}Q&&R(!0),re.scrollTo({top:J,behavior:G}),a()},[t,a,R]),P=j(({behavior:q="auto"}={})=>T.current?(E(0),n.current=null,h.current="free-scrolling",M(0,{behavior:q}),r(),!0):!1,[r,M,E]),O=j(({behavior:q="auto"}={})=>{let G=T.current;return G?(E(0),n.current=null,h.current=s.current?"following-bottom":"free-scrolling",M(aoe(G),{autoscrolling:!0,behavior:q}),r(),!0):!1},[r,M,E]),F=j((q,{align:G="start",behavior:Q="auto",scrollMargin:re=w.current}={},{keepPreviousPeek:J=!1}={})=>{let X=f.current,Z=T.current;if(!X||!Z||!X.contains(q))return!1;let te=eoe({align:G,element:q,scrollMargin:J?re+C.current:re,spacer:I.current,viewport:Z}),D=toe({content:X,scrollTop:te,spacer:I.current,viewport:Z});return E(D),v.current={element:q,viewportTop:uy(q,Z)},h.current=J?"anchored-to-message":"settling-jump",n.current=J?q:null,M(te,{behavior:Q}),r(),!0},[r,M,E]),z=j(()=>{let q=n.current;return!q||!q.isConnected||h.current!=="anchored-to-message"?!1:F(q,{align:"start"},{keepPreviousPeek:!0})},[F]),Y=j((q,G)=>{let Q=g.current.get(q);return Q?(dy(e),F(Q,G)?(x.current=null,!0):(x.current={messageId:q,options:G},!0)):m.current===0?(x.current={messageId:q,options:G},dy(e),!0):!1},[F]);return{flushPendingScrollToMessage:j(()=>{let q=x.current;if(!q)return!1;let G=g.current.get(q.messageId);return!G||!F(G,q.options)?!1:(x.current=null,dy(e),!0)},[F]),reanchorToAnchoredMessage:z,scrollToElement:F,scrollToEnd:O,scrollToMessage:Y,scrollToStart:P}}function w7(e,t){return j((a)=>{e.current=a,a&&t()},[e,t])}function uoe({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:a=Hre,scrollPreviousItemPeek:r=Vre,scrollMargin:n=jre}){let s=loe({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:a,scrollMargin:n,scrollPreviousItemPeek:r}),{streamingTurnRef:l,autoScrollRef:c,autoscrollingRef:f,autoscrollingTimeoutRef:m,contentRef:g,defaultScrollPositionAppliedRef:h,firstItemRef:x,itemCountRef:v,lastScrollTopRef:w,messageElementsRef:C,modeRef:L,pendingScrollFrameRef:k,pendingScrollToMessageRef:I,prependRestoreRef:T,preserveScrollOnPrependRef:R,pendingDefaultScrollStore:E,rootRef:M,scrollEdgeThresholdRef:P,scrollMarginRef:O,scrollPreviousItemPeekRef:F,spacerGapRef:z,spacerHeightRef:Y,spacerRef:q,stateFrameRef:G,stateStore:Q,viewportRef:re,visibilityFrameRef:J,visibilityObserverRef:X,visibilityStore:Z,visibleMessageIdsRef:te,handledScrollAnchorsRef:D}=s,Te=B(t);Te.current!==t&&(Te.current=t,h.current=!1);let Le=j((Se)=>{let Ne=M.current,Qe=re.current,pt=[Se.start&&"start",Se.end&&"end"].filter(Boolean).join(" "),Hr=f.current;for(let aa of[Ne,Qe])aa&&(pt?aa.setAttribute("data-scrollable",pt):aa.removeAttribute("data-scrollable"),aa.toggleAttribute("data-autoscrolling",Hr))},[]),H=j((Se)=>{let Ne=re.current?.scrollTop??0,Qe=Ne<w.current-fy;w.current=Ne,c.current&&!Se.end&&L.current!=="settling-jump"&&L.current!=="anchored-to-message"?L.current="following-bottom":L.current==="following-bottom"&&Se.end&&Qe&&!f.current&&(L.current="free-scrolling")},[]),me=j(()=>{let Se=Xre({content:g.current,scrollEdgeThreshold:P.current,spacer:q.current,viewport:re.current});H(Se);let Ne=L.current==="following-bottom"?{...Se,end:!1}:Se;Le(Ne),Q.setSnapshot(Ne)},[H,Q,Le]),Ce=j(()=>{G.current===null&&(G.current=window.requestAnimationFrame(()=>{G.current=null,me()}))},[me]),ge=j(()=>{Z.hasListeners()&&J.current===null&&(J.current=window.requestAnimationFrame(()=>{J.current=null,Z.hasListeners()&&Z.setSnapshot(Yre({content:g.current,scrollMargin:O.current,scrollPreviousItemPeek:F.current,spacer:q.current,viewport:re.current,visibleMessageIds:te.current}))}))},[Z]),{flushPendingScrollToMessage:He,reanchorToAnchoredMessage:ce,scrollToElement:he,scrollToEnd:ue,scrollToMessage:K,scrollToStart:ee}=coe({refs:s,commitScrollState:me,scheduleStateCommit:Ce,scheduleVisibilitySync:ge}),W=j(()=>{let Se=T.current,Ne=re.current;if(!Se||!Ne||!Se.element.isConnected)return!1;let Qe=uy(Se.element,Ne)-Se.viewportTop;return Math.abs(Qe)<=fy?!1:(Ne.scrollTop+=Qe,Se.viewportTop=uy(Se.element,Ne),Ce(),ge(),!0)},[Ce,ge]),ve=j(()=>{let Se=g.current,Ne=re.current;if(!Se||!Ne){T.current=null;return}let Qe=Jre({content:Se,spacer:q.current,viewport:Ne});T.current=Qe?{element:Qe,viewportTop:uy(Qe,Ne)}:null},[]),Ee=j(()=>{k.current===null&&(k.current=window.requestAnimationFrame(()=>{k.current=null,He()&&ve()}))},[ve,He]),xe=j(()=>{if(!t||h.current||v.current===0)return!1;let Se=!1;if(t==="last-anchor"){let Ne=g.current,Qe=re.current,pt=Ne&&Qe?Zre(yh(Ne,q.current)):null;if(!Ne||!Qe||!pt)Se=ue({behavior:"auto"});else{let Hr=k7(pt,Qe);Se=KI({content:Ne,spacer:q.current,viewport:Qe})-Hr<=Qe.clientHeight?ue({behavior:"auto"}):he(pt,{align:"start"},{keepPreviousPeek:!0})}}else Se=t==="end"?ue({behavior:"auto"}):ee({behavior:"auto"});return Se?(dy(s),!0):!1},[t,he,ue,ee]),ye=j(()=>{let Se=g.current;if(!Se)return;let Ne=yh(Se,q.current),Qe=v.current,pt=x.current;v.current=Ne.length,x.current=Ne[0]??null,(()=>{if(He())return;if(Qe===0){if(xe()||Ne.length>0&&c.current&&ue({behavior:"auto"}))return;me(),ge();return}let Hr=pt?Ne.indexOf(pt):-1;if(R.current&&Hr>0){W();return}if(Ne.length>Qe){let aa=Wre(Ne,Qe);if(aa){if(c.current&&L.current==="following-bottom"&&Qre(Ne,Qe)){ue({behavior:"auto"});return}he(aa,{align:"start"},{keepPreviousPeek:!0}),D.current.add(aa);return}}if(Ne.length===Qe){let aa=$re(Ne,D.current);if(aa){he(aa,{align:"start"},{keepPreviousPeek:!0}),D.current.add(aa);return}}L.current==="following-bottom"&&c.current?ue({behavior:"auto"}):(me(),ge())})(),ve()},[xe,ve,me,He,W,ge,he,ue]),ft=j(()=>{if(L.current==="following-bottom"&&c.current){ue({behavior:"auto"});return}let Se=Y.current;if(ce()){c.current&&Se>0&&Y.current===0&&ue({behavior:"auto"});return}Ce(),ge()},[ce,Ce,ge,ue]),zt=j(()=>{let Se=re.current;if(!(!Se||!Z.hasListeners())){if(typeof IntersectionObserver>"u"){ge();return}X.current||(X.current=new IntersectionObserver((Ne)=>{for(let Qe of Ne){let pt=Qe.target.dataset.messageId;pt&&(Qe.isIntersecting?te.current.add(pt):te.current.delete(pt))}ge()},{root:Se,rootMargin:`${-(O.current+F.current)}px 0px 0px 0px`,threshold:[0,0.01,0.5,1]})),C.current.forEach((Ne)=>{X.current?.observe(Ne)}),ge()}},[ge,Z]),$a=j(()=>{J.current!==null&&(window.cancelAnimationFrame(J.current),J.current=null),X.current?.disconnect(),X.current=null,te.current.clear(),Z.setSnapshot(py)},[Z]),Mo=j((Se,Ne,Qe)=>{if(Ne){C.current.set(Se,Ne),X.current?.observe(Ne),ge(),I.current?.messageId===Se&&Ee();return}Qe&&C.current.get(Se)===Qe&&(C.current.delete(Se),te.current.delete(Se),X.current?.unobserve(Qe),ge())},[Ee,ge]),Dt=j(()=>{(L.current==="following-bottom"||L.current==="anchored-to-message"||L.current==="settling-jump")&&(l.current=null,L.current="free-scrolling")},[]),jl=j(()=>Le(Q.getSnapshot()),[Q,Le]),Po=w7(M,jl),Gu=w7(re,jl),oe=j((Se)=>{g.current=Se},[]),be=j((Se)=>{q.current=Se,z.current=ooe(Se?.parentElement??null)},[]),Ve=j(()=>{me(),ge(),ve()},[ve,me,ge]),$e=de(()=>({handleContentChange:ye,handleResize:ft,observeVisibility:zt,pendingDefaultScrollStore:E,preserveScrollOnPrependRef:R,scrollToEnd:ue,scrollToMessage:K,scrollToStart:ee,setContentElement:oe,setRootElement:Po,setSpacerElement:be,setViewportElement:Gu,stateStore:Q,syncAfterScroll:Ve,unobserveVisibility:$a,userScrollIntent:Dt,viewportRef:re,visibilityStore:Z}),[ye,ft,zt,E,ue,K,ee,oe,Po,be,Gu,Q,Ve,$a,Dt,Z]);return Vt(()=>{xe()||v.current===0&&L7(s)},[xe]),U(()=>()=>{G.current!==null&&(window.cancelAnimationFrame(G.current),G.current=null),J.current!==null&&(window.cancelAnimationFrame(J.current),J.current=null),m.current!==null&&(window.clearTimeout(m.current),m.current=null),k.current!==null&&(window.cancelAnimationFrame(k.current),k.current=null),X.current?.disconnect(),X.current=null},[]),Vt(()=>{if(e&&L.current==="following-bottom"&&v.current>0){ue({behavior:"auto"});return}me()},[e,me,ue]),{context:$e,registerMessage:Mo}}function doe(e){let t=B(e);return t.current=e,t}var T7=ht(null),R7=ht(null);function Nf(){let e=We(T7);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function foe(){let e=We(R7);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}function XI(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:a}=Nf();return de(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:a}),[e,t,a])}function poe({autoScroll:e=!1,children:t,defaultScrollPosition:a="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:s}){let{context:l,registerMessage:c}=uoe({autoScroll:e,defaultScrollPosition:a,scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:s});return d(T7.Provider,{value:l,children:d(R7.Provider,{value:c,children:t})})}function A7(){let{pendingDefaultScrollStore:e}=Nf();return Eo(e.subscribe,e.getSnapshot,e.getSnapshot)}function moe({children:e,...t}){let{setRootElement:a}=Nf(),r=A7();return d("div",{ref:a,...t,...r?{"data-pending-scroll":""}:null,children:e})}function goe({"aria-label":e,children:t,onKeyDown:a,onScroll:r,onTouchMove:n,onWheel:s,preserveScrollOnPrepend:l=!0,ref:c,role:f,tabIndex:m,...g}){let{handleResize:h,preserveScrollOnPrependRef:x,setViewportElement:v,syncAfterScroll:w,userScrollIntent:C,viewportRef:L}=Nf(),k=A7();x.current=l;let I=j((P)=>{v(P),Ef(c)?.(P)},[c,v]);function T(P){w(),r?.(P)}function R(P){C(),s?.(P)}function E(P){C(),n?.(P)}function M(P){qre.has(P.key)&&C(),a?.(P)}return U(()=>{let P=L.current;if(!P||typeof ResizeObserver>"u")return;let O=0,F=new ResizeObserver(()=>{window.cancelAnimationFrame(O),O=window.requestAnimationFrame(h)});return F.observe(P),()=>{window.cancelAnimationFrame(O),F.disconnect()}},[h,L]),d("div",{ref:I,role:f??"region","aria-label":e??"Messages",tabIndex:m??0,onKeyDown:M,onScroll:T,onTouchMove:E,onWheel:R,...g,...k?{"data-pending-scroll":""}:null,children:t})}function hoe({"aria-relevant":e,children:t,ref:a,role:r,spacerClassName:n,...s}){let{handleContentChange:l,handleResize:c,setContentElement:f,setSpacerElement:m}=Nf(),g=B(null),h=j((x)=>{g.current=x,f(x),Ef(a)?.(x)},[a,f]);return Vt(()=>{let x=g.current;if(!x||(l(),typeof MutationObserver>"u"))return;let v=new MutationObserver(()=>{l()});return v.observe(x,{childList:!0}),()=>v.disconnect()},[l]),U(()=>{let x=g.current;if(!x||typeof ResizeObserver>"u")return;let v=0,w=new ResizeObserver(()=>{window.cancelAnimationFrame(v),v=window.requestAnimationFrame(c)});return w.observe(x),()=>{window.cancelAnimationFrame(v),w.disconnect()}},[c]),S("div",{ref:h,role:r??"log","aria-relevant":e??"additions",...s,children:[t,d("div",{ref:m,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:n})]})}function xoe({messageId:e,ref:t,scrollAnchor:a=!1,...r}){let n=foe(),s=B(null),l=j((c)=>{let f=s.current;s.current=c,e&&n(e,c,f),Ef(t)?.(c)},[e,t,n]);return d("div",{ref:l,"data-message-id":e,"data-scroll-anchor":a?"true":"false",...r})}function voe({behavior:e="smooth",children:t,direction:a="end",onClick:r,render:n,tabIndex:s,type:l="button",...c}){let{scrollToEnd:f,scrollToStart:m,stateStore:g}=Nf(),h=doe(r),x=j((L)=>g.subscribe(L),[g]),v=j(()=>{let L=g.getSnapshot();return a==="start"?L.start:L.end},[a,g]),w=Eo(x,v,v),C=j((L)=>{w&&(h.current?.(L),L.defaultPrevented||(L.currentTarget.blur(),a==="start"?m({behavior:e}):f({behavior:e})))},[e,a,w,h,f,m]);return b7({defaultTagName:"button",props:cy({type:l,inert:!w,tabIndex:w?s:-1,children:t??S("span",{children:["Scroll to ",a]}),onClick:C},c),render:n,state:{active:w,direction:a},stateAttributesMapping:{active:(L)=>({"data-active":L?"true":"false"})}})}var Lu={Provider:poe,Root:moe,Viewport:goe,Content:hoe,Item:xoe,Button:voe};function M7(e){return d(Lu.Provider,{...e})}function P7({className:e,...t}){return d(Lu.Root,{"data-slot":"message-scroller",className:N("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function E7({className:e,...t}){return d(Lu.Viewport,{"data-slot":"message-scroller-viewport",className:N("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-none",e),...t})}function N7({className:e,...t}){return d(Lu.Content,{"data-slot":"message-scroller-content",className:N("flex h-max min-h-full flex-col gap-8",e),...t})}function YI({className:e,scrollAnchor:t=!1,...a}){return d(Lu.Item,{"data-slot":"message-scroller-item",scrollAnchor:t,className:N("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...a})}function D7({direction:e="end",className:t,children:a,render:r,variant:n="secondary",size:s="icon-sm",...l}){return d(Lu.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":n,"data-size":s,direction:e,className:N("absolute left-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full data-[direction=start]:[&_svg]:rotate-180",t),render:r??d(ae,{variant:n,size:s}),...l,children:a??S(se,{children:[d(Nm,{}),d("span",{className:"sr-only",children:e==="end"?"Scroll to end":"Scroll to start"})]})})}function Et(){}function my(){}function b(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var boe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yoe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,woe={};function gy(e,t){return((t||woe).jsx?yoe:boe).test(e)}var Soe=/[ \t\n\f\r]/g;function o(e){return typeof e==="object"?e.type==="text"?O7(e.value):!1:O7(e)}function O7(e){return e.replace(Soe,"")===""}class Dl{constructor(e,t,a){if(this.normal=t,this.property=e,a)this.space=a}}Dl.prototype.normal={};Dl.prototype.property={};Dl.prototype.space=void 0;function WI(e,t){let a={},r={};for(let n of e)Object.assign(a,n.property),Object.assign(r,n.normal);return new Dl(a,r,t)}function wh(e){return e.toLowerCase()}class Wa{constructor(e,t){this.attribute=t,this.property=e}}Wa.prototype.attribute="";Wa.prototype.booleanish=!1;Wa.prototype.boolean=!1;Wa.prototype.commaOrSpaceSeparated=!1;Wa.prototype.commaSeparated=!1;Wa.prototype.defined=!1;Wa.prototype.mustUseProperty=!1;Wa.prototype.number=!1;Wa.prototype.overloadedBoolean=!1;Wa.prototype.property="";Wa.prototype.spaceSeparated=!1;Wa.prototype.space=void 0;var Sh={};sR(Sh,{boolean:()=>Ge,booleanish:()=>Kt,commaOrSpaceSeparated:()=>Ur,commaSeparated:()=>rs,number:()=>pe,overloadedBoolean:()=>hy,spaceSeparated:()=>gt});var koe=0,Ge=Tu(),Kt=Tu(),hy=Tu(),pe=Tu(),gt=Tu(),rs=Tu(),Ur=Tu();function Tu(){return 2**++koe}var $I=Object.keys(Sh);class Df extends Wa{constructor(e,t,a,r){let n=-1;super(e,t);if(_7(this,"space",r),typeof a==="number")while(++n<$I.length){let s=$I[n];_7(this,$I[n],(a&Sh[s])===Sh[s])}}}Df.prototype.defined=!0;function _7(e,t,a){if(a)e[t]=a}function Ro(e){let t={},a={};for(let[r,n]of Object.entries(e.properties)){let s=new Df(r,e.transform(e.attributes||{},r),n,e.space);if(e.mustUseProperty&&e.mustUseProperty.includes(r))s.mustUseProperty=!0;t[r]=s,a[wh(r)]=r,a[wh(s.attribute)]=r}return new Dl(t,a,e.space)}var QI=Ro({properties:{ariaActiveDescendant:null,ariaAtomic:Kt,ariaAutoComplete:null,ariaBusy:Kt,ariaChecked:Kt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Kt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Kt,ariaFlowTo:gt,ariaGrabbed:Kt,ariaHasPopup:null,ariaHidden:Kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:pe,ariaLive:null,ariaModal:Kt,ariaMultiLine:Kt,ariaMultiSelectable:Kt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Kt,ariaReadOnly:Kt,ariaRelevant:null,ariaRequired:Kt,ariaRoleDescription:gt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Kt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function xy(e,t){return t in e?e[t]:t}function vy(e,t){return xy(e,t.toLowerCase())}var z7=Ro({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rs,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alpha:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:gt,autoFocus:Ge,autoPlay:Ge,blocking:gt,capture:null,charSet:null,checked:Ge,cite:null,className:gt,closedBy:null,colorSpace:null,cols:pe,colSpan:pe,command:null,commandFor:null,content:null,contentEditable:Kt,controls:Ge,controlsList:gt,coords:pe|rs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:hy,draggable:Kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:gt,height:pe,hidden:hy,high:pe,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:gt,itemRef:gt,itemScope:Ge,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ge,optimum:pe,pattern:null,ping:gt,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:gt,required:Ge,reversed:Ge,rows:pe,rowSpan:pe,sandbox:gt,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootCustomElementRegistry:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shadowRootSerializable:Ge,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:Kt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Kt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ge,disablePictureInPicture:Ge,disableRemotePlayback:Ge,exportParts:rs,part:gt,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:vy});var B7=Ro({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ur,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:gt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:rs,g2:rs,glyphName:rs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:Ur,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ur,rev:Ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ur,requiredFeatures:Ur,requiredFonts:Ur,requiredFormats:Ur,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:Ur,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ur,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ur,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:xy});var ZI=Ro({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var JI=Ro({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:vy});var eL=Ro({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var tL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var Coe=/[A-Z]/g,F7=/-[a-z]/g,Ioe=/^data[-\w.:]+$/i;function p(e,t){let a=wh(t),r=t,n=Wa;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Ioe.test(t)){if(t.charAt(4)==="-"){let s=t.slice(5).replace(F7,Toe);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{let s=t.slice(4);if(!F7.test(s)){let l=s.replace(Coe,Loe);if(l.charAt(0)!=="-")l="-"+l;t="data"+l}}n=Df}return new n(r,t)}function Loe(e){return"-"+e.toLowerCase()}function Toe(e){return e.charAt(1).toUpperCase()}var _=WI([QI,z7,ZI,JI,eL],"html"),i=WI([QI,B7,ZI,JI,eL],"svg");function y(e){return e.join(" ").trim()}var aU=iR(Z7(),1);var by=J7("end"),Of=J7("start");function J7(e){return t;function t(a){let r=a&&a.position&&a.position[e]||{};if(typeof r.line==="number"&&r.line>0&&typeof r.column==="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset==="number"&&r.offset>-1?r.offset:void 0}}}function oL(e){let t=Of(e),a=by(e);if(t&&a)return{start:t,end:a}}function Ol(e){if(!e||typeof e!=="object")return"";if("position"in e||"type"in e)return eU(e.position);if("start"in e||"end"in e)return eU(e);if("line"in e||"column"in e)return nL(e);return""}function nL(e){return tU(e&&e.line)+":"+tU(e&&e.column)}function eU(e){return nL(e&&e.start)+"-"+nL(e&&e.end)}function tU(e){return e&&typeof e==="number"?e:1}class ca extends Error{constructor(e,t,a){super();if(typeof t==="string")a=t,t=void 0;let r="",n={},s=!1;if(t)if("line"in t&&"column"in t)n={place:t};else if("start"in t&&"end"in t)n={place:t};else if("type"in t)n={ancestors:[t],place:t.position};else n={...t};if(typeof e==="string")r=e;else if(!n.cause&&e)s=!0,r=e.message,n.cause=e;if(!n.ruleId&&!n.source&&typeof a==="string"){let c=a.indexOf(":");if(c===-1)n.ruleId=a;else n.source=a.slice(0,c),n.ruleId=a.slice(c+1)}if(!n.place&&n.ancestors&&n.ancestors){let c=n.ancestors[n.ancestors.length-1];if(c)n.place=c.position}let l=n.place&&"start"in n.place?n.place.start:n.place;this.ancestors=n.ancestors||void 0,this.cause=n.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Ol(n.place)||"1:1",this.place=n.place||void 0,this.reason=this.message,this.ruleId=n.ruleId||void 0,this.source=n.source||void 0,this.stack=s&&n.cause&&typeof n.cause.stack==="string"?n.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ca.prototype.file="";ca.prototype.name="";ca.prototype.reason="";ca.prototype.message="";ca.prototype.stack="";ca.prototype.column=void 0;ca.prototype.line=void 0;ca.prototype.ancestors=void 0;ca.prototype.cause=void 0;ca.prototype.fatal=void 0;ca.prototype.place=void 0;ca.prototype.ruleId=void 0;ca.prototype.source=void 0;var iL={}.hasOwnProperty,Joe=new Map,ene=/[A-Z]/g,tne=new Set(["table","tbody","thead","tfoot","tr"]),ane=new Set(["td","th"]),rU="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sL(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");r=une(a,t.jsxDEV)}else{if(typeof t.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");r=cne(a,t.jsx,t.jsxs)}let n={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?i:_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=oU(n,e,void 0);if(s&&typeof s!=="string")return s;return n.create(e,n.Fragment,{children:s||void 0},void 0)}function oU(e,t,a){if(t.type==="element")return rne(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return one(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ine(e,t,a);if(t.type==="mdxjsEsm")return nne(e,t);if(t.type==="root")return sne(e,t,a);if(t.type==="text")return lne(e,t)}function rne(e,t,a){let r=e.schema,n=r;if(t.tagName.toLowerCase()==="svg"&&r.space==="html")n=i,e.schema=n;e.ancestors.push(t);let s=iU(e,t.tagName,!1),l=dne(e,t),c=cL(e,t);if(tne.has(t.tagName))c=c.filter(function(f){return typeof f==="string"?!o(f):!0});return nU(e,l,s,t),lL(l,c),e.ancestors.pop(),e.schema=r,e.create(t,s,l,a)}function one(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return Et(r.type==="ExpressionStatement"),e.evaluater.evaluateExpression(r.expression)}Ch(e,t.position)}function nne(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ch(e,t.position)}function ine(e,t,a){let r=e.schema,n=r;if(t.name==="svg"&&r.space==="html")n=i,e.schema=n;e.ancestors.push(t);let s=t.name===null?e.Fragment:iU(e,t.name,!0),l=fne(e,t),c=cL(e,t);return nU(e,l,s,t),lL(l,c),e.ancestors.pop(),e.schema=r,e.create(t,s,l,a)}function sne(e,t,a){let r={};return lL(r,cL(e,t)),e.create(t,e.Fragment,r,a)}function lne(e,t){return t.value}function nU(e,t,a,r){if(typeof a!=="string"&&a!==e.Fragment&&e.passNode)t.node=r}function lL(e,t){if(t.length>0){let a=t.length>1?t:t[0];if(a)e.children=a}}function cne(e,t,a){return r;function r(n,s,l,c){let m=Array.isArray(l.children)?a:t;return c?m(s,l,c):m(s,l)}}function une(e,t){return a;function a(r,n,s,l){let c=Array.isArray(s.children),f=Of(r);return t(n,s,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function dne(e,t){let a={},r,n;for(n in t.properties)if(n!=="children"&&iL.call(t.properties,n)){let s=pne(e,n,t.properties[n]);if(s){let[l,c]=s;if(e.tableCellAlignToStyle&&l==="align"&&typeof c==="string"&&ane.has(t.tagName))r=c;else a[l]=c}}if(r){let s=a.style||(a.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function fne(e,t){let a={};for(let r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){let s=r.data.estree.body[0];Et(s.type==="ExpressionStatement");let l=s.expression;Et(l.type==="ObjectExpression");let c=l.properties[0];Et(c.type==="SpreadElement"),Object.assign(a,e.evaluater.evaluateExpression(c.argument))}else Ch(e,t.position);else{let n=r.name,s;if(r.value&&typeof r.value==="object")if(r.value.data&&r.value.data.estree&&e.evaluater){let c=r.value.data.estree.body[0];Et(c.type==="ExpressionStatement"),s=e.evaluater.evaluateExpression(c.expression)}else Ch(e,t.position);else s=r.value===null?!0:r.value;a[n]=s}return a}function cL(e,t){let a=[],r=-1,n=e.passKeys?new Map:Joe;while(++r<t.children.length){let s=t.children[r],l;if(e.passKeys){let f=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(f){let m=n.get(f)||0;l=f+"-"+m,n.set(f,m+1)}}let c=oU(e,s,l);if(c!==void 0)a.push(c)}return a}function pne(e,t,a){let r=p(e.schema,t);if(a===null||a===void 0||typeof a==="number"&&Number.isNaN(a))return;if(Array.isArray(a))a=r.commaSeparated?b(a):y(a);if(r.property==="style"){let n=typeof a==="object"?a:mne(e,String(a));if(e.stylePropertyNameCase==="css")n=gne(n);return["style",n]}return[e.elementAttributeNameCase==="react"&&r.space?tL[r.property]||r.property:r.attribute,a]}function mne(e,t){try{return aU.default(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let r=a,n=new ca("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=rU+"#cannot-parse-style-attribute",n}}function iU(e,t,a){let r;if(!a)r={type:"Literal",value:t};else if(t.includes(".")){let n=t.split("."),s=-1,l;while(++s<n.length){let c=gy(n[s])?{type:"Identifier",name:n[s]}:{type:"Literal",value:n[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:Boolean(s&&c.type==="Literal"),optional:!1}:c}Et(l,"always a result"),r=l}else r=gy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){let n=r.value;return iL.call(e.components,n)?e.components[n]:n}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ch(e)}function Ch(e,t){let a=new ca("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=rU+"#cannot-handle-mdx-estrees-without-createevaluater",a}function gne(e){let t={},a;for(a in e)if(iL.call(e,a))t[hne(a)]=e[a];return t}function hne(e){let t=e.replace(ene,xne);if(t.slice(0,3)==="ms-")t="-"+t;return t}function xne(e){return"-"+e.toLowerCase()}var Ih={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var vne={};function Au(e,t){let a=t||vne,r=typeof a.includeImageAlt==="boolean"?a.includeImageAlt:!0,n=typeof a.includeHtml==="boolean"?a.includeHtml:!0;return lU(e,r,n)}function lU(e,t,a){if(bne(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return sU(e.children,t,a)}if(Array.isArray(e))return sU(e,t,a);return""}function sU(e,t,a){let r=[],n=-1;while(++n<e.length)r[n]=lU(e[n],t,a);return r.join("")}function bne(e){return Boolean(e&&typeof e==="object")}var cU=document.createElement("i");function _f(e){let t="&"+e+";";cU.innerHTML=t;let a=cU.textContent;if(a.charCodeAt(a.length-1)===59&&e!=="semi")return!1;return a===t?!1:a}function ta(e,t,a,r){let n=e.length,s=0,l;if(t<0)t=-t>n?0:n+t;else t=t>n?n:t;if(a=a>0?a:0,r.length<1e4)l=Array.from(r),l.unshift(t,a),e.splice(...l);else{if(a)e.splice(t,a);while(s<r.length)l=r.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}}function Sr(e,t){if(e.length>0)return ta(e,e.length,0,t),e;return t}var uU={}.hasOwnProperty;function yy(e){let t={},a=-1;while(++a<e.length)yne(t,e[a]);return t}function yne(e,t){let a;for(a in t){let n=(uU.call(e,a)?e[a]:void 0)||(e[a]={}),s=t[a],l;if(s)for(l in s){if(!uU.call(n,l))n[l]=[];let c=s[l];wne(n[l],Array.isArray(c)?c:c?[c]:[])}}}function wne(e,t){let a=-1,r=[];while(++a<t.length)(t[a].add==="after"?e:r).push(t[a]);ta(e,0,0,r)}function wy(e,t){let a=Number.parseInt(e,t);if(a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111)return"�";return String.fromCodePoint(a)}function lr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var va=_l(/[A-Za-z]/),Xt=_l(/[\dA-Za-z]/),dU=_l(/[#-'*+\--9=?A-Z^-~]/);function Mu(e){return e!==null&&(e<32||e===127)}var Lh=_l(/\d/),fU=_l(/[\dA-Fa-f]/),pU=_l(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function tt(e){return e!==null&&(e<0||e===32)}function Ue(e){return e===-2||e===-1||e===32}var Pu=_l(/\p{P}|\p{S}/u),oi=_l(/\s/);function _l(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Ao(e){let t=[],a=-1,r=0,n=0;while(++a<e.length){let s=e.charCodeAt(a),l="";if(s===37&&Xt(e.charCodeAt(a+1))&&Xt(e.charCodeAt(a+2)))n=2;else if(s<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s)))l=String.fromCharCode(s)}else if(s>55295&&s<57344){let c=e.charCodeAt(a+1);if(s<56320&&c>56319&&c<57344)l=String.fromCharCode(s,c),n=1;else l="�"}else l=String.fromCharCode(s);if(l)t.push(e.slice(r,a),encodeURIComponent(l)),r=a+n+1,l="";if(n)a+=n,n=0}return t.join("")+e.slice(r)}function ze(e,t,a,r){let n=r?r-1:Number.POSITIVE_INFINITY,s=0;return l;function l(f){if(Ue(f))return e.enter(a),c(f);return t(f)}function c(f){if(Ue(f)&&s++<n)return e.consume(f),c;return e.exit(a),t(f)}}var mU={tokenize:Sne};function Sne(e){let t=e.attempt(this.parser.constructs.contentInitial,r,n),a;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ze(e,t,"linePrefix")}function n(c){return e.enter("paragraph"),s(c)}function s(c){let f=e.enter("chunkText",{contentType:"text",previous:a});if(a)a.next=f;return a=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}if(Ie(c))return e.consume(c),e.exit("chunkText"),s;return e.consume(c),l}}var hU={tokenize:kne},gU={tokenize:Cne};function kne(e){let t=this,a=[],r=0,n,s,l;return c;function c(T){if(r<a.length){let R=a[r];return t.containerState=R[1],e.attempt(R[0].continuation,f,m)(T)}return m(T)}function f(T){if(r++,t.containerState._closeFlow){if(t.containerState._closeFlow=void 0,n)I();let R=t.events.length,E=R,M;while(E--)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){M=t.events[E][1].end;break}k(r);let P=R;while(P<t.events.length)t.events[P][1].end={...M},P++;return ta(t.events,E+1,0,t.events.slice(R)),t.events.length=P,m(T)}return c(T)}function m(T){if(r===a.length){if(!n)return x(T);if(n.currentConstruct&&n.currentConstruct.concrete)return w(T);t.interrupt=Boolean(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gU,g,h)(T)}function g(T){if(n)I();return k(r),x(T)}function h(T){return t.parser.lazy[t.now().line]=r!==a.length,l=t.now().offset,w(T)}function x(T){return t.containerState={},e.attempt(gU,v,w)(T)}function v(T){return r++,a.push([t.currentConstruct,t.containerState]),x(T)}function w(T){if(T===null){if(n)I();k(0),e.consume(T);return}return n=n||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:n,contentType:"flow",previous:s}),C(T)}function C(T){if(T===null){L(e.exit("chunkFlow"),!0),k(0),e.consume(T);return}if(Ie(T))return e.consume(T),L(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c;return e.consume(T),C}function L(T,R){let E=t.sliceStream(T);if(R)E.push(null);if(T.previous=s,s)s.next=T;if(s=T,n.defineSkip(T.start),n.write(E),t.parser.lazy[T.start.line]){let M=n.events.length;while(M--)if(n.events[M][1].start.offset<l&&(!n.events[M][1].end||n.events[M][1].end.offset>l))return;let P=t.events.length,O=P,F,z;while(O--)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(F){z=t.events[O][1].end;break}F=!0}k(r),M=P;while(M<t.events.length)t.events[M][1].end={...z},M++;ta(t.events,O+1,0,t.events.slice(P)),t.events.length=M}}function k(T){let R=a.length;while(R-- >T){let E=a[R];t.containerState=E[1],E[0].exit.call(t,e)}a.length=T}function I(){n.write([null]),s=void 0,n=void 0,t.containerState._closeFlow=void 0}}function Cne(e,t,a){return ze(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function os(e){if(e===null||tt(e)||oi(e))return 1;if(Pu(e))return 2}function zl(e,t,a){let r=[],n=-1;while(++n<e.length){let s=e[n].resolveAll;if(s&&!r.includes(s))t=s(t,a),r.push(s)}return t}var Th={name:"attention",resolveAll:Ine,tokenize:Lne};function Ine(e,t){let a=-1,r,n,s,l,c,f,m,g;while(++a<e.length)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){r=a;while(r--)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let h={...e[r][1].end},x={...e[a][1].start};if(xU(h,-f),xU(x,f),l={type:f>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:x},s={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},n={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[a][1].start={...c.end},m=[],e[r][1].end.offset-e[r][1].start.offset)m=Sr(m,[["enter",e[r][1],t],["exit",e[r][1],t]]);if(m=Sr(m,[["enter",n,t],["enter",l,t],["exit",l,t],["enter",s,t]]),m=Sr(m,zl(t.parser.constructs.insideSpan.null,e.slice(r+1,a),t)),m=Sr(m,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",n,t]]),e[a][1].end.offset-e[a][1].start.offset)g=2,m=Sr(m,[["enter",e[a][1],t],["exit",e[a][1],t]]);else g=0;ta(e,r-1,a-r+3,m),a=r+m.length-g-2;break}}a=-1;while(++a<e.length)if(e[a][1].type==="attentionSequence")e[a][1].type="data";return e}function Lne(e,t){let a=this.parser.constructs.attentionMarkers.null,r=this.previous,n=os(r),s;return l;function l(f){return s=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===s)return e.consume(f),c;let m=e.exit("attentionSequence"),g=os(f),h=!g||g===2&&n||a.includes(f),x=!n||n===2&&g||a.includes(r);return m._open=Boolean(s===42?h:h&&(n||!x)),m._close=Boolean(s===42?x:x&&(g||!h)),t(f)}}function xU(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var uL={name:"autolink",tokenize:Tne};function Tne(e,t,a){let r=0;return n;function n(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(v){if(va(v))return e.consume(v),l;if(v===64)return a(v);return m(v)}function l(v){if(v===43||v===45||v===46||Xt(v))return r=1,c(v);return m(v)}function c(v){if(v===58)return e.consume(v),r=0,f;if((v===43||v===45||v===46||Xt(v))&&r++<32)return e.consume(v),c;return r=0,m(v)}function f(v){if(v===62)return e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t;if(v===null||v===32||v===60||Mu(v))return a(v);return e.consume(v),f}function m(v){if(v===64)return e.consume(v),g;if(dU(v))return e.consume(v),m;return a(v)}function g(v){return Xt(v)?h(v):a(v)}function h(v){if(v===46)return e.consume(v),r=0,g;if(v===62)return e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t;return x(v)}function x(v){if((v===45||Xt(v))&&r++<63){let w=v===45?x:h;return e.consume(v),w}return a(v)}}var ni={partial:!0,tokenize:Rne};function Rne(e,t,a){return r;function r(s){return Ue(s)?ze(e,n,"linePrefix")(s):n(s)}function n(s){return s===null||Ie(s)?t(s):a(s)}}var Sy={continuation:{tokenize:Mne},exit:Pne,name:"blockQuote",tokenize:Ane};function Ane(e,t,a){let r=this;return n;function n(l){if(l===62){let c=r.containerState;if(!c.open)e.enter("blockQuote",{_container:!0}),c.open=!0;return e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return a(l)}function s(l){if(Ue(l))return e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t;return e.exit("blockQuotePrefix"),t(l)}}function Mne(e,t,a){let r=this;return n;function n(l){if(Ue(l))return ze(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l);return s(l)}function s(l){return e.attempt(Sy,t,a)(l)}}function Pne(e){e.exit("blockQuote")}var ky={name:"characterEscape",tokenize:Ene};function Ene(e,t,a){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),n}function n(s){if(pU(s))return e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t;return a(s)}}var Cy={name:"characterReference",tokenize:Nne};function Nne(e,t,a){let r=this,n=0,s,l;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),f}function f(h){if(h===35)return e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),m;return e.enter("characterReferenceValue"),s=31,l=Xt,g(h)}function m(h){if(h===88||h===120)return e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=fU,g;return e.enter("characterReferenceValue"),s=7,l=Lh,g(h)}function g(h){if(h===59&&n){let x=e.exit("characterReferenceValue");if(l===Xt&&!_f(r.sliceSerialize(x)))return a(h);return e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t}if(l(h)&&n++<s)return e.consume(h),g;return a(h)}}var vU={partial:!0,tokenize:One},Iy={concrete:!0,name:"codeFenced",tokenize:Dne};function Dne(e,t,a){let r=this,n={partial:!0,tokenize:E},s=0,l=0,c;return f;function f(M){return m(M)}function m(M){let P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,c=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(M)}function g(M){if(M===c)return l++,e.consume(M),g;if(l<3)return a(M);return e.exit("codeFencedFenceSequence"),Ue(M)?ze(e,h,"whitespace")(M):h(M)}function h(M){if(M===null||Ie(M))return e.exit("codeFencedFence"),r.interrupt?t(M):e.check(vU,C,R)(M);return e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(M)}function x(M){if(M===null||Ie(M))return e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(M);if(Ue(M))return e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ze(e,v,"whitespace")(M);if(M===96&&M===c)return a(M);return e.consume(M),x}function v(M){if(M===null||Ie(M))return h(M);return e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(M)}function w(M){if(M===null||Ie(M))return e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(M);if(M===96&&M===c)return a(M);return e.consume(M),w}function C(M){return e.attempt(n,R,L)(M)}function L(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),k}function k(M){return s>0&&Ue(M)?ze(e,I,"linePrefix",s+1)(M):I(M)}function I(M){if(M===null||Ie(M))return e.check(vU,C,R)(M);return e.enter("codeFlowValue"),T(M)}function T(M){if(M===null||Ie(M))return e.exit("codeFlowValue"),I(M);return e.consume(M),T}function R(M){return e.exit("codeFenced"),t(M)}function E(M,P,O){let F=0;return z;function z(re){return M.enter("lineEnding"),M.consume(re),M.exit("lineEnding"),Y}function Y(re){return M.enter("codeFencedFence"),Ue(re)?ze(M,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):q(re)}function q(re){if(re===c)return M.enter("codeFencedFenceSequence"),G(re);return O(re)}function G(re){if(re===c)return F++,M.consume(re),G;if(F>=l)return M.exit("codeFencedFenceSequence"),Ue(re)?ze(M,Q,"whitespace")(re):Q(re);return O(re)}function Q(re){if(re===null||Ie(re))return M.exit("codeFencedFence"),P(re);return O(re)}}}function One(e,t,a){let r=this;return n;function n(l){if(l===null)return a(l);return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s}function s(l){return r.parser.lazy[r.now().line]?a(l):t(l)}}var Rh={name:"codeIndented",tokenize:zne},_ne={partial:!0,tokenize:Bne};function zne(e,t,a){let r=this;return n;function n(m){return e.enter("codeIndented"),ze(e,s,"linePrefix",5)(m)}function s(m){let g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(m):a(m)}function l(m){if(m===null)return f(m);if(Ie(m))return e.attempt(_ne,l,f)(m);return e.enter("codeFlowValue"),c(m)}function c(m){if(m===null||Ie(m))return e.exit("codeFlowValue"),l(m);return e.consume(m),c}function f(m){return e.exit("codeIndented"),t(m)}}function Bne(e,t,a){let r=this;return n;function n(l){if(r.parser.lazy[r.now().line])return a(l);if(Ie(l))return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n;return ze(e,s,"linePrefix",5)(l)}function s(l){let c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Ie(l)?n(l):a(l)}}var dL={name:"codeText",previous:Une,resolve:Fne,tokenize:Hne};function Fne(e){let t=e.length-4,a=3,r,n;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){r=a;while(++r<t)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}r=a-1,t++;while(++r<=t)if(n===void 0){if(r!==t&&e[r][1].type!=="lineEnding")n=r}else if(r===t||e[r][1].type==="lineEnding"){if(e[n][1].type="codeTextData",r!==n+2)e[n][1].end=e[r-1][1].end,e.splice(n+2,r-n-2),t-=r-n-2,r=n+2;n=void 0}return e}function Une(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Hne(e,t,a){let r=this,n=0,s,l;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),f(x)}function f(x){if(x===96)return e.consume(x),n++,f;return e.exit("codeTextSequence"),m(x)}function m(x){if(x===null)return a(x);if(x===32)return e.enter("space"),e.consume(x),e.exit("space"),m;if(x===96)return l=e.enter("codeTextSequence"),s=0,h(x);if(Ie(x))return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m;return e.enter("codeTextData"),g(x)}function g(x){if(x===null||x===32||x===96||Ie(x))return e.exit("codeTextData"),m(x);return e.consume(x),g}function h(x){if(x===96)return e.consume(x),s++,h;if(s===n)return e.exit("codeTextSequence"),e.exit("codeText"),t(x);return l.type="codeTextData",g(x)}}class fL{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(e<this.left.length)return this.left[e];return this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let a=t===null||t===void 0?Number.POSITIVE_INFINITY:t;if(a<this.left.length)return this.left.slice(e,a);if(e>this.left.length)return this.right.slice(this.right.length-a+this.left.length,this.right.length-e+this.left.length).reverse();return this.left.slice(e).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(e,t,a){let r=t||0;this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);if(a)Ah(this.left,a);return n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Ah(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ah(this.right,e.reverse())}setCursor(e){if(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)return;if(e<this.left.length){let t=this.left.splice(e,Number.POSITIVE_INFINITY);Ah(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ah(this.left,t.reverse())}}}function Ah(e,t){let a=0;if(t.length<1e4)e.push(...t);else while(a<t.length)e.push(...t.slice(a,a+1e4)),a+=1e4}function Ly(e){let t={},a=-1,r,n,s,l,c,f,m,g=new fL(e);while(++a<g.length){while(a in t)a=t[a];if(r=g.get(a),a&&r[1].type==="chunkFlow"&&g.get(a-1)[1].type==="listItemPrefix"){if(f=r[1]._tokenizer.events,s=0,s<f.length&&f[s][1].type==="lineEndingBlank")s+=2;if(s<f.length&&f[s][1].type==="content")while(++s<f.length){if(f[s][1].type==="content")break;if(f[s][1].type==="chunkText")f[s][1]._isInFirstContentOfListItem=!0,s++}}if(r[0]==="enter"){if(r[1].contentType)Object.assign(t,Vne(g,a)),a=t[a],m=!0}else if(r[1]._container){s=a,n=void 0;while(s--)if(l=g.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank"){if(l[0]==="enter"){if(n)g.get(n)[1].type="lineEndingBlank";l[1].type="lineEnding",n=s}}else if(l[1].type==="linePrefix"||l[1].type==="listItemIndent");else break;if(n)r[1].end={...g.get(n)[1].start},c=g.slice(n,a),c.unshift(r),g.splice(n,a-n+1,c)}}return ta(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function Vne(e,t){let a=e.get(t)[1],r=e.get(t)[2],n=t-1,s=[],l=a._tokenizer;if(!l){if(l=r.parser[a.contentType](a.start),a._contentTypeTextTrailing)l._contentTypeTextTrailing=!0}let c=l.events,f=[],m={},g,h,x=-1,v=a,w=0,C=0,L=[C];while(v){while(e.get(++n)[1]!==v);if(s.push(n),!v._tokenizer){if(g=r.sliceStream(v),!v.next)g.push(null);if(h)l.defineSkip(v.start);if(v._isInFirstContentOfListItem)l._gfmTasklistFirstContentOfListItem=!0;if(l.write(g),v._isInFirstContentOfListItem)l._gfmTasklistFirstContentOfListItem=void 0}h=v,v=v.next}v=a;while(++x<c.length)if(c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line)C=x+1,L.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next;if(l.events=[],v)v._tokenizer=void 0,v.previous=void 0;else L.pop();x=L.length;while(x--){let k=c.slice(L[x],L[x+1]),I=s.pop();f.push([I,I+k.length-1]),e.splice(I,2,k)}f.reverse(),x=-1;while(++x<f.length)m[w+f[x][0]]=w+f[x][1],w+=f[x][1]-f[x][0]-1;return m}var pL={resolve:Gne,tokenize:qne},jne={partial:!0,tokenize:Kne};function Gne(e){return Ly(e),e}function qne(e,t){let a;return r;function r(c){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),n(c)}function n(c){if(c===null)return s(c);if(Ie(c))return e.check(jne,l,s)(c);return e.consume(c),n}function s(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,n}}function Kne(e,t,a){let r=this;return n;function n(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ze(e,s,"linePrefix")}function s(l){if(l===null||Ie(l))return a(l);let c=r.events[r.events.length-1];if(!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4)return t(l);return e.interrupt(r.parser.constructs.flow,a,t)(l)}}function Ty(e,t,a,r,n,s,l,c,f){let m=f||Number.POSITIVE_INFINITY,g=0;return h;function h(k){if(k===60)return e.enter(r),e.enter(n),e.enter(s),e.consume(k),e.exit(s),x;if(k===null||k===32||k===41||Mu(k))return a(k);return e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(k)}function x(k){if(k===62)return e.enter(s),e.consume(k),e.exit(s),e.exit(n),e.exit(r),t;return e.enter(c),e.enter("chunkString",{contentType:"string"}),v(k)}function v(k){if(k===62)return e.exit("chunkString"),e.exit(c),x(k);if(k===null||k===60||Ie(k))return a(k);return e.consume(k),k===92?w:v}function w(k){if(k===60||k===62||k===92)return e.consume(k),v;return v(k)}function C(k){if(!g&&(k===null||k===41||tt(k)))return e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(k);if(g<m&&k===40)return e.consume(k),g++,C;if(k===41)return e.consume(k),g--,C;if(k===null||k===32||k===40||Mu(k))return a(k);return e.consume(k),k===92?L:C}function L(k){if(k===40||k===41||k===92)return e.consume(k),C;return C(k)}}function Ry(e,t,a,r,n,s){let l=this,c=0,f;return m;function m(v){return e.enter(r),e.enter(n),e.consume(v),e.exit(n),e.enter(s),g}function g(v){if(c>999||v===null||v===91||v===93&&!f||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs)return a(v);if(v===93)return e.exit(s),e.enter(n),e.consume(v),e.exit(n),e.exit(r),t;if(Ie(v))return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g;return e.enter("chunkString",{contentType:"string"}),h(v)}function h(v){if(v===null||v===91||v===93||Ie(v)||c++>999)return e.exit("chunkString"),g(v);if(e.consume(v),!f)f=!Ue(v);return v===92?x:h}function x(v){if(v===91||v===92||v===93)return e.consume(v),c++,h;return h(v)}}function Ay(e,t,a,r,n,s){let l;return c;function c(x){if(x===34||x===39||x===40)return e.enter(r),e.enter(n),e.consume(x),e.exit(n),l=x===40?41:x,f;return a(x)}function f(x){if(x===l)return e.enter(n),e.consume(x),e.exit(n),e.exit(r),t;return e.enter(s),m(x)}function m(x){if(x===l)return e.exit(s),f(l);if(x===null)return a(x);if(Ie(x))return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),ze(e,m,"linePrefix");return e.enter("chunkString",{contentType:"string"}),g(x)}function g(x){if(x===l||x===null||Ie(x))return e.exit("chunkString"),m(x);return e.consume(x),x===92?h:g}function h(x){if(x===l||x===92)return e.consume(x),g;return g(x)}}function Eu(e,t){let a;return r;function r(n){if(Ie(n))return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),a=!0,r;if(Ue(n))return ze(e,r,a?"linePrefix":"lineSuffix")(n);return t(n)}}var mL={name:"definition",tokenize:Yne},Xne={partial:!0,tokenize:Wne};function Yne(e,t,a){let r=this,n;return s;function s(v){return e.enter("definition"),l(v)}function l(v){return Ry.call(r,e,c,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){if(n=lr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58)return e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),f;return a(v)}function f(v){return tt(v)?Eu(e,m)(v):m(v)}function m(v){return Ty(e,g,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(Xne,h,h)(v)}function h(v){return Ue(v)?ze(e,x,"whitespace")(v):x(v)}function x(v){if(v===null||Ie(v))return e.exit("definition"),r.parser.defined.push(n),t(v);return a(v)}}function Wne(e,t,a){return r;function r(c){return tt(c)?Eu(e,n)(c):a(c)}function n(c){return Ay(e,s,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return Ue(c)?ze(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ie(c)?t(c):a(c)}}var gL={name:"hardBreakEscape",tokenize:$ne};function $ne(e,t,a){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),n}function n(s){if(Ie(s))return e.exit("hardBreakEscape"),t(s);return a(s)}}var hL={name:"headingAtx",resolve:Qne,tokenize:Zne};function Qne(e,t){let a=e.length-2,r=3,n,s;if(e[r][1].type==="whitespace")r+=2;if(a-2>r&&e[a][1].type==="whitespace")a-=2;if(e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace"))a-=r+1===a?2:4;if(a>r)n={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},s={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},ta(e,r,a-r+1,[["enter",n,t],["enter",s,t],["exit",s,t],["exit",n,t]]);return e}function Zne(e,t,a){let r=0;return n;function n(g){return e.enter("atxHeading"),s(g)}function s(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){if(g===35&&r++<6)return e.consume(g),l;if(g===null||tt(g))return e.exit("atxHeadingSequence"),c(g);return a(g)}function c(g){if(g===35)return e.enter("atxHeadingSequence"),f(g);if(g===null||Ie(g))return e.exit("atxHeading"),t(g);if(Ue(g))return ze(e,c,"whitespace")(g);return e.enter("atxHeadingText"),m(g)}function f(g){if(g===35)return e.consume(g),f;return e.exit("atxHeadingSequence"),c(g)}function m(g){if(g===null||g===35||tt(g))return e.exit("atxHeadingText"),c(g);return e.consume(g),m}}var bU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],xL=["pre","script","style","textarea"];var vL={concrete:!0,name:"htmlFlow",resolveTo:tie,tokenize:aie},Jne={partial:!0,tokenize:oie},eie={partial:!0,tokenize:rie};function tie(e){let t=e.length;while(t--)if(e[t][0]==="enter"&&e[t][1].type==="htmlFlow")break;if(t>1&&e[t-2][1].type==="linePrefix")e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2);return e}function aie(e,t,a){let r=this,n,s,l,c,f;return m;function m(H){return g(H)}function g(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),h}function h(H){if(H===33)return e.consume(H),x;if(H===47)return e.consume(H),s=!0,C;if(H===63)return e.consume(H),n=3,r.interrupt?t:D;if(va(H))return e.consume(H),l=String.fromCharCode(H),L;return a(H)}function x(H){if(H===45)return e.consume(H),n=2,v;if(H===91)return e.consume(H),n=5,c=0,w;if(va(H))return e.consume(H),n=4,r.interrupt?t:D;return a(H)}function v(H){if(H===45)return e.consume(H),r.interrupt?t:D;return a(H)}function w(H){if(H==="CDATA[".charCodeAt(c++)){if(e.consume(H),c===6)return r.interrupt?t:q;return w}return a(H)}function C(H){if(va(H))return e.consume(H),l=String.fromCharCode(H),L;return a(H)}function L(H){if(H===null||H===47||H===62||tt(H)){let me=H===47,Ce=l.toLowerCase();if(!me&&!s&&xL.includes(Ce))return n=1,r.interrupt?t(H):q(H);if(bU.includes(l.toLowerCase())){if(n=6,me)return e.consume(H),k;return r.interrupt?t(H):q(H)}return n=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(H):s?I(H):T(H)}if(H===45||Xt(H))return e.consume(H),l+=String.fromCharCode(H),L;return a(H)}function k(H){if(H===62)return e.consume(H),r.interrupt?t:q;return a(H)}function I(H){if(Ue(H))return e.consume(H),I;return z(H)}function T(H){if(H===47)return e.consume(H),z;if(H===58||H===95||va(H))return e.consume(H),R;if(Ue(H))return e.consume(H),T;return z(H)}function R(H){if(H===45||H===46||H===58||H===95||Xt(H))return e.consume(H),R;return E(H)}function E(H){if(H===61)return e.consume(H),M;if(Ue(H))return e.consume(H),E;return T(H)}function M(H){if(H===null||H===60||H===61||H===62||H===96)return a(H);if(H===34||H===39)return e.consume(H),f=H,P;if(Ue(H))return e.consume(H),M;return O(H)}function P(H){if(H===f)return e.consume(H),f=null,F;if(H===null||Ie(H))return a(H);return e.consume(H),P}function O(H){if(H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||tt(H))return E(H);return e.consume(H),O}function F(H){if(H===47||H===62||Ue(H))return T(H);return a(H)}function z(H){if(H===62)return e.consume(H),Y;return a(H)}function Y(H){if(H===null||Ie(H))return q(H);if(Ue(H))return e.consume(H),Y;return a(H)}function q(H){if(H===45&&n===2)return e.consume(H),J;if(H===60&&n===1)return e.consume(H),X;if(H===62&&n===4)return e.consume(H),Te;if(H===63&&n===3)return e.consume(H),D;if(H===93&&n===5)return e.consume(H),te;if(Ie(H)&&(n===6||n===7))return e.exit("htmlFlowData"),e.check(Jne,Le,G)(H);if(H===null||Ie(H))return e.exit("htmlFlowData"),G(H);return e.consume(H),q}function G(H){return e.check(eie,Q,Le)(H)}function Q(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),re}function re(H){if(H===null||Ie(H))return G(H);return e.enter("htmlFlowData"),q(H)}function J(H){if(H===45)return e.consume(H),D;return q(H)}function X(H){if(H===47)return e.consume(H),l="",Z;return q(H)}function Z(H){if(H===62){let me=l.toLowerCase();if(xL.includes(me))return e.consume(H),Te;return q(H)}if(va(H)&&l.length<8)return e.consume(H),l+=String.fromCharCode(H),Z;return q(H)}function te(H){if(H===93)return e.consume(H),D;return q(H)}function D(H){if(H===62)return e.consume(H),Te;if(H===45&&n===2)return e.consume(H),D;return q(H)}function Te(H){if(H===null||Ie(H))return e.exit("htmlFlowData"),Le(H);return e.consume(H),Te}function Le(H){return e.exit("htmlFlow"),t(H)}}function rie(e,t,a){let r=this;return n;function n(l){if(Ie(l))return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s;return a(l)}function s(l){return r.parser.lazy[r.now().line]?a(l):t(l)}}function oie(e,t,a){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(ni,t,a)}}var bL={name:"htmlText",tokenize:nie};function nie(e,t,a){let r=this,n,s,l;return c;function c(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),f}function f(D){if(D===33)return e.consume(D),m;if(D===47)return e.consume(D),E;if(D===63)return e.consume(D),T;if(va(D))return e.consume(D),O;return a(D)}function m(D){if(D===45)return e.consume(D),g;if(D===91)return e.consume(D),s=0,w;if(va(D))return e.consume(D),I;return a(D)}function g(D){if(D===45)return e.consume(D),v;return a(D)}function h(D){if(D===null)return a(D);if(D===45)return e.consume(D),x;if(Ie(D))return l=h,X(D);return e.consume(D),h}function x(D){if(D===45)return e.consume(D),v;return h(D)}function v(D){return D===62?J(D):D===45?x(D):h(D)}function w(D){if(D==="CDATA[".charCodeAt(s++))return e.consume(D),s===6?C:w;return a(D)}function C(D){if(D===null)return a(D);if(D===93)return e.consume(D),L;if(Ie(D))return l=C,X(D);return e.consume(D),C}function L(D){if(D===93)return e.consume(D),k;return C(D)}function k(D){if(D===62)return J(D);if(D===93)return e.consume(D),k;return C(D)}function I(D){if(D===null||D===62)return J(D);if(Ie(D))return l=I,X(D);return e.consume(D),I}function T(D){if(D===null)return a(D);if(D===63)return e.consume(D),R;if(Ie(D))return l=T,X(D);return e.consume(D),T}function R(D){return D===62?J(D):T(D)}function E(D){if(va(D))return e.consume(D),M;return a(D)}function M(D){if(D===45||Xt(D))return e.consume(D),M;return P(D)}function P(D){if(Ie(D))return l=P,X(D);if(Ue(D))return e.consume(D),P;return J(D)}function O(D){if(D===45||Xt(D))return e.consume(D),O;if(D===47||D===62||tt(D))return F(D);return a(D)}function F(D){if(D===47)return e.consume(D),J;if(D===58||D===95||va(D))return e.consume(D),z;if(Ie(D))return l=F,X(D);if(Ue(D))return e.consume(D),F;return J(D)}function z(D){if(D===45||D===46||D===58||D===95||Xt(D))return e.consume(D),z;return Y(D)}function Y(D){if(D===61)return e.consume(D),q;if(Ie(D))return l=Y,X(D);if(Ue(D))return e.consume(D),Y;return F(D)}function q(D){if(D===null||D===60||D===61||D===62||D===96)return a(D);if(D===34||D===39)return e.consume(D),n=D,G;if(Ie(D))return l=q,X(D);if(Ue(D))return e.consume(D),q;return e.consume(D),Q}function G(D){if(D===n)return e.consume(D),n=void 0,re;if(D===null)return a(D);if(Ie(D))return l=G,X(D);return e.consume(D),G}function Q(D){if(D===null||D===34||D===39||D===60||D===61||D===96)return a(D);if(D===47||D===62||tt(D))return F(D);return e.consume(D),Q}function re(D){if(D===47||D===62||tt(D))return F(D);return a(D)}function J(D){if(D===62)return e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t;return a(D)}function X(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return Ue(D)?ze(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):te(D)}function te(D){return e.enter("htmlTextData"),l(D)}}var Nu={name:"labelEnd",resolveAll:cie,resolveTo:uie,tokenize:die},iie={tokenize:fie},sie={tokenize:pie},lie={tokenize:mie};function cie(e){let t=-1,a=[];while(++t<e.length){let r=e[t][1];if(a.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let n=r.type==="labelImage"?4:2;r.type="data",t+=n}}if(e.length!==a.length)ta(e,0,e.length,a);return e}function uie(e,t){let a=e.length,r=0,n,s,l,c;while(a--)if(n=e[a][1],s){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;if(e[a][0]==="enter"&&n.type==="labelLink")n._inactive=!0}else if(l){if(e[a][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced){if(s=a,n.type!=="labelLink"){r=2;break}}}else if(n.type==="labelEnd")l=a;let f={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[s][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",m,t]],c=Sr(c,e.slice(s+1,s+r+3)),c=Sr(c,[["enter",g,t]]),c=Sr(c,zl(t.parser.constructs.insideSpan.null,e.slice(s+r+4,l-3),t)),c=Sr(c,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),c=Sr(c,e.slice(l+1)),c=Sr(c,[["exit",f,t]]),ta(e,s,e.length,c),e}function die(e,t,a){let r=this,n=r.events.length,s,l;while(n--)if((r.events[n][1].type==="labelImage"||r.events[n][1].type==="labelLink")&&!r.events[n][1]._balanced){s=r.events[n][1];break}return c;function c(x){if(!s)return a(x);if(s._inactive)return h(x);return l=r.parser.defined.includes(lr(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),f}function f(x){if(x===40)return e.attempt(iie,g,l?g:h)(x);if(x===91)return e.attempt(sie,g,l?m:h)(x);return l?g(x):h(x)}function m(x){return e.attempt(lie,g,h)(x)}function g(x){return t(x)}function h(x){return s._balanced=!0,a(x)}}function fie(e,t,a){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),n}function n(h){return tt(h)?Eu(e,s)(h):s(h)}function s(h){if(h===41)return g(h);return Ty(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return tt(h)?Eu(e,f)(h):g(h)}function c(h){return a(h)}function f(h){if(h===34||h===39||h===40)return Ay(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(h);return g(h)}function m(h){return tt(h)?Eu(e,g)(h):g(h)}function g(h){if(h===41)return e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t;return a(h)}}function pie(e,t,a){let r=this;return n;function n(c){return Ry.call(r,e,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return r.parser.defined.includes(lr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):a(c)}function l(c){return a(c)}}function mie(e,t,a){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),n}function n(s){if(s===93)return e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t;return a(s)}}var yL={name:"labelStartImage",resolveAll:Nu.resolveAll,tokenize:gie};function gie(e,t,a){let r=this;return n;function n(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),s}function s(c){if(c===91)return e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l;return a(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(c):t(c)}}var wL={name:"labelStartLink",resolveAll:Nu.resolveAll,tokenize:hie};function hie(e,t,a){let r=this;return n;function n(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(l):t(l)}}var Mh={name:"lineEnding",tokenize:xie};function xie(e,t){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ze(e,t,"linePrefix")}}var Du={name:"thematicBreak",tokenize:vie};function vie(e,t,a){let r=0,n;return s;function s(m){return e.enter("thematicBreak"),l(m)}function l(m){return n=m,c(m)}function c(m){if(m===n)return e.enter("thematicBreakSequence"),f(m);if(r>=3&&(m===null||Ie(m)))return e.exit("thematicBreak"),t(m);return a(m)}function f(m){if(m===n)return e.consume(m),r++,f;return e.exit("thematicBreakSequence"),Ue(m)?ze(e,c,"whitespace")(m):c(m)}}var cr={continuation:{tokenize:Sie},exit:Cie,name:"list",tokenize:wie},bie={partial:!0,tokenize:Iie},yie={partial:!0,tokenize:kie};function wie(e,t,a){let r=this,n=r.events[r.events.length-1],s=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,l=0;return c;function c(v){let w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:Lh(v)){if(!r.containerState.type)r.containerState.type=w,e.enter(w,{_container:!0});if(w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Du,a,m)(v):m(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(v)}return a(v)}function f(v){if(Lh(v)&&++l<10)return e.consume(v),f;if((!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46))return e.exit("listItemValue"),m(v);return a(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(ni,r.interrupt?a:g,e.attempt(bie,x,h))}function g(v){return r.containerState.initialBlankLine=!0,s++,x(v)}function h(v){if(Ue(v))return e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),x;return a(v)}function x(v){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Sie(e,t,a){let r=this;return r.containerState._closeFlow=void 0,e.check(ni,n,s);function n(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ze(e,t,"listItemIndent",r.containerState.size+1)(c)}function s(c){if(r.containerState.furtherBlankLines||!Ue(c))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yie,t,l)(c)}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,ze(e,e.attempt(cr,t,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function kie(e,t,a){let r=this;return ze(e,n,"listItemIndent",r.containerState.size+1);function n(s){let l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(s):a(s)}}function Cie(e){e.exit(this.containerState.type)}function Iie(e,t,a){let r=this;return ze(e,n,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(s){let l=r.events[r.events.length-1];return!Ue(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):a(s)}}var My={name:"setextUnderline",resolveTo:Lie,tokenize:Tie};function Lie(e,t){let a=e.length,r,n,s;while(a--)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}if(e[a][1].type==="paragraph")n=a}else{if(e[a][1].type==="content")e.splice(a,1);if(!s&&e[a][1].type==="definition")s=a}let l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};if(e[n][1].type="setextHeadingText",s)e.splice(n,0,["enter",l,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end};else e[r][1]=l;return e.push(["exit",l,t]),e}function Tie(e,t,a){let r=this,n;return s;function s(m){let g=r.events.length,h;while(g--)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){h=r.events[g][1].type==="paragraph";break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||h))return e.enter("setextHeadingLine"),n=m,l(m);return a(m)}function l(m){return e.enter("setextHeadingLineSequence"),c(m)}function c(m){if(m===n)return e.consume(m),c;return e.exit("setextHeadingLineSequence"),Ue(m)?ze(e,f,"lineSuffix")(m):f(m)}function f(m){if(m===null||Ie(m))return e.exit("setextHeadingLine"),t(m);return a(m)}}var yU={tokenize:Rie};function Rie(e){let t=this,a=e.attempt(ni,r,e.attempt(this.parser.constructs.flowInitial,n,ze(e,e.attempt(this.parser.constructs.flow,n,e.attempt(pL,n)),"linePrefix")));return a;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function n(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var wU={resolveAll:IU()},SU=CU("string"),kU=CU("text");function CU(e){return{resolveAll:IU(e==="text"?Aie:void 0),tokenize:t};function t(a){let r=this,n=this.parser.constructs[e],s=a.attempt(n,l,c);return l;function l(g){return m(g)?s(g):c(g)}function c(g){if(g===null){a.consume(g);return}return a.enter("data"),a.consume(g),f}function f(g){if(m(g))return a.exit("data"),s(g);return a.consume(g),f}function m(g){if(g===null)return!0;let h=n[g],x=-1;if(h)while(++x<h.length){let v=h[x];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function IU(e){return t;function t(a,r){let n=-1,s;while(++n<=a.length)if(s===void 0){if(a[n]&&a[n][1].type==="data")s=n,n++}else if(!a[n]||a[n][1].type!=="data"){if(n!==s+2)a[s][1].end=a[n-1][1].end,a.splice(s+2,n-s-2),n=s+2;s=void 0}return e?e(a,r):a}}function Aie(e,t){let a=0;while(++a<=e.length)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let r=e[a-1][1],n=t.sliceStream(r),s=n.length,l=-1,c=0,f;while(s--){let m=n[s];if(typeof m==="string"){l=m.length;while(m.charCodeAt(l-1)===32)c++,l--;if(l)break;l=-1}else if(m===-2)f=!0,c++;else if(m===-1);else{s++;break}}if(t._contentTypeTextTrailing&&a===e.length)c=0;if(c){let m={type:a===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:r.start._bufferIndex+l,_index:r.start._index+s,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};if(r.end={...m.start},r.start.offset===r.end.offset)Object.assign(r,m);else e.splice(a,0,["enter",m,t],["exit",m,t]),a+=2}a++}return e}var SL={};sR(SL,{attentionMarkers:()=>zie,contentInitial:()=>Pie,disable:()=>Bie,document:()=>Mie,flow:()=>Nie,flowInitial:()=>Eie,insideSpan:()=>_ie,string:()=>Die,text:()=>Oie});var Mie={[42]:cr,[43]:cr,[45]:cr,[48]:cr,[49]:cr,[50]:cr,[51]:cr,[52]:cr,[53]:cr,[54]:cr,[55]:cr,[56]:cr,[57]:cr,[62]:Sy},Pie={[91]:mL},Eie={[-2]:Rh,[-1]:Rh,[32]:Rh},Nie={[35]:hL,[42]:Du,[45]:[My,Du],[60]:vL,[61]:My,[95]:Du,[96]:Iy,[126]:Iy},Die={[38]:Cy,[92]:ky},Oie={[-5]:Mh,[-4]:Mh,[-3]:Mh,[33]:yL,[38]:Cy,[42]:Th,[60]:[uL,bL],[91]:wL,[92]:[gL,ky],[93]:Nu,[95]:Th,[96]:dL},_ie={null:[Th,wU]},zie={null:[42,95]},Bie={null:[]};function LU(e,t,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},n={},s=[],l=[],c=[],f=!0,m={attempt:F(P),check:F(O),consume:R,enter:E,exit:M,interrupt:F(O,{interrupt:!0})},g={code:null,containerState:{},defineSkip:k,events:[],now:L,parser:e,previous:null,sliceSerialize:w,sliceStream:C,write:v},h=t.tokenize.call(g,m),x;if(t.resolveAll)s.push(t);return g;function v(G){if(l=Sr(l,G),I(),l[l.length-1]!==null)return[];return z(t,0),g.events=zl(s,g.events,g),g.events}function w(G,Q){return Uie(C(G),Q)}function C(G){return Fie(l,G)}function L(){let{_bufferIndex:G,_index:Q,line:re,column:J,offset:X}=r;return{_bufferIndex:G,_index:Q,line:re,column:J,offset:X}}function k(G){n[G.line]=G.column,q()}function I(){let G;while(r._index<l.length){let Q=l[r._index];if(typeof Q==="string"){if(G=r._index,r._bufferIndex<0)r._bufferIndex=0;while(r._index===G&&r._bufferIndex<Q.length)T(Q.charCodeAt(r._bufferIndex))}else T(Q)}}function T(G){f=void 0,x=G,h=h(G)}function R(G){if(Ie(G))r.line++,r.column=1,r.offset+=G===-3?2:1,q();else if(G!==-1)r.column++,r.offset++;if(r._bufferIndex<0)r._index++;else if(r._bufferIndex++,r._bufferIndex===l[r._index].length)r._bufferIndex=-1,r._index++;g.previous=G,f=!0}function E(G,Q){let re=Q||{};return re.type=G,re.start=L(),g.events.push(["enter",re,g]),c.push(re),re}function M(G){let Q=c.pop();return Q.end=L(),g.events.push(["exit",Q,g]),Q}function P(G,Q){z(G,Q.from)}function O(G,Q){Q.restore()}function F(G,Q){return re;function re(J,X,Z){let te,D,Te,Le;return Array.isArray(J)?me(J):("tokenize"in J)?me([J]):H(J);function H(ce){return he;function he(ue){let K=ue!==null&&ce[ue],ee=ue!==null&&ce.null,W=[...Array.isArray(K)?K:K?[K]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return me(W)(ue)}}function me(ce){if(te=ce,D=0,ce.length===0)return Z;return Ce(ce[D])}function Ce(ce){return he;function he(ue){if(Le=Y(),Te=ce,!ce.partial)g.currentConstruct=ce;if(ce.name&&g.parser.constructs.disable.null.includes(ce.name))return He(ue);return ce.tokenize.call(Q?Object.assign(Object.create(g),Q):g,m,ge,He)(ue)}}function ge(ce){return f=!0,G(Te,Le),X}function He(ce){if(f=!0,Le.restore(),++D<te.length)return Ce(te[D]);return Z}}}function z(G,Q){if(G.resolveAll&&!s.includes(G))s.push(G);if(G.resolve)ta(g.events,Q,g.events.length-Q,G.resolve(g.events.slice(Q),g));if(G.resolveTo)g.events=G.resolveTo(g.events,g)}function Y(){let G=L(),{previous:Q,currentConstruct:re}=g,J=g.events.length,X=Array.from(c);return{from:J,restore:Z};function Z(){r=G,g.previous=Q,g.currentConstruct=re,g.events.length=J,c=X,q()}}function q(){if(r.line in n&&r.column<2)r.column=n[r.line],r.offset+=n[r.line]-1}}function Fie(e,t){let a=t.start._index,r=t.start._bufferIndex,n=t.end._index,s=t.end._bufferIndex,l;if(a===n)l=[e[a].slice(r,s)];else{if(l=e.slice(a,n),r>-1){let c=l[0];if(typeof c==="string")l[0]=c.slice(r);else l.shift()}if(s>0)l.push(e[n].slice(0,s))}return l}function Uie(e,t){let a=-1,r=[],n;while(++a<e.length){let s=e[a],l;if(typeof s==="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
|
|
69
|
+
`;break}case-3:{l=`\r
|
|
70
|
+
`;break}case-2:{l=t?" ":"\t";break}case-1:{if(!t&&n)continue;l=" ";break}default:l=String.fromCharCode(s)}n=s===-2,r.push(l)}return r.join("")}function kL(e){let r={constructs:yy([SL,...(e||{}).extensions||[]]),content:n(mU),defined:[],document:n(hU),flow:n(yU),lazy:{},string:n(SU),text:n(kU)};return r;function n(s){return l;function l(c){return LU(r,s,c)}}}function CL(e){while(!Ly(e));return e}var TU=/[\0\t\n\r]/g;function IL(){let e=1,t="",a=!0,r;return n;function n(s,l,c){let f=[],m,g,h,x,v;if(s=t+(typeof s==="string"?s.toString():new TextDecoder(l||void 0).decode(s)),h=0,t="",a){if(s.charCodeAt(0)===65279)h++;a=void 0}while(h<s.length){if(TU.lastIndex=h,m=TU.exec(s),x=m&&m.index!==void 0?m.index:s.length,v=s.charCodeAt(x),!m){t=s.slice(h);break}if(v===10&&h===x&&r)f.push(-3),r=void 0;else{if(r)f.push(-5),r=void 0;if(h<x)f.push(s.slice(h,x)),e+=x-h;switch(v){case 0:{f.push(65533),e++;break}case 9:{g=Math.ceil(e/4)*4,f.push(-2);while(e++<g)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}}h=x+1}if(c){if(r)f.push(-5);if(t)f.push(t);f.push(null)}return f}}var Hie=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function RU(e){return e.replace(Hie,Vie)}function Vie(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let n=a.charCodeAt(1),s=n===120||n===88;return wy(a.slice(s?2:1),s?16:10)}return _f(a)||e}var MU={}.hasOwnProperty;function LL(e,t,a){if(t&&typeof t==="object")a=t,t=void 0;return jie(a)(CL(kL(a).document().write(IL()(e,t,!0))))}function jie(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(zt),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Ee),blockQuote:s(ue),characterEscape:F,characterReference:F,codeFenced:s(K),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(K,l),codeText:s(ee,l),codeTextData:F,data:F,codeFlowValue:F,definition:s(W),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(ve),hardBreakEscape:s(xe),hardBreakTrailing:s(xe),htmlFlow:s(ye,l),htmlFlowData:F,htmlText:s(ye,l),htmlTextData:F,image:s(ft),label:l,link:s(zt),listItem:s(Mo),listItemValue:x,listOrdered:s($a,h),listUnordered:s($a),paragraph:s(Dt),reference:H,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(Ee),strong:s(jl),thematicBreak:s(Gu)},exit:{atxHeading:f(),atxHeadingSequence:E,autolink:f(),autolinkEmail:he,autolinkProtocol:ce,blockQuote:f(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:ge,characterReference:He,codeFenced:f(L),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:z,codeIndented:f(k),codeText:f(re),codeTextData:z,data:z,definition:f(),definitionDestinationString:R,definitionLabelString:I,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(q),hardBreakTrailing:f(q),htmlFlow:f(G),htmlFlowData:z,htmlText:f(Q),htmlTextData:z,image:f(X),label:te,labelText:Z,lineEnding:Y,link:f(J),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:me,resourceDestinationString:D,resourceTitleString:Te,resource:Le,setextHeading:f(O),setextHeadingLineSequence:P,setextHeadingText:M,strong:f(),thematicBreak:f()}};PU(t,(e||{}).mdastExtensions||[]);let a={};return r;function r(oe){let be={type:"root",children:[]},Ve={stack:[be],tokenStack:[],config:t,enter:c,exit:m,buffer:l,resume:g,data:a},$e=[],Se=-1;while(++Se<oe.length)if(oe[Se][1].type==="listOrdered"||oe[Se][1].type==="listUnordered")if(oe[Se][0]==="enter")$e.push(Se);else{let Ne=$e.pop();Se=n(oe,Ne,Se)}Se=-1;while(++Se<oe.length){let Ne=t[oe[Se][0]];if(MU.call(Ne,oe[Se][1].type))Ne[oe[Se][1].type].call(Object.assign({sliceSerialize:oe[Se][2].sliceSerialize},Ve),oe[Se][1])}if(Ve.tokenStack.length>0){let Ne=Ve.tokenStack[Ve.tokenStack.length-1];(Ne[1]||AU).call(Ve,void 0,Ne[0])}be.position={start:Bl(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Bl(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;while(++Se<t.transforms.length)be=t.transforms[Se](be)||be;return be}function n(oe,be,Ve){let $e=be-1,Se=-1,Ne=!1,Qe,pt,Hr,aa;while(++$e<=Ve){let Qa=oe[$e];switch(Qa[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(Qa[0]==="enter")Se++;else Se--;aa=void 0;break}case"lineEndingBlank":{if(Qa[0]==="enter"){if(Qe&&!aa&&!Se&&!Hr)Hr=$e;aa=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:aa=void 0}if(!Se&&Qa[0]==="enter"&&Qa[1].type==="listItemPrefix"||Se===-1&&Qa[0]==="exit"&&(Qa[1].type==="listUnordered"||Qa[1].type==="listOrdered")){if(Qe){let si=$e;pt=void 0;while(si--){let ra=oe[si];if(ra[1].type==="lineEnding"||ra[1].type==="lineEndingBlank"){if(ra[0]==="exit")continue;if(pt)oe[pt][1].type="lineEndingBlank",Ne=!0;ra[1].type="lineEnding",pt=si}else if(ra[1].type==="linePrefix"||ra[1].type==="blockQuotePrefix"||ra[1].type==="blockQuotePrefixWhitespace"||ra[1].type==="blockQuoteMarker"||ra[1].type==="listItemIndent");else break}if(Hr&&(!pt||Hr<pt))Qe._spread=!0;Qe.end=Object.assign({},pt?oe[pt][1].start:Qa[1].end),oe.splice(pt||$e,0,["exit",Qe,Qa[2]]),$e++,Ve++}if(Qa[1].type==="listItemPrefix"){let si={type:"listItem",_spread:!1,start:Object.assign({},Qa[1].start),end:void 0};Qe=si,oe.splice($e,0,["enter",si,Qa[2]]),$e++,Ve++,Hr=void 0,aa=!0}}}return oe[be][1]._spread=Ne,Ve}function s(oe,be){return Ve;function Ve($e){if(c.call(this,oe($e),$e),be)be.call(this,$e)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(oe,be,Ve){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([be,Ve||void 0]),oe.position={start:Bl(be.start),end:void 0}}function f(oe){return be;function be(Ve){if(oe)oe.call(this,Ve);m.call(this,Ve)}}function m(oe,be){let Ve=this.stack.pop(),$e=this.tokenStack.pop();if(!$e)throw Error("Cannot close `"+oe.type+"` ("+Ol({start:oe.start,end:oe.end})+"): it’s not open");else if($e[0].type!==oe.type)if(be)be.call(this,oe,$e[0]);else($e[1]||AU).call(this,oe,$e[0]);Ve.position.end=Bl(oe.end)}function g(){return Au(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function x(oe){if(this.data.expectingFirstListItemValue){let be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function v(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.lang=oe}function w(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.meta=oe}function C(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function L(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.value=oe.replace(/(\r?\n|\r)$/g,"")}function I(oe){let be=this.resume(),Ve=this.stack[this.stack.length-1];Ve.label=be,Ve.identifier=lr(this.sliceSerialize(oe)).toLowerCase()}function T(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.title=oe}function R(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.url=oe}function E(oe){let be=this.stack[this.stack.length-1];if(!be.depth){let Ve=this.sliceSerialize(oe).length;be.depth=Ve}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function P(oe){let be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function F(oe){let Ve=this.stack[this.stack.length-1].children,$e=Ve[Ve.length-1];if(!$e||$e.type!=="text")$e=Po(),$e.position={start:Bl(oe.start),end:void 0},Ve.push($e);this.stack.push($e)}function z(oe){let be=this.stack.pop();be.value+=this.sliceSerialize(oe),be.position.end=Bl(oe.end)}function Y(oe){let be=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ve=be.children[be.children.length-1];Ve.position.end=Bl(oe.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type))F.call(this,oe),z.call(this,oe)}function q(){this.data.atHardBreak=!0}function G(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.value=oe}function Q(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.value=oe}function re(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.value=oe}function J(){let oe=this.stack[this.stack.length-1];if(this.data.inReference){let be=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=be,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function X(){let oe=this.stack[this.stack.length-1];if(this.data.inReference){let be=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=be,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Z(oe){let be=this.sliceSerialize(oe),Ve=this.stack[this.stack.length-2];Ve.label=RU(be),Ve.identifier=lr(be).toLowerCase()}function te(){let oe=this.stack[this.stack.length-1],be=this.resume(),Ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ve.type==="link"){let $e=oe.children;Ve.children=$e}else Ve.alt=be}function D(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.url=oe}function Te(){let oe=this.resume(),be=this.stack[this.stack.length-1];be.title=oe}function Le(){this.data.inReference=void 0}function H(){this.data.referenceType="collapsed"}function me(oe){let be=this.resume(),Ve=this.stack[this.stack.length-1];Ve.label=be,Ve.identifier=lr(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function Ce(oe){this.data.characterReferenceType=oe.type}function ge(oe){let be=this.sliceSerialize(oe),Ve=this.data.characterReferenceType,$e;if(Ve)$e=wy(be,Ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else $e=_f(be);let Se=this.stack[this.stack.length-1];Se.value+=$e}function He(oe){let be=this.stack.pop();be.position.end=Bl(oe.end)}function ce(oe){z.call(this,oe);let be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(oe)}function he(oe){z.call(this,oe);let be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(oe)}function ue(){return{type:"blockquote",children:[]}}function K(){return{type:"code",lang:null,meta:null,value:""}}function ee(){return{type:"inlineCode",value:""}}function W(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ve(){return{type:"emphasis",children:[]}}function Ee(){return{type:"heading",depth:0,children:[]}}function xe(){return{type:"break"}}function ye(){return{type:"html",value:""}}function ft(){return{type:"image",title:null,url:"",alt:null}}function zt(){return{type:"link",title:null,url:"",children:[]}}function $a(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Mo(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function Dt(){return{type:"paragraph",children:[]}}function jl(){return{type:"strong",children:[]}}function Po(){return{type:"text",value:""}}function Gu(){return{type:"thematicBreak"}}}function Bl(e){return{line:e.line,column:e.column,offset:e.offset}}function PU(e,t){let a=-1;while(++a<t.length){let r=t[a];if(Array.isArray(r))PU(e,r);else Gie(e,r)}}function Gie(e,t){let a;for(a in t)if(MU.call(t,a))switch(a){case"canContainEols":{let r=t[a];if(r)e[a].push(...r);break}case"transforms":{let r=t[a];if(r)e[a].push(...r);break}case"enter":case"exit":{let r=t[a];if(r)Object.assign(e[a],r);break}}}function AU(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+Ol({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ol({start:t.start,end:t.end})+") is open");else throw Error("Cannot close document, a token (`"+t.type+"`, "+Ol({start:t.start,end:t.end})+") is still open")}function Py(e){let t=this;t.parser=a;function a(r){return LL(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var Ey=-1,zf=0,Ou=1,Bf=2,Ph=3,Eh=4,Nh=5,Dh=6,Ny=7,Dy=8;var{defineProperty:qie}=Object,NU=typeof self==="object"?self:globalThis,EU=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+e)}return new NU[e](t)},Kie=(e,t)=>{let a=(n,s)=>(e.set(s,n),n),r=(n)=>{if(e.has(n))return e.get(n);let[s,l]=t[n];switch(s){case zf:case Ey:return a(l,n);case Ou:{let c=a([],n);for(let f of l)c.push(r(f));return c}case Bf:{let c=a({},n);for(let[f,m]of l){let g=r(f),h=r(m);if(g==="__proto__")qie(c,g,{value:h,configurable:!0,enumerable:!0,writable:!0});else c[g]=h}return c}case Ph:return a(new Date(l),n);case Eh:{let{source:c,flags:f}=l;return a(new RegExp(c,f),n)}case Nh:{let c=a(new Map,n);for(let[f,m]of l)c.set(r(f),r(m));return c}case Dh:{let c=a(new Set,n);for(let f of l)c.add(r(f));return c}case Ny:{let{name:c,message:f}=l;return a(typeof NU[c]==="function"?EU(c,f):Error(f),n)}case Dy:return a(BigInt(l),n);case"BigInt":return a(Object(BigInt(l)),n);case"ArrayBuffer":return a(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:c}=new Uint8Array(l);return a(new DataView(c),l)}case"-0":return-0}return a(EU(s,l),n)};return r},TL=(e)=>Kie(new Map,e)(0);var _u="",{toString:Xie}={},{keys:Yie,is:Wie}=Object,Oh=(e)=>{let t=typeof e;if(t!=="object"||!e)return[zf,t];let a=Xie.call(e).slice(8,-1);switch(a){case"Array":return[Ou,_u];case"Object":return[Bf,_u];case"Date":return[Ph,_u];case"RegExp":return[Eh,_u];case"Map":return[Nh,_u];case"Set":return[Dh,_u];case"DataView":return[Ou,a]}if(a.includes("Array"))return[Ou,a];if(e instanceof Error)return[Ny,e.name||"Error"];return[Bf,a]},Oy=([e,t])=>e===zf&&(t==="function"||t==="symbol"),$ie=(e,t,a,r)=>{let n=(l,c)=>{let f=r.push(l)-1;return a.set(c,f),f},s=(l)=>{if(a.has(l))return a.get(l);let[c,f]=Oh(l);switch(c){case zf:{let g=l;switch(f){case"bigint":c=Dy,g=l.toString();break;case"number":if(!l&&Wie(l,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+f);g=null;break;case"undefined":return n([Ey],l)}return n([c,g],l)}case Ou:{if(f){let x=l;if(f==="DataView")x=new Uint8Array(l.buffer);else if(f==="ArrayBuffer")x=new Uint8Array(l);return n([f,[...x]],l)}let g=[],h=n([c,g],l);for(let x of l)g.push(s(x));return h}case Bf:{if(f)switch(f){case"BigInt":return n([f,l.toString()],l);case"Boolean":case"Number":case"String":return n([f,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());let g=[],h=n([c,g],l);for(let x of Yie(l))if(e||!Oy(Oh(l[x])))g.push([s(x),s(l[x])]);return h}case Ph:return n([c,isNaN(l.getTime())?_u:l.toISOString()],l);case Eh:{let{source:g,flags:h}=l;return n([c,{source:g,flags:h}],l)}case Nh:{let g=[],h=n([c,g],l);for(let[x,v]of l)if(e||!(Oy(Oh(x))||Oy(Oh(v))))g.push([s(x),s(v)]);return h}case Dh:{let g=[],h=n([c,g],l);for(let x of l)if(e||!Oy(Oh(x)))g.push(s(x));return h}}let{message:m}=l;return n([c,{name:f,message:m}],l)};return s},RL=(e,{json:t,lossy:a}={})=>{let r=[];return $ie(!(t||a),!!t,new Map,r)(e),r};var Ff=typeof structuredClone==="function"?(e,t)=>t&&(("json"in t)||("lossy"in t))?TL(RL(e,t)):structuredClone(e):(e,t)=>TL(RL(e,t));function Qie(e,t){let a=[{type:"text",value:"↩"}];if(t>1)a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]});return a}function Zie(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function DU(e){let t=typeof e.options.clobberPrefix==="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||Qie,r=e.options.footnoteBackLabel||Zie,n=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[],f=-1;while(++f<e.footnoteOrder.length){let m=e.footnoteById.get(e.footnoteOrder[f]);if(!m)continue;let g=e.all(m),h=String(m.identifier).toUpperCase(),x=Ao(h.toLowerCase()),v=0,w=[],C=e.footnoteCounts.get(h);while(C!==void 0&&++v<=C){if(w.length>0)w.push({type:"text",value:" "});let I=typeof a==="string"?a:a(f,v);if(typeof I==="string")I={type:"text",value:I};w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r==="string"?r:r(f,v),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}let L=g[g.length-1];if(L&&L.type==="element"&&L.tagName==="p"){let I=L.children[L.children.length-1];if(I&&I.type==="text")I.value+=" ";else L.children.push({type:"text",value:" "});L.children.push(...w)}else g.push(...w);let k={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(m,k),c.push(k)}if(c.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Ff(l),id:"footnote-label"},children:[{type:"text",value:n}]},{type:"text",value:`
|
|
71
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
72
|
+
`}]}}var Fl=function(e){if(e===null||e===void 0)return ase;if(typeof e==="function")return _y(e);if(typeof e==="object")return Array.isArray(e)?Jie(e):ese(e);if(typeof e==="string")return tse(e);throw Error("Expected function, string, or object as test")};function Jie(e){let t=[],a=-1;while(++a<e.length)t[a]=Fl(e[a]);return _y(r);function r(...n){let s=-1;while(++s<t.length)if(t[s].apply(this,n))return!0;return!1}}function ese(e){let t=e;return _y(a);function a(r){let n=r,s;for(s in e)if(n[s]!==t[s])return!1;return!0}}function tse(e){return _y(t);function t(a){return a&&a.type===e}}function _y(e){return t;function t(a,r,n){return Boolean(rse(a)&&e.call(this,a,typeof r==="number"?r:void 0,n||void 0))}}function ase(){return!0}function rse(e){return e!==null&&typeof e==="object"&&"type"in e}function OU(e){return e}var _U=[],zy=!0,zu=!1,By="skip";function _h(e,t,a,r){let n;if(typeof t==="function"&&typeof a!=="function")r=a,a=t;else n=t;let s=Fl(n),l=r?-1:1;c(e,void 0,[])();function c(f,m,g){let h=f&&typeof f==="object"?f:{};if(typeof h.type==="string"){let v=typeof h.tagName==="string"?h.tagName:typeof h.name==="string"?h.name:void 0;Object.defineProperty(x,"name",{value:"node ("+OU(f.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=_U,w,C,L;if(!t||s(f,m,g[g.length-1]||void 0)){if(v=ose(a(f,g)),v[0]===zu)return v}if("children"in f&&f.children){let k=f;if(k.children&&v[0]!==By){C=(r?k.children.length:-1)+l,L=g.concat(k);while(C>-1&&C<k.children.length){let I=k.children[C];if(w=c(I,C,L)(),w[0]===zu)return w;C=typeof w[1]==="number"?w[1]:C+l}}}return v}}}function ose(e){if(Array.isArray(e))return e;if(typeof e==="number")return[zy,e];return e===null||e===void 0?_U:[e]}function Bu(e,t,a,r){let n,s,l;if(typeof t==="function"&&typeof a!=="function")s=void 0,l=t,n=a;else s=t,l=a,n=r;_h(e,s,c,n);function c(f,m){let g=m[m.length-1],h=g?g.children.indexOf(f):void 0;return l(f,h,g)}}function zU(e,t){let a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function BU(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
73
|
+
`}]}function FU(e,t){let a=t.value?t.value+`
|
|
74
|
+
`:"",r={},n=t.lang?t.lang.split(/\s+/):[];if(n.length>0)r.className=["language-"+n[0]];let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};if(t.meta)s.data={meta:t.meta};return e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function UU(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function HU(e,t){let a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function VU(e,t){let a=typeof e.options.clobberPrefix==="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),n=Ao(r.toLowerCase()),s=e.footnoteOrder.indexOf(r),l,c=e.footnoteCounts.get(r);if(c===void 0)c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length;else l=s+1;c+=1,e.footnoteCounts.set(r,c);let f={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+n,id:a+"fnref-"+n+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);let m={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,m),e.applyData(t,m)}function jU(e,t){let a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function GU(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}return}function Fy(e,t){let a=t.referenceType,r="]";if(a==="collapsed")r+="[]";else if(a==="full")r+="["+(t.label||t.identifier)+"]";if(t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];let n=e.all(t),s=n[0];if(s&&s.type==="text")s.value="["+s.value;else n.unshift({type:"text",value:"["});let l=n[n.length-1];if(l&&l.type==="text")l.value+=r;else n.push({type:"text",value:r});return n}function qU(e,t){let a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Fy(e,t);let n={src:Ao(r.url||""),alt:t.alt};if(r.title!==null&&r.title!==void 0)n.title=r.title;let s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function KU(e,t){let a={src:Ao(t.url)};if(t.alt!==null&&t.alt!==void 0)a.alt=t.alt;if(t.title!==null&&t.title!==void 0)a.title=t.title;let r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,r),e.applyData(t,r)}function XU(e,t){let a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);let r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,r),e.applyData(t,r)}function YU(e,t){let a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Fy(e,t);let n={href:Ao(r.url||"")};if(r.title!==null&&r.title!==void 0)n.title=r.title;let s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function WU(e,t){let a={href:Ao(t.url)};if(t.title!==null&&t.title!==void 0)a.title=t.title;let r={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $U(e,t,a){let r=e.all(t),n=a?nse(a):QU(t),s={},l=[];if(typeof t.checked==="boolean"){let g=r[0],h;if(g&&g.type==="element"&&g.tagName==="p")h=g;else h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h);if(h.children.length>0)h.children.unshift({type:"text",value:" "});h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;while(++c<r.length){let g=r[c];if(n||c!==0||g.type!=="element"||g.tagName!=="p")l.push({type:"text",value:`
|
|
75
|
+
`});if(g.type==="element"&&g.tagName==="p"&&!n)l.push(...g.children);else l.push(g)}let f=r[r.length-1];if(f&&(n||f.type!=="element"||f.tagName!=="p"))l.push({type:"text",value:`
|
|
76
|
+
`});let m={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,m),e.applyData(t,m)}function nse(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,r=-1;while(!t&&++r<a.length)t=QU(a[r])}return t}function QU(e){let t=e.spread;return t===null||t===void 0?e.children.length>1:t}function ZU(e,t){let a={},r=e.all(t),n=-1;if(typeof t.start==="number"&&t.start!==1)a.start=t.start;while(++n<r.length){let l=r[n];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}let s={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function JU(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function e9(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function t9(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function a9(e,t){let a=e.all(t),r=a.shift(),n=[];if(r){let l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),n.push(l)}if(a.length>0){let l={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},c=Of(t.children[1]),f=by(t.children[t.children.length-1]);if(c&&f)l.position={start:c,end:f};n.push(l)}let s={type:"element",tagName:"table",properties:{},children:e.wrap(n,!0)};return e.patch(t,s),e.applyData(t,s)}function r9(e,t,a){let r=a?a.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",l=a&&a.type==="table"?a.align:void 0,c=l?l.length:t.children.length,f=-1,m=[];while(++f<c){let h=t.children[f],x={},v=l?l[f]:void 0;if(v)x.align=v;let w={type:"element",tagName:s,properties:x,children:[]};if(h)w.children=e.all(h),e.patch(h,w),w=e.applyData(h,w);m.push(w)}let g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function o9(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function i9(e){let t=String(e),a=/\r?\n|\r/g,r=a.exec(t),n=0,s=[];while(r)s.push(n9(t.slice(n,r.index),n>0,!0),r[0]),n=r.index+r[0].length,r=a.exec(t);return s.push(n9(t.slice(n),n>0,!1)),s.join("")}function n9(e,t,a){let r=0,n=e.length;if(t){let s=e.codePointAt(r);while(s===9||s===32)r++,s=e.codePointAt(r)}if(a){let s=e.codePointAt(n-1);while(s===9||s===32)n--,s=e.codePointAt(n-1)}return n>r?e.slice(r,n):""}function s9(e,t){let a={type:"text",value:i9(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function l9(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var c9={blockquote:zU,break:BU,code:FU,delete:UU,emphasis:HU,footnoteReference:VU,heading:jU,html:GU,imageReference:qU,image:KU,inlineCode:XU,linkReference:YU,link:WU,listItem:$U,list:ZU,paragraph:JU,root:e9,strong:t9,table:a9,tableCell:o9,tableRow:r9,text:s9,thematicBreak:l9,toml:Uy,yaml:Uy,definition:Uy,footnoteDefinition:Uy};function Uy(){return}var AL={}.hasOwnProperty,ise={};function d9(e,t){let a=t||ise,r=new Map,n=new Map,s=new Map,l={...c9,...a.handlers},c={all:m,applyData:lse,definitionById:r,footnoteById:n,footnoteCounts:s,footnoteOrder:[],handlers:l,one:f,options:a,patch:sse,wrap:use};return Bu(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){let h=g.type==="definition"?r:n,x=String(g.identifier).toUpperCase();if(!h.has(x))h.set(x,g)}}),c;function f(g,h){let x=g.type,v=c.handlers[x];if(AL.call(c.handlers,x)&&v)return v(c,g,h);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in g){let{children:C,...L}=g,k=Ff(L);return k.children=c.all(g),k}return Ff(g)}return(c.options.unknownHandler||cse)(c,g,h)}function m(g){let h=[];if("children"in g){let x=g.children,v=-1;while(++v<x.length){let w=c.one(x[v],g);if(w){if(v&&x[v-1].type==="break"){if(!Array.isArray(w)&&w.type==="text")w.value=u9(w.value);if(!Array.isArray(w)&&w.type==="element"){let C=w.children[0];if(C&&C.type==="text")C.value=u9(C.value)}}if(Array.isArray(w))h.push(...w);else h.push(w)}}}return h}}function sse(e,t){if(e.position)t.position=oL(e)}function lse(e,t){let a=t;if(e&&e.data){let r=e.data.hName,n=e.data.hChildren,s=e.data.hProperties;if(typeof r==="string")if(a.type==="element")a.tagName=r;else{let l="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:l}}if(a.type==="element"&&s)Object.assign(a.properties,Ff(s));if("children"in a&&a.children&&n!==null&&n!==void 0)a.children=n}return a}function cse(e,t){let a=t.data||{},r="value"in t&&!(AL.call(a,"hProperties")||AL.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function use(e,t){let a=[],r=-1;if(t)a.push({type:"text",value:`
|
|
77
|
+
`});while(++r<e.length){if(r)a.push({type:"text",value:`
|
|
78
|
+
`});a.push(e[r])}if(t&&e.length>0)a.push({type:"text",value:`
|
|
79
|
+
`});return a}function u9(e){let t=0,a=e.charCodeAt(t);while(a===9||a===32)t++,a=e.charCodeAt(t);return e.slice(t)}function Hy(e,t){let a=d9(e,t),r=a.one(e,void 0),n=DU(a),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};if(n)Et("children"in s),s.children.push({type:"text",value:`
|
|
80
|
+
`},n);return s}function Vy(e,t){if(e&&"run"in e)return async function(a,r){let n=Hy(a,{file:r,...t});await e.run(n,r)};return function(a,r){return Hy(a,{file:r,...e||t})}}function ML(e){if(e)throw e}var qy=iR(y9(),1);function zh(e){if(typeof e!=="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function PL(){let e=[],t={run:a,use:r};return t;function a(...n){let s=-1,l=n.pop();if(typeof l!=="function")throw TypeError("Expected function as last argument, not "+l);c(null,...n);function c(f,...m){let g=e[++s],h=-1;if(f){l(f);return}while(++h<n.length)if(m[h]===null||m[h]===void 0)m[h]=n[h];if(n=m,g)w9(g,c)(...m);else l(null,...m)}}function r(n){if(typeof n!=="function")throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function w9(e,t){let a;return r;function r(...l){let c=e.length>l.length,f;if(c)l.push(n);try{f=e.apply(this,l)}catch(m){let g=m;if(c&&a)throw g;return n(g)}if(!c)if(f&&f.then&&typeof f.then==="function")f.then(s,n);else if(f instanceof Error)n(f);else s(f)}function n(l,...c){if(!a)a=!0,t(l,...c)}function s(l){n(null,l)}}var sn={basename:dse,dirname:fse,extname:pse,join:mse,sep:"/"};function dse(e,t){if(t!==void 0&&typeof t!=="string")throw TypeError('"ext" argument must be a string');Bh(e);let a=0,r=-1,n=e.length,s;if(t===void 0||t.length===0||t.length>e.length){while(n--)if(e.codePointAt(n)===47){if(s){a=n+1;break}}else if(r<0)s=!0,r=n+1;return r<0?"":e.slice(a,r)}if(t===e)return"";let l=-1,c=t.length-1;while(n--)if(e.codePointAt(n)===47){if(s){a=n+1;break}}else{if(l<0)s=!0,l=n+1;if(c>-1)if(e.codePointAt(n)===t.codePointAt(c--)){if(c<0)r=n}else c=-1,r=l}if(a===r)r=l;else if(r<0)r=e.length;return e.slice(a,r)}function fse(e){if(Bh(e),e.length===0)return".";let t=-1,a=e.length,r;while(--a)if(e.codePointAt(a)===47){if(r){t=a;break}}else if(!r)r=!0;return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pse(e){Bh(e);let t=e.length,a=-1,r=0,n=-1,s=0,l;while(t--){let c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}if(a<0)l=!0,a=t+1;if(c===46){if(n<0)n=t;else if(s!==1)s=1}else if(n>-1)s=-1}if(n<0||a<0||s===0||s===1&&n===a-1&&n===r+1)return"";return e.slice(n,a)}function mse(...e){let t=-1,a;while(++t<e.length)if(Bh(e[t]),e[t])a=a===void 0?e[t]:a+"/"+e[t];return a===void 0?".":gse(a)}function gse(e){Bh(e);let t=e.codePointAt(0)===47,a=hse(e,!t);if(a.length===0&&!t)a=".";if(a.length>0&&e.codePointAt(e.length-1)===47)a+="/";return t?"/"+a:a}function hse(e,t){let a="",r=0,n=-1,s=0,l=-1,c,f;while(++l<=e.length){if(l<e.length)c=e.codePointAt(l);else if(c===47)break;else c=47;if(c===47){if(n===l-1||s===1);else if(n!==l-1&&s===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(f=a.lastIndexOf("/"),f!==a.length-1){if(f<0)a="",r=0;else a=a.slice(0,f),r=a.length-1-a.lastIndexOf("/");n=l,s=0;continue}}else if(a.length>0){a="",r=0,n=l,s=0;continue}}if(t)a=a.length>0?a+"/..":"..",r=2}else{if(a.length>0)a+="/"+e.slice(n+1,l);else a=e.slice(n+1,l);r=l-n-1}n=l,s=0}else if(c===46&&s>-1)s++;else s=-1}return a}function Bh(e){if(typeof e!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(e))}var S9={cwd:xse};function xse(){return"/"}function Uf(e){return Boolean(e!==null&&typeof e==="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function k9(e){if(typeof e==="string")e=new URL(e);else if(!Uf(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return vse(e)}function vse(e){if(e.hostname!==""){let r=TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,a=-1;while(++a<t.length)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){let r=t.codePointAt(a+2);if(r===70||r===102){let n=TypeError("File URL path must not include encoded / characters");throw n.code="ERR_INVALID_FILE_URL_PATH",n}}return decodeURIComponent(t)}var EL=["history","path","basename","stem","extname","dirname"];class Hf{constructor(e){let t;if(!e)t={};else if(Uf(e))t={path:e};else if(typeof e==="string"||bse(e))t={value:e};else t=e;this.cwd="cwd"in t?"":S9.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;while(++a<EL.length){let n=EL[a];if(n in t&&t[n]!==void 0&&t[n]!==null)this[n]=n==="history"?[...t[n]]:t[n]}let r;for(r in t)if(!EL.includes(r))this[r]=t[r]}get basename(){return typeof this.path==="string"?sn.basename(this.path):void 0}set basename(e){DL(e,"basename"),NL(e,"basename"),this.path=sn.join(this.dirname||"",e)}get dirname(){return typeof this.path==="string"?sn.dirname(this.path):void 0}set dirname(e){C9(this.basename,"dirname"),this.path=sn.join(e||"",this.basename)}get extname(){return typeof this.path==="string"?sn.extname(this.path):void 0}set extname(e){if(NL(e,"extname"),C9(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=sn.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){if(Uf(e))e=k9(e);if(DL(e,"path"),this.path!==e)this.history.push(e)}get stem(){return typeof this.path==="string"?sn.basename(this.path,this.extname):void 0}set stem(e){DL(e,"stem"),NL(e,"stem"),this.path=sn.join(this.dirname||"",e+(this.extname||""))}fail(e,t,a){let r=this.message(e,t,a);throw r.fatal=!0,r}info(e,t,a){let r=this.message(e,t,a);return r.fatal=void 0,r}message(e,t,a){let r=new ca(e,t,a);if(this.path)r.name=this.path+":"+r.name,r.file=this.path;return r.fatal=!1,this.messages.push(r),r}toString(e){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function NL(e,t){if(e&&e.includes(sn.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+sn.sep+"`")}function DL(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function C9(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function bse(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var I9=function(e){let r=this.constructor.prototype,n=r[e],s=function(){return n.apply(s,arguments)};return Object.setPrototypeOf(s,r),s};var yse={}.hasOwnProperty;class BL extends I9{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=PL()}copy(){let e=new BL,t=-1;while(++t<this.attachers.length){let a=this.attachers[t];e.use(...a)}return e.data(qy.default(!0,{},this.namespace)),e}data(e,t){if(typeof e==="string"){if(arguments.length===2)return zL("data",this.frozen),this.namespace[e]=t,this;return yse.call(this.namespace,e)&&this.namespace[e]||void 0}if(e)return zL("data",this.frozen),this.namespace=e,this;return this.namespace}freeze(){if(this.frozen)return this;let e=this;while(++this.freezeIndex<this.attachers.length){let[t,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;if(a[0]===!0)a[0]=void 0;let r=t.call(e,...a);if(typeof r==="function")this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let t=Gy(e),a=this.parser||this.Parser;return OL("parse",a),a(String(t),t)}process(e,t){let a=this;return this.freeze(),OL("process",this.parser||this.Parser),_L("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(n,s){let l=Gy(e),c=a.parse(l);a.run(c,l,function(m,g,h){if(m||!g||!h)return f(m);let x=g,v=a.stringify(x,h);if(Sse(v))h.value=v;else h.result=v;f(m,h)});function f(m,g){if(m||!g)s(m);else if(n)n(g);else Et(t,"`done` is defined if `resolve` is not"),t(void 0,g)}}}processSync(e){let t=!1,a;return this.freeze(),OL("processSync",this.parser||this.Parser),_L("processSync",this.compiler||this.Compiler),this.process(e,r),T9("processSync","process",t),Et(a,"we either bailed on an error or have a tree"),a;function r(n,s){t=!0,ML(n),a=s}}run(e,t,a){L9(e),this.freeze();let r=this.transformers;if(!a&&typeof t==="function")a=t,t=void 0;return a?n(void 0,a):new Promise(n);function n(s,l){Et(typeof t!=="function","`file` can’t be a `done` anymore, we checked");let c=Gy(t);r.run(e,c,f);function f(m,g,h){let x=g||e;if(m)l(m);else if(s)s(x);else Et(a,"`done` is defined if `resolve` is not"),a(void 0,x,h)}}}runSync(e,t){let a=!1,r;return this.run(e,t,n),T9("runSync","run",a),Et(r,"we either bailed on an error or have a tree"),r;function n(s,l){ML(s),r=l,a=!0}}stringify(e,t){this.freeze();let a=Gy(t),r=this.compiler||this.Compiler;return _L("stringify",r),L9(e),r(e,a)}use(e,...t){let a=this.attachers,r=this.namespace;if(zL("use",this.frozen),e===null||e===void 0);else if(typeof e==="function")c(e,t);else if(typeof e==="object")if(Array.isArray(e))l(e);else s(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function n(f){if(typeof f==="function")c(f,[]);else if(typeof f==="object")if(Array.isArray(f)){let[m,...g]=f;c(m,g)}else s(f);else throw TypeError("Expected usable value, not `"+f+"`")}function s(f){if(!("plugins"in f)&&!("settings"in f))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(l(f.plugins),f.settings)r.settings=qy.default(!0,r.settings,f.settings)}function l(f){let m=-1;if(f===null||f===void 0);else if(Array.isArray(f))while(++m<f.length){let g=f[m];n(g)}else throw TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,m){let g=-1,h=-1;while(++g<a.length)if(a[g][0]===f){h=g;break}if(h===-1)a.push([f,...m]);else if(m.length>0){let[x,...v]=m,w=a[h][1];if(zh(w)&&zh(x))x=qy.default(!0,w,x);a[h]=[f,x,...v]}}}}var FL=new BL().freeze();function OL(e,t){if(typeof t!=="function")throw TypeError("Cannot `"+e+"` without `parser`")}function _L(e,t){if(typeof t!=="function")throw TypeError("Cannot `"+e+"` without `compiler`")}function zL(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function L9(e){if(!zh(e)||typeof e.type!=="string")throw TypeError("Expected node, got `"+e+"`")}function T9(e,t,a){if(!a)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gy(e){return wse(e)?e:new Hf(e)}function wse(e){return Boolean(e&&typeof e==="object"&&"message"in e&&"messages"in e)}function Sse(e){return typeof e==="string"||kse(e)}function kse(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var Cse="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",R9=[],A9={allowDangerousHtml:!0},Ise=/^(https?|ircs?|mailto|xmpp)$/i,Lse=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function UL(e){let t=Tse(e),a=Rse(e);return Ase(t.runSync(t.parse(a),a),e)}function Tse(e){let t=e.rehypePlugins||R9,a=e.remarkPlugins||R9,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...A9}:A9;return FL().use(Py).use(a).use(Vy,r).use(t)}function Rse(e){let t=e.children||"",a=new Hf;if(typeof t==="string")a.value=t;else my("Unexpected value `"+t+"` for `children` prop, expected `string`");return a}function Ase(e,t){let{allowedElements:a,allowElement:r,components:n,disallowedElements:s,skipHtml:l,unwrapDisallowed:c}=t,f=t.urlTransform||M9;for(let g of Lse)if(Object.hasOwn(t,g.from))my("Unexpected `"+g.from+"` prop, "+(g.to?"use `"+g.to+"` instead":"remove it")+" (see <"+Cse+"#"+g.id+"> for more info)");if(a&&s)my("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return Bu(e,m),sL(e,{Fragment:se,components:n,ignoreInvalidStyle:!0,jsx:d,jsxs:S,passKeys:!0,passNode:!0});function m(g,h,x){if(g.type==="raw"&&x&&typeof h==="number"){if(l)x.children.splice(h,1);else x.children[h]={type:"text",value:g.value};return h}if(g.type==="element"){let v;for(v in Ih)if(Object.hasOwn(Ih,v)&&Object.hasOwn(g.properties,v)){let w=g.properties[v],C=Ih[v];if(C===null||C.includes(g.tagName))g.properties[v]=f(String(w||""),v,g)}}if(g.type==="element"){let v=a?!a.includes(g.tagName):s?s.includes(g.tagName):!1;if(!v&&r&&typeof h==="number")v=!r(g,h,x);if(v&&x&&typeof h==="number"){if(c&&g.children)x.children.splice(h,1,...g.children);else x.children.splice(h,1);return h}}}}function M9(e){let t=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),n=e.indexOf("/");if(t===-1||n!==-1&&t>n||a!==-1&&t>a||r!==-1&&t>r||Ise.test(e.slice(0,t)))return e;return""}function u(e,t){let a=String(e);if(typeof t!=="string")throw TypeError("Expected character");let r=0,n=a.indexOf(t);while(n!==-1)r++,n=a.indexOf(t,n+t.length);return r}function HL(e){if(typeof e!=="string")throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function VL(e,t,a){let n=Fl((a||{}).ignore||[]),s=Mse(t),l=-1;while(++l<s.length)_h(e,"text",c);function c(m,g){let h=-1,x;while(++h<g.length){let v=g[h],w=x?x.children:void 0;if(n(v,w?w.indexOf(v):void 0,x))return;x=v}if(x)return f(m,g)}function f(m,g){let h=g[g.length-1],x=s[l][0],v=s[l][1],w=0,L=h.children.indexOf(m),k=!1,I=[];x.lastIndex=0;let T=x.exec(m.value);while(T){let R=T.index,E={index:T.index,input:T.input,stack:[...g,m]},M=v(...T,E);if(typeof M==="string")M=M.length>0?{type:"text",value:M}:void 0;if(M===!1)x.lastIndex=R+1;else{if(w!==R)I.push({type:"text",value:m.value.slice(w,R)});if(Array.isArray(M))I.push(...M);else if(M)I.push(M);w=R+T[0].length,k=!0}if(!x.global)break;T=x.exec(m.value)}if(k){if(w<m.value.length)I.push({type:"text",value:m.value.slice(w)});h.children.splice(L,1,...I)}else I=[m];return L+I.length}}function Mse(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let a=!e[0]||Array.isArray(e[0])?e:[e],r=-1;while(++r<a.length){let n=a[r];t.push([Pse(n[0]),Ese(n[1])])}return t}function Pse(e){return typeof e==="string"?new RegExp(HL(e),"g"):e}function Ese(e){return typeof e==="function"?e:function(){return e}}var jL="phrasing",GL=["autolink","link","image","label"];function KL(){return{transforms:[Bse],enter:{literalAutolink:Nse,literalAutolinkEmail:qL,literalAutolinkHttp:qL,literalAutolinkWww:qL},exit:{literalAutolink:zse,literalAutolinkEmail:_se,literalAutolinkHttp:Dse,literalAutolinkWww:Ose}}}function XL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:jL,notInConstruct:GL},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:jL,notInConstruct:GL},{character:":",before:"[ps]",after:"\\/",inConstruct:jL,notInConstruct:GL}]}}function Nse(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qL(e){this.config.enter.autolinkProtocol.call(this,e)}function Dse(e){this.config.exit.autolinkProtocol.call(this,e)}function Ose(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];Et(t.type==="link"),t.url="http://"+this.sliceSerialize(e)}function _se(e){this.config.exit.autolinkEmail.call(this,e)}function zse(e){this.exit(e)}function Bse(e){VL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Fse],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Use]],{ignore:["link","linkReference"]})}function Fse(e,t,a,r,n){let s="";if(!P9(n))return!1;if(/^w/i.test(t))a=t+a,t="",s="http://";if(!Hse(a))return!1;let l=Vse(a+r);if(!l[0])return!1;let c={type:"link",title:null,url:s+t+l[0],children:[{type:"text",value:t+l[0]}]};if(l[1])return[c,{type:"text",value:l[1]}];return c}function Use(e,t,a,r){if(!P9(r,!0)||/[-\d_]$/.test(a))return!1;return{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function Hse(e){let t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}function Vse(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],r=a.indexOf(")"),n=u(e,"("),s=u(e,")");while(r!==-1&&n>s)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),s++;return[e,a]}function P9(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||oi(a)||Pu(a))&&(!t||a!==47)}E9.peek=Qse;function jse(){this.buffer()}function Gse(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function qse(){this.buffer()}function Kse(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Xse(e){let t=this.resume(),a=this.stack[this.stack.length-1];Et(a.type==="footnoteReference"),a.identifier=lr(this.sliceSerialize(e)).toLowerCase(),a.label=t}function Yse(e){this.exit(e)}function Wse(e){let t=this.resume(),a=this.stack[this.stack.length-1];Et(a.type==="footnoteDefinition"),a.identifier=lr(this.sliceSerialize(e)).toLowerCase(),a.label=t}function $se(e){this.exit(e)}function Qse(){return"["}function E9(e,t,a,r){let n=a.createTracker(r),s=n.move("[^"),l=a.enter("footnoteReference"),c=a.enter("reference");return s+=n.move(a.safe(a.associationId(e),{after:"]",before:s})),c(),l(),s+=n.move("]"),s}function YL(){return{enter:{gfmFootnoteCallString:jse,gfmFootnoteCall:Gse,gfmFootnoteDefinitionLabelString:qse,gfmFootnoteDefinition:Kse},exit:{gfmFootnoteCallString:Xse,gfmFootnoteCall:Yse,gfmFootnoteDefinitionLabelString:Wse,gfmFootnoteDefinition:$se}}}function WL(e){let t=!1;if(e&&e.firstLineBlank)t=!0;return{handlers:{footnoteDefinition:a,footnoteReference:E9},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,n,s,l){let c=s.createTracker(l),f=c.move("[^"),m=s.enter("footnoteDefinition"),g=s.enter("label");if(f+=c.move(s.safe(s.associationId(r),{before:f,after:"]"})),g(),f+=c.move("]:"),r.children&&r.children.length>0)c.shift(4),f+=c.move((t?`
|
|
81
|
+
`:" ")+s.indentLines(s.containerFlow(r,c.current()),t?N9:Zse));return m(),f}}function Zse(e,t,a){return t===0?e:N9(e,t,a)}function N9(e,t,a){return(a?"":" ")+e}var Jse=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];D9.peek=ale;function $L(){return{canContainEols:["delete"],enter:{strikethrough:ele},exit:{strikethrough:tle}}}function QL(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Jse}],handlers:{delete:D9}}}function ele(e){this.enter({type:"delete",children:[]},e)}function tle(e){this.exit(e)}function D9(e,t,a,r){let n=a.createTracker(r),s=a.enter("strikethrough"),l=n.move("~~");return l+=a.containerPhrasing(e,{...n.current(),before:l,after:"~"}),l+=n.move("~~"),s(),l}function ale(){return"~"}function rle(e){return e.length}function _9(e,t){let a=t||{},r=(a.align||[]).concat(),n=a.stringLength||rle,s=[],l=[],c=[],f=[],m=0,g=-1;while(++g<e.length){let C=[],L=[],k=-1;if(e[g].length>m)m=e[g].length;while(++k<e[g].length){let I=ole(e[g][k]);if(a.alignDelimiters!==!1){let T=n(I);if(L[k]=T,f[k]===void 0||T>f[k])f[k]=T}C.push(I)}l[g]=C,c[g]=L}let h=-1;if(typeof r==="object"&&"length"in r)while(++h<m)s[h]=O9(r[h]);else{let C=O9(r);while(++h<m)s[h]=C}h=-1;let x=[],v=[];while(++h<m){let C=s[h],L="",k="";if(C===99)L=":",k=":";else if(C===108)L=":";else if(C===114)k=":";let I=a.alignDelimiters===!1?1:Math.max(1,f[h]-L.length-k.length),T=L+"-".repeat(I)+k;if(a.alignDelimiters!==!1){if(I=L.length+I+k.length,I>f[h])f[h]=I;v[h]=I}x[h]=T}l.splice(1,0,x),c.splice(1,0,v),g=-1;let w=[];while(++g<l.length){let C=l[g],L=c[g];h=-1;let k=[];while(++h<m){let I=C[h]||"",T="",R="";if(a.alignDelimiters!==!1){let E=f[h]-(L[h]||0),M=s[h];if(M===114)T=" ".repeat(E);else if(M===99)if(E%2)T=" ".repeat(E/2+0.5),R=" ".repeat(E/2-0.5);else T=" ".repeat(E/2),R=T;else R=" ".repeat(E)}if(a.delimiterStart!==!1&&!h)k.push("|");if(a.padding!==!1&&!(a.alignDelimiters===!1&&I==="")&&(a.delimiterStart!==!1||h))k.push(" ");if(a.alignDelimiters!==!1)k.push(T);if(k.push(I),a.alignDelimiters!==!1)k.push(R);if(a.padding!==!1)k.push(" ");if(a.delimiterEnd!==!1||h!==m-1)k.push("|")}w.push(a.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
|
|
82
|
+
`)}function ole(e){return e===null||e===void 0?"":String(e)}function O9(e){let t=typeof e==="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function z9(e,t,a,r){let n=a.enter("blockquote"),s=a.createTracker(r);s.move("> "),s.shift(2);let l=a.indentLines(a.containerFlow(e,s.current()),nle);return n(),l}function nle(e,t,a){return">"+(a?"":" ")+e}function F9(e,t){return B9(e,t.inConstruct,!0)&&!B9(e,t.notInConstruct,!1)}function B9(e,t,a){if(typeof t==="string")t=[t];if(!t||t.length===0)return a;let r=-1;while(++r<t.length)if(e.includes(t[r]))return!0;return!1}function ZL(e,t,a,r){let n=-1;while(++n<a.unsafe.length)if(a.unsafe[n].character===`
|
|
83
|
+
`&&F9(a.stack,a.unsafe[n]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function U9(e,t){let a=String(e),r=a.indexOf(t),n=r,s=0,l=0;if(typeof t!=="string")throw TypeError("Expected substring");while(r!==-1){if(r===n){if(++s>l)l=s}else s=1;n=r+t.length,r=a.indexOf(t,n)}return l}function H9(e,t){return Boolean(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function V9(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function j9(e,t,a,r){let n=V9(a),s=e.value||"",l=n==="`"?"GraveAccent":"Tilde";if(H9(e,a)){let h=a.enter("codeIndented"),x=a.indentLines(s,ile);return h(),x}let c=a.createTracker(r),f=n.repeat(Math.max(U9(s,n)+1,3)),m=a.enter("codeFenced"),g=c.move(f);if(e.lang){let h=a.enter(`codeFencedLang${l}`);g+=c.move(a.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),h()}if(e.lang&&e.meta){let h=a.enter(`codeFencedMeta${l}`);g+=c.move(" "),g+=c.move(a.safe(e.meta,{before:g,after:`
|
|
84
|
+
`,encode:["`"],...c.current()})),h()}if(g+=c.move(`
|
|
85
|
+
`),s)g+=c.move(s+`
|
|
86
|
+
`);return g+=c.move(f),m(),g}function ile(e,t,a){return(a?"":" ")+e}function Vf(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function G9(e,t,a,r){let n=Vf(a),s=n==='"'?"Quote":"Apostrophe",l=a.enter("definition"),c=a.enter("label"),f=a.createTracker(r),m=f.move("[");if(m+=f.move(a.safe(a.associationId(e),{before:m,after:"]",...f.current()})),m+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url))c=a.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(a.safe(e.url,{before:m,after:">",...f.current()})),m+=f.move(">");else c=a.enter("destinationRaw"),m+=f.move(a.safe(e.url,{before:m,after:e.title?" ":`
|
|
87
|
+
`,...f.current()}));if(c(),e.title)c=a.enter(`title${s}`),m+=f.move(" "+n),m+=f.move(a.safe(e.title,{before:m,after:n,...f.current()})),m+=f.move(n),c();return l(),m}function q9(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ul(e){return"&#x"+e.toString(16).toUpperCase()+";"}function jf(e,t,a){let r=os(e),n=os(t);if(r===void 0)return n===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:n===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(r===1)return n===void 0?{inside:!1,outside:!1}:n===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return n===void 0?{inside:!1,outside:!1}:n===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}JL.peek=sle;function JL(e,t,a,r){let n=q9(a),s=a.enter("emphasis"),l=a.createTracker(r),c=l.move(n),f=l.move(a.containerPhrasing(e,{after:n,before:c,...l.current()})),m=f.charCodeAt(0),g=jf(r.before.charCodeAt(r.before.length-1),m,n);if(g.inside)f=Ul(m)+f.slice(1);let h=f.charCodeAt(f.length-1),x=jf(r.after.charCodeAt(0),h,n);if(x.inside)f=f.slice(0,-1)+Ul(h);let v=l.move(n);return s(),a.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+v}function sle(e,t,a){return a.options.emphasis||"*"}function K9(e,t){let a=!1;return Bu(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,zu}),Boolean((!e.depth||e.depth<3)&&Au(e)&&(t.options.setext||a))}function X9(e,t,a,r){let n=Math.max(Math.min(6,e.depth||1),1),s=a.createTracker(r);if(K9(e,a)){let g=a.enter("headingSetext"),h=a.enter("phrasing"),x=a.containerPhrasing(e,{...s.current(),before:`
|
|
88
|
+
`,after:`
|
|
89
|
+
`});return h(),g(),x+`
|
|
90
|
+
`+(n===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
91
|
+
`))+1))}let l="#".repeat(n),c=a.enter("headingAtx"),f=a.enter("phrasing");s.move(l+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
|
|
92
|
+
`,...s.current()});if(/^[\t ]/.test(m))m=Ul(m.charCodeAt(0))+m.slice(1);if(m=m?l+" "+m:l,a.options.closeAtx)m+=" "+l;return f(),c(),m}eT.peek=lle;function eT(e){return e.value||""}function lle(){return"<"}tT.peek=cle;function tT(e,t,a,r){let n=Vf(a),s=n==='"'?"Quote":"Apostrophe",l=a.enter("image"),c=a.enter("label"),f=a.createTracker(r),m=f.move("![");if(m+=f.move(a.safe(e.alt,{before:m,after:"]",...f.current()})),m+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url))c=a.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(a.safe(e.url,{before:m,after:">",...f.current()})),m+=f.move(">");else c=a.enter("destinationRaw"),m+=f.move(a.safe(e.url,{before:m,after:e.title?" ":")",...f.current()}));if(c(),e.title)c=a.enter(`title${s}`),m+=f.move(" "+n),m+=f.move(a.safe(e.title,{before:m,after:n,...f.current()})),m+=f.move(n),c();return m+=f.move(")"),l(),m}function cle(){return"!"}aT.peek=ule;function aT(e,t,a,r){let n=e.referenceType,s=a.enter("imageReference"),l=a.enter("label"),c=a.createTracker(r),f=c.move("!["),m=a.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(m+"]["),l();let g=a.stack;a.stack=[],l=a.enter("reference");let h=a.safe(a.associationId(e),{before:f,after:"]",...c.current()});if(l(),a.stack=g,s(),n==="full"||!m||m!==h)f+=c.move(h+"]");else if(n==="shortcut")f=f.slice(0,-1);else f+=c.move("]");return f}function ule(){return"!"}rT.peek=dle;function rT(e,t,a){let r=e.value||"",n="`",s=-1;while(new RegExp("(^|[^`])"+n+"([^`]|$)").test(r))n+="`";if(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r)))r=" "+r+" ";while(++s<a.unsafe.length){let l=a.unsafe[s],c=a.compilePattern(l),f;if(!l.atBreak)continue;while(f=c.exec(r)){let m=f.index;if(r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13)m--;r=r.slice(0,m)+" "+r.slice(f.index+1)}}return n+r+n}function dle(){return"`"}function oT(e,t){let a=Au(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}nT.peek=fle;function nT(e,t,a,r){let n=Vf(a),s=n==='"'?"Quote":"Apostrophe",l=a.createTracker(r),c,f;if(oT(e,a)){let g=a.stack;a.stack=[],c=a.enter("autolink");let h=l.move("<");return h+=l.move(a.containerPhrasing(e,{before:h,after:">",...l.current()})),h+=l.move(">"),c(),a.stack=g,h}c=a.enter("link"),f=a.enter("label");let m=l.move("[");if(m+=l.move(a.containerPhrasing(e,{before:m,after:"](",...l.current()})),m+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url))f=a.enter("destinationLiteral"),m+=l.move("<"),m+=l.move(a.safe(e.url,{before:m,after:">",...l.current()})),m+=l.move(">");else f=a.enter("destinationRaw"),m+=l.move(a.safe(e.url,{before:m,after:e.title?" ":")",...l.current()}));if(f(),e.title)f=a.enter(`title${s}`),m+=l.move(" "+n),m+=l.move(a.safe(e.title,{before:m,after:n,...l.current()})),m+=l.move(n),f();return m+=l.move(")"),c(),m}function fle(e,t,a){return oT(e,a)?"<":"["}iT.peek=ple;function iT(e,t,a,r){let n=e.referenceType,s=a.enter("linkReference"),l=a.enter("label"),c=a.createTracker(r),f=c.move("["),m=a.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(m+"]["),l();let g=a.stack;a.stack=[],l=a.enter("reference");let h=a.safe(a.associationId(e),{before:f,after:"]",...c.current()});if(l(),a.stack=g,s(),n==="full"||!m||m!==h)f+=c.move(h+"]");else if(n==="shortcut")f=f.slice(0,-1);else f+=c.move("]");return f}function ple(){return"["}function Gf(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Y9(e){let t=Gf(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function W9(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ky(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function $9(e,t,a,r){let n=a.enter("list"),s=a.bulletCurrent,l=e.ordered?W9(a):Gf(a),c=e.ordered?l==="."?")":".":Y9(a),f=t&&a.bulletLastUsed?l===a.bulletLastUsed:!1;if(!e.ordered){let g=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&g&&(!g.children||!g.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0)f=!0;if(Ky(a)===l&&g){let h=-1;while(++h<e.children.length){let x=e.children[h];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){f=!0;break}}}}if(f)l=c;a.bulletCurrent=l;let m=a.containerFlow(e,r);return a.bulletLastUsed=l,a.bulletCurrent=s,n(),m}function Q9(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Z9(e,t,a,r){let n=Q9(a),s=a.bulletCurrent||Gf(a);if(t&&t.type==="list"&&t.ordered)s=(typeof t.start==="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+s;let l=s.length+1;if(n==="tab"||n==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))l=Math.ceil(l/4)*4;let c=a.createTracker(r);c.move(s+" ".repeat(l-s.length)),c.shift(l);let f=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,c.current()),g);return f(),m;function g(h,x,v){if(x)return(v?"":" ".repeat(l))+h;return(v?s:s+" ".repeat(l-s.length))+h}}function J9(e,t,a,r){let n=a.enter("paragraph"),s=a.enter("phrasing"),l=a.containerPhrasing(e,r);return s(),n(),l}var sT=Fl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function eH(e,t,a,r){return(e.children.some(function(l){return sT(l)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function tH(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lT.peek=mle;function lT(e,t,a,r){let n=tH(a),s=a.enter("strong"),l=a.createTracker(r),c=l.move(n+n),f=l.move(a.containerPhrasing(e,{after:n,before:c,...l.current()})),m=f.charCodeAt(0),g=jf(r.before.charCodeAt(r.before.length-1),m,n);if(g.inside)f=Ul(m)+f.slice(1);let h=f.charCodeAt(f.length-1),x=jf(r.after.charCodeAt(0),h,n);if(x.inside)f=f.slice(0,-1)+Ul(h);let v=l.move(n+n);return s(),a.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+v}function mle(e,t,a){return a.options.strong||"*"}function aH(e,t,a,r){return a.safe(e.value,r)}function rH(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function oH(e,t,a){let r=(Ky(a)+(a.options.ruleSpaces?" ":"")).repeat(rH(a));return a.options.ruleSpaces?r.slice(0,-1):r}var Fh={blockquote:z9,break:ZL,code:j9,definition:G9,emphasis:JL,hardBreak:ZL,heading:X9,html:eT,image:tT,imageReference:aT,inlineCode:rT,link:nT,linkReference:iT,list:$9,listItem:Z9,paragraph:J9,root:eH,strong:lT,text:aH,thematicBreak:oH};function uT(){return{enter:{table:gle,tableData:nH,tableHeader:nH,tableRow:xle},exit:{codeText:vle,table:hle,tableData:cT,tableHeader:cT,tableRow:cT}}}function gle(e){let t=e._align;Et(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function hle(e){this.exit(e),this.data.inTable=void 0}function xle(e){this.enter({type:"tableRow",children:[]},e)}function cT(e){this.exit(e)}function nH(e){this.enter({type:"tableCell",children:[]},e)}function vle(e){let t=this.resume();if(this.data.inTable)t=t.replace(/\\([\\|])/g,ble);let a=this.stack[this.stack.length-1];Et(a.type==="inlineCode"),a.value=t,this.exit(e)}function ble(e,t){return t==="|"?t:e}function dT(e){let t=e||{},{tableCellPadding:a,tablePipeAlign:r,stringLength:n}=t,s=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
93
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:f,tableRow:c}};function l(v,w,C,L){return m(g(v,C,L),v.align)}function c(v,w,C,L){let k=h(v,C,L),I=m([k]);return I.slice(0,I.indexOf(`
|
|
94
|
+
`))}function f(v,w,C,L){let k=C.enter("tableCell"),I=C.enter("phrasing"),T=C.containerPhrasing(v,{...L,before:s,after:s});return I(),k(),T}function m(v,w){return _9(v,{align:w,alignDelimiters:r,padding:a,stringLength:n})}function g(v,w,C){let L=v.children,k=-1,I=[],T=w.enter("table");while(++k<L.length)I[k]=h(L[k],w,C);return T(),I}function h(v,w,C){let L=v.children,k=-1,I=[],T=w.enter("tableRow");while(++k<L.length)I[k]=f(L[k],v,w,C);return T(),I}function x(v,w,C){let L=Fh.inlineCode(v,w,C);if(C.stack.includes("tableCell"))L=L.replace(/\|/g,"\\$&");return L}}function fT(){return{exit:{taskListCheckValueChecked:iH,taskListCheckValueUnchecked:iH,paragraph:yle}}}function pT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wle}}}function iH(e){let t=this.stack[this.stack.length-2];Et(t.type==="listItem"),t.checked=e.type==="taskListCheckValueChecked"}function yle(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked==="boolean"){let a=this.stack[this.stack.length-1];Et(a.type==="paragraph");let r=a.children[0];if(r&&r.type==="text"){let n=t.children,s=-1,l;while(++s<n.length){let c=n[s];if(c.type==="paragraph"){l=c;break}}if(l===a){if(r.value=r.value.slice(1),r.value.length===0)a.children.shift();else if(a.position&&r.position&&typeof r.position.start.offset==="number")r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)}}}this.exit(e)}function wle(e,t,a,r){let n=e.children[0],s=typeof e.checked==="boolean"&&n&&n.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=a.createTracker(r);if(s)c.move(l);let f=Fh.listItem(e,t,a,{...r,...c.current()});if(s)f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m);return f;function m(g){return g+l}}function mT(){return[KL(),YL(),$L(),uT(),fT()]}function gT(e){return{extensions:[XL(),WL(e),QL(),dT(e),pT()]}}var Sle={tokenize:Tle,partial:!0},sH={tokenize:Rle,partial:!0},lH={tokenize:Ale,partial:!0},cH={tokenize:Mle,partial:!0},kle={tokenize:Ple,partial:!0},uH={name:"wwwAutolink",tokenize:Ile,previous:fH},dH={name:"protocolAutolink",tokenize:Lle,previous:pH},ns={name:"emailAutolink",tokenize:Cle,previous:mH},ii={};function xT(){return{text:ii}}var Fu=48;while(Fu<123)if(ii[Fu]=ns,Fu++,Fu===58)Fu=65;else if(Fu===91)Fu=97;ii[43]=ns;ii[45]=ns;ii[46]=ns;ii[95]=ns;ii[72]=[ns,dH];ii[104]=[ns,dH];ii[87]=[ns,uH];ii[119]=[ns,uH];function Cle(e,t,a){let r=this,n,s;return l;function l(h){if(!hT(h)||!mH.call(r,r.previous)||vT(r.events))return a(h);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(h)}function c(h){if(hT(h))return e.consume(h),c;if(h===64)return e.consume(h),f;return a(h)}function f(h){if(h===46)return e.check(kle,g,m)(h);if(h===45||h===95||Xt(h))return s=!0,e.consume(h),f;return g(h)}function m(h){return e.consume(h),n=!0,f}function g(h){if(s&&n&&va(r.previous))return e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h);return a(h)}}function Ile(e,t,a){let r=this;return n;function n(l){if(l!==87&&l!==119||!fH.call(r,r.previous)||vT(r.events))return a(l);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Sle,e.attempt(sH,e.attempt(lH,s),a),a)(l)}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Lle(e,t,a){let r=this,n="",s=!1;return l;function l(h){if((h===72||h===104)&&pH.call(r,r.previous)&&!vT(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),n+=String.fromCodePoint(h),e.consume(h),c;return a(h)}function c(h){if(va(h)&&n.length<5)return n+=String.fromCodePoint(h),e.consume(h),c;if(h===58){let x=n.toLowerCase();if(x==="http"||x==="https")return e.consume(h),f}return a(h)}function f(h){if(h===47){if(e.consume(h),s)return m;return s=!0,f}return a(h)}function m(h){return h===null||Mu(h)||tt(h)||oi(h)||Pu(h)?a(h):e.attempt(sH,e.attempt(lH,g),a)(h)}function g(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function Tle(e,t,a){let r=0;return n;function n(l){if((l===87||l===119)&&r<3)return r++,e.consume(l),n;if(l===46&&r===3)return e.consume(l),s;return a(l)}function s(l){return l===null?a(l):t(l)}}function Rle(e,t,a){let r,n,s;return l;function l(m){if(m===46||m===95)return e.check(cH,f,c)(m);if(m===null||tt(m)||oi(m)||m!==45&&Pu(m))return f(m);return s=!0,e.consume(m),l}function c(m){if(m===95)r=!0;else n=r,r=void 0;return e.consume(m),l}function f(m){if(n||r||!s)return a(m);return t(m)}}function Ale(e,t){let a=0,r=0;return n;function n(l){if(l===40)return a++,e.consume(l),n;if(l===41&&r<a)return s(l);if(l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126)return e.check(cH,t,s)(l);if(l===null||tt(l)||oi(l))return t(l);return e.consume(l),n}function s(l){if(l===41)r++;return e.consume(l),n}}function Mle(e,t,a){return r;function r(c){if(c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126)return e.consume(c),r;if(c===38)return e.consume(c),s;if(c===93)return e.consume(c),n;if(c===60||c===null||tt(c)||oi(c))return t(c);return a(c)}function n(c){if(c===null||c===40||c===91||tt(c)||oi(c))return t(c);return r(c)}function s(c){return va(c)?l(c):a(c)}function l(c){if(c===59)return e.consume(c),r;if(va(c))return e.consume(c),l;return a(c)}}function Ple(e,t,a){return r;function r(s){return e.consume(s),n}function n(s){return Xt(s)?a(s):t(s)}}function fH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||tt(e)}function pH(e){return!va(e)}function mH(e){return!(e===47||hT(e))}function hT(e){return e===43||e===45||e===46||e===95||Xt(e)}function vT(e){let t=e.length,a=!1;while(t--){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}if(e.length>0&&!a)e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return a}var Ele={tokenize:Fle,partial:!0};function bT(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:_le,continuation:{tokenize:zle},exit:Ble}},text:{[91]:{name:"gfmFootnoteCall",tokenize:Ole},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Nle,resolveTo:Dle}}}}function Nle(e,t,a){let r=this,n=r.events.length,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),l;while(n--){let f=r.events[n][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return a(f);let m=lr(r.sliceSerialize({start:l.end,end:r.now()}));if(m.codePointAt(0)!==94||!s.includes(m.slice(1)))return a(f);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f)}}function Dle(e,t){let a=e.length,r;while(a--)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){r=e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},f=[e[a+1],e[a+2],["enter",n,t],e[a+3],e[a+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",c,t],["exit",c,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice(a,e.length-a+1,...f),e}function Ole(e,t,a){let r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s=0,l;return c;function c(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),f}function f(h){if(h!==94)return a(h);return e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m}function m(h){if(s>999||h===93&&!l||h===null||h===91||tt(h))return a(h);if(h===93){e.exit("chunkString");let x=e.exit("gfmFootnoteCallString");if(!n.includes(lr(r.sliceSerialize(x))))return a(h);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}if(!tt(h))l=!0;return s++,e.consume(h),h===92?g:m}function g(h){if(h===91||h===92||h===93)return e.consume(h),s++,m;return m(h)}}function _le(e,t,a){let r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s,l=0,c;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(w){if(w===94)return e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g;return a(w)}function g(w){if(l>999||w===93&&!c||w===null||w===91||tt(w))return a(w);if(w===93){e.exit("chunkString");let C=e.exit("gfmFootnoteDefinitionLabelString");return s=lr(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}if(!tt(w))c=!0;return l++,e.consume(w),w===92?h:g}function h(w){if(w===91||w===92||w===93)return e.consume(w),l++,g;return g(w)}function x(w){if(w===58){if(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),!n.includes(s))n.push(s);return ze(e,v,"gfmFootnoteDefinitionWhitespace")}return a(w)}function v(w){return t(w)}}function zle(e,t,a){return e.check(ni,t,e.attempt(Ele,t,a))}function Ble(e){e.exit("gfmFootnoteDefinition")}function Fle(e,t,a){let r=this;return ze(e,n,"gfmFootnoteDefinitionIndent",5);function n(s){let l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(s):a(s)}}function yT(e){let a=(e||{}).singleTilde,r={name:"strikethrough",tokenize:s,resolveAll:n};if(a===null||a===void 0)a=!0;return{text:{[126]:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function n(l,c){let f=-1;while(++f<l.length)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let m=f;while(m--)if(l[m][0]==="exit"&&l[m][1].type==="strikethroughSequenceTemporary"&&l[m][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[m][1].end.offset-l[m][1].start.offset){l[f][1].type="strikethroughSequence",l[m][1].type="strikethroughSequence";let g={type:"strikethrough",start:Object.assign({},l[m][1].start),end:Object.assign({},l[f][1].end)},h={type:"strikethroughText",start:Object.assign({},l[m][1].end),end:Object.assign({},l[f][1].start)},x=[["enter",g,c],["enter",l[m][1],c],["exit",l[m][1],c],["enter",h,c]],v=c.parser.constructs.insideSpan.null;if(v)ta(x,x.length,0,zl(v,l.slice(m+1,f),c));ta(x,x.length,0,[["exit",h,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",g,c]]),ta(l,m-1,f-m+3,x),f=m+x.length-2;break}}f=-1;while(++f<l.length)if(l[f][1].type==="strikethroughSequenceTemporary")l[f][1].type="data";return l}function s(l,c,f){let m=this.previous,g=this.events,h=0;return x;function x(w){if(m===126&&g[g.length-1][1].type!=="characterEscape")return f(w);return l.enter("strikethroughSequenceTemporary"),v(w)}function v(w){let C=os(m);if(w===126){if(h>1)return f(w);return l.consume(w),h++,v}if(h<2&&!a)return f(w);let L=l.exit("strikethroughSequenceTemporary"),k=os(w);return L._open=!k||k===2&&Boolean(C),L._close=!C||C===2&&Boolean(k),c(w)}}}class wT{constructor(){this.map=[]}add(e,t,a){Ule(this,e,t,a)}consume(e){if(this.map.sort(function(n,s){return n[0]-s[0]}),this.map.length===0)return;let t=this.map.length,a=[];while(t>0)t-=1,a.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];a.push(e.slice()),e.length=0;let r=a.pop();while(r){for(let n of r)e.push(n);r=a.pop()}this.map.length=0}}function Ule(e,t,a,r){let n=0;if(a===0&&r.length===0)return;while(n<e.map.length){if(e.map[n][0]===t){e.map[n][1]+=a,e.map[n][2].push(...r);return}n+=1}e.map.push([t,a,r])}function gH(e,t){let a=!1,r=[];while(t<e.length){let n=e[t];if(a){if(n[0]==="enter"){if(n[1].type==="tableContent")r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(n[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else if(n[0]==="enter"&&n[1].type==="tableDelimiterRow")a=!0;t+=1}return r}function ST(){return{flow:{null:{name:"table",tokenize:Hle,resolveAll:Vle}}}}function Hle(e,t,a){let r=this,n=0,s=0,l;return c;function c(z){let Y=r.events.length-1;while(Y>-1){let Q=r.events[Y][1].type;if(Q==="lineEnding"||Q==="linePrefix")Y--;else break}let q=Y>-1?r.events[Y][1].type:null,G=q==="tableHead"||q==="tableRow"?M:f;if(G===M&&r.parser.lazy[r.now().line])return a(z);return G(z)}function f(z){return e.enter("tableHead"),e.enter("tableRow"),m(z)}function m(z){if(z===124)return g(z);return l=!0,s+=1,g(z)}function g(z){if(z===null)return a(z);if(Ie(z)){if(s>1)return s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),v;return a(z)}if(Ue(z))return ze(e,g,"whitespace")(z);if(s+=1,l)l=!1,n+=1;if(z===124)return e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),l=!0,g;return e.enter("data"),h(z)}function h(z){if(z===null||z===124||tt(z))return e.exit("data"),g(z);return e.consume(z),z===92?x:h}function x(z){if(z===92||z===124)return e.consume(z),h;return h(z)}function v(z){if(r.interrupt=!1,r.parser.lazy[r.now().line])return a(z);if(e.enter("tableDelimiterRow"),l=!1,Ue(z))return ze(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z);return w(z)}function w(z){if(z===45||z===58)return L(z);if(z===124)return l=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),C;return E(z)}function C(z){if(Ue(z))return ze(e,L,"whitespace")(z);return L(z)}function L(z){if(z===58)return s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),k;if(z===45)return s+=1,k(z);if(z===null||Ie(z))return R(z);return E(z)}function k(z){if(z===45)return e.enter("tableDelimiterFiller"),I(z);return E(z)}function I(z){if(z===45)return e.consume(z),I;if(z===58)return l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),T;return e.exit("tableDelimiterFiller"),T(z)}function T(z){if(Ue(z))return ze(e,R,"whitespace")(z);return R(z)}function R(z){if(z===124)return w(z);if(z===null||Ie(z)){if(!l||n!==s)return E(z);return e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)}return E(z)}function E(z){return a(z)}function M(z){return e.enter("tableRow"),P(z)}function P(z){if(z===124)return e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),P;if(z===null||Ie(z))return e.exit("tableRow"),t(z);if(Ue(z))return ze(e,P,"whitespace")(z);return e.enter("data"),O(z)}function O(z){if(z===null||z===124||tt(z))return e.exit("data"),P(z);return e.consume(z),z===92?F:O}function F(z){if(z===92||z===124)return e.consume(z),O;return O(z)}}function Vle(e,t){let a=-1,r=!0,n=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,m,g,h,x=new wT;while(++a<e.length){let v=e[a],w=v[1];if(v[0]==="enter"){if(w.type==="tableHead"){if(c=!1,f!==0)hH(x,t,f,m,g),g=void 0,f=0;m={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(a,0,[["enter",m,t]])}else if(w.type==="tableRow"||w.type==="tableDelimiterRow"){if(r=!0,h=void 0,s=[0,0,0,0],l=[0,a+1,0,0],c)c=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(a,0,[["enter",g,t]]);n=w.type==="tableDelimiterRow"?2:g?3:1}else if(n&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")){if(r=!1,l[2]===0){if(s[1]!==0)l[0]=l[1],h=Xy(x,t,s,n,void 0,h),s=[0,0,0,0];l[2]=a}}else if(w.type==="tableCellDivider")if(r)r=!1;else{if(s[1]!==0)l[0]=l[1],h=Xy(x,t,s,n,void 0,h);s=l,l=[s[1],a,0,0]}}else if(w.type==="tableHead")c=!0,f=a;else if(w.type==="tableRow"||w.type==="tableDelimiterRow"){if(f=a,s[1]!==0)l[0]=l[1],h=Xy(x,t,s,n,a,h);else if(l[1]!==0)h=Xy(x,t,l,n,a,h);n=0}else if(n&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller"))l[3]=a}if(f!==0)hH(x,t,f,m,g);x.consume(t.events),a=-1;while(++a<t.events.length){let v=t.events[a];if(v[0]==="enter"&&v[1].type==="table")v[1]._align=gH(t.events,a)}return e}function Xy(e,t,a,r,n,s){let l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";if(a[0]!==0)s.end=Object.assign({},qf(t.events,a[0])),e.add(a[0],0,[["exit",s,t]]);let f=qf(t.events,a[1]);if(s={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(a[1],0,[["enter",s,t]]),a[2]!==0){let m=qf(t.events,a[2]),g=qf(t.events,a[3]),h={type:"tableContent",start:Object.assign({},m),end:Object.assign({},g)};if(e.add(a[2],0,[["enter",h,t]]),r!==2){let x=t.events[a[2]],v=t.events[a[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",a[3]>a[2]+1){let w=a[2]+1,C=a[3]-a[2]-1;e.add(w,C,[])}}e.add(a[3]+1,0,[["exit",h,t]])}if(n!==void 0)s.end=Object.assign({},qf(t.events,n)),e.add(n,0,[["exit",s,t]]),s=void 0;return s}function hH(e,t,a,r,n){let s=[],l=qf(t.events,a);if(n)n.end=Object.assign({},l),s.push(["exit",n,t]);r.end=Object.assign({},l),s.push(["exit",r,t]),e.add(a+1,0,s)}function qf(e,t){let a=e[t],r=a[0]==="enter"?"start":"end";return a[1][r]}var jle={name:"tasklistCheck",tokenize:Gle};function kT(){return{text:{[91]:jle}}}function Gle(e,t,a){let r=this;return n;function n(f){if(r.previous!==null||!r._gfmTasklistFirstContentOfListItem)return a(f);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),s}function s(f){if(tt(f))return e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l;if(f===88||f===120)return e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l;return a(f)}function l(f){if(f===93)return e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c;return a(f)}function c(f){if(Ie(f))return t(f);if(Ue(f))return e.check({tokenize:qle},t,a)(f);return a(f)}}function qle(e,t,a){return ze(e,r,"whitespace");function r(n){return n===null?a(n):t(n)}}function xH(e){return yy([xT(),bT(),yT(e),ST(),kT()])}var Kle={};function Yy(e){let t=this,a=e||Kle,r=t.data(),n=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);n.push(xH(a)),s.push(mT()),l.push(gT(a))}var bH={javascript:()=>(Ye("rj1164tm"),import("/chunk-rj1164tm.js")),typescript:()=>(Ye("jcnm8ap3"),import("/chunk-jcnm8ap3.js")),jsx:()=>(Ye("p5m4kcyp"),import("/chunk-p5m4kcyp.js")),tsx:()=>(Ye("1hsbtrt7"),import("/chunk-1hsbtrt7.js")),json:()=>(Ye("yenm06gj"),import("/chunk-yenm06gj.js")),jsonc:()=>(Ye("4587k1kk"),import("/chunk-4587k1kk.js")),shellscript:()=>(Ye("deqmvh2y"),import("/chunk-deqmvh2y.js")),powershell:()=>(Ye("vcj3m7wp"),import("/chunk-vcj3m7wp.js")),python:()=>(Ye("7hpamxpk"),import("/chunk-7hpamxpk.js")),go:()=>(Ye("9e08jfg6"),import("/chunk-9e08jfg6.js")),rust:()=>(Ye("dwa0v44t"),import("/chunk-dwa0v44t.js")),java:()=>(Ye("3zr9b6sh"),import("/chunk-3zr9b6sh.js")),kotlin:()=>(Ye("fwhn9kja"),import("/chunk-fwhn9kja.js")),c:()=>(Ye("sm5g3apm"),import("/chunk-sm5g3apm.js")),cpp:()=>(Ye("c29x9yr7"),import("/chunk-c29x9yr7.js")),csharp:()=>(Ye("s0wykzpf"),import("/chunk-s0wykzpf.js")),php:()=>(Ye("0k94bd7w"),import("/chunk-0k94bd7w.js")),ruby:()=>(Ye("nnhyekc9"),import("/chunk-nnhyekc9.js")),swift:()=>(Ye("5a2wt1wn"),import("/chunk-5a2wt1wn.js")),dart:()=>(Ye("gzmwacrs"),import("/chunk-gzmwacrs.js")),lua:()=>(Ye("yymd449s"),import("/chunk-yymd449s.js")),sql:()=>(Ye("98m1ye59"),import("/chunk-98m1ye59.js")),graphql:()=>(Ye("pae7wjqv"),import("/chunk-pae7wjqv.js")),yaml:()=>(Ye("v0b1rz8b"),import("/chunk-v0b1rz8b.js")),toml:()=>(Ye("rachd7gd"),import("/chunk-rachd7gd.js")),ini:()=>(Ye("6f4fhpq5"),import("/chunk-6f4fhpq5.js")),xml:()=>(Ye("7fh46gy9"),import("/chunk-7fh46gy9.js")),html:()=>(Ye("2g1d0p8k"),import("/chunk-2g1d0p8k.js")),css:()=>(Ye("2y991ert"),import("/chunk-2y991ert.js")),scss:()=>(Ye("7k2ksd6m"),import("/chunk-7k2ksd6m.js")),vue:()=>(Ye("qnky191x"),import("/chunk-qnky191x.js")),svelte:()=>(Ye("7vp7mn8t"),import("/chunk-7vp7mn8t.js")),markdown:()=>(Ye("jt618p78"),import("/chunk-jt618p78.js")),diff:()=>(Ye("wqjjkgh9"),import("/chunk-wqjjkgh9.js")),docker:()=>(Ye("neqyf1jm"),import("/chunk-neqyf1jm.js")),make:()=>(Ye("7r3qwgvk"),import("/chunk-7r3qwgvk.js"))},Xle={js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",console:"shellscript",ps1:"powershell",ps:"powershell",py:"python",golang:"go",rs:"rust",kt:"kotlin","c++":"cpp",cs:"csharp","c#":"csharp",rb:"ruby",gql:"graphql",yml:"yaml",htm:"html",md:"markdown",patch:"diff",dockerfile:"docker",makefile:"make",svg:"xml"};function yH(e){if(!e)return null;let t=e.trim().toLowerCase().replace(/^language-/,"");if(t in bH)return t;return Xle[t]??null}var vH=null,CT=new Map;function Yle(){return vH??=(async()=>{let[{createHighlighterCore:e},{createJavaScriptRegexEngine:t}]=await Promise.all([(Ye("yvhjz3k7"),import("/chunk-yvhjz3k7.js")),(Ye("adfxb1sz"),import("/chunk-adfxb1sz.js"))]);return e({themes:[(Ye("c84m5n2b"),import("/chunk-c84m5n2b.js")),(Ye("ewkw0yxq"),import("/chunk-ewkw0yxq.js"))],langs:[],engine:t({forgiving:!0})})})(),vH}async function Wle(e,t){if(e.getLoadedLanguages().includes(t))return;let a=CT.get(t);if(!a)a=e.loadLanguage(bH[t]()).catch((r)=>{throw CT.delete(t),r}),CT.set(t,a);await a}async function wH(e,t){try{let a=await Yle();return await Wle(a,t),a.codeToTokensWithThemes(e,{lang:t,themes:{light:"github-light",dark:"github-dark"}}).map((n)=>n.map((s)=>({content:s.content,style:$le(s.variants)})))}catch{return null}}function $le(e){let t={},{light:a,dark:r}=e;if(a?.color)t["--shiki-light"]=a.color;if(r?.color)t["--shiki-dark"]=r.color;let n=a?.fontStyle??0;if(n>0){if(n&1)t.fontStyle="italic";if(n&2)t.fontWeight="600";if(n&4)t.textDecoration="underline"}return t}var Qle=120;function SH({code:e,language:t}){let a=yH(t),[r,n]=A(null),[s,l]=A(!1);U(()=>{if(!a)return;let h=!1,x=setTimeout(()=>{wH(e,a).then((v)=>{if(!h&&v)n({code:e,lines:v})})},Qle);return()=>{h=!0,clearTimeout(x)}},[e,a]);let c=async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)}catch{}},f=r&&e.startsWith(r.code)?r:null,m=f?e.slice(f.code.length):e,g=t?.replace(/^language-/,"")||"text";return S("div",{className:"my-3 max-w-full overflow-hidden rounded-2xl bg-muted/70 first:mt-0 last:mb-0 dark:bg-muted/50",children:[S("div",{className:"flex items-center justify-between gap-2 pt-4 pr-4 pl-6 sm:pl-7",children:[d("span",{className:"text-[13px] font-medium text-foreground/80 uppercase",children:g}),d("button",{type:"button",onClick:()=>void c(),"aria-label":s?"Copied":"Copy code",title:s?"Copied":"Copy code",className:"flex size-8 items-center justify-center rounded-full text-muted-foreground transition-colors outline-none hover:bg-foreground/10 hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/40",children:s?d(Ke,{className:"size-4","aria-hidden":!0}):d(gr,{className:"size-4","aria-hidden":!0})})]}),d("pre",{className:N("overflow-x-auto px-6 pt-3 pb-6 font-mono sm:px-7 text-[14px] leading-[1.45]",f&&"shiki-code"),children:S("code",{children:[f?.lines.map((h,x)=>S("span",{children:[h.map((v,w)=>d("span",{style:v.style,children:v.content},w)),x<f.lines.length-1?`
|
|
95
|
+
`:""]},x)),m]})})]})}var Zle=["img","iframe","script","style","video","audio","embed","object"];function Ea(e,t){return function({node:r,className:n,...s}){return d(e,{...s,className:N(t,n)})}}function Jle({node:e,className:t,...a}){return d("a",{...a,target:"_blank",rel:"noopener noreferrer nofollow",className:N("font-medium text-primary underline underline-offset-2 hover:no-underline",t)})}function ece({node:e,className:t,...a}){let r=typeof t==="string"&&t.includes("language-");return d("code",{...a,className:N("font-mono",r?"bg-transparent p-0 text-base":"rounded bg-muted px-1 py-0.5 text-[0.9em] wrap-anywhere",t)})}function IT(e){if(typeof e==="string"||typeof e==="number")return String(e);if(Array.isArray(e))return e.map(IT).join("");if(Yt(e))return IT(e.props.children);return""}function tce({node:e,children:t}){let a=ur.toArray(t)[0];if(Yt(a)){let r=a.props.className??"",n=/(?:^|\s)language-(\S+)/.exec(r)?.[1]??null,s=IT(a.props.children).replace(/\n$/,"");return d(SH,{code:s,language:n})}return d("pre",{className:"my-2 overflow-x-auto rounded-lg border bg-muted/60 p-3",children:t})}function ace({node:e,className:t,...a}){return d("div",{className:"my-2 max-w-full overflow-x-auto rounded-lg border first:mt-0 last:mb-0",children:d("table",{...a,className:N("w-full border-collapse text-left text-base",t)})})}var rce={a:Jle,code:ece,table:ace,pre:tce,p:Ea("p","my-2 first:mt-0 last:mb-0"),h1:Ea("h1","mt-4 mb-2 text-lg font-semibold first:mt-0"),h2:Ea("h2","mt-4 mb-2 text-lg font-semibold first:mt-0"),h3:Ea("h3","mt-3 mb-1.5 text-base font-semibold first:mt-0"),h4:Ea("h4","mt-3 mb-1.5 text-base font-semibold first:mt-0"),h5:Ea("h5","mt-3 mb-1 text-base font-semibold first:mt-0"),h6:Ea("h6","mt-3 mb-1 text-base font-semibold first:mt-0"),ul:Ea("ul","my-2 list-disc space-y-1 ps-5 first:mt-0 last:mb-0"),ol:Ea("ol","my-2 list-decimal space-y-1 ps-5 first:mt-0 last:mb-0"),li:Ea("li","marker:text-muted-foreground"),blockquote:Ea("blockquote","my-2 border-s-2 border-border ps-3 text-muted-foreground italic first:mt-0 last:mb-0"),hr:Ea("hr","my-3 border-border"),thead:Ea("thead","bg-muted/60"),th:Ea("th","border-b px-3 py-2 font-semibold whitespace-nowrap"),td:Ea("td","border-b px-3 py-2 align-top"),strong:Ea("strong","font-semibold"),em:Ea("em","italic"),del:Ea("del","text-muted-foreground line-through")};function kH({children:e,className:t}){return d("div",{className:N("min-w-0",t),children:d(UL,{remarkPlugins:[Yy],disallowedElements:Zle,unwrapDisallowed:!0,components:rce,children:e})})}function Wy({text:e,className:t}){let[a,r]=A(!1);if(U(()=>{if(!a)return;let s=setTimeout(()=>r(!1),1500);return()=>clearTimeout(s)},[a]),e.trim()==="")return null;let n=async()=>{try{await navigator.clipboard.writeText(e),r(!0)}catch{De.error("Couldn't copy. Select the text and copy it manually.")}};return S(rn,{children:[d(on,{asChild:!0,children:d("button",{type:"button",onClick:()=>void n(),"aria-label":a?"Copied":"Copy message",className:N("flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-[opacity,color,background-color] outline-none hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50","pointer-fine:opacity-0 pointer-fine:group-hover/message:opacity-100 pointer-fine:group-focus-within/message:opacity-100",a&&"opacity-100 pointer-fine:opacity-100",t),children:a?d(Ke,{className:"size-3.5 text-emerald-600 dark:text-emerald-400","aria-hidden":!0}):d(gr,{className:"size-3.5","aria-hidden":!0})})}),d(nn,{children:a?"Copied":"Copy"})]})}var oce=Ca("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});function Uh({variant:e="default",align:t="start",className:a,...r}){return d("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:N(oce({variant:e}),a),...r})}function Hh({asChild:e=!1,className:t,...a}){let r=e?mf:"div";return d(r,{"data-slot":"bubble-content",className:N("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-base leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",t),...a})}var Nfr=Ca("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}});function $y({className:e,align:t="start",...a}){return d("div",{"data-slot":"message","data-align":t,className:N("group/message relative flex w-full min-w-0 gap-2 text-base data-[align=end]:flex-row-reverse",e),...a})}function Qy({className:e,...t}){return d("div",{"data-slot":"message-content",className:N("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",e),...t})}function Zy({className:e,...t}){return d("div",{"data-slot":"message-footer",className:N("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",e),...t})}var nce=90,ice=400,sce=12;function CH(){return typeof window<"u"&&typeof window.matchMedia==="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function lce(e,t,a){let r=t.length-e;if(r<=0)return t.length;let n=Math.max(0,Math.min(a,100)),s=r/ice*1000,l=Math.max(nce,s),c=e+Math.max(1,Math.round(l*n/1000));if(c>=t.length)return t.length;let m=t.slice(c,c+sce).search(/\s/);if(m>0)c+=m;return Math.min(c,t.length)}function Jy(e,t){let[a,r]=A(()=>t?"":e),n=B(a),s=B(e);s.current=e;let l=j((c)=>{if(n.current===c)return;n.current=c,r(c)},[]);if(U(()=>{if(!t||CH())return;r(n.current);let c=0,f=null,m=(g)=>{let h=f===null?16:g-f;f=g;let x=s.current,v=n.current;if(!x.startsWith(v))l(x);else if(v.length<x.length)l(x.slice(0,lce(v.length,x,h)));c=requestAnimationFrame(m)};return c=requestAnimationFrame(m),()=>cancelAnimationFrame(c)},[t,l]),!t||CH())return n.current=e,e;return a}function ew(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function IH(e){let t=Math.round(e/1000);if(t<60)return`${t}s`;let a=Math.floor(t/60),r=t%60;return r===0?`${a}m`:`${a}m ${r}s`}function tw(e,t,a){Object.defineProperty(e,t,{value:a,enumerable:!0,writable:!0,configurable:!0})}function LH(e,t){if(t.length===0)return e;let a={};for(let[r,n]of Object.entries(e))tw(a,r,n);for(let r of t)if(!Object.hasOwn(a,r))tw(a,r,!1);return a}function LT(e,t){if(Object.hasOwn(e,t))return Boolean(e[t]);return!0}function TH(e,t){let a={};for(let[r,n]of Object.entries(e))tw(a,r,n);return tw(a,t,!LT(e,t)),a}var cce={read:Ei,list:_t,glob:_t,edit:zn,write:zn,patch:zn,bash:ll,shell:ll,grep:la,webfetch:Jr};function uce(e){let t=(typeof e.tool==="string"?e.tool:e.type).toLowerCase();return t!==""&&cce[t]||Bg}function TT(e,t){return d(e,{className:N("size-3.5 shrink-0",t),"data-icon":"inline-start"})}function dce({text:e,live:t=!1}){let a=Jy(e,t),r=a.trim()==="";return d("div",{className:N("max-h-40 overflow-y-auto whitespace-pre-wrap text-[13px] leading-relaxed",r&&"text-muted-foreground/50"),children:r?"organizing thoughts…":a})}function RT(e,t,a){return S("div",{className:N("relative flex gap-2.5",!a?.last&&"pb-5"),children:[!a?.last&&d("span",{className:"absolute top-6 bottom-0 left-2.5 -ml-px w-px bg-border","aria-hidden":!0}),d("span",{className:N("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full",a?.streaming&&"animate-pulse text-foreground/70"),children:e}),d("div",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:t})]})}function RH({groupId:e,blockKey:t,steps:a,collapsible:r,onToggle:n,streaming:s,isLastBlock:l}){if(a.length===0)return null;let c=`${e}:${t}`,f=LT(r,c),m=s&&l;return S(Lo,{open:f,children:[S(ae,{type:"button",variant:"ghost",size:"sm",className:"h-7 self-start gap-1 px-2 text-xs text-muted-foreground",onClick:()=>n(c),"aria-expanded":f,children:["Thought process",d(Jt,{"data-icon":"inline-end",className:N("transition-transform",f&&"rotate-90")})]}),d(To,{children:S("div",{className:"flex flex-col px-3 pt-1",children:[a.map((g,h)=>g.kind==="reasoning"?d("div",{children:RT(TT(Hm,"text-muted-foreground"),d(dce,{text:Iu(g.part)??"",live:m&&h===a.length-1}),{last:m&&h===a.length-1,streaming:m&&h===a.length-1})},g.key):d("div",{children:RT(TT(uce(g.part),"text-muted-foreground"),d("span",{className:"font-mono text-[13px]",children:UI(g.part)}),{last:m&&h===a.length-1,streaming:!1})},g.key)),!m&&RT(TT(el,"text-muted-foreground"),d("span",{children:"Done"}),{last:!0})]})})]})}function fce({text:e,streaming:t}){let a=Jy(e,t);return d(kH,{children:a})}function AT(e){return e.trim().toLowerCase()==="(empty)"}function AH({group:e,collapsible:t,onToggle:a}){let r=e.messages[0];if(!r)return null;let n=xh(e.messages),s=r.streaming===!0||e.messages.some((m)=>m.streaming===!0),l=Z0(n),c=!s?qF(e.messages):null,f=l.map((m)=>m.content?.kind==="text"&&!AT(m.content.text)?m.content.text.trim():"").filter((m)=>m!=="").join(`
|
|
96
|
+
|
|
97
|
+
`);return d($y,{align:"start",children:S(Qy,{children:[l.map((m,g)=>{let h=g===l.length-1,x=m.steps.length>0;return S("div",{children:[d(RH,{groupId:e.id,blockKey:m.key,steps:m.steps,collapsible:t,onToggle:a,streaming:s,isLastBlock:h}),m.content?.kind==="error"&&d("div",{className:N(x&&"mt-3"),children:d(Uh,{variant:"destructive",children:d(Hh,{children:S("div",{className:"flex gap-2",children:[d(jo,{className:"mt-0.5 size-4 shrink-0","data-icon":"inline-start"}),d("span",{className:"whitespace-pre-wrap",children:Iu(m.content.part)??"Something went wrong while processing the prompt."})]})})})}),m.content?.kind==="text"&&AT(m.content.text)&&d("p",{className:N("text-xs text-muted-foreground/70 italic",x&&"mt-2"),children:m.content.text.trim()}),m.content?.kind==="text"&&m.content.text!==""&&!AT(m.content.text)&&d("div",{className:N(x&&"mt-3"),children:d(Uh,{variant:"ghost",className:"max-w-full",children:d(Hh,{className:"w-full",children:d(fce,{text:m.content.text,streaming:s&&h})})})})]},m.key)}),!s&&S(Zy,{className:"gap-1 animate-in fade-in-0 slide-in-from-right-4 duration-500",children:[S("span",{className:"text-muted-foreground/80",children:[ew(r.createdAt),c!==null&&S(se,{children:[d("span",{className:"mx-1.5 text-muted-foreground/40","aria-hidden":!0,children:"●"}),S("span",{children:["thoughts ",IH(c)]})]})]}),d(Wy,{text:f,className:"ml-1"})]})]})})}function MH({label:e,active:t=!1,standby:a=!1,className:r}){let n=e===null||e==="";if(n&&!a)return null;return S("div",{className:N("flex items-center gap-2.5 py-1 text-sm text-muted-foreground",r),role:"status","aria-live":"polite",children:[d("img",{src:Cr,alt:"","aria-hidden":!0,className:N("size-5 shrink-0",t&&"animate-pulse",n&&"opacity-60")}),!n&&d("span",{className:"truncate",children:e})]})}var MT=[0,2,4,5,7,9,11];function EH(e,t=261.63){let a=Math.min(Math.max(0,Math.floor(e)),14),r=MT[a%MT.length]??0,n=Math.floor(a/MT.length);return t*2**((r+n*12)/12)}var PH=null;function pce(){if(typeof window>"u")return null;let e=window.AudioContext??window.webkitAudioContext;if(!e)return null;return PH??=new e,PH}function NH(e){try{let t=pce();if(!t)return;if(t.state==="suspended")t.resume();if(t.state!=="running")return;let a=t.currentTime,r=t.createOscillator(),n=t.createGain();r.type="triangle",r.frequency.value=e,n.gain.setValueAtTime(0,a),n.gain.linearRampToValueAtTime(0.06,a+0.012),n.gain.exponentialRampToValueAtTime(0.0001,a+0.16),r.connect(n).connect(t.destination),r.start(a),r.stop(a+0.18)}catch{}}var mce=450;function DH({marks:e,activeId:t,onJump:a}){let r=B(null);if(U(()=>{let n=r.current;if(n===null||t===null)return;if(n.scrollHeight<=n.clientHeight)return;let s=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t;n.querySelector(`[data-mark-id="${s}"]`)?.scrollIntoView({block:"nearest"})},[t]),e.length<2)return null;return d("nav",{"aria-label":"Your messages",className:"pointer-events-none absolute top-1/2 left-4 hidden -translate-y-1/2 lg:flex xl:left-6",children:d("ul",{ref:r,className:"pointer-events-auto flex max-h-[60vh] flex-col items-center gap-px overflow-y-auto py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:e.map((n,s)=>{let l=n.id===t;return d("li",{"data-mark-id":n.id,children:S(rn,{delayDuration:mce,children:[d(on,{asChild:!0,children:d("button",{type:"button",onClick:()=>a(n.id),onPointerEnter:(c)=>{if(c.pointerType!=="touch")NH(EH(s))},"aria-label":`Jump to your message ${s+1}: ${n.preview}`,"aria-current":l?"true":void 0,className:"group/mark flex h-3 w-7 items-center justify-center rounded-sm outline-none focus-visible:ring-[3px] focus-visible:ring-ring/40",children:d("span",{"aria-hidden":!0,className:N("block h-[3px] rounded-full transition-[width,background-color] duration-200","group-hover/mark:w-7 group-focus-visible/mark:w-7",l?"w-[18px] bg-foreground/70":"w-3.5 bg-foreground/30 group-hover/mark:bg-foreground/60")})})}),d(nn,{side:"right",className:"max-w-56",children:d("span",{className:"line-clamp-2",children:n.preview})})]})},n.id)})})})}function OH(e){return e.type==="file"&&typeof e.mime==="string"&&bh(e.mime)&&typeof e.attachmentId==="string"}function gce(e){return e.type==="file"&&typeof e.attachmentId==="string"&&typeof e.filename==="string"&&!OH(e)}function _H({message:e}){let[t,a]=A(null),r=e.parts.filter(OH),n=$0(e.parts),s=r.map((g)=>({src:NC(e.sessionId,g.attachmentId),alt:g.filename??"Attached image"})),l=e.parts.filter(gce),c=(g)=>g.type==="file"&&typeof g.attachmentId!=="string"&&typeof g.filename==="string",f=new Set(e.parts.filter(c).map((g)=>g.filename)),m=e.parts.filter(c).map((g)=>({part:g,filename:g.filename}));return d($y,{align:"end",children:S(Qy,{children:[r.length>0&&d("ul",{"aria-label":`${r.length} attached ${r.length===1?"image":"images"}`,className:N("grid gap-1.5 self-end",r.length===1?"w-full max-w-72 grid-cols-1":"w-full max-w-80 grid-cols-2"),children:s.map((g,h)=>d("li",{className:N(r.length===3&&h===0&&"col-span-2"),children:d("button",{type:"button",onClick:()=>a(h),"aria-label":`Preview ${g.alt}`,className:"group/img block w-full overflow-hidden rounded-xl border bg-muted outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",children:d("img",{src:g.src,alt:g.alt,loading:"lazy",draggable:!1,className:N("w-full object-cover transition-transform duration-200 group-hover/img:scale-[1.02]",r.length===1?"max-h-80":"aspect-square",r.length===3&&h===0&&"aspect-[2/1]")})})},g.src))}),l.length>0&&d("ul",{"aria-label":`${l.length} attached ${l.length===1?"file":"files"}`,className:"flex max-w-full flex-wrap justify-end gap-1.5 self-end",children:l.map((g)=>d("li",{className:"min-w-0",children:d("a",{href:NC(e.sessionId,g.attachmentId),download:g.filename,title:`Download ${g.filename}`,className:"block rounded-lg outline-none transition-opacity hover:opacity-90 focus-visible:ring-[3px] focus-visible:ring-ring/50",children:d(ry,{filename:g.filename,mime:g.mime??"",className:"h-14 w-56 max-w-full"})})},g.attachmentId))}),(n!==""||m.length>0)&&S(Uh,{children:[n!==""&&d(Hh,{className:"whitespace-pre-wrap",children:ly(n,f).map((g,h)=>g.kind==="mention"?d("mark",{className:"rounded-[3px] bg-current/10 text-inherit",children:g.text},h):d("span",{children:g.text},h))}),m.length>0&&d("div",{className:"mt-1.5 flex flex-wrap gap-1",children:m.map(({filename:g})=>S("span",{className:"inline-flex max-w-full items-center gap-1 rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:[d(Ei,{className:"size-3 shrink-0"}),d("span",{className:"truncate",children:g})]},g))})]}),S(Zy,{className:"gap-1",children:[d(Wy,{text:n}),d("span",{className:"text-muted-foreground/80",children:ew(e.createdAt)})]}),d(oy,{images:s,index:t,onIndexChange:a})]})})}function zH({error:e,status:t,messages:a,collapsible:r,onToggle:n,generating:s}){let l=B(null),[c,f]=A(0);Vt(()=>{let R=l.current;if(R===null)return;let E=()=>f(R.clientHeight);if(E(),typeof ResizeObserver>"u")return;let M=new ResizeObserver(E);return M.observe(R),()=>M.disconnect()},[]);let m=de(()=>Q0(a),[a]),g=WF(m),h=de(()=>a.filter((R)=>R.role==="user").map((R)=>{let E=$0(R.parts).trim().replace(/\s+/g," ");return{id:R.id,preview:E===""?"Attachment":E.slice(0,120)}}),[a]),x=B(new Map),[v,w]=A(null),C=j(()=>{let R=l.current;if(R===null)return;let E=R.getBoundingClientRect().top,M=null;for(let P of h){let O=x.current.get(P.id);if(O&&O.getBoundingClientRect().top-E<=24)M=P.id}w(M??h[0]?.id??null)},[h]);U(()=>{let R=l.current;if(R===null||h.length<2)return;return C(),R.addEventListener("scroll",C,{passive:!0}),()=>R.removeEventListener("scroll",C)},[h.length,C]);let L=j((R,E)=>{if(E)x.current.set(R,E);else x.current.delete(R)},[]),k=j((R)=>{let E=x.current.get(R),M=l.current;if(!E||!M)return;let P=E.getBoundingClientRect().top-M.getBoundingClientRect().top;M.scrollTo({top:M.scrollTop+P-16,behavior:"smooth"})},[]),I=g?.messages.some((R)=>R.streaming===!0)?g:null,T=s?(I?GF(I.messages,!0):null)??"Starting…":null;return S(M7,{autoScroll:!1,scrollEdgeThreshold:c,children:[d(hce,{messages:a,status:t,error:e,viewportRef:l}),S(P7,{className:"min-h-0 flex-1",children:[d(E7,{ref:l,children:S(N7,{className:N("mx-auto w-full gap-6 px-3 py-4 sm:gap-8 sm:px-4",X0),children:[e&&d(YI,{messageId:"error",children:d("p",{className:"text-sm text-destructive",children:e})}),m.map((R)=>R.kind==="user"?d("div",{ref:(E)=>L(R.message.id,E),className:"scroll-mt-4",children:d(_H,{message:R.message})},R.message.id):d(AH,{group:R,collapsible:r,onToggle:n},R.id)),a.length>0&&d(YI,{messageId:"mascot",children:d(MH,{label:s?T??"Starting…":null,active:s,standby:!0,className:"px-1"})})]})}),d(DH,{marks:h,activeId:v,onJump:k}),d(D7,{})]})]})}function hce({messages:e,status:t,error:a,viewportRef:r}){let{scrollToEnd:n}=XI(),s=B(null);return Vt(()=>{let l=r.current;if(l===null)return;let c=s.current;if(!(c===null||l.scrollHeight>c))return;if(l.scrollHeight-l.scrollTop-l.clientHeight<=l.clientHeight)n()},[e,t,a,r,n]),Vt(()=>{let l=r.current;if(l!==null)s.current=l.scrollHeight}),null}function BH(e){if(e.questions&&e.questions.length>0)return e.questions;if(e.kind!=="question")return[];return[{question:e.title,options:e.options??null,multiple:e.multiple===!0?!0:void 0,custom:e.custom===!0?!0:void 0}]}function FH(e){let t=new Map;for(let a of e){let r=`${a.kind}\x00${a.title??""}`,n=t.get(r);if(n)n.push(a);else t.set(r,[a])}return[...t.values()]}var xce="optimistic:first-prompt";function UH({session:e,onBack:t,onDeleted:a}){let[r,n]=A(()=>{let xe=EF(e.id);return xe===null?null:{id:xce,sessionId:e.id,role:"user",parts:[{type:"text",text:xe}],createdAt:Date.now()}}),[s,l]=A([]),c=s.some((xe)=>xe.role==="user"),f=de(()=>r&&!c?[r,...s]:s,[r,c,s]);U(()=>{if(r&&c)n(null)},[r,c]);let[m,g]=A({}),[h,x]=A([]),[v,w]=A(e.status),[C,L]=A(null),[k,I]=A(null),[T,R]=A(!1),[E,M]=A(!1),[P,O]=A(!1),[F,z]=A(!1),[Y,q]=A(!1),[G,Q]=A(!1),re=B(t);re.current=t;let J=j((xe)=>{switch(xe.type){case"history":L(null),l(xe.messages),x(xe.prompts),R(!1),g({}),Q(!0);break;case"message":L(null),l((ye)=>YF(ye,xe.message));break;case"message_part":L(null),l((ye)=>KF(ye,xe.sessionId,xe.messageId,xe.part));break;case"message_part_delta":l((ye)=>XF(ye,xe.messageId,xe.partId,xe.field,xe.delta));break;case"prompt":L(null),x((ye)=>ye.some((ft)=>ft.id===xe.prompt.id)?ye:[...ye,xe.prompt]);break;case"prompt_resolved":x((ye)=>ye.filter((ft)=>ft.id!==xe.promptId));break;case"session_status":if(xe.sessionId!==e.id)break;if(w(xe.status),xe.status!=="running")R(!1);break;case"turn_active":R(xe.active);break;case"session_deleted":if(xe.sessionId!==e.id)break;re.current();break;case"error":if(xe.code==="PROMPT_EXPIRED"){L(xe.message);break}if(xe.code==="PROMPT_NOT_FOUND"||xe.code==="PROMPT_ALREADY_RESOLVED"||xe.code==="PROMPT_FAILED"){I(xe.message);break}L(xe.message);break}},[e.id]),{status:X,attach:Z,send:te,disconnect:D}=Tf({onMessage:J});U(()=>(Z(e.id),()=>D()),[Z,D,e.id]),U(()=>{if(!G||X!=="connected")return;let xe=NF(e.id);if(xe===null)return;if(!te({type:"input",sessionId:e.id,text:xe}))K0(e.id,xe)},[G,X,te,e.id]),U(()=>{g((xe)=>{let ye=[];for(let ft of Q0(f)){if(ft.kind!=="assistant")continue;if(!ft.messages.some(($a)=>$a.parts.some((Mo)=>Mo.type==="reasoning"||Mo.type==="tool")))continue;let zt=xh(ft.messages);for(let $a of Z0(zt))if($a.steps.length>0)ye.push(`${ft.id}:${$a.key}`)}return LH(xe,ye)})},[f]);let Te=j((xe)=>{g((ye)=>TH(ye,xe))},[]),Le=j(()=>I(null),[]),H=j((xe,ye)=>{if(X!=="connected")throw Error(`Not connected (${h0(X)}). Try again.`);te({type:"prompt_response",sessionId:e.id,promptId:xe,response:ye})},[te,e.id,X]),me=j((xe)=>L(xe),[]),Ce=j(()=>{te({type:"interrupt",sessionId:e.id}),l((xe)=>xe.filter((ye)=>!(ye.role==="assistant"&&ye.streaming===!0))),R(!1)},[te,e.id]),ge=j(async()=>{M(!0),L(null);try{await le(`/api/sessions/${e.id}`,{method:"POST"}),De.success("Session resumed.")}catch(xe){De.error(xe instanceof we?xe.message:"Couldn't resume the session.")}finally{M(!1)}},[e.id]),He=j(async()=>{O(!0),L(null);try{await le(`/api/sessions/${e.id}/stop`,{method:"POST"}),De.success("Session stopped.")}catch(xe){De.error(xe instanceof we?xe.message:"Couldn't stop the session.")}finally{O(!1)}},[e.id]),ce=j(()=>z(!0),[]),he=j(()=>z(!1),[]),ue=j(async()=>{q(!0),L(null);try{await le(`/api/sessions/${e.id}`,{method:"DELETE"}),z(!1),De.success("Session deleted."),Ya(),(a??t)()}catch(xe){De.error(xe instanceof we?xe.message:"Couldn't delete the session.")}finally{q(!1)}},[e.id,t,a]),K=T||f.some((xe)=>xe.role==="assistant"&&xe.streaming===!0),ee=K&&v==="running",W=X==="connected"&&v==="running"&&!K,ve=de(()=>FH(h),[h]),Ee=de(()=>h.some((xe)=>xe.kind==="question"),[h]);return{wsStatus:X,send:te,status:v,busy:K,generating:ee,canInput:W,error:C,reportError:me,messages:f,historyLoaded:G,collapsible:m,toggleBlock:Te,prompts:h,promptGroups:ve,hasPendingQuestion:Ee,promptError:k,consumePromptError:Le,resolvePrompt:H,interrupt:Ce,starting:E,start:ge,stopping:P,stop:He,deleteOpen:F,beginDelete:ce,cancelDelete:he,deleting:Y,confirmDelete:ue}}var vce=2500,bce=12000;function HH(e,t,a){let[r,n]=A(null),[s,l]=A(!1),c=B(!1),f=B(0),m=j(async()=>{let h=++f.current;try{let v=await(await le(`/api/sessions/${e}/context`)).json();if(h!==f.current||!v.context)return;c.current=!0,n(v.context)}catch{}finally{if(h===f.current)l(!1)}},[e]),g=j(()=>{if(!t)return;m()},[t,m]);return U(()=>{c.current=!1,n(null)},[e]),U(()=>{if(!t)return;l(!c.current),m();let h=null,x=()=>{if(h!==null)return;h=setInterval(()=>void m(),a?vce:bce)},v=()=>{if(h!==null)clearInterval(h);h=null},w=()=>{if(document.visibilityState==="visible")m(),x();else v()};if(document.visibilityState==="visible")x();return document.addEventListener("visibilitychange",w),()=>{v(),document.removeEventListener("visibilitychange",w)}},[t,a,m]),{context:r,loading:s,refresh:g}}var yce=Ca("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function VH({className:e,variant:t="default",asChild:a=!1,...r}){let n=a?mf:"span";return d(n,{"data-slot":"badge","data-variant":t,className:N(yce({variant:t}),e),...r})}function PT({className:e,...t}){return d("div",{"data-slot":"card",className:N("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function ET({className:e,...t}){return d("div",{"data-slot":"card-header",className:N("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function NT({className:e,...t}){return d("div",{"data-slot":"card-title",className:N("min-w-0 wrap-anywhere leading-none font-semibold",e),...t})}function DT({className:e,...t}){return d("div",{"data-slot":"card-description",className:N("min-w-0 text-muted-foreground wrap-anywhere text-sm",e),...t})}function OT({className:e,...t}){return d("div",{"data-slot":"card-content",className:N("px-6",e),...t})}var wce={bash:{label:"Run a shell command",risk:"high"},external_directory:{label:"Access a folder outside the project",risk:"high"},doom_loop:{label:"Keep going after repeating the same step",risk:"medium"},edit:{label:"Edit files",risk:"medium"},task:{label:"Start a sub-agent",risk:"medium"},webfetch:{label:"Fetch a web page",risk:"medium"},websearch:{label:"Search the web",risk:"medium"},skill:{label:"Use a skill",risk:"medium"},read:{label:"Read files",risk:"low"},list:{label:"List folder contents",risk:"low"},glob:{label:"Search for files",risk:"low"},grep:{label:"Search inside files",risk:"low"},lsp:{label:"Use the language server",risk:"low"},todowrite:{label:"Update the task list",risk:"low"},question:{label:"Ask you a question",risk:"low"}},Sce=new Set(["Izin tool","Tool permission"]);function kce(e){let t=e.replace(/[_-]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function jH(e){let t=(e??"").trim();if(t===""||Sce.has(t))return{permission:null,label:"Use a tool",targets:[],risk:"medium"};let[a="",...r]=t.split(" — "),n=a.trim(),s=r.map((c)=>c.trim().replace(/^`(.*)`$/s,"$1").trim()).filter((c)=>c!==""),l=wce[n.toLowerCase()];return{permission:n,label:l?.label??kce(n),targets:s,risk:l?.risk??"medium"}}function KH({prompts:e,onResolve:t,errorSignal:a,onConsumeError:r,docked:n=!1}){let s=e[0],[l,c]=A(null),f=B(!1),[m,g]=A(null),[h,x]=A(""),[v,w]=A(new Set),[C,L]=A({}),[k,I]=A({}),[T,R]=A(0),E=B(void 0);U(()=>{if(a)f.current=!1,c(null),g(a),r?.()},[a,r]),U(()=>(w(new Set),x(""),L({}),I({}),R(0),f.current=!1,c(null),g(null),()=>clearTimeout(E.current)),[s?.id]);let M=B(()=>{});if(U(()=>{let K=(ee)=>M.current(ee);return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[]),!s)return null;let P=s.type==="menu",O=s.kind==="permission",F=P&&s.multiple===!0,z=BH(s),Y=P&&z.length>1,q=e.length,G=(K,ee)=>{if(f.current)return;f.current=!0,g(null),c(K);try{for(let W of e)t(W.id,ee)}catch(W){f.current=!1,c(null),g(W instanceof Error?W.message:"Failed to send the response.")}},Q=()=>{let K=h.trim();if(K.length===0)return;x(""),G("custom",{option:K})},re=(K)=>{w((ee)=>{let W=new Set(ee);if(W.has(K))W.delete(K);else W.add(K);return W})},J=(K)=>{let ee=[...v],W=K?.trim()??"";if(W.length>0)ee.push(W);if(ee.length===0)return;x(""),G("multi-submit",{options:ee})},X=(K,ee,W)=>{L((ve)=>{let Ee=new Set(ve[K]??[]);if(W)if(Ee.has(ee))Ee.delete(ee);else Ee.add(ee);else Ee.clear(),Ee.add(ee);return{...ve,[K]:Ee}})},Z=()=>{let K=z.map((ee,W)=>{let ve=[...C[W]??[]],Ee=(k[W]??"").trim();if(Ee.length>0)ve.push(Ee);return ve});if(K.some((ee)=>ee.length===0))return;I({}),G("multi-question",{answers:K})},te=z.every((K,ee)=>(C[ee]?.size??0)>0||(k[ee]??"").trim().length>0),D=(K,ee,W,ve,Ee,xe)=>K.map((ye,ft)=>{let zt=W!=="action"&&ve(ye.label),$a=W==="action"&&l===`option-${ye.label}`,Mo=l!==null,Dt=(ee==="single"||ee.startsWith("step"))&&ft<9?String(ft+1):void 0;return d("li",{children:S("button",{type:"button",role:W==="checkbox"?"checkbox":W==="radio"?"radio":void 0,...W!=="action"?{"aria-checked":zt}:{},"aria-busy":$a,"aria-keyshortcuts":Dt,disabled:Mo,onClick:()=>W==="action"?xe(ye.label):Ee(ye.label),className:N("flex min-h-14 w-full touch-manipulation items-center gap-3 px-4 py-2.5 text-left transition-colors outline-none","hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/40 focus-visible:ring-inset active:bg-muted",Mo&&!$a&&"pointer-events-none opacity-50"),children:[W==="checkbox"&&d("span",{"aria-hidden":!0,className:N("flex size-5 shrink-0 items-center justify-center rounded-md border-2 transition-colors sm:size-4.5",zt?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/45"),children:zt&&d(Ke,{className:"size-3",strokeWidth:3})}),W==="radio"&&d("span",{"aria-hidden":!0,className:N("flex size-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors sm:size-4.5",zt?"border-primary bg-primary":"border-muted-foreground/45"),children:zt&&d("span",{className:"size-1.5 rounded-full bg-primary-foreground"})}),S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 py-0.5",children:[d("span",{className:"wrap-anywhere text-[15px] leading-5",children:ye.label}),ye.description&&d("span",{className:"wrap-anywhere text-[13px] leading-snug text-muted-foreground",children:ye.description})]}),W==="action"&&S("span",{className:"flex shrink-0 items-center gap-2",children:[Dt&&d("kbd",{"aria-hidden":!0,className:"hidden rounded border px-1.5 font-mono text-[11px] leading-5 text-muted-foreground sm:inline",children:Dt}),$a?d(fe,{className:"size-4"}):d(Jt,{"aria-hidden":!0,className:"size-4 text-muted-foreground"})]})]})},`${ee}-${ye.label}`)}),Te=(K)=>d("li",{children:S("label",{className:"flex min-h-14 cursor-text items-center gap-3 px-4 py-2 focus-within:bg-muted/30",children:[d(wg,{"aria-hidden":!0,className:"size-4 shrink-0 text-muted-foreground"}),S("span",{className:"flex min-w-0 flex-1 flex-col",children:[d("span",{className:"text-[12px] leading-4 text-muted-foreground",children:"Other"}),d("input",{value:K.value,onChange:(ee)=>K.onChange(ee.target.value),onKeyDown:(ee)=>{if(ee.key==="Enter"&&!ee.nativeEvent.isComposing)ee.preventDefault(),K.onSubmit()},placeholder:"Type your own answer…",disabled:l!==null,"aria-label":K.ariaLabel??"Your own answer",enterKeyHint:K.enterHint??(K.showSend===!1?"next":"send"),className:"h-7 w-full min-w-0 bg-transparent text-base outline-none placeholder:text-muted-foreground/70 disabled:opacity-60 sm:text-[15px]"})]}),K.showSend!==!1&&d("button",{type:"button",disabled:l!==null||K.sendDisabled,"aria-busy":K.busy,"aria-label":"Send your answer",onClick:K.onSubmit,className:N("flex size-9 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-xs transition-opacity outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-0 sm:size-8",K.busy&&"disabled:opacity-60"),children:K.busy?d(fe,{className:"size-4"}):d(Dm,{className:"size-4"})})]})});if(O)return d(Lce,{prompt:s,twinCount:q,submittingKey:l,error:m,onResolve:G});let Le=(K)=>(C[K]?.size??0)>0||(k[K]??"").trim().length>0,H=z.filter((K,ee)=>Le(ee)).length,me=Math.min(T,Math.max(z.length-1,0)),Ce=me===z.length-1,ge=(K)=>{if(clearTimeout(E.current),K<0||K>=z.length||K===me)return;R(K)},He=(K,ee,W)=>{if(X(K,ee,W),W||K>=z.length-1)return;clearTimeout(E.current),E.current=setTimeout(()=>ge(K+1),220)},ce=F?{submitDisabled:v.size===0&&h.trim().length===0,busy:l==="multi-submit",onSubmit:()=>J(h)}:null,he=F?"Select all that apply":"Tap an option to answer";M.current=(K)=>{if(l!==null||K.defaultPrevented||K.isComposing)return;if(K.metaKey||K.ctrlKey||K.altKey)return;let ee=K.target;if(ee&&(ee.tagName==="INPUT"||ee.tagName==="TEXTAREA"||ee.isContentEditable))return;if(Y){if(K.key==="ArrowLeft"){K.preventDefault(),ge(me-1);return}if(K.key==="ArrowRight"){if(K.preventDefault(),Le(me))ge(me+1);return}}if(!/^[1-9]$/.test(K.key))return;let W=Number(K.key)-1;if(Y){let Ee=z[me],xe=Ee?.options?.[W];if(!Ee||!xe)return;K.preventDefault(),He(me,xe.label,Ee.multiple===!0);return}let ve=(s.options??[])[W];if(!ve)return;if(K.preventDefault(),F)re(ve.label);else G(`option-${ve.label}`,{option:ve.label})};let ue=Y?z[me]?.options?.length??0:s.options?.length??0;return S(PT,{role:"dialog","aria-labelledby":`q-${s.id}-title`,className:N("gap-0 rounded-2xl border bg-background py-0 shadow-lg",n&&"flex min-h-0 shrink flex-col overflow-hidden"),children:[S(ET,{className:"flex max-h-[30dvh] shrink-0 flex-row items-start gap-3 overflow-y-auto px-5 pt-4 pb-3",children:[d("span",{"aria-hidden":!0,className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-foreground/80",children:Y||F?d(qc,{className:"size-4"}):d(Go,{className:"size-4"})}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d(NT,{id:`q-${s.id}-title`,className:"wrap-anywhere text-[17px] leading-6 font-semibold tracking-tight sm:text-base",children:Y?`The agent has ${z.length} questions`:s.title??"The agent has a question"}),d(DT,{className:"flex items-center gap-1.5 text-[13px]",children:l!==null?S(se,{children:[d(fe,{className:"size-3"}),"Sending…"]}):Y?`Question ${me+1} of ${z.length} · ${H} answered`:ue>0?S(se,{children:[d("span",{className:"sm:hidden",children:he}),S("span",{className:"hidden sm:inline",children:[F?he:"Click an option"," · press"," ",d("kbd",{className:"rounded border px-1 font-mono text-[10px]",children:"1"}),ue>1&&S(se,{children:["–",d("kbd",{className:"rounded border px-1 font-mono text-[10px]",children:Math.min(ue,9)})]})]})]}):he})]})]}),Y&&d(Cce,{count:z.length,current:me,answered:Le,labels:z.map((K,ee)=>K.header??`Question ${ee+1}`),disabled:l!==null,onSelect:ge}),S(OT,{className:N("flex flex-col px-3 sm:px-4","pt-1",n?"min-h-0 flex-auto overflow-hidden":"pb-3"),children:[d("div",{role:"group","aria-label":"Answers",className:N("flex flex-col",n&&"min-h-0 flex-auto overflow-x-hidden overflow-y-auto overscroll-contain pb-3 [scrollbar-width:thin] [-webkit-overflow-scrolling:touch]"),children:Y?d("div",{className:"grid min-w-0 overflow-x-clip",children:z.map((K,ee)=>{let W=ee===me,ve=K.multiple===!0,Ee=C[ee]??new Set,xe=ee<me?-24:ee>me?24:0;return S(AC,{initial:!1,animate:{opacity:W?1:0,x:xe,transition:{duration:W?0.2:0.12,ease:"easeOut"}},inert:!W,"aria-hidden":!W,"aria-labelledby":`q-${s.id}-${ee}`,className:N("col-start-1 row-start-1 flex min-w-0 flex-col gap-2.5",!W&&"pointer-events-none"),children:[S("div",{className:"flex flex-col gap-0.5 px-1",children:[K.header&&d("span",{className:"text-[12px] text-muted-foreground",children:K.header}),d("h3",{id:`q-${s.id}-${ee}`,className:"wrap-anywhere text-[15px] leading-5 font-semibold tracking-tight",children:K.question??`Question ${ee+1}`}),ve&&d("p",{className:"text-[13px] text-muted-foreground",children:"Select all that apply"})]}),S(GH,{children:[D(K.options??[],W?`step${ee}`:`hidden${ee}`,ve?"checkbox":"radio",(ye)=>Ee.has(ye),(ye)=>He(ee,ye,ve),()=>{}),K.custom!==!1&&Te({value:k[ee]??"",onChange:(ye)=>I((ft)=>({...ft,[ee]:ye})),onSubmit:()=>ee===z.length-1?Z():Le(ee)&&ge(ee+1),sendDisabled:!0,busy:!1,ariaLabel:`Your own answer for question ${ee+1}`,showSend:!1,enterHint:ee===z.length-1?"send":"next"})]})]},`step-${ee}`)})}):S(GH,{children:[D(s.options??[],"single",F?"checkbox":"action",(K)=>v.has(K),re,(K)=>G(`option-${K}`,{option:K})),s.custom===!0&&Te({value:h,onChange:x,onSubmit:()=>F?J(h):Q(),sendDisabled:F?h.trim().length===0&&v.size===0:h.trim().length===0,busy:l==="custom"||l==="multi-submit",showSend:!F})]})}),m&&d("p",{className:"pt-2 text-[13px] text-destructive sm:text-xs",role:"alert",children:m})]}),S("div",{className:N("flex shrink-0 items-center gap-2 px-3 pt-1 pb-3 sm:px-4",ce===null&&!Y&&"justify-end"),children:[S(ae,{type:"button",variant:Y?"ghost":"secondary",disabled:l!==null,"aria-busy":l==="dismiss",onClick:()=>G("dismiss","cancel"),className:N("h-11 rounded-full px-5 text-[15px] sm:h-9 sm:text-sm",Y&&"px-3 text-muted-foreground hover:text-foreground sm:px-4",ce!==null&&"flex-1 sm:flex-none"),children:[l==="dismiss"&&d(fe,{className:"size-4","data-icon":"inline-start"}),"Skip"]}),Y&&S("div",{className:"ms-auto flex items-center gap-2",children:[S(ae,{type:"button",variant:"secondary",disabled:l!==null||me===0,onClick:()=>ge(me-1),"aria-label":"Previous question","aria-keyshortcuts":"ArrowLeft",className:"h-11 rounded-full px-4 text-[15px] sm:h-9 sm:text-sm",children:[d(Pi,{className:"size-4","data-icon":"inline-start"}),d("span",{className:"hidden sm:inline",children:"Back"})]}),Ce?S(ae,{type:"button",disabled:l!==null||!te,"aria-busy":l==="multi-question",onClick:Z,className:"h-11 rounded-full px-5 text-[15px] sm:h-9 sm:text-sm",children:[l==="multi-question"&&d(fe,{className:"size-4","data-icon":"inline-start"}),"Submit answers"]}):S(ae,{type:"button",disabled:l!==null||!Le(me),onClick:()=>ge(me+1),"aria-keyshortcuts":"ArrowRight",className:"h-11 rounded-full px-5 text-[15px] sm:h-9 sm:text-sm",children:["Next",d(Jt,{className:"size-4","data-icon":"inline-end"})]})]}),ce&&S(ae,{type:"button",disabled:l!==null||ce.submitDisabled,"aria-busy":ce.busy,onClick:ce.onSubmit,className:"h-11 flex-[2] rounded-full px-5 text-[15px] sm:ms-auto sm:h-9 sm:flex-none sm:text-sm",children:[ce.busy&&d(fe,{className:"size-4","data-icon":"inline-start"}),"Submit"]})]})]})}function Cce({count:e,current:t,answered:a,labels:r,disabled:n,onSelect:s}){return d("nav",{"aria-label":"Questions",className:"shrink-0 px-4 sm:px-5",children:d("ol",{className:"-my-2 flex gap-1.5",children:Array.from({length:e},(l,c)=>{let f=a(c),m=c===t;return d("li",{className:"min-w-0 flex-1",children:d("button",{type:"button",disabled:n,onClick:()=>s(c),"aria-current":m?"step":void 0,"aria-label":`${r[c]}${f?" (answered)":""}`,className:"group flex h-11 w-full touch-manipulation items-center outline-none sm:h-6",children:d("span",{className:N("h-1 w-full rounded-full transition-colors group-focus-visible:ring-[3px] group-focus-visible:ring-ring/50",m?"bg-primary":f?"bg-primary/45 group-hover:bg-primary/60":"bg-muted group-hover:bg-muted-foreground/30")})})},c)})})})}function GH({children:e}){return d("div",{className:"overflow-hidden rounded-xl border bg-card shadow-xs",children:d("ul",{className:"flex flex-col divide-y",children:e})})}var Ice={high:{icon:"bg-amber-500/15 text-amber-600 dark:text-amber-400",label:"Review carefully"},medium:{icon:"bg-muted text-foreground/80",label:""},low:{icon:"bg-muted text-muted-foreground",label:"Read-only"}};function Lce({prompt:e,twinCount:t,submittingKey:a,error:r,onResolve:n}){let s=jH(e.title),l=Ice[s.risk],c=a!==null;U(()=>{let g=(h)=>{if(c||h.defaultPrevented||h.isComposing)return;let x=h.target;if(x!==null&&(x.tagName==="INPUT"||x.tagName==="TEXTAREA"||x.isContentEditable))return;if(h.key==="Enter"&&!h.shiftKey&&!h.metaKey&&!h.ctrlKey&&!h.altKey)h.preventDefault(),n("approve","approve");else if(h.key==="Escape")h.preventDefault(),n("deny","deny")};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[c,n]);let f=(g)=>a===g?d(fe,{className:"size-4","data-icon":"inline-start"}):null,m="h-11 w-full text-[15px] sm:h-8 sm:w-auto sm:text-sm";return S(PT,{role:"alertdialog","aria-labelledby":`perm-${e.id}-title`,"aria-describedby":`perm-${e.id}-targets`,className:"gap-4 rounded-2xl border bg-card py-4 shadow-lg sm:gap-3 sm:rounded-xl sm:py-3.5",children:[S(ET,{className:"flex flex-row items-start gap-3 px-4",children:[d("span",{"aria-hidden":!0,className:N("flex size-10 shrink-0 items-center justify-center rounded-full sm:size-8",l.icon),children:d(Wo,{className:"size-5 sm:size-4.5"})}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:gap-0.5",children:[S(NT,{id:`perm-${e.id}-title`,className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-base leading-6 sm:text-sm sm:leading-5",children:[d("span",{children:s.label}),t>1&&S(VH,{variant:"secondary",title:`${t} identical requests`,children:["×",t]})]}),S(DT,{className:"flex flex-wrap items-center gap-x-1.5 text-[13px] sm:text-xs",children:[d("span",{children:"The agent is asking for permission"}),s.permission&&S(se,{children:[d("span",{"aria-hidden":!0,children:"·"}),d("code",{className:"font-mono text-[12px] sm:text-[11px]",children:s.permission})]}),l.label&&S(se,{children:[d("span",{"aria-hidden":!0,children:"·"}),d("span",{className:N(s.risk==="high"&&"font-medium text-amber-700 dark:text-amber-400"),children:l.label})]})]})]})]}),S(OT,{className:"flex flex-col gap-4 px-4 sm:gap-3",children:[s.targets.length>0&&d("ul",{id:`perm-${e.id}-targets`,className:"flex max-h-40 flex-col gap-1 overflow-y-auto rounded-xl bg-muted/60 px-3 py-2.5 [scrollbar-width:thin] sm:max-h-32 sm:rounded-lg sm:py-2",children:s.targets.map((g)=>d("li",{className:"wrap-anywhere font-mono text-[13px] leading-relaxed text-foreground/90 sm:text-xs",children:g},g))}),S("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[S(ae,{type:"button",size:"sm",disabled:c,"aria-busy":a==="approve",onClick:()=>n("approve","approve"),"aria-keyshortcuts":"Enter",className:N(m,"sm:order-3"),children:[f("approve"),"Allow once",d(qH,{children:"↵"})]}),S(ae,{type:"button",size:"sm",variant:"outline",disabled:c,"aria-busy":a==="deny",onClick:()=>n("deny","deny"),"aria-keyshortcuts":"Escape",className:N(m,"sm:order-2 sm:ms-auto"),children:[f("deny"),"Deny",d(qH,{children:"Esc"})]}),S(ae,{type:"button",size:"sm",variant:"ghost",disabled:c,"aria-busy":a==="always",onClick:()=>n("always","always"),title:"Don't ask again for matching requests in this session",className:N(m,"text-muted-foreground hover:text-foreground sm:order-1"),children:[f("always")??d($o,{className:"size-4","data-icon":"inline-start"}),"Always allow"]})]}),r&&d("p",{className:"text-[13px] text-destructive sm:text-xs",role:"alert",children:r})]})]})}function qH({children:e}){return d("kbd",{"aria-hidden":!0,className:"ms-0.5 hidden rounded border border-current/20 px-1 font-sans text-[10px] leading-4 opacity-60 sm:inline",children:e})}var Tce=[0.32,0.72,0,1];function XH({groups:e,errorSignal:t,onResolve:a,onConsumeError:r,docked:n=!1}){let s=e.length===0;return d("div",{"aria-live":"polite",className:s?"pointer-events-none relative z-30":n?"pointer-events-auto relative z-30 flex max-h-[75dvh] min-h-0 shrink flex-col gap-2 px-3 pt-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] sm:max-h-[min(75dvh,36rem)] sm:px-4 sm:pb-3":"pointer-events-auto relative z-30 mb-1.5 flex max-h-[60dvh] flex-col gap-2 overflow-y-auto overscroll-contain px-3 pt-2 sm:max-h-72 sm:px-4",children:d(bo,{initial:!0,mode:"popLayout",children:e.map((l)=>d(ar,{initial:{opacity:0,y:24,scale:0.96},animate:{opacity:1,y:0,scale:1,transition:{duration:0.4,ease:Tce}},exit:{opacity:0,y:16,scale:0.96,transition:{duration:0.2,ease:"easeIn"}},className:n?N("mx-auto flex min-h-0 w-full flex-col",as):N("pointer-events-auto mx-auto w-full",as),children:d(KH,{prompts:l,onResolve:a,errorSignal:t,onConsumeError:r,docked:n})},l[0]?.id))})})}var Rce="(min-width: 1024px)";function YH({session:e,onBack:t,onDeleted:a}){let r=UH({session:e,onBack:t,onDeleted:a}),n=!r.historyLoaded&&r.messages.length===0,s=!n&&r.messages.length===0,l=B(null),[c,f]=A(!1),m=Ji(Rce),g=HH(e.id,c,r.generating),h=de(()=>c?ZF(r.messages,e.cwd):[],[c,r.messages,e.cwd]),x=!n&&(s||!r.hasPendingQuestion),v=x&&r.canInput,w=n?"Wait for the conversation to load, then drop your files.":!x?"Answer the question first, then add your files.":r.busy?"Wait for the response to finish, then drop your files.":"Start the session to add files.";return S("div",{"data-vt-name":"session-surface",className:"flex h-full min-h-0 flex-col",children:[d(v7,{session:e,status:r.status,wsStatus:r.wsStatus,onStop:()=>void r.stop(),onStart:()=>void r.start(),onRequestDelete:r.beginDelete,stopping:r.stopping,starting:r.starting}),S("div",{className:"relative flex min-h-0 flex-1",children:[d("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n?S(se,{children:[d(Y0,{}),d(W0,{})]}):s?S("div",{className:"flex min-h-0 flex-1 flex-col px-3 sm:px-4",children:[d("div",{className:"min-h-0 flex-[2]"}),S("div",{className:N("mx-auto w-full",as),children:[d("h1",{className:"mb-6 text-center text-2xl font-medium tracking-tight sm:text-3xl",children:"No conversation yet"}),d(GI,{ref:l,session:e,inputAllowed:r.canInput,busy:r.busy,generating:r.generating,wsStatus:r.wsStatus,send:r.send,reportError:r.reportError,onInterrupt:r.interrupt})]}),d("div",{className:"min-h-0 flex-[3]"})]}):S(se,{children:[d(zH,{error:r.error,status:r.status,messages:r.messages,collapsible:r.collapsible,onToggle:r.toggleBlock,generating:r.generating}),d(XH,{groups:r.promptGroups,errorSignal:r.promptError,onResolve:r.resolvePrompt,onConsumeError:r.consumePromptError,docked:r.hasPendingQuestion}),!r.hasPendingQuestion&&d(GI,{ref:l,session:e,inputAllowed:r.canInput,busy:r.busy,generating:r.generating,wsStatus:r.wsStatus,send:r.send,reportError:r.reportError,onInterrupt:r.interrupt})]})}),!m?S(se,{children:[d(HI,{onOpen:()=>f(!0)}),d(r7,{open:c,onOpenChange:f,context:g.context,references:h,loading:g.loading})]}):c?d("div",{className:"flex w-[17rem] shrink-0 flex-col pt-2 pe-3 pb-3 sm:pe-4",children:d(a7,{context:g.context,references:h,loading:g.loading,onClose:()=>f(!1)})}):d(HI,{onOpen:()=>f(!0)})]}),d(o7,{accepting:v,blockedReason:w,onDropFiles:(C,L)=>l.current?.addFiles(C,L)}),d(gu,{open:r.deleteOpen,onOpenChange:(C)=>C?r.beginDelete():r.cancelDelete(),deleting:r.deleting,onConfirm:()=>void r.confirmDelete()})]})}function WH({projectId:e,sessionId:t}){let{navigate:a}=wt(),[r,n]=A(()=>{let l=_I(t);return l&&l.projectId===e?{phase:"ready",session:l}:{phase:"loading"}}),s=j(async()=>{if(_I(t)?.projectId===e){OF(t);return}n({phase:"loading"});try{let f=(await(await le("/api/sessions")).json()).sessions.find((m)=>m.id===t&&m.projectId===e);if(f===void 0)n({phase:"error",code:"SESSION_NOT_FOUND"});else n({phase:"ready",session:f})}catch(l){n({phase:"error",code:l instanceof we?l.code:"INTERNAL_ERROR"})}},[e,t]);if(U(()=>{s()},[s]),r.phase==="loading")return S("div",{className:"flex h-full min-h-0 flex-col","aria-busy":"true",children:[S("div",{className:"flex shrink-0 items-center gap-2 px-3 py-3 sm:px-4",children:[d(Fe,{className:"size-9 rounded-md"}),S("div",{className:"flex flex-col gap-1.5",children:[d(Fe,{className:"h-4 w-40"}),d(Fe,{className:"hidden h-3 w-56 sm:block"})]})]}),d(Y0,{}),d(W0,{})]});if(r.phase==="error")return S("div",{className:"flex flex-col items-center gap-4 py-10 text-center",children:[d("p",{className:"text-sm text-muted-foreground",children:vr(r.code)}),d("a",{href:Gi(e),onClick:(l)=>{l.preventDefault(),a(Gi(e))},className:"text-sm font-medium underline underline-offset-4",children:"Back to sessions"})]});return d("main",{className:"min-h-0 flex-1",children:d(YH,{session:r.session,onBack:()=>a(Gi(e)),onDeleted:()=>a(Gi(e))},r.session.id)})}var _T=["cat","dog","rabbit","panda","bird","fish","turtle","squirrel","rocket","bot","ghost","gamepad","flower","leaf","mountain","coffee"];var $H=4;function QH({profile:e,onResult:t}){let[a,r]=A(!1),[n,s]=A(null),l=B(null),c=B(null),f=e.avatarUrl!==null||e.avatarPreset!==null,m=async(C,L,k)=>{s(C);try{await L(),await Ut(),t({ok:k}),r(!1)}catch(I){t({error:I instanceof we?I.message:"Couldn't update the avatar."})}finally{s(null)}},g=(C)=>m(C,()=>le("/api/auth/avatar/preset",{method:"PUT",body:JSON.stringify({preset:C})}),"Avatar updated."),h=(C)=>{let L=new FormData;return L.append("file",C),m("upload",()=>le("/api/auth/avatar",{method:"PUT",body:L}),"Photo updated.")},x=()=>m("remove",()=>le("/api/auth/avatar",{method:"DELETE"}),"Avatar removed."),v=(C)=>{let L=[...c.current?.querySelectorAll("[data-avatar-option]")??[]],k=L.indexOf(document.activeElement);if(k===-1)return;let T={ArrowRight:1,ArrowLeft:-1,ArrowDown:$H,ArrowUp:-$H}[C.key];if(T===void 0)return;C.preventDefault(),L[(k+T+L.length)%L.length]?.focus()},w=e.avatarPreset?_T.indexOf(e.avatarPreset):-1;return S("div",{className:"relative w-fit",children:[d(dl,{nickname:e.nickname,avatarUrl:e.avatarUrl,avatarPreset:e.avatarPreset,className:"size-28 text-5xl",textClassName:"text-4xl"}),n==="upload"&&d("span",{className:"absolute inset-0 flex items-center justify-center rounded-full bg-background/70",children:d(fe,{className:"size-6"})}),S(Af,{open:a,onOpenChange:r,children:[d(Mf,{asChild:!0,children:d("button",{type:"button","aria-label":"Edit avatar",className:"absolute right-0 bottom-0 flex size-9 items-center justify-center rounded-full border-2 border-background bg-primary text-primary-foreground shadow-md transition-transform outline-none hover:scale-105 focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[state=open]:scale-105",children:d(Yc,{className:"size-4"})})}),S(Pf,{align:"center",side:"bottom",sideOffset:10,className:"w-[19rem] rounded-xl p-3",onOpenAutoFocus:(C)=>{C.preventDefault(),c.current?.querySelectorAll("[data-avatar-option]")?.[Math.max(0,w)]?.focus()},children:[d("p",{className:"px-1 pb-2 text-sm font-semibold",children:"Choose an avatar"}),d("fieldset",{ref:c,"aria-label":"Default avatars",onKeyDown:v,className:"grid grid-cols-4 gap-2 border-0 p-0",children:_T.map((C,L)=>{let k=Rb[C],I=e.avatarPreset===C;return S("button",{type:"button","data-avatar-option":!0,"aria-pressed":I,"aria-label":k.label,title:k.label,tabIndex:L===Math.max(0,w)?0:-1,disabled:n!==null,onClick:()=>void g(C),className:N("relative flex aspect-square items-center justify-center rounded-full transition-transform outline-none hover:scale-105 focus-visible:ring-[3px] focus-visible:ring-ring/60 disabled:opacity-60",k.className,I&&"ring-2 ring-primary ring-offset-2 ring-offset-popover"),children:[n===C?d(fe,{className:"size-5"}):d(k.Icon,{className:"size-[55%]",strokeWidth:1.75,"aria-hidden":!0}),I&&n!==C&&d("span",{className:"absolute -right-0.5 -bottom-0.5 flex size-4 items-center justify-center rounded-full bg-primary text-primary-foreground",children:d(Ke,{className:"size-3",strokeWidth:3,"aria-hidden":!0})})]},C)})}),S("div",{className:"mt-3 flex flex-col gap-1 border-t pt-3",children:[S(ae,{type:"button",variant:"ghost",className:"w-full justify-start",disabled:n!==null,onClick:()=>l.current?.click(),children:[n==="upload"?d(fe,{"data-icon":"inline-start"}):d(sg,{"data-icon":"inline-start"}),"Upload photo…"]}),f&&S(ae,{type:"button",variant:"ghost",className:"w-full justify-start text-destructive hover:text-destructive",disabled:n!==null,onClick:()=>void x(),children:[n==="remove"?d(fe,{"data-icon":"inline-start"}):d(pa,{"data-icon":"inline-start"}),"Remove avatar"]}),d("p",{className:"px-3 pt-1 text-[11px] text-muted-foreground",children:"PNG, JPEG, WebP or GIF, up to 2 MB."})]})]})]}),d("input",{ref:l,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",className:"sr-only",tabIndex:-1,"aria-hidden":!0,onChange:(C)=>{let L=C.target.files?.[0];if(C.target.value="",L)h(L)}})]})}var Ace=[{username:"irsyadulibad",role:"Lead Developer"},{username:"sahrullahh",role:"Product Advisor"}];function ZH(e){return`https://github.com/${encodeURIComponent(e)}`}function Mce(e){return e==="dev"?"dev":`v${e}`}function JH(){let[e,t]=A(null),[a,r]=A(!1);return U(()=>{let n=!1;return(async()=>{try{let l=await(await le("/api/meta")).json();if(!n)t(l.version)}catch{if(!n)r(!0)}})(),()=>{n=!0}},[]),d(Pce,{version:e,failed:a})}function Pce({version:e,failed:t}){return S(se,{children:[S("section",{"aria-labelledby":"about-title",className:"relative isolate overflow-hidden rounded-3xl border bg-card px-6 pt-12 pb-9 text-center shadow-xs",children:[d("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(70%_55%_at_50%_0%,rgba(109,92,251,0.09),transparent_70%)] dark:bg-[radial-gradient(70%_55%_at_50%_0%,rgba(109,92,251,0.16),transparent_70%)]"}),d("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-12 top-0 h-px bg-gradient-to-r from-transparent via-[#6D5CFB]/45 to-transparent"}),S("div",{className:"flex flex-col items-center",children:[d("span",{className:"flex size-24 items-center justify-center rounded-[1.75rem] border bg-background p-5 shadow-sm sm:size-28",children:d("img",{src:Cr,alt:"KCG Code logo",className:"size-full"})}),d("h2",{id:"about-title",className:"mt-6 text-2xl font-semibold tracking-tight sm:text-3xl",children:"KCG Code"}),d("p",{className:"mt-1.5 max-w-xs text-[14px] leading-snug text-pretty text-muted-foreground",children:"Your AI coding agent, in your pocket."}),d("div",{className:"mt-5",children:e!==null?S("span",{className:"inline-flex items-center gap-1.5 rounded-full border bg-background px-3 py-1 font-mono text-[12.5px] text-muted-foreground",title:e==="dev"?"Running from source (bun dev)":void 0,children:[d("span",{"aria-hidden":!0,className:N("size-1.5 rounded-full",e==="dev"?"bg-amber-500":"bg-emerald-500")}),d("span",{className:"text-foreground/80",children:Mce(e)})]}):t?d("span",{className:"text-[13px] text-muted-foreground",children:"Version unavailable"}):d(Fe,{className:"h-7 w-20 rounded-full","aria-label":"Loading version"})})]})]}),S("section",{"aria-labelledby":"about-credits",className:"flex flex-col gap-3",children:[S("div",{className:"flex flex-col gap-0.5 px-1",children:[d("h2",{id:"about-credits",className:"text-[15px] font-semibold tracking-tight",children:"Credits"}),d("p",{className:"text-[13px] text-muted-foreground",children:"The people building KCG Code."})]}),d("ul",{className:"grid gap-3 sm:grid-cols-2",children:Ace.map((a)=>d("li",{children:S("a",{href:ZH(a.username),target:"_blank",rel:"noopener noreferrer",className:"group flex h-full items-center gap-3.5 rounded-2xl border bg-card p-4 shadow-xs transition-colors outline-none hover:border-foreground/20 hover:bg-muted/40 focus-visible:ring-[3px] focus-visible:ring-ring/50 active:bg-muted/70",children:[d("img",{src:`${ZH(a.username)}.png?size=112`,alt:"",width:44,height:44,loading:"lazy",className:"size-11 shrink-0 rounded-full bg-muted ring-1 ring-border"}),S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[S("span",{className:"truncate text-[15px] leading-5 font-medium",children:["@",a.username]}),d("span",{className:"text-[13px] leading-snug text-muted-foreground",children:a.role})]}),d(Ece,{className:"size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-foreground"}),d("span",{className:"sr-only",children:"(opens GitHub in a new tab)"})]})},a.username))})]}),d("p",{className:"pb-2 text-center text-[12px] text-muted-foreground",children:"Built with Bun & OpenCode."})]})}function Ece(e){return d("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",...e,children:d("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function tV(){let{navigate:e}=wt(),[t,a]=A({phase:"loading"});U(()=>{let c=!1;return(async()=>{try{let f=await le("/api/tunnel"),{tunnel:m}=await f.json();if(!c)a({phase:"ready",configured:m.configured,account:m.account})}catch{if(!c)a({phase:"error"})}})(),()=>{c=!0}},[]);let r="Account";if(t.phase==="loading")return d(Ze,{title:r,children:S("li",{className:"flex min-h-16 items-center justify-center",role:"status",children:[d(fe,{className:"size-5 text-muted-foreground"}),d("span",{className:"sr-only",children:"Loading account…"})]})});if(t.phase==="error")return d(Ze,{title:r,children:d(it,{title:"Couldn't load account",subtitle:"Reload the page to try again."})});let{account:n,configured:s}=t,l=()=>e(xa("remote"));if(!n)return d(Ze,{title:r,children:d(it,{prefix:d(eV,{}),title:"No account linked",subtitle:s?"Sign in with Google in Remote access to use KCG Code from anywhere":"Remote access isn't available in this version",onActivate:s?l:void 0})});return S(Ze,{title:r,children:[S("li",{className:"flex items-center gap-3 px-4 py-3",children:[d(eV,{}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d("span",{className:"truncate text-[15px] leading-5",title:n.email,children:n.email}),S("span",{className:"truncate text-[13px] text-muted-foreground",children:["Signed in with Google · @",n.username]})]}),d(Nl,{tone:"success",children:"Linked"})]}),d(it,{prefix:d("span",{className:"flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground",children:d(Jr,{className:"size-5","aria-hidden":!0})}),title:"Remote access",subtitle:d("span",{className:"block truncate",title:n.url,children:n.url.replace(/^https?:\/\//,"")}),onActivate:l})]})}function eV(){return d("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:d(Ko,{className:"size-5","aria-hidden":!0})})}var Uu=((e)=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(Uu||{}),Nce=[0,1],rV=[1,0],oV=[2,3],nV=[3,2],Dce={L:Nce,M:rV,Q:oV,H:nV},Oce=/^\d*$/,_ce=/^[A-Z0-9 $%*+./:-]*$/,zT="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",UT=1,HT=40,aV=3,zce=3,aw=40,Bce=10,iV=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],sV=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class lV{constructor(e,t,a,r){if(this.version=e,this.ecc=t,e<UT||e>HT)throw RangeError("Version value out of range");if(r<-1||r>7)throw RangeError("Mask value out of range");this.size=e*4+17;let n=Array.from({length:this.size}).fill(!1);for(let l=0;l<this.size;l++)this.modules.push(n.slice()),this.types.push(n.map(()=>0));this.drawFunctionPatterns();let s=this.addEccAndInterleave(a);if(this.drawCodewords(s),r===-1){let l=1e9;for(let c=0;c<8;c++){this.applyMask(c),this.drawFormatBits(c);let f=this.getPenaltyScore();if(f<l)r=c,l=f;this.applyMask(c)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let a=0;a<this.size;a++)this.setFunctionModule(6,a,a%2===0,Uu.Timing),this.setFunctionModule(a,6,a%2===0,Uu.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let a=0;a<t;a++)for(let r=0;r<t;r++)if(!(a===0&&r===0||a===0&&r===t-1||a===t-1&&r===0))this.drawAlignmentPattern(e[a],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,a=t;for(let n=0;n<10;n++)a=a<<1^(a>>>9)*1335;let r=(t<<10|a)^21522;for(let n=0;n<=5;n++)this.setFunctionModule(8,n,is(r,n));this.setFunctionModule(8,7,is(r,6)),this.setFunctionModule(8,8,is(r,7)),this.setFunctionModule(7,8,is(r,8));for(let n=9;n<15;n++)this.setFunctionModule(14-n,8,is(r,n));for(let n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,is(r,n));for(let n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,is(r,n));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let a=0;a<12;a++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let a=0;a<18;a++){let r=is(t,a),n=this.size-11+a%3,s=Math.floor(a/3);this.setFunctionModule(n,s,r),this.setFunctionModule(s,n,r)}}drawFinderPattern(e,t){for(let a=-4;a<=4;a++)for(let r=-4;r<=4;r++){let n=Math.max(Math.abs(r),Math.abs(a)),s=e+r,l=t+a;if(s>=0&&s<this.size&&l>=0&&l<this.size)this.setFunctionModule(s,l,n!==2&&n!==4,Uu.Position)}}drawAlignmentPattern(e,t){for(let a=-2;a<=2;a++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+a,Math.max(Math.abs(r),Math.abs(a))!==1,Uu.Alignment)}setFunctionModule(e,t,a,r=Uu.Function){this.modules[t][e]=a,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,a=this.ecc;if(e.length!==rw(t,a))throw RangeError("Invalid argument");let r=sV[a[0]][t],n=iV[a[0]][t],s=Math.floor(BT(t)/8),l=r-s%r,c=Math.floor(s/r),f=[],m=Xce(n);for(let h=0,x=0;h<r;h++){let v=e.slice(x,x+c-n+(h<l?0:1));x+=v.length;let w=Yce(v,m);if(h<l)v.push(0);f.push(v.concat(w))}let g=[];for(let h=0;h<f[0].length;h++)f.forEach((x,v)=>{if(h!==c-n||v>=l)g.push(x[h])});return g}drawCodewords(e){if(e.length!==Math.floor(BT(this.version)/8))throw RangeError("Invalid argument");let t=0;for(let a=this.size-1;a>=1;a-=2){if(a===6)a=5;for(let r=0;r<this.size;r++)for(let n=0;n<2;n++){let s=a-n,c=(a+1&2)===0?this.size-1-r:r;if(!this.types[c][s]&&t<e.length*8)this.modules[c][s]=is(e[t>>>3],7-(t&7)),t++}}}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let a=0;a<this.size;a++){let r;switch(e){case 0:r=(a+t)%2===0;break;case 1:r=t%2===0;break;case 2:r=a%3===0;break;case 3:r=(a+t)%3===0;break;case 4:r=(Math.floor(a/3)+Math.floor(t/2))%2===0;break;case 5:r=a*t%2+a*t%3===0;break;case 6:r=(a*t%2+a*t%3)%2===0;break;case 7:r=((a+t)%2+a*t%3)%2===0;break;default:throw Error("Unreachable")}if(!this.types[t][a]&&r)this.modules[t][a]=!this.modules[t][a]}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let s=!1,l=0,c=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)if(this.modules[n][f]===s){if(l++,l===5)e+=aV;else if(l>5)e++}else{if(this.finderPenaltyAddHistory(l,c),!s)e+=this.finderPenaltyCountPatterns(c)*aw;s=this.modules[n][f],l=1}e+=this.finderPenaltyTerminateAndCount(s,l,c)*aw}for(let n=0;n<this.size;n++){let s=!1,l=0,c=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)if(this.modules[f][n]===s){if(l++,l===5)e+=aV;else if(l>5)e++}else{if(this.finderPenaltyAddHistory(l,c),!s)e+=this.finderPenaltyCountPatterns(c)*aw;s=this.modules[f][n],l=1}e+=this.finderPenaltyTerminateAndCount(s,l,c)*aw}for(let n=0;n<this.size-1;n++)for(let s=0;s<this.size-1;s++){let l=this.modules[n][s];if(l===this.modules[n][s+1]&&l===this.modules[n+1][s]&&l===this.modules[n+1][s+1])e+=zce}let t=0;for(let n of this.modules)t=n.reduce((s,l)=>s+(l?1:0),t);let a=this.size*this.size,r=Math.ceil(Math.abs(t*20-a*10)/a)-1;return e+=r*Bce,e}getAlignmentPatternPositions(){if(this.version===1)return[];else{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,a=[6];for(let r=this.size-7;a.length<e;r-=t)a.splice(1,0,r);return a}}finderPenaltyCountPatterns(e){let t=e[1],a=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(a&&e[0]>=t*4&&e[6]>=t?1:0)+(a&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,a){if(e)this.finderPenaltyAddHistory(t,a),t=0;return t+=this.size,this.finderPenaltyAddHistory(t,a),this.finderPenaltyCountPatterns(a)}finderPenaltyAddHistory(e,t){if(t[0]===0)e+=this.size;t.pop(),t.unshift(e)}}function ss(e,t,a){if(t<0||t>31||e>>>t!==0)throw RangeError("Value out of range");for(let r=t-1;r>=0;r--)a.push(e>>>r&1)}function is(e,t){return(e>>>t&1)!==0}class ow{constructor(e,t,a){if(this.mode=e,this.numChars=t,this.bitData=a,t<0)throw RangeError("Invalid argument");this.bitData=a.slice()}getData(){return this.bitData.slice()}}var Fce=[1,10,12,14],Uce=[2,9,11,13],Hce=[4,8,16,16];function cV(e,t){return e[Math.floor((t+7)/17)+1]}function uV(e){let t=[];for(let a of e)ss(a,8,t);return new ow(Hce,e.length,t)}function Vce(e){if(!dV(e))throw RangeError("String contains non-numeric characters");let t=[];for(let a=0;a<e.length;){let r=Math.min(e.length-a,3);ss(Number.parseInt(e.substring(a,a+r),10),r*3+1,t),a+=r}return new ow(Fce,e.length,t)}function jce(e){if(!fV(e))throw RangeError("String contains unencodable characters in alphanumeric mode");let t=[],a;for(a=0;a+2<=e.length;a+=2){let r=zT.indexOf(e.charAt(a))*45;r+=zT.indexOf(e.charAt(a+1)),ss(r,11,t)}if(a<e.length)ss(zT.indexOf(e.charAt(a)),6,t);return new ow(Uce,e.length,t)}function Gce(e){if(e==="")return[];else if(dV(e))return[Vce(e)];else if(fV(e))return[jce(e)];else return[uV(Kce(e))]}function dV(e){return Oce.test(e)}function fV(e){return _ce.test(e)}function qce(e,t){let a=0;for(let r of e){let n=cV(r.mode,t);if(r.numChars>=1<<n)return Number.POSITIVE_INFINITY;a+=4+n+r.bitData.length}return a}function Kce(e){e=encodeURI(e);let t=[];for(let a=0;a<e.length;a++)if(e.charAt(a)!=="%")t.push(e.charCodeAt(a));else t.push(Number.parseInt(e.substring(a+1,a+3),16)),a+=2;return t}function BT(e){if(e<UT||e>HT)throw RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){let a=Math.floor(e/7)+2;if(t-=(25*a-10)*a-55,e>=7)t-=36}return t}function rw(e,t){return Math.floor(BT(e)/8)-iV[t[0]][e]*sV[t[0]][e]}function Xce(e){if(e<1||e>255)throw RangeError("Degree out of range");let t=[];for(let r=0;r<e-1;r++)t.push(0);t.push(1);let a=1;for(let r=0;r<e;r++){for(let n=0;n<t.length;n++)if(t[n]=FT(t[n],a),n+1<t.length)t[n]^=t[n+1];a=FT(a,2)}return t}function Yce(e,t){let a=t.map((r)=>0);for(let r of e){let n=r^a.shift();a.push(0),t.forEach((s,l)=>a[l]^=FT(s,n))}return a}function FT(e,t){if(e>>>8!==0||t>>>8!==0)throw RangeError("Byte out of range");let a=0;for(let r=7;r>=0;r--)a=a<<1^(a>>>7)*285,a^=(t>>>r&1)*e;return a}function Wce(e,t,a=1,r=40,n=-1,s=!0){if(!(UT<=a&&a<=r&&r<=HT)||n<-1||n>7)throw RangeError("Invalid value");let l,c;for(l=a;;l++){let h=rw(l,t)*8,x=qce(e,l);if(x<=h){c=x;break}if(l>=r)throw RangeError("Data too long")}for(let h of[rV,oV,nV])if(s&&c<=rw(l,h)*8)t=h;let f=[];for(let h of e){ss(h.mode[0],4,f),ss(h.numChars,cV(h.mode,l),f);for(let x of h.getData())f.push(x)}let m=rw(l,t)*8;ss(0,Math.min(4,m-f.length),f),ss(0,(8-f.length%8)%8,f);for(let h=236;f.length<m;h^=253)ss(h,8,f);let g=Array.from({length:Math.ceil(f.length/8)},()=>0);return f.forEach((h,x)=>g[x>>>3]|=h<<7-(x&7)),new lV(l,t,g,n)}function pV(e,t){let{ecc:a="L",boostEcc:r=!1,minVersion:n=1,maxVersion:s=40,maskPattern:l=-1,border:c=1}=t||{},f=typeof e==="string"?Gce(e):Array.isArray(e)?[uV(e)]:void 0;if(!f)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let m=Wce(f,Dce[a],n,s,l,r),g=$ce({version:m.version,maskPattern:m.mask,size:m.size,data:m.modules,types:m.types},c);if(t?.invert)g.data=g.data.map((h)=>h.map((x)=>!x));return t?.onEncoded?.(g),g}function $ce(e,t=1){if(!t)return e;let{size:a}=e,r=a+t*2;e.size=r,e.data.forEach((s)=>{for(let l=0;l<t;l++)s.unshift(!1),s.push(!1)});for(let s=0;s<t;s++)e.data.unshift(Array.from({length:r},(l)=>!1)),e.data.push(Array.from({length:r},(l)=>!1));let n=Uu.Border;e.types.forEach((s)=>{for(let l=0;l<t;l++)s.unshift(n),s.push(n)});for(let s=0;s<t;s++)e.types.unshift(Array.from({length:r},(l)=>n)),e.types.push(Array.from({length:r},(l)=>n));return e}function nw({className:e,size:t="default",...a}){return d(yee,{"data-slot":"switch","data-size":t,className:N("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),...a,children:d(See,{"data-slot":"switch-thumb",className:N("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}var Qce=["starting","connecting","reconnecting"];function mV(e,t){return e instanceof we?e.message:t}function gV({protectedApp:e,LiveAddress:t,LogPanel:a,onRequestStop:r,methodPicker:n}){let{navigate:s}=wt(),[l,c]=A(null),[f,m]=A(null),[g,h]=A(!1),x=j(async()=>{try{let P=await le("/api/tunnel/lhr");c((await P.json()).lhr)}catch{}},[]),v=l!==null&&Qce.includes(l.phase);U(()=>{x();let P=setInterval(()=>void x(),v?1500:5000);return()=>clearInterval(P)},[x,v]);let w=async()=>{m("start");try{let P=await le("/api/tunnel/lhr/start",{method:"POST",body:"{}"});c((await P.json()).lhr)}catch(P){De.error(mV(P,"Couldn't turn on remote access.")),x()}finally{m(null)}},C=async()=>{m("stop");try{let P=await le("/api/tunnel/lhr/stop",{method:"POST",body:"{}"});c((await P.json()).lhr),De.success("Remote access turned off.")}catch(P){De.error(mV(P,"Couldn't turn off remote access."))}finally{m(null)}};if(!l)return d(Ze,{children:S("li",{className:"flex min-h-14 items-center justify-center",role:"status",children:[d(fe,{className:"size-5 text-muted-foreground"}),d("span",{className:"sr-only",children:"Loading remote access…"})]})});let L=l.enabled&&l.phase!=="stopped",k=l.phase==="online"&&l.url!==null,I=l.url!==null&&Zce(l.url),T=L&&!k&&l.phase!=="error",R="muted",E="Off";if(!e)R="warning",E="Needs a PIN or password first";else if(l.phase==="error")R="warning",E=d("span",{className:"text-destructive",children:l.error?vr(l.error):"Couldn't connect. Check your internet and try again."});else if(k)R="success",E="On · PIN still required";else if(T)R="busy",E=l.phase==="reconnecting"?"Reconnecting to localhost.run…":"Getting a link from localhost.run…";let M=(P)=>{if(P)w();else r(C,I)};return S(se,{children:[S(Ze,{id:"remote",children:[d("li",{children:S("label",{htmlFor:"lhr-switch",className:N("flex min-h-14 items-center gap-3 px-4 py-2.5",e&&"cursor-pointer"),children:[d(VT,{tone:R,children:d(Jr,{})}),S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 py-0.5",children:[d("span",{className:"text-[15px] leading-5",children:"Remote access"}),d("span",{role:"status",className:"text-[13px] leading-snug text-muted-foreground",children:E})]}),f!==null&&d(fe,{className:"size-4 text-muted-foreground","aria-hidden":!0}),d(nw,{id:"lhr-switch",checked:L||f==="start",disabled:!e||f!==null,onCheckedChange:M})]})}),!e&&d(it,{prefix:d(VT,{tone:"muted",children:d(Ka,{})}),title:"Set up app lock",subtitle:"Add a PIN or password in Security",onActivate:()=>s(xa("security"))})]}),k&&l.url&&d(Ze,{title:"Your link",children:d(t,{url:l.url})}),n,d(Ze,{children:d(Lo,{asChild:!0,open:g,onOpenChange:h,children:S("li",{children:[d(ai,{asChild:!0,children:S("button",{type:"button",className:"flex min-h-14 w-full items-center gap-3 px-4 py-2.5 text-left text-[15px] leading-5 transition-colors outline-none hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/40 focus-visible:ring-inset",children:[d(VT,{tone:"muted",children:d(yo,{})}),S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d("span",{children:"Connection log"}),d("span",{className:"text-[13px] leading-snug text-muted-foreground",children:"Technical details for troubleshooting"})]}),d(yt,{className:N("size-4 shrink-0 text-muted-foreground transition-transform duration-200",g&&"rotate-180"),"aria-hidden":!0})]})}),d(To,{className:"border-t",children:d("ul",{children:g&&d(a,{endpoint:"/api/tunnel/lhr/logs"})})})]})})})]})}function Zce(e){try{return new URL(e).origin===window.location.origin}catch{return!1}}function VT({tone:e,children:t}){return d("span",{"aria-hidden":!0,className:N("flex size-9 shrink-0 items-center justify-center rounded-full [&>svg]:size-[18px]",e==="success"&&"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",e==="busy"&&"bg-sky-500/10 text-sky-700 dark:text-sky-400",e==="warning"&&"bg-amber-500/15 text-amber-800 dark:text-amber-300",e==="muted"&&"bg-muted text-muted-foreground"),children:e==="busy"?d(fe,{className:"size-[18px]"}):t})}var Jce=["starting","connecting","reconnecting"],eue="Open KCG Code from your phone or another computer, even when you're away.";function vV(e,t){return e instanceof we?e.message:t}async function hV(e){return(await e.json()).tunnel}function tue(e){let t=!!e.tunnel&&e.tunnel.enabled&&e.tunnel.phase!=="stopped",a=!!e.lhr&&e.lhr.enabled&&e.lhr.phase!=="stopped",r=t?"kcg":a?"lhr":null;return{provider:e.provider==="lhr"?"lhr":"kcg",live:r,liveUrl:r==="kcg"?e.tunnel?.account?.url??null:r==="lhr"?e.lhr?.url??null:null}}function bV({protectedApp:e}){let[t,a]=A(null),[r,n]=A({provider:null,url:null}),[s,l]=A(!1),[c,f]=A(null),[m,g]=A(null),[h,x]=A(!1),v=j(async()=>{try{let k=tue(await(await le("/api/tunnel")).json());return n({provider:k.live,url:k.liveUrl}),k}catch{return null}},[]);U(()=>{let k=!1;v().then((T)=>{if(!k)a((R)=>R??T?.provider??"kcg")});let I=setInterval(()=>void v(),5000);return()=>{k=!0,clearInterval(I)}},[v]);let w=async(k)=>{l(!0);try{await le("/api/tunnel/provider",{method:"PUT",body:JSON.stringify({provider:k})}),a(k),await v()}catch(I){De.error(vV(I,"Couldn't switch the remote access option."))}finally{l(!1),f(null)}},C=async(k)=>{if(k===t||s)return;let I=await v();if(I?.live&&I.live!==k)f(k);else w(k)},L=d(rue,{value:t,live:r.provider,disabled:s,onChange:(k)=>void C(k)});return S("div",{className:"flex flex-col gap-6",children:[d("p",{className:"px-1 text-[13px] leading-snug text-muted-foreground",children:eue}),d(oue,{to:c,viaTunnel:r.url!==null&&yV(r.url),busy:s,onCancel:()=>f(null),onConfirm:(k)=>void w(k)}),t===null?d(Ze,{children:S("li",{className:"flex min-h-14 items-center justify-center",role:"status",children:[d(fe,{className:"size-5 text-muted-foreground"}),d("span",{className:"sr-only",children:"Loading remote access…"})]})}):t==="lhr"?d(gV,{protectedApp:e,LiveAddress:wV,LogPanel:SV,onRequestStop:(k,I)=>g({run:k,via:I}),methodPicker:L}):d(nue,{protectedApp:e,methodPicker:L}),d(kV,{kind:m?"stop":null,viaTunnel:m?.via??!1,busy:h,onOpenChange:(k)=>!k&&g(null),onConfirm:()=>{let k=m;if(!k)return;x(!0),k.run().finally(()=>{x(!1),g(null),v()})}})]})}var aue=[{id:"kcg",title:"KCG Code link",subtitle:"Recommended · fixed address",recommended:!0},{id:"lhr",title:"localhost.run",subtitle:"No account · address changes"}],jT={kcg:"KCG Code link",lhr:"localhost.run"};function rue({value:e,live:t,disabled:a,onChange:r}){return S("section",{"aria-labelledby":"remote-provider",className:"flex flex-col gap-2.5",children:[d("div",{className:"flex flex-col gap-0.5 px-1",children:d("h2",{id:"remote-provider",className:"text-[15px] font-semibold tracking-tight",children:"Connection method"})}),d("fieldset",{"aria-labelledby":"remote-provider",disabled:a||e===null,className:"m-0 min-w-0 overflow-hidden rounded-xl border bg-card p-0 shadow-xs",children:d("ul",{className:"flex flex-col divide-y",children:aue.map((n)=>{let s=e===n.id;return d("li",{children:S("label",{className:N("flex min-h-14 cursor-pointer items-center gap-3 px-4 py-2.5 transition-colors","hover:bg-muted/60 active:bg-muted has-[:focus-visible]:bg-muted/60","has-[:disabled]:cursor-default has-[:disabled]:opacity-60 has-[:disabled]:hover:bg-transparent"),children:[d("input",{type:"radio",name:"remote-provider",value:n.id,checked:s,onChange:()=>r(n.id),className:"peer sr-only"}),d("span",{"aria-hidden":!0,className:N("flex size-[18px] shrink-0 items-center justify-center rounded-full border-2 transition-colors","peer-focus-visible:ring-[3px] peer-focus-visible:ring-ring/40",s?"border-primary bg-primary":"border-muted-foreground/45"),children:s&&d("span",{className:"size-1.5 rounded-full bg-primary-foreground"})}),S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 py-0.5",children:[d("span",{className:"text-[15px] leading-5",children:n.title}),d("span",{className:"text-[13px] leading-snug text-muted-foreground",children:n.subtitle})]}),t===n.id&&d(Nl,{tone:"success",children:"On"})]})},n.id)})})})]})}function oue({to:e,viaTunnel:t,busy:a,onCancel:r,onConfirm:n}){let[s,l]=A("kcg");if(e&&e!==s)l(e);let c=e??s,f=c==="kcg"?"lhr":"kcg";return d(qi,{open:e!==null,onOpenChange:(m)=>!m&&!a&&r(),children:S(Ki,{children:[S(Xi,{children:[S(Wi,{children:["Switch to ",jT[c],"?"]}),S($i,{children:["Only one link can be on at a time, so your ",jT[f]," link will turn off and stop working. You can turn on ",jT[c]," right after.",t&&S(se,{children:[" ",d("strong",{className:"font-medium text-foreground",children:"You're using this link right now, so this page will close its connection."})]})]})]}),S(Yi,{children:[d(Zi,{disabled:a,children:"Cancel"}),S(Qi,{disabled:a,onClick:(m)=>{m.preventDefault(),n(c)},children:[a&&d(fe,{"data-icon":"inline-start"}),"Switch"]})]})]})})}function nue({protectedApp:e,methodPicker:t}){let{navigate:a}=wt(),[r,n]=A(null),[s,l]=A(null),[c,f]=A(null),m=j(async()=>{try{n(await hV(await le("/api/tunnel")))}catch{}},[]),g=r!==null&&(r.pairing!==null||Jce.includes(r.phase));U(()=>{m();let R=setInterval(()=>void m(),g?1500:5000);return()=>clearInterval(R)},[m,g]);let h=async(R,E,M)=>{l(R);try{if(n(await hV(await le(E,{method:"POST",body:"{}"}))),M)De.success(M)}catch(P){De.error(vV(P,"Something went wrong.")),m()}finally{l(null)}};if(!r)return d(Ze,{children:S("li",{className:"flex min-h-14 items-center justify-center",role:"status",children:[d(fe,{className:"size-5 text-muted-foreground"}),d("span",{className:"sr-only",children:"Loading remote access…"})]})});if(!r.configured)return S(se,{children:[d(Ze,{id:"remote",children:d(it,{prefix:d(GT,{tone:"muted"}),title:"Not available in this version",subtitle:S(se,{children:["Remote access hasn't been set up for this copy of KCG Code. If you manage it, set"," ",d("code",{className:"font-mono text-[12px]",children:"KCG_TUNNEL_API_URL"})," and restart."]})})}),t]});if(!r.account)return S(se,{children:[d(Ze,{id:"remote",children:r.pairing?d(lue,{pairing:r.pairing,busy:s!==null,onCancel:()=>void h("cancel","/api/tunnel/connect/cancel")}):d(sue,{protectedApp:e,error:r.error,busy:s,onStart:()=>void h("connect","/api/tunnel/connect")})}),t]});let x=r.enabled&&r.phase!=="stopped",v=yV(r.account.url),w=async(R)=>{if(R==="stop")await h("stop","/api/tunnel/stop","Remote access turned off.");if(R==="rotate")await h("rotate","/api/tunnel/rotate-secret","Security key reset.");if(R==="signout")await h("signout","/api/tunnel/signout","This computer was unlinked.");f(null)},C=x&&r.phase==="online"&&e,L=r.account,k,I;if(!e)k="warning",I="Needs a PIN or password first";else if(x&&r.phase==="error")k="warning",I=d("span",{className:"text-destructive",children:r.error?vr(r.error):"Couldn't connect. Check your internet."});else if(C)k="success",I="On · PIN still required";else if(x||s==="start")k="busy",I=r.phase==="reconnecting"?"Reconnecting…":"Turning on…";else k="muted",I="Off";return S(se,{children:[S(Ze,{id:"remote",children:[d(iue,{id:"kcg-remote-switch",icon:d(GT,{tone:k}),title:"Remote access",subtitle:I,checked:x||s==="start",disabled:!e||s!==null,busy:s==="start"||s==="stop",onChange:(R)=>{if(R)h("start","/api/tunnel/start");else f("stop")}}),!e&&d(it,{prefix:d(Hl,{icon:d(Ka,{className:"size-[18px]","aria-hidden":!0})}),title:"Set up app lock",subtitle:"Add a PIN or password in Security",onActivate:()=>a(xa("security"))}),e&&x&&r.phase==="error"&&d(it,{prefix:d(Hl,{icon:d(xr,{className:"size-[18px]","aria-hidden":!0})}),title:"Try again",disabled:s!==null,onActivate:()=>void h("start","/api/tunnel/start")})]}),C&&d(Ze,{title:"Your link",children:d(wV,{url:L.url})}),d(Ze,{title:"Account",children:d(it,{title:"Google account",subtitle:d("span",{className:"break-all",children:L.email})})}),t,d(cue,{busy:s!==null,onRotate:()=>f("rotate"),onUnlink:()=>f("signout")}),d(kV,{kind:c,viaTunnel:v,busy:s!==null,onOpenChange:(R)=>!R&&f(null),onConfirm:(R)=>void w(R)})]})}function iue({id:e,icon:t,title:a,subtitle:r,checked:n,disabled:s,busy:l,onChange:c}){return d("li",{children:S("label",{htmlFor:e,className:N("flex min-h-14 items-center gap-3 px-4 py-2.5",!s&&"cursor-pointer"),children:[t,S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 py-0.5",children:[d("span",{className:"text-[15px] leading-5",children:a}),d("span",{role:"status",className:"text-[13px] leading-snug text-muted-foreground",children:r})]}),l&&d(fe,{className:"size-4 text-muted-foreground","aria-hidden":!0}),d(nw,{id:e,checked:n,disabled:s,onCheckedChange:c})]})})}function yV(e){try{return new URL(e).origin===window.location.origin}catch{return!1}}function GT({tone:e,className:t}){return d("span",{className:N("flex size-9 shrink-0 items-center justify-center rounded-full",e==="success"&&"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",e==="busy"&&"bg-sky-500/10 text-sky-700 dark:text-sky-400",e==="warning"&&"bg-amber-500/15 text-amber-800 dark:text-amber-300",e==="muted"&&"bg-muted text-muted-foreground",t),children:e==="busy"?d(fe,{className:"size-5"}):e==="warning"?d(jo,{className:"size-5","aria-hidden":!0}):d(Jr,{className:"size-5","aria-hidden":!0})})}function sue({protectedApp:e,error:t,busy:a,onStart:r}){let{navigate:n}=wt();return S("li",{className:"flex flex-col gap-4 px-4 py-4",children:[S("div",{className:"flex items-start gap-3",children:[d(GT,{tone:"muted"}),S("div",{className:"flex min-w-0 flex-col gap-0.5",children:[d("p",{className:"text-[15px] font-medium",children:"Set up remote access"}),d("p",{className:"text-[13px] text-muted-foreground",children:"It takes about a minute. You'll get your own link to open KCG Code from anywhere."})]})]}),S("ol",{className:"flex flex-col gap-3 pl-1",children:[d(xV,{n:1,done:e,title:"Lock KCG Code with a PIN or password",subtitle:e?"Done.":"This keeps others out when your link is shared online.",action:!e&&d(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>n(xa("security")),children:"Set up lock"})}),d(xV,{n:2,title:"Sign in with Google",subtitle:"You can do this on your phone. We only use it to give you a personal link.",action:S(ae,{type:"button",size:"sm",disabled:a!==null||!e,onClick:r,children:[a==="connect"&&d(fe,{"data-icon":"inline-start"}),"Get started"]})})]}),t&&S("p",{role:"alert",className:"flex items-start gap-2 text-[13px] text-destructive",children:[d(jo,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),vr(t)]})]})}function xV({n:e,done:t,title:a,subtitle:r,action:n}){return S("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[d("span",{className:N("flex size-6 shrink-0 items-center justify-center rounded-full text-[12px] font-semibold",t?"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400":"bg-muted text-muted-foreground"),"aria-hidden":!0,children:t?d(Ke,{className:"size-3.5"}):e}),S("div",{className:"flex min-w-[min(100%,12rem)] flex-1 flex-col",children:[S("span",{className:N("text-[14px]",t&&"text-muted-foreground line-through"),children:[S("span",{className:"sr-only",children:["Step ",e,t?" (done)":"",":"," "]}),a]}),d("span",{className:"text-[12.5px] text-muted-foreground",children:r})]}),n&&d("div",{className:"ml-9 shrink-0 sm:ml-0",children:n})]})}function lue({pairing:e,busy:t,onCancel:a}){let[r,n]=A(()=>Math.max(0,e.expiresAt-Date.now()));U(()=>{let c=setInterval(()=>n(Math.max(0,e.expiresAt-Date.now())),1000);return()=>clearInterval(c)},[e.expiresAt]);let s=Math.floor(r/60000),l=String(Math.floor(r%60000/1000)).padStart(2,"0");return S("li",{className:"flex flex-col items-center gap-5 px-4 py-5 text-center sm:flex-row sm:items-start sm:text-left",children:[d(qT,{value:e.verificationUriComplete,label:"QR code to open the sign-in page on your phone"}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[d("p",{className:"text-[15px] font-medium",children:"Sign in to finish"}),S("ol",{className:"flex list-decimal flex-col gap-1.5 pl-5 text-left text-[13px] text-muted-foreground marker:text-foreground/70",children:[S("li",{children:["Scan the code with your phone camera, or"," ",d("a",{href:e.verificationUriComplete,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-foreground underline underline-offset-2",children:"open the sign-in page"}),"."]}),d("li",{children:"Sign in with your Google account."}),d("li",{children:"Make sure the page shows the same code as below, then tap Approve."})]}),S("p",{className:"rounded-lg bg-muted px-3 py-2 text-center font-mono text-2xl font-semibold tracking-[0.2em]",children:[d("span",{className:"sr-only",children:"Code: "}),e.userCode]}),S("div",{className:"flex flex-wrap items-center justify-center gap-3 sm:justify-between",children:[S("span",{className:"flex items-center gap-2 text-[12px] text-muted-foreground",role:"status",children:[d(fe,{className:"size-3.5"}),"Waiting for you to approve · ",s,":",l," left"]}),d(ae,{type:"button",variant:"ghost",size:"sm",disabled:t,onClick:a,children:"Cancel"})]})]})]})}function qT({value:e,label:t,className:a}){let{data:r,size:n}=de(()=>{let l=pV(e,{ecc:"M",border:2});return{data:l.data,size:l.size}},[e]),s=de(()=>{let l="";for(let c=0;c<r.length;c++){let f=r[c]??[];for(let m=0;m<f.length;m++)if(f[m])l+=`M${m} ${c}h1v1h-1z`}return l},[r]);return d("svg",{viewBox:`0 0 ${n} ${n}`,role:"img","aria-label":t,shapeRendering:"crispEdges",className:N("size-40 shrink-0 rounded-lg bg-white p-1",a),children:d("path",{d:s,fill:"#000"})})}function wV({url:e}){let[t,a]=A(!1),r=async()=>{try{await navigator.clipboard.writeText(e),a(!0),De.success("Link copied."),setTimeout(()=>a(!1),1500)}catch{De.error("Couldn't copy. Select the link and copy it manually.")}},n=typeof navigator<"u"&&typeof navigator.share==="function",s=async()=>{try{await navigator.share({title:"KCG Code",url:e})}catch{}},l=e.replace(/^https?:\/\//,"");return S(se,{children:[d("li",{className:"hidden justify-center py-5 sm:flex",children:d(qT,{value:e,label:"QR code of your remote access link",className:"size-40"})}),S("li",{className:"flex min-h-14 items-center gap-2 py-2 pr-2 pl-4",children:[d("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"min-w-0 flex-1 truncate font-mono text-[14px] hover:underline",title:e,children:l}),d(ae,{type:"button",variant:"ghost",size:"icon-sm",className:"rounded-full","aria-label":t?"Copied":"Copy link",onClick:()=>void r(),children:t?d(Ke,{className:"text-emerald-600 dark:text-emerald-400"}):d(gr,{})}),d(ae,{asChild:!0,variant:"ghost",size:"icon-sm",className:"rounded-full",children:d("a",{href:e,target:"_blank",rel:"noopener noreferrer","aria-label":"Open link in new tab",children:d(Xo,{})})})]}),n&&d(it,{className:"sm:hidden",prefix:d(Hl,{icon:d(Ag,{className:"size-[18px]","aria-hidden":!0})}),title:"Share link",onActivate:()=>void s()}),d(R0,{className:"sm:hidden",prefix:d(Hl,{icon:d(Sg,{className:"size-[18px]","aria-hidden":!0})}),title:"QR code",subtitle:"Scan from another device",children:d("div",{className:"flex justify-center py-2",children:d(qT,{value:e,label:"QR code of your remote access link",className:"size-44"})})})]})}function cue({busy:e,onRotate:t,onUnlink:a}){let[r,n]=A(!1),[s,l]=A(!1);return S(Lo,{open:r,onOpenChange:n,className:"overflow-hidden rounded-xl border bg-card shadow-xs",children:[d(ai,{asChild:!0,children:S("button",{type:"button",className:"flex min-h-14 w-full items-center gap-3 px-4 py-2.5 text-left transition-colors outline-none hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/40 focus-visible:ring-inset data-[state=open]:bg-muted/50 data-[state=open]:hover:bg-muted/70",children:[d(Hl,{icon:d(Tg,{className:"size-[18px]","aria-hidden":!0})}),S("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d("span",{className:"text-[15px] leading-5",children:"Advanced options"}),d("span",{className:"text-[13px] leading-snug text-muted-foreground",children:"Security key, connection log, and unlinking this computer"})]}),d(yt,{className:N("size-4 shrink-0 text-muted-foreground transition-transform duration-200",r&&"rotate-180"),"aria-hidden":!0})]})}),d(To,{className:"border-t",children:S("ul",{className:"flex flex-col divide-y",children:[d(it,{prefix:d(Hl,{icon:d(xr,{className:"size-[18px]","aria-hidden":!0})}),title:"Reset security key",subtitle:"Only needed if you think someone else got access. Your link stays the same.",disabled:e,onActivate:t}),d(it,{prefix:d(Hl,{icon:d(yo,{className:"size-[18px]","aria-hidden":!0})}),title:"Connection log",subtitle:"Technical details that can help when troubleshooting",suffix:d(ae,{type:"button",variant:"ghost",size:"sm","aria-expanded":s,onClick:()=>l((c)=>!c),children:s?"Hide":"Show"})}),s&&d(SV,{}),d(it,{prefix:d(Hl,{destructive:!0,icon:d(_g,{className:"size-[18px]","aria-hidden":!0})}),title:"Unlink this computer",subtitle:"Turns remote access off and removes this computer from your Google account",destructive:!0,disabled:e,onActivate:a})]})})]})}function Hl({icon:e,destructive:t}){return d("span",{className:N("flex size-9 items-center justify-center rounded-full",t?"bg-destructive/10 text-destructive":"bg-muted text-muted-foreground"),children:e})}function SV({endpoint:e="/api/tunnel/logs"}){let[t,a]=A([]),r=B(0),n=B(null);return U(()=>{let s=!1,l=async()=>{try{let m=await(await le(`${e}?from=${r.current}`)).json();if(s)return;if(r.current=m.next,m.lines.length>0)a((g)=>[...g,...m.lines].slice(-300))}catch{}};l();let c=setInterval(()=>void l(),1500);return()=>{s=!0,clearInterval(c)}},[e]),U(()=>{n.current?.scrollTo({top:n.current.scrollHeight})},[t.length]),d("li",{className:"px-4 py-3",children:d("pre",{ref:n,role:"log","aria-label":"Connection log",className:"max-h-56 overflow-auto rounded-md bg-muted/60 p-3 font-mono text-[11.5px] leading-relaxed whitespace-pre-wrap break-all",children:t.length===0?"No output yet.":t.join(`
|
|
98
|
+
`)})})}var uue={stop:{title:"Turn off remote access?",body:"Your link will stop working and any phone or computer using it will be disconnected. You can turn it back on from this computer anytime.",action:"Turn off",destructive:!0},rotate:{title:"Reset security key?",body:"Remote access restarts, so your link stops for a few seconds. Other computers linked to your account will need to sign in again.",action:"Reset",destructive:!1},signout:{title:"Unlink this computer?",body:"Remote access turns off and this computer is removed from your Google account. You can set it up again anytime.",action:"Unlink",destructive:!0}};function kV({kind:e,viaTunnel:t,busy:a,onOpenChange:r,onConfirm:n}){let[s,l]=A("stop");if(e&&e!==s)l(e);let c=uue[e??s],f=t&&(e??s)!=="rotate";return d(qi,{open:e!==null,onOpenChange:(m)=>!a&&r(m),children:S(Ki,{children:[S(Xi,{children:[d(Wi,{children:c.title}),S($i,{children:[c.body,f&&S(se,{children:[" ",d("strong",{className:"font-medium text-foreground",children:"You're using this link right now, so this page will close its connection."})]})]})]}),S(Yi,{children:[d(Zi,{disabled:a,children:"Cancel"}),S(Qi,{variant:c.destructive?"destructive":"default",disabled:a,onClick:(m)=>{m.preventDefault(),n(e??s)},children:[a&&d(fe,{"data-icon":"inline-start"}),c.action]})]})]})})}function CV(e,t){return e instanceof we?e.message:t}function due(e){if(!e)return{label:"Unknown device",mobile:!1};let t=/Android|iPhone|iPad|Mobile/i.test(e),a=/Edg\//.test(e)?"Edge":/OPR\/|Opera/.test(e)?"Opera":/Firefox\//.test(e)?"Firefox":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)?"Safari":"Browser",r=/Android/.test(e)?"Android":/iPhone|iPad|iOS/.test(e)?"iOS":/Mac OS X|Macintosh/.test(e)?"macOS":/Windows/.test(e)?"Windows":/Linux/.test(e)?"Linux":"";return{label:r?`${a} on ${r}`:a,mobile:t}}function fue(e){let t=Math.round((Date.now()-e)/1000);if(t<60)return"Active now";let a=Math.round(t/60);if(a<60)return`Active ${a} min ago`;let r=Math.round(a/60);if(r<24)return`Active ${r} h ago`;return`Active ${Math.round(r/24)} d ago`}function IV({onError:e}){let[t,a]=A(null),[r,n]=A(!1),s=j(async()=>{try{let f=await le("/api/auth/devices");a((await f.json()).devices)}catch(f){e(CV(f,"Couldn't load devices."))}},[e]);U(()=>{s()},[s]);let l=async(f,m)=>{n(!0);try{await le(f,m),await s()}catch(g){e(CV(g,"Couldn't sign out the device."))}finally{n(!1)}},c=t?.filter((f)=>!f.current)??[];return d(Ze,{id:"devices",title:"Signed-in devices",description:"Devices that have unlocked KCG Code.",suffix:c.length>0?d(ae,{type:"button",variant:"ghost",size:"sm",disabled:r,onClick:()=>void l("/api/auth/devices/revoke-others",{method:"POST"}),children:"Sign out others"}):void 0,children:t===null?d("li",{className:"flex min-h-14 items-center justify-center",role:"status",children:d(fe,{className:"size-5 text-muted-foreground"})}):t.map((f)=>{let m=due(f.userAgent),g=m.mobile?Pg:ug;return d(it,{prefix:d("span",{className:"flex size-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:d(g,{className:"size-[18px]","aria-hidden":!0})}),title:m.label,subtitle:fue(f.lastSeenAt),suffix:f.current?d(Nl,{children:"This device"}):d(ae,{type:"button",variant:"outline",size:"sm",disabled:r,onClick:()=>void l(`/api/auth/devices/${encodeURIComponent(f.id)}`,{method:"DELETE"}),"aria-label":`Sign out ${m.label}`,children:"Sign out"})},f.id)})})}function LV({status:e}){let[t,a]=A({phase:"loading"}),[r,n]=A(!1),[s,l]=A(null),[c,f]=A(null),m=j(async()=>{try{a({phase:"ready",passkeys:await t_()})}catch(g){a({phase:"error",message:g instanceof we?g.message:"Couldn't load passkeys."})}},[]);return U(()=>{f(_b()),m()},[m]),S(se,{children:[d(pue,{state:t,supported:c,onAdd:()=>n(!0),onRename:async(g,h)=>{let x=await o_(g.id,h);a((v)=>v.phase==="ready"?{...v,passkeys:v.passkeys.map((w)=>w.id===g.id?{...w,name:x.name}:w)}:v)},onRemove:l}),d(hue,{open:r,status:e,onOpenChange:n,onAdded:(g)=>{n(!1),De.success(`${g.name} added. You can now unlock with it.`),m()}}),d(xue,{passkey:s,onOpenChange:(g)=>!g&&l(null),onRemoved:(g)=>{l(null),De.success(`${g.name} removed.`),a((h)=>h.phase==="ready"?{...h,passkeys:h.passkeys.filter((x)=>x.id!==g.id)}:h)}})]})}function pue({state:e,supported:t,onAdd:a,onRename:r,onRemove:n}){let s=t===!1;return S(Ze,{title:"Passkeys",description:"Unlock with your fingerprint, face, or device screen lock. Your PIN or password still works as a backup.",suffix:S(ae,{type:"button",size:"sm",variant:"ghost",onClick:a,disabled:s||e.phase==="loading",children:[d(hr,{"data-icon":"inline-start"}),"Add"]}),children:[e.phase==="loading"?S("li",{className:"flex min-h-14 items-center justify-center px-4",role:"status",children:[d(fe,{className:"size-4 text-muted-foreground"}),d("span",{className:"sr-only",children:"Loading passkeys…"})]}):e.phase==="error"?d("li",{role:"alert",className:"px-4 py-4 text-[13px] text-destructive",children:e.message}):e.passkeys.length===0?d(mue,{unsupported:s,onAdd:a}):e.passkeys.map((l)=>d(gue,{passkey:l,onRename:r,onRemove:n},l.id)),s&&e.phase==="ready"&&e.passkeys.length>0&&d("li",{className:"px-4 py-3 text-[13px] text-muted-foreground",children:"This address can't use passkeys. Open KCG Code over https or on localhost to add one."})]})}function mue({unsupported:e,onAdd:t}){return S("li",{className:"flex flex-col items-center gap-3 px-6 py-7 text-center",children:[d("span",{className:"flex size-12 items-center justify-center rounded-2xl bg-muted text-muted-foreground",children:d(rr,{className:"size-6","aria-hidden":!0})}),S("div",{className:"flex max-w-xs flex-col gap-1",children:[d("p",{className:"text-[15px] font-medium",children:"No passkeys yet"}),d("p",{className:"text-[13px] leading-snug text-muted-foreground",children:e?"Passkeys need a secure address. Open KCG Code over https or on localhost to add one.":"Skip typing your PIN. Add a passkey from this device to unlock in one tap."})]}),!e&&S(ae,{type:"button",size:"sm",variant:"secondary",onClick:t,children:[d(rr,{"data-icon":"inline-start"}),"Add a passkey"]})]})}function gue({passkey:e,onRename:t,onRemove:a}){let[r,n]=A(!1),[s,l]=A(e.name),[c,f]=A(!1),[m,g]=A(null),h=lt(),x=B(null);U(()=>{if(r)x.current?.select()},[r]);let v=async()=>{let C=s.trim();if(C===e.name||C===""){n(!1),l(e.name);return}f(!0),g(null);try{await t(e,C),n(!1)}catch(L){g(L instanceof we?L.message:"Couldn't rename the passkey.")}finally{f(!1)}},w=[e.lastUsedAt?`Used ${bu(e.lastUsedAt)}`:"Never used",`added ${bu(e.createdAt)}`].join(" · ");return S("li",{className:"flex min-h-16 items-center gap-3 px-4 py-2.5",children:[d("span",{className:N("flex size-9 shrink-0 items-center justify-center rounded-full",e.usableHere?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:d(rr,{className:"size-[18px]","aria-hidden":!0})}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[r?S("form",{className:"flex items-center gap-1.5",onSubmit:(C)=>{C.preventDefault(),v()},children:[d("label",{htmlFor:h,className:"sr-only",children:"Passkey name"}),d("input",{ref:x,id:h,value:s,maxLength:60,disabled:c,onChange:(C)=>{l(C.target.value),g(null)},onKeyDown:(C)=>{if(C.key==="Escape")C.preventDefault(),n(!1),l(e.name),g(null)},"aria-invalid":m?!0:void 0,className:"h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-base outline-none focus-visible:ring-[3px] focus-visible:ring-ring/40 sm:text-[15px]"}),d(ae,{type:"submit",size:"icon",className:"size-8",disabled:c,"aria-label":"Save name",children:c?d(fe,{className:"size-4"}):d(Ke,{className:"size-4"})}),d(ae,{type:"button",size:"icon",variant:"ghost",className:"size-8",disabled:c,"aria-label":"Cancel rename",onClick:()=>{n(!1),l(e.name),g(null)},children:d(Ft,{className:"size-4"})})]}):S("span",{className:"flex min-w-0 items-center gap-2",children:[d("span",{className:"truncate text-[15px] leading-5",children:e.name}),e.synced&&S("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-1.5 py-px text-[11px] text-muted-foreground",title:"Synced across your devices (e.g. iCloud Keychain or Google Password Manager)",children:[d(jm,{className:"size-3","aria-hidden":!0}),"Synced"]})]}),m?d("span",{role:"alert",className:"text-[12px] text-destructive",children:m}):d("span",{className:"truncate text-[13px] leading-snug text-muted-foreground",children:e.usableHere?w:`For ${e.rpId}`})]}),!r&&S("div",{className:"flex shrink-0 items-center",children:[d(ae,{type:"button",size:"icon",variant:"ghost",className:"size-9 text-muted-foreground hover:text-foreground","aria-label":`Rename ${e.name}`,onClick:()=>{l(e.name),n(!0)},children:d(Yc,{className:"size-4"})}),d(ae,{type:"button",size:"icon",variant:"ghost",className:"size-9 text-muted-foreground hover:text-destructive","aria-label":`Remove ${e.name}`,onClick:()=>a(e),children:d(pa,{className:"size-4"})})]})]})}function hue({open:e,status:t,onOpenChange:a,onAdded:r}){let n=t.lockKind??"password",s=wo(n),[l,c]=A(""),[f,m]=A(!1),[g,h]=A(null),x=lt(),v=B(null);return U(()=>{if(!e)return;c(""),h(null);let C=setTimeout(()=>v.current?.focus(),50);return()=>clearTimeout(C)},[e]),d(Ma,{open:e,onOpenChange:(C)=>!f&&a(C),children:S(or,{className:"gap-5 sm:max-w-md",children:[S(zr,{className:"items-center text-center sm:items-center sm:text-center",children:[d("span",{className:"mb-1 flex size-14 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:d(rr,{className:"size-7","aria-hidden":!0})}),d(nr,{children:"Add a passkey"}),S(ir,{children:["Confirm your ",s," first. Then your device will ask for your fingerprint, face, or screen lock."]})]}),S("form",{id:"add-passkey-form",onSubmit:async(C)=>{if(C.preventDefault(),l==="")return;m(!0),h(null);let L=await a_(l);if(m(!1),L.ok){r(L.data);return}if(L.cancelled)return;if(h(L.message),L.code==="CURRENT_SECRET_INVALID")c(""),v.current?.focus()},className:"flex flex-col gap-3",children:[d("div",{className:"overflow-hidden rounded-xl border bg-card",children:S("div",{className:"flex flex-col px-4 py-2 focus-within:bg-muted/30",children:[S("label",{htmlFor:x,className:"text-[12px] leading-4 text-muted-foreground",children:["Current ",s]}),d("input",{ref:v,id:x,type:"password",inputMode:n==="pin"?"numeric":void 0,autoComplete:"current-password",maxLength:n==="pin"?12:128,value:l,disabled:f,onChange:(C)=>{c(n==="pin"?C.target.value.replace(/\D/g,""):C.target.value),h(null)},className:N("h-7 w-full bg-transparent text-base outline-none sm:text-[15px]",n==="pin"&&"tracking-[0.3em]")})]})}),g&&d("p",{role:"alert",className:"px-1 text-sm text-destructive",children:g}),d("p",{className:"px-1 text-[12px] leading-snug text-muted-foreground",children:"The passkey works on this address only. Your fingerprint or face never leaves your device."})]}),S(ao,{children:[d(ae,{type:"button",variant:"ghost",onClick:()=>a(!1),disabled:f,children:"Cancel"}),S(ae,{type:"submit",form:"add-passkey-form",disabled:f||l==="",children:[f?d(fe,{"data-icon":"inline-start"}):d(rr,{"data-icon":"inline-start"}),f?"Waiting for your device…":"Continue"]})]})]})})}function xue({passkey:e,onOpenChange:t,onRemoved:a}){let[r,n]=A(!1),[s,l]=A(null);U(()=>{if(e)l(null)},[e]);let c=async()=>{if(!e)return;n(!0),l(null);try{await n_(e.id),a(e)}catch(f){l(f instanceof we?f.message:"Couldn't remove the passkey.")}finally{n(!1)}};return d(Ma,{open:e!==null,onOpenChange:(f)=>!r&&t(f),children:S(or,{className:"gap-5 sm:max-w-md",children:[S(zr,{children:[S(nr,{children:["Remove ",e?.name,"?"]}),d(ir,{children:"You won't be able to unlock with it anymore. It may still appear in your device's password manager; you can delete it there too."})]}),s&&d("p",{role:"alert",className:"text-sm text-destructive",children:s}),S(ao,{children:[d(ae,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:r,children:"Cancel"}),S(ae,{type:"button",variant:"destructive",onClick:()=>void c(),disabled:r,children:[r&&d(fe,{"data-icon":"inline-start"}),"Remove"]})]})]})})}var vue=Object.defineProperty,bue=(e,t)=>vue(e,"name",{value:t,configurable:!0});function iw(e,[t,a]){return Math.min(a,Math.max(t,e))}bue(iw,"clamp");var yue=Object.defineProperty,wue=(e,t)=>yue(e,"name",{value:t,configurable:!0});function KT(e){let t=B({value:e,previous:e});return de(()=>{if(t.current.value!==e)t.current.previous=t.current.value,t.current.value=e;return t.current.previous},[e])}wue(KT,"usePrevious");var Sue=Object.defineProperty,st=(e,t)=>Sue(e,"name",{value:t,configurable:!0}),kue=[" ","Enter","ArrowUp","ArrowDown"],Cue=[" ","Enter"],Kf="Select",[lw,cw,Iue]=ou(Kf),[Vu,dxr]=Tt(Kf,[Iue,Co]),YT=Co(),[Lue,Vl]=Vu(Kf),[Tue,Rue]=Vu(Kf);function PV(e){let{__scopeSelect:t,children:a,open:r,defaultOpen:n,onOpenChange:s,value:l,defaultValue:c,onValueChange:f,dir:m,name:g,autoComplete:h,disabled:x,required:v,form:w,internal_do_not_use_render:C}=e,L=YT(t),[k,I]=A(null),[T,R]=A(null),[E,M]=A(!1),P=nu(m),[O,F]=Ia({prop:r,defaultProp:n??!1,onChange:s,caller:Kf}),[z,Y]=Ia({prop:l,defaultProp:c,onChange:f,caller:Kf}),q=B(null),G=B(z);U(()=>{let Le=w?k?.ownerDocument.getElementById(w):k?.form;if(Le instanceof HTMLFormElement){let H=st(()=>Y(G.current),"reset");return Le.addEventListener("reset",H),()=>Le.removeEventListener("reset",H)}},[w,k,Y]);let Q=k?!!w||!!k.closest("form"):!0,[re,J]=A(new Set),X=ga(),Z=Array.from(re).map((Le)=>Le.props.value).join(";"),te=j((Le)=>{J((H)=>new Set(H).add(Le))},[]),D=j((Le)=>{J((H)=>{let me=new Set(H);return me.delete(Le),me})},[]),Te={required:v,trigger:k,onTriggerChange:I,valueNode:T,onValueNodeChange:R,valueNodeHasChildren:E,onValueNodeHasChildrenChange:M,contentId:X,value:z,onValueChange:Y,open:O,onOpenChange:F,dir:P,triggerPointerDownPosRef:q,disabled:x,name:g,autoComplete:h,form:w,nativeOptions:re,nativeSelectKey:Z,isFormControl:Q};return d(hl,{...L,children:d(Lue,{scope:t,...Te,children:d(lw.Provider,{scope:t,children:d(Tue,{scope:t,onNativeOptionAdd:te,onNativeOptionRemove:D,children:XV(C)?C(Te):a})})})})}st(PV,"SelectProvider");var EV=st((e)=>{let{__scopeSelect:t,children:a,...r}=e;return d(PV,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:n})=>S(se,{children:[a,n?d(jue,{__scopeSelect:t}):null]})})},"Select"),Aue="SelectTrigger",NV=ne(st(function(t,a){let{__scopeSelect:r,disabled:n=!1,...s}=t,l=YT(r),c=Vl(Aue,r),f=c.disabled||n,m=Oe(a,c.onTriggerChange),g=cw(r),h=B("touch"),[x,v,w]=$T((L)=>{let k=g().filter((R)=>!R.disabled),I=k.find((R)=>R.value===c.value),T=QT(k,L,I);if(T!==void 0)c.onValueChange(T.value)}),C=st((L)=>{if(!f)c.onOpenChange(!0),w();if(L)c.triggerPointerDownPosRef.current={x:Math.round(L.pageX),y:Math.round(L.pageY)}},"handleOpen");return d(xl,{asChild:!0,...l,children:d(_e.button,{type:"button",role:"combobox","aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":Vh(c.value)?"":void 0,...s,ref:m,onClick:ke(s.onClick,(L)=>{if(L.currentTarget.focus(),h.current!=="mouse")C(L)}),onPointerDown:ke(s.onPointerDown,(L)=>{h.current=L.pointerType;let k=L.target;if(k.hasPointerCapture(L.pointerId))k.releasePointerCapture(L.pointerId);if(L.button===0&&L.ctrlKey===!1&&L.pointerType==="mouse")C(L),L.preventDefault()}),onKeyDown:ke(s.onKeyDown,(L)=>{let k=x.current!=="";if(!(L.ctrlKey||L.altKey||L.metaKey)&&L.key.length===1)v(L.key);if(k&&L.key===" ")return;if(kue.includes(L.key))C(),L.preventDefault()})})})},"SelectTrigger")),Mue="SelectValue",DV=ne(st(function(t,a){let{__scopeSelect:r,className:n,style:s,children:l,placeholder:c="",...f}=t,m=Vl(Mue,r),{onValueNodeHasChildrenChange:g}=m,h=l!==void 0,x=Oe(a,m.onValueNodeChange);nt(()=>{g(h)},[g,h]);let v=Vh(m.value);return d(_e.span,{...f,asChild:v?!1:f.asChild,ref:x,style:{pointerEvents:"none"},children:d(Za,{children:v?c:l},v?"placeholder":"value")})},"SelectValue")),OV=ne(st(function(t,a){let{__scopeSelect:r,children:n,...s}=t;return d(_e.span,{"aria-hidden":!0,...s,ref:a,children:n||"▼"})},"SelectIcon")),Pue="SelectPortal",[Eue,Nue]=Vu(Pue,{forceMount:void 0}),_V=st((e)=>{let{__scopeSelect:t,forceMount:a,...r}=e;return d(Eue,{scope:e.__scopeSelect,forceMount:a,children:d(jn,{asChild:!0,...r})})},"SelectPortal"),Hu="SelectContent",zV=ne(st(function(t,a){let r=Nue(Hu,t.__scopeSelect),{forceMount:n=r.forceMount,...s}=t,l=Vl(Hu,t.__scopeSelect),[c,f]=A();return nt(()=>{f(new DocumentFragment)},[]),d(Xa,{present:n||l.open,children:({present:m})=>m?d(_ue,{...s,ref:a}):d(Due,{...s,fragment:c})})},"SelectContent")),Due=ne(st(function(t,a){let{__scopeSelect:r,children:n,fragment:s}=t;if(!s)return null;return fn(d(BV,{scope:r,children:d(lw.Slot,{scope:r,children:d("div",{ref:a,children:n})})}),s)},"SelectContentFragment")),ln=10,[BV,ju]=Vu(Hu),Oue=La("SelectContent.RemoveScroll"),_ue=ne(st(function(t,a){let{__scopeSelect:r}=t,{position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:f,sideOffset:m,align:g,alignOffset:h,arrowPadding:x,collisionBoundary:v,collisionPadding:w,sticky:C,hideWhenDetached:L,avoidCollisions:k,...I}=t,T=Vl(Hu,r),[R,E]=A(null),[M,P]=A(null),O=Oe(a,E),[F,z]=A(null),[Y,q]=A(null),G=cw(r),[Q,re]=A(!1),J=B(!1);U(()=>{if(R)return pl(R)},[R]),Gn();let X=j((ce)=>{let[he,...ue]=G().map((W)=>W.ref.current),[K]=ue.slice(-1),ee=document.activeElement;for(let W of ce){if(W===ee)return;if(W?.scrollIntoView({block:"nearest"}),W===he&&M)M.scrollTop=0;if(W===K&&M)M.scrollTop=M.scrollHeight;if(W?.focus(),document.activeElement!==ee)return}},[G,M]),Z=j(()=>X([F,R]),[X,F,R]);U(()=>{if(Q)Z()},[Q,Z]);let{onOpenChange:te,triggerPointerDownPosRef:D}=T;U(()=>{if(R){let ce={x:0,y:0},he=st((K)=>{ce={x:Math.abs(Math.round(K.pageX)-(D.current?.x??0)),y:Math.abs(Math.round(K.pageY)-(D.current?.y??0))}},"handlePointerMove"),ue=st((K)=>{if(ce.x<=10&&ce.y<=10)K.preventDefault();else if(!K.composedPath().includes(R))te(!1);document.removeEventListener("pointermove",he),D.current=null},"handlePointerUp");if(D.current!==null)document.addEventListener("pointermove",he),document.addEventListener("pointerup",ue,{capture:!0,once:!0});return()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",ue,{capture:!0})}}},[R,te,D]),U(()=>{let ce=st(()=>te(!1),"close");return window.addEventListener("blur",ce),window.addEventListener("resize",ce),()=>{window.removeEventListener("blur",ce),window.removeEventListener("resize",ce)}},[te]);let[Te,Le]=$T((ce)=>{let he=G().filter((ee)=>!ee.disabled),ue=he.find((ee)=>ee.ref.current===document.activeElement),K=QT(he,ce,ue);if(K)setTimeout(()=>K.ref.current?.focus())}),H=j((ce,he,ue)=>{let K=!J.current&&!ue;if(T.value!==void 0&&T.value===he||K){if(z(ce),K)J.current=!0}},[T.value]),me=j(()=>R?.focus(),[R]),Ce=j((ce,he,ue)=>{let K=!J.current&&!ue;if(T.value!==void 0&&T.value===he||K)q(ce)},[T.value]),ge=n==="popper"?TV:zue,He=ge===TV?{side:f,sideOffset:m,align:g,alignOffset:h,arrowPadding:x,collisionBoundary:v,collisionPadding:w,sticky:C,hideWhenDetached:L,avoidCollisions:k}:{};return d(BV,{scope:r,content:R,viewport:M,onViewportChange:P,itemRefCallback:H,selectedItem:F,onItemLeave:me,itemTextRefCallback:Ce,focusSelectedItem:Z,selectedItemText:Y,position:n,isPositioned:Q,searchRef:Te,children:d(Bi,{as:Oue,allowPinchZoom:!0,children:d(fl,{asChild:!0,trapped:T.open,onMountAutoFocus:(ce)=>{ce.preventDefault()},onUnmountAutoFocus:ke(s,(ce)=>{T.trigger?.focus({preventScroll:!0}),ce.preventDefault()}),children:d(Vn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:(ce)=>ce.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:d(ge,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:(ce)=>ce.preventDefault(),...I,...He,onPlaced:()=>re(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...I.style},onKeyDown:ke(I.onKeyDown,(ce)=>{let he=ce.ctrlKey||ce.altKey||ce.metaKey;if(ce.key==="Tab")ce.preventDefault();if(!he&&ce.key.length===1)Le(ce.key);if(["ArrowUp","ArrowDown","Home","End"].includes(ce.key)){let K=G().filter((ee)=>!ee.disabled).map((ee)=>ee.ref.current);if(["ArrowUp","End"].includes(ce.key))K=K.slice().reverse();if(["ArrowUp","ArrowDown"].includes(ce.key)){let ee=ce.target,W=K.indexOf(ee);K=K.slice(W+1)}setTimeout(()=>X(K)),ce.preventDefault()}})})})})})})},"SelectContentImpl")),zue=ne(st(function(t,a){let{__scopeSelect:r,onPlaced:n,...s}=t,l=Vl(Hu,r),c=ju(Hu,r),[f,m]=A(null),[g,h]=A(null),x=Oe(a,h),v=cw(r),w=B(!1),C=B(!0),{viewport:L,selectedItem:k,selectedItemText:I,focusSelectedItem:T}=c,R=j(()=>{if(l.trigger&&l.valueNode&&f&&g&&L&&k&&I){let O=l.trigger.getBoundingClientRect(),F=g.getBoundingClientRect(),z=l.valueNode.getBoundingClientRect(),Y=I.getBoundingClientRect();if(l.dir!=="rtl"){let ee=Y.left-F.left,W=z.left-ee,ve=O.left-W,Ee=O.width+ve,xe=Math.max(Ee,F.width),ye=window.innerWidth-ln,ft=iw(W,[ln,Math.max(ln,ye-xe)]);f.style.minWidth=Ee+"px",f.style.left=ft+"px"}else{let ee=F.right-Y.right,W=window.innerWidth-z.right-ee,ve=window.innerWidth-O.right-W,Ee=O.width+ve,xe=Math.max(Ee,F.width),ye=window.innerWidth-ln,ft=iw(W,[ln,Math.max(ln,ye-xe)]);f.style.minWidth=Ee+"px",f.style.right=ft+"px"}let q=v(),G=window.innerHeight-ln*2,Q=L.scrollHeight,re=window.getComputedStyle(g),J=parseInt(re.borderTopWidth,10),X=parseInt(re.paddingTop,10),Z=parseInt(re.borderBottomWidth,10),te=parseInt(re.paddingBottom,10),D=J+X+Q+te+Z,Te=Math.min(k.offsetHeight*5,D),Le=window.getComputedStyle(L),H=parseInt(Le.paddingTop,10),me=parseInt(Le.paddingBottom,10),Ce=O.top+O.height/2-ln,ge=G-Ce,He=k.offsetHeight/2,ce=k.offsetTop+He,he=J+X+ce,ue=D-he;if(he<=Ce){let ee=q.length>0&&k===q[q.length-1].ref.current;f.style.bottom="0px";let W=g.clientHeight-L.offsetTop-L.offsetHeight,ve=Math.max(ge,He+(ee?me:0)+W+Z),Ee=he+ve;f.style.height=Ee+"px"}else{let ee=q.length>0&&k===q[0].ref.current;f.style.top="0px";let ve=Math.max(Ce,J+L.offsetTop+(ee?H:0)+He)+ue;f.style.height=ve+"px",L.scrollTop=he-Ce+L.offsetTop}f.style.margin=`${ln}px 0`,f.style.minHeight=Te+"px",f.style.maxHeight=G+"px",n?.(),requestAnimationFrame(()=>w.current=!0)}},[v,l.trigger,l.valueNode,f,g,L,k,I,l.dir,n]);nt(()=>R(),[R]);let[E,M]=A();nt(()=>{if(g)M(window.getComputedStyle(g).zIndex)},[g]);let P=j((O)=>{if(O&&C.current===!0)R(),T?.(),C.current=!1},[R,T]);return d(Bue,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:w,onScrollButtonChange:P,children:d("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:d(_e.div,{...s,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),TV=ne(st(function(t,a){let{__scopeSelect:r,align:n="start",collisionPadding:s=ln,...l}=t,c=YT(r);return d(vl,{...c,...l,ref:a,align:n,collisionPadding:s,style:{boxSizing:"border-box",...l.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")),[Bue,WT]=Vu(Hu,{}),RV="SelectViewport",FV=ne(st(function(t,a){let{__scopeSelect:r,nonce:n,...s}=t,l=ju(RV,r),c=WT(RV,r),f=Oe(a,l.onViewportChange),m=B(0);return S(se,{children:[d("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:n}),d(lw.Slot,{scope:r,children:d(_e.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ke(s.onScroll,(g)=>{let h=g.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:v}=c;if(v?.current&&x){let w=Math.abs(m.current-h.scrollTop);if(w>0){let C=window.innerHeight-ln*2,L=parseFloat(x.style.minHeight),k=parseFloat(x.style.height),I=Math.max(L,k);if(I<C){let T=I+w,R=Math.min(C,T),E=T-R;if(x.style.height=R+"px",x.style.bottom==="0px")h.scrollTop=E>0?E:0,x.style.justifyContent="flex-end"}}}m.current=h.scrollTop})})})]})},"SelectViewport")),Fue="SelectGroup",[fxr,pxr]=Vu(Fue);var XT="SelectItem",[Uue,UV]=Vu(XT),HV=ne(st(function(t,a){let{__scopeSelect:r,value:n,disabled:s=!1,textValue:l,...c}=t,f=Vl(XT,r),m=ju(XT,r),g=f.value===n,[h,x]=A(l??""),[v,w]=A(!1),C=Ta((R)=>m.itemRefCallback?.(R,n,s)),L=Oe(a,C),k=ga(),I=B("touch"),T=st(()=>{if(!s)f.onValueChange(n),f.onOpenChange(!1)},"handleSelect");return d(Uue,{scope:r,value:n,disabled:s,textId:k,isSelected:g,onItemTextChange:j((R)=>{x((E)=>E||(R?.textContent??"").trim())},[]),children:d(lw.ItemSlot,{scope:r,value:n,disabled:s,textValue:h,children:d(_e.div,{role:"option","aria-labelledby":k,"data-highlighted":v?"":void 0,"aria-selected":g&&v,"data-state":g?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:L,onFocus:ke(c.onFocus,()=>w(!0)),onBlur:ke(c.onBlur,()=>w(!1)),onClick:ke(c.onClick,()=>{if(I.current!=="mouse")T()}),onPointerUp:ke(c.onPointerUp,()=>{if(I.current==="mouse")T()}),onPointerDown:ke(c.onPointerDown,(R)=>{I.current=R.pointerType}),onPointerMove:ke(c.onPointerMove,(R)=>{if(I.current=R.pointerType,s)m.onItemLeave?.();else if(I.current==="mouse")R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(c.onPointerLeave,(R)=>{if(R.currentTarget===document.activeElement)m.onItemLeave?.()}),onKeyDown:ke(c.onKeyDown,(R)=>{if(s||R.target!==R.currentTarget)return;if(m.searchRef?.current!==""&&R.key===" ")return;if(Cue.includes(R.key))T();if(R.key===" ")R.preventDefault()})})})})},"SelectItem")),sw="SelectItemText",VV=ne(st(function(t,a){let{__scopeSelect:r,className:n,style:s,...l}=t,c=Vl(sw,r),f=ju(sw,r),m=UV(sw,r),g=Rue(sw,r),[h,x]=A(null),v=Ta((T)=>f.itemTextRefCallback?.(T,m.value,m.disabled)),w=Oe(a,x,m.onItemTextChange,v),C=h?.textContent,L=de(()=>d("option",{value:m.value,disabled:m.disabled,children:C},m.value),[m.disabled,m.value,C]),{onNativeOptionAdd:k,onNativeOptionRemove:I}=g;return nt(()=>(k(L),()=>I(L)),[k,I,L]),S(se,{children:[d(_e.span,{id:m.textId,...l,ref:w}),m.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!Vh(c.value)?fn(l.children,c.valueNode):null]})},"SelectItemText")),Hue="SelectItemIndicator",jV=ne(st(function(t,a){let{__scopeSelect:r,...n}=t;return UV(Hue,r).isSelected?d(_e.span,{"aria-hidden":!0,...n,ref:a}):null},"SelectItemIndicator")),AV="SelectScrollUpButton",GV=ne(st(function(t,a){let r=ju(AV,t.__scopeSelect),n=WT(AV,t.__scopeSelect),[s,l]=A(!1),c=Oe(a,n.onScrollButtonChange);return nt(()=>{if(r.viewport&&r.isPositioned){let m=function(){let h=g.scrollTop>0;l(h)};var f=m;st(m,"handleScroll");let g=r.viewport;return m(),g.addEventListener("scroll",m),()=>g.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),s?d(KV,{...t,ref:c,onAutoScroll:()=>{let{viewport:f,selectedItem:m}=r;if(f&&m)f.scrollTop=f.scrollTop-m.offsetHeight}}):null},"SelectScrollUpButton")),MV="SelectScrollDownButton",qV=ne(st(function(t,a){let r=ju(MV,t.__scopeSelect),n=WT(MV,t.__scopeSelect),[s,l]=A(!1),c=Oe(a,n.onScrollButtonChange);return nt(()=>{if(r.viewport&&r.isPositioned){let m=function(){let h=g.scrollHeight-g.clientHeight,x=Math.ceil(g.scrollTop)<h;l(x)};var f=m;st(m,"handleScroll");let g=r.viewport;return m(),g.addEventListener("scroll",m),()=>g.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),s?d(KV,{...t,ref:c,onAutoScroll:()=>{let{viewport:f,selectedItem:m}=r;if(f&&m)f.scrollTop=f.scrollTop+m.offsetHeight}}):null},"SelectScrollDownButton")),KV=ne(st(function(t,a){let{__scopeSelect:r,onAutoScroll:n,...s}=t,l=ju("SelectScrollButton",r),c=B(null),f=cw(r),m=j(()=>{if(c.current!==null)window.clearInterval(c.current),c.current=null},[]);return U(()=>()=>m(),[m]),nt(()=>{f().find((h)=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),d(_e.div,{"aria-hidden":!0,...s,ref:a,style:{flexShrink:0,...s.style},onPointerDown:ke(s.onPointerDown,()=>{if(c.current===null)c.current=window.setInterval(n,50)}),onPointerMove:ke(s.onPointerMove,()=>{if(l.onItemLeave?.(),c.current===null)c.current=window.setInterval(n,50)}),onPointerLeave:ke(s.onPointerLeave,()=>{m()})})},"SelectScrollButtonImpl"));var Vue="SelectBubbleInput",jue=ne(st(function({__scopeSelect:t,...a},r){let n=Vl(Vue,t),{value:s,onValueChange:l,required:c,disabled:f,name:m,autoComplete:g,form:h}=n,{nativeOptions:x,nativeSelectKey:v}=n,w=B(null),C=Oe(r,w),L=s??"",k=KT(L),I=Array.from(x).some((T)=>(T.props.value??"")==="");return U(()=>{let T=w.current;if(!T)return;let R=window.HTMLSelectElement.prototype,M=Object.getOwnPropertyDescriptor(R,"value").set;if(k!==L&&M){let P=new Event("change",{bubbles:!0});M.call(T,L),T.dispatchEvent(P)}},[k,L]),S(_e.select,{"aria-hidden":!0,required:c,tabIndex:-1,name:m,autoComplete:g,disabled:f,form:h,onChange:(T)=>l(T.target.value),...a,style:{...aI,...a.style},ref:C,defaultValue:L,children:[Vh(s)&&!I?d("option",{value:""}):null,Array.from(x)]},v)},"SelectBubbleInput"));function XV(e){return typeof e==="function"}st(XV,"isFunction");function Vh(e){return e===""||e===void 0}st(Vh,"shouldShowPlaceholder");function $T(e){let t=Ta(e),a=B(""),r=B(0),n=j((l)=>{let c=a.current+l;t(c),st(function f(m){if(a.current=m,window.clearTimeout(r.current),m!=="")r.current=window.setTimeout(()=>f(""),1000)},"updateSearch")(c)},[t]),s=j(()=>{a.current="",window.clearTimeout(r.current)},[]);return U(()=>()=>window.clearTimeout(r.current),[]),[a,n,s]}st($T,"useTypeaheadSearch");function QT(e,t,a){let n=t.length>1&&Array.from(t).every((m)=>m===t[0])?t[0]:t,s=a?e.indexOf(a):-1,l=YV(e,Math.max(s,0));if(n.length===1)l=l.filter((m)=>m!==a);let f=l.find((m)=>m.textValue.toLowerCase().startsWith(n.toLowerCase()));return f!==a?f:void 0}st(QT,"findNextItem");function YV(e,t){return e.map((a,r)=>e[(t+r)%e.length])}st(YV,"wrapArray");function WV({...e}){return d(EV,{"data-slot":"select",...e})}function $V({...e}){return d(DV,{"data-slot":"select-value",...e})}function QV({className:e,size:t="default",children:a,...r}){return S(NV,{"data-slot":"select-trigger","data-size":t,className:N("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,d(OV,{asChild:!0,children:d(yt,{className:"size-4 opacity-50"})})]})}function ZV({className:e,children:t,position:a="popper",align:r="center",...n}){return d(_V,{children:S(zV,{"data-slot":"select-content",className:N("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,align:r,...n,children:[d(que,{}),d(FV,{className:N("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d(Kue,{})]})})}function JV({className:e,children:t,...a}){return S(HV,{"data-slot":"select-item",className:N("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none 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",e),...a,children:[d("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d(jV,{children:d(Ke,{className:"size-4"})})}),d(VV,{children:t})]})}function que({className:e,...t}){return d(GV,{"data-slot":"select-scroll-up-button",className:N("flex cursor-default items-center justify-center py-1",e),...t,children:d(Fm,{className:"size-4"})})}function Kue({className:e,...t}){return d(qV,{"data-slot":"select-scroll-down-button",className:N("flex cursor-default items-center justify-center py-1",e),...t,children:d(yt,{className:"size-4"})})}var ej=[{value:0,label:"Never"},{value:5,label:"5 minutes"},{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour"}];function JT(e,t){return e instanceof we?e.message:t}function tj({status:e,onOk:t}){let[a,r]=A(null),[n,s]=A(e.autoLockMinutes),[l,c]=A(null),f=lt(),m=async(x)=>{let v=n;s(x),c(null);try{await le("/api/auth/settings",{method:"PATCH",body:JSON.stringify({autoLockMinutes:x})}),De.success(x===0?"Auto-lock turned off.":`Auto-lock set to ${ej.find((w)=>w.value===x)?.label??`${x} minutes`}.`),Ut()}catch(w){s(v),c(JT(w,"Couldn't save auto-lock."))}},g=e.lockKind??"password",h=wo(g);return S(se,{children:[S("section",{"aria-labelledby":"security-status",className:N("flex flex-col items-center gap-3 rounded-xl border px-5 py-6 text-center",e.protected?"bg-card shadow-xs":"border-amber-500/30 bg-amber-500/10"),children:[d("span",{className:N("flex size-14 items-center justify-center rounded-full",e.protected?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400":"bg-amber-500/15 text-amber-700 dark:text-amber-400"),children:e.protected?d($o,{className:"size-7","aria-hidden":!0}):d(Wo,{className:"size-7","aria-hidden":!0})}),S("div",{className:"flex max-w-sm flex-col gap-1",children:[d("h2",{id:"security-status",className:"text-[17px] font-semibold tracking-tight",children:e.protected?"KCG Code is locked":"KCG Code isn't locked"}),d("p",{className:"text-[13px] leading-snug text-muted-foreground",children:e.protected?`Every phone or computer needs your ${h} before it can open KCG Code.`:"Anyone who can open this page can control your agents. Add a PIN or password to keep it safe."})]}),!e.protected&&S(ae,{type:"button",className:"mt-1",onClick:()=>r("set"),children:[d(Ka,{"data-icon":"inline-start"}),"Set up lock"]})]}),e.protected&&S(se,{children:[S(Ze,{title:"Lock settings",children:[d(it,{prefix:d(ZT,{icon:d(cg,{className:"size-[18px]","aria-hidden":!0})}),title:`Change ${h}`,subtitle:"Other devices will need to unlock again",onActivate:()=>r("set")}),S("li",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center",children:[S("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[d(ZT,{icon:d(Ng,{className:"size-[18px]","aria-hidden":!0})}),S("div",{className:"flex min-w-0 flex-col gap-0.5",children:[d("label",{htmlFor:f,className:"text-[15px] leading-5",children:"Lock automatically"}),d("span",{className:N("text-[13px] leading-snug",l?"text-destructive":"text-muted-foreground"),children:l??"When a device isn't used for a while"})]})]}),S(WV,{value:String(n),onValueChange:(x)=>void m(Number(x)),children:[d(QV,{id:f,className:"w-full shrink-0 sm:w-40","aria-label":"Lock automatically after",children:d($V,{})}),d(ZV,{align:"end",children:ej.map((x)=>d(JV,{value:String(x.value),children:x.value===0?"Never":`After ${x.label}`},x.value))})]})]})]}),d(LV,{status:e}),d(IV,{onError:(x)=>De.error(x)}),d(Ze,{children:d(it,{prefix:d(ZT,{destructive:!0,icon:d(rl,{className:"size-[18px]","aria-hidden":!0})}),title:`Remove ${h}`,subtitle:`KCG Code will open without a ${h}`,destructive:!0,onActivate:()=>r("remove")})})]}),d(Xue,{open:a==="set",status:e,onOpenChange:(x)=>r(x?"set":null),onDone:(x)=>{r(null),t(e.protected?"Lock updated. Other devices were signed out.":`${x==="pin"?"PIN":"Password"} set. This device stays unlocked.`)}}),d(Yue,{open:a==="remove",status:e,onOpenChange:(x)=>r(x?"remove":null),onDone:()=>{r(null),t("Lock removed. KCG Code is no longer protected.")}})]})}function ZT({icon:e,destructive:t}){return d("span",{className:N("flex size-9 shrink-0 items-center justify-center rounded-full",t?"bg-destructive/10 text-destructive":"bg-muted text-muted-foreground"),children:e})}function uw({label:e,kind:t,value:a,onChange:r,autoComplete:n,autoFocus:s,hint:l}){let c=lt(),f=B(null);return U(()=>{if(s){let m=setTimeout(()=>f.current?.focus(),50);return()=>clearTimeout(m)}},[s]),S("li",{className:"flex flex-col px-4 py-2 focus-within:bg-muted/30",children:[d("label",{htmlFor:c,className:"text-[12px] leading-4 text-muted-foreground",children:e}),d("input",{ref:f,id:c,type:"password",inputMode:t==="pin"?"numeric":void 0,autoComplete:n,maxLength:t==="pin"?12:128,value:a,onChange:(m)=>r(t==="pin"?m.target.value.replace(/\D/g,""):m.target.value),"aria-describedby":l?`${c}-hint`:void 0,className:N("h-7 w-full bg-transparent text-base outline-none sm:text-[15px]",t==="pin"&&"tracking-[0.3em]")}),l&&d("span",{id:`${c}-hint`,className:"sr-only",children:l})]})}function Xue({open:e,status:t,onOpenChange:a,onDone:r}){let[n,s]=A(t.lockKind??"pin"),[l,c]=A(""),[f,m]=A(""),[g,h]=A(""),[x,v]=A(!1),[w,C]=A(null),L=t.lockKind??"password";U(()=>{if(!e)return;s(t.lockKind??"pin"),c(""),m(""),h(""),C(null)},[e,t.lockKind]);let k=n==="pin"?"6–12 digits. Avoid repeated or sequential digits like 111111 or 123456.":"At least 8 characters. A short phrase is easy to remember and hard to guess.",I=()=>{if(t.protected&&l==="")return`Enter your current ${wo(L)}.`;if(n==="pin"&&(f.length<6||f.length>12))return"PIN must be 6–12 digits.";if(n==="password"&&f.length<8)return"Password must be at least 8 characters.";if(f!==g)return`The ${wo(n)}s don't match.`;return null},T=async(R)=>{R.preventDefault();let E=I();if(E){C(E);return}v(!0),C(null);try{await le("/api/auth/lock",{method:"PUT",body:JSON.stringify({kind:n,secret:f,current:t.protected?l:void 0})}),await Ut(),r(n)}catch(M){C(JT(M,"Couldn't save the lock."))}finally{v(!1)}};return d(Ma,{open:e,onOpenChange:(R)=>!x&&a(R),children:S(or,{className:"gap-5 sm:max-w-md",children:[S(zr,{children:[d(nr,{children:t.protected?"Change lock":"Set up app lock"}),d(ir,{children:t.protected?"Other devices will be signed out and must unlock again.":"You'll need it to open KCG Code on any device."})]}),S("form",{id:"lock-form",onSubmit:T,className:"flex flex-col gap-5",children:[t.protected&&d("div",{className:"overflow-hidden rounded-xl border bg-card",children:d("ul",{className:"flex flex-col divide-y",children:d(uw,{label:`Current ${wo(L)}`,kind:L,value:l,onChange:(R)=>{c(R),C(null)},autoComplete:"current-password",autoFocus:!0})})}),S("div",{className:"flex flex-col gap-2",children:[d("span",{id:"lock-kind-label",className:"px-1 text-[13px] font-medium",children:"Lock type"}),d("fieldset",{"aria-labelledby":"lock-kind-label",className:"grid grid-cols-2 gap-1 rounded-lg border-0 bg-muted p-1",children:["pin","password"].map((R)=>S("label",{className:N("cursor-pointer rounded-md px-3 py-1.5 text-center text-sm font-medium transition-colors has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-ring/50",n===R?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[d("input",{type:"radio",name:"lock-kind",value:R,checked:n===R,onChange:()=>{s(R),m(""),h(""),C(null)},className:"sr-only"}),R==="pin"?"PIN":"Password"]},R))})]}),S("div",{className:"flex flex-col gap-2",children:[d("div",{className:"overflow-hidden rounded-xl border bg-card",children:S("ul",{className:"flex flex-col divide-y",children:[d(uw,{label:`New ${wo(n)}`,kind:n,value:f,onChange:(R)=>{m(R),C(null)},autoComplete:"new-password",autoFocus:!t.protected,hint:k}),d(uw,{label:`Confirm ${wo(n)}`,kind:n,value:g,onChange:(R)=>{h(R),C(null)},autoComplete:"new-password"})]})}),d("p",{className:"px-1 text-[12px] text-muted-foreground",children:k})]}),w&&d("p",{role:"alert",className:"px-1 text-sm text-destructive",children:w})]}),S(ao,{children:[d(ae,{type:"button",variant:"ghost",onClick:()=>a(!1),disabled:x,children:"Cancel"}),S(ae,{type:"submit",form:"lock-form",disabled:x||f===""||g==="",children:[x&&d(fe,{"data-icon":"inline-start"}),t.protected?"Change":"Turn on"]})]})]})})}function Yue({open:e,status:t,onOpenChange:a,onDone:r}){let[n,s]=A(""),[l,c]=A(!1),[f,m]=A(null),g=t.lockKind??"password";return U(()=>{if(!e)return;s(""),m(null)},[e]),d(Ma,{open:e,onOpenChange:(x)=>!l&&a(x),children:S(or,{className:"gap-5 sm:max-w-md",children:[S(zr,{children:[d(nr,{children:"Remove app lock?"}),d(ir,{children:"Without a lock, anyone who can reach this address can control your agents. All devices will be signed out and every passkey will be removed."})]}),S("form",{id:"remove-lock-form",onSubmit:async(x)=>{x.preventDefault(),c(!0),m(null);try{await le("/api/auth/lock",{method:"DELETE",body:JSON.stringify({current:n})}),await Ut(),r()}catch(v){m(JT(v,"Couldn't remove the lock."))}finally{c(!1)}},className:"flex flex-col gap-3",children:[d("div",{className:"overflow-hidden rounded-xl border bg-card",children:d("ul",{className:"flex flex-col divide-y",children:d(uw,{label:`Current ${wo(g)}`,kind:g,value:n,onChange:(x)=>{s(x),m(null)},autoComplete:"current-password",autoFocus:!0})})}),f&&d("p",{role:"alert",className:"px-1 text-sm text-destructive",children:f})]}),S(ao,{children:[d(ae,{type:"button",variant:"ghost",onClick:()=>a(!1),disabled:l,children:"Cancel"}),S(ae,{type:"submit",form:"remove-lock-form",variant:"destructive",disabled:l||n==="",children:[l&&d(fe,{"data-icon":"inline-start"}),"Remove"]})]})]})})}function aj({status:e}){let[t,a]=A({phase:"loading"}),[r,n]=A(!1),s=j(async()=>{try{let l=await le("/api/workspace");a({phase:"ready",workspace:(await l.json()).workspace})}catch(l){a({phase:"error",message:l instanceof we?l.message:"Couldn't load the workspace."})}},[]);return U(()=>{s()},[s]),S(se,{children:[d(Wue,{state:t,onChange:()=>n(!0)}),t.phase==="ready"&&d(Que,{open:r,status:e,current:t.workspace,onOpenChange:n,onChanged:(l)=>{n(!1),a({phase:"ready",workspace:l}),De.success(`Workspace changed to ${l.display}.`)}})]})}function Wue({state:e,onChange:t}){return S(se,{children:[d(Ze,{title:"Workspace folder",description:"Every project lives inside this folder. KCG Code and your agents can't open anything outside it.",children:e.phase==="loading"?S("li",{className:"flex min-h-16 items-center justify-center px-4",role:"status",children:[d(fe,{className:"size-4 text-muted-foreground"}),d("span",{className:"sr-only",children:"Loading workspace…"})]}):e.phase==="error"?d("li",{role:"alert",className:"px-4 py-4 text-[13px] text-destructive",children:e.message}):S(se,{children:[S("li",{className:"flex min-h-16 items-center gap-3 px-4 py-3",children:[d("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:d(Vc,{className:"size-[18px]","aria-hidden":!0})}),S("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d("span",{className:"truncate font-mono text-[14px] leading-5",title:e.workspace.root,children:e.workspace.display}),d("span",{className:"text-[13px] leading-snug text-muted-foreground",children:e.workspace.projectCount===1?"1 project":`${e.workspace.projectCount} projects`})]}),d($ue,{value:e.workspace.root})]}),d(it,{prefix:d("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:d(_t,{className:"size-[18px]","aria-hidden":!0})}),title:"Change folder",subtitle:"Pick another folder for new and existing projects",onActivate:t})]})}),e.phase==="ready"&&S("p",{className:"-mt-4 px-1 text-[12px] text-muted-foreground",children:["Saved in ",d("code",{className:"font-mono",children:e.workspace.configPath})]})]})}function $ue({value:e}){let[t,a]=A(!1);return U(()=>{if(!t)return;let r=setTimeout(()=>a(!1),1500);return()=>clearTimeout(r)},[t]),d(ae,{type:"button",size:"icon",variant:"ghost",className:"size-9 shrink-0 text-muted-foreground hover:text-foreground","aria-label":t?"Copied":"Copy full path",onClick:()=>{navigator.clipboard?.writeText(e).then(()=>a(!0))},children:t?d(Ke,{className:"size-4"}):d(gr,{className:"size-4"})})}function Que({open:e,status:t,current:a,onOpenChange:r,onChanged:n}){let s=lt(),l=lt(),c=lt(),f=B(null),[m,g]=A(a.display),[h,x]=A(!1),[v,w]=A(""),[C,L]=A(!1),[k,I]=A(null),[T,R]=A([]),E=t.lockKind??"password",M=t.protected;U(()=>{if(!e)return;g(a.display),x(!1),w(""),I(null),R([]);let F=setTimeout(()=>f.current?.select(),50);return()=>clearTimeout(F)},[e,a.display]);let P=m.trim()===a.display||m.trim()===a.root;return d(Ma,{open:e,onOpenChange:(F)=>!C&&r(F),children:S(or,{className:"gap-5 sm:max-w-lg",children:[S(zr,{children:[d(nr,{children:"Change workspace folder"}),d(ir,{children:"Projects and agents will only be able to use files inside the new folder. Nothing is moved or deleted."})]}),S("form",{id:"workspace-form",onSubmit:async(F)=>{if(F.preventDefault(),P)return;L(!0),I(null),R([]);try{let z=await le("/api/workspace",{method:"PUT",body:JSON.stringify({path:m.trim(),create:h,current:M?v:void 0})});n((await z.json()).workspace)}catch(z){if(z instanceof we&&z.code==="WORKSPACE_PROJECTS_OUTSIDE"){let Y=z.body?.projects;R(Array.isArray(Y)?Y:[])}if(z instanceof we&&z.code==="CURRENT_SECRET_INVALID")w("");I(z instanceof we?z.message:"Couldn't change the workspace.")}finally{L(!1)}},className:"flex flex-col gap-4",children:[S("div",{className:"flex flex-col gap-2",children:[d("div",{className:"overflow-hidden rounded-xl border bg-card",children:S("div",{className:"flex flex-col divide-y",children:[S("div",{className:"flex flex-col px-4 py-2 focus-within:bg-muted/30",children:[d("label",{htmlFor:s,className:"text-[12px] leading-4 text-muted-foreground",children:"Folder path"}),d("input",{ref:f,id:s,value:m,maxLength:1024,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,placeholder:"~/code",disabled:C,onChange:(F)=>{g(F.target.value),I(null),R([])},className:"h-8 w-full bg-transparent font-mono text-base outline-none placeholder:text-muted-foreground/60 sm:text-[14px]"})]}),M&&S("div",{className:"flex flex-col px-4 py-2 focus-within:bg-muted/30",children:[S("label",{htmlFor:l,className:"text-[12px] leading-4 text-muted-foreground",children:["Current ",wo(E)]}),d("input",{id:l,type:"password",inputMode:E==="pin"?"numeric":void 0,autoComplete:"current-password",maxLength:E==="pin"?12:128,value:v,disabled:C,onChange:(F)=>{w(E==="pin"?F.target.value.replace(/\D/g,""):F.target.value),I(null)},className:N("h-8 w-full bg-transparent text-base outline-none sm:text-[15px]",E==="pin"&&"tracking-[0.3em]")})]})]})}),S("p",{className:"px-1 text-[12px] leading-snug text-muted-foreground",children:["Use a full path like ",d("code",{className:"font-mono",children:"~/code"})," or"," ",d("code",{className:"font-mono",children:"/srv/projects"}),". Your home folder, system folders, and the KCG Code data folder can't be used."]})]}),S("label",{htmlFor:c,className:"flex cursor-pointer items-center gap-3 rounded-xl px-1 text-[14px]",children:[d("input",{id:c,type:"checkbox",checked:h,disabled:C,onChange:(F)=>x(F.target.checked),className:"size-4 accent-primary"}),"Create the folder if it doesn't exist"]}),k&&S("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm",children:[S("p",{className:"flex items-start gap-2 text-destructive",children:[d(qa,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),k]}),T.length>0&&d("ul",{className:"flex flex-col gap-1 pl-6 text-[13px] text-foreground/80",children:T.map((F)=>S("li",{className:"truncate",children:[d("span",{className:"font-medium",children:F.name})," ",d("span",{className:"font-mono text-muted-foreground",children:F.path})]},F.id))})]})]}),S(ao,{children:[d(ae,{type:"button",variant:"ghost",onClick:()=>r(!1),disabled:C,children:"Cancel"}),S(ae,{type:"submit",form:"workspace-form",disabled:C||P||m.trim()===""||M&&v==="",children:[C&&d(fe,{"data-icon":"inline-start"}),"Change folder"]})]})]})})}function oj({className:e}){return d("img",{src:Cr,alt:"",className:N("rounded-[22%]",e)})}var eR=[{id:"profile",label:"Profile",description:"Name, picture & account",icon:Qc},{id:"security",label:"Security",description:"App lock, passkeys & devices",icon:Mg},{id:"workspace",label:"Workspace",description:"Where your projects live",icon:_t},{id:"remote",label:"Remote access",description:"Open KCG Code from anywhere",icon:Jr}],tR={id:"about",label:"About KCG Code",description:"Version & credits",icon:oj};function rj(e){return eR.find((t)=>t.id===e)??tR}var Zue="(min-width: 1024px)";function Jue(e,t){return e instanceof we?e.message:t}function nj(){let{navigate:e}=wt();return(t)=>(a)=>{if(a.metaKey||a.ctrlKey||a.shiftKey||a.button!==0)return;a.preventDefault(),e(t)}}function ij({section:e,anchor:t,root:a=!1}){let r=ff(),n=r.phase==="ready"?r.status:null,s=j((g)=>De.success(g),[]),l=j((g)=>De.error(g),[]),c=n!==null,f=Ji(Zue);U(()=>{if(!t||!c)return;let g=setTimeout(()=>{document.getElementById(t)?.scrollIntoView({block:"start",behavior:"smooth"})},100);return()=>clearTimeout(g)},[t,c]);let m=!n?S("div",{className:"flex justify-center py-16",role:"status",children:[d(fe,{className:"size-6 text-muted-foreground"}),d("span",{className:"sr-only",children:"Loading settings…"})]}):S("div",{className:"flex flex-col gap-8",children:[e==="profile"&&d(rde,{status:n,onOk:s,onError:l}),e==="security"&&d(tj,{status:n,onOk:s}),e==="workspace"&&d(aj,{status:n}),e==="remote"&&d(bV,{protectedApp:n.protected}),e==="about"&&d(JH,{})]});if(f)return S("div",{className:"grid grid-cols-[14.5rem_minmax(0,1fr)] gap-10 pt-2 pb-10",children:[d(ede,{current:e}),S("div",{className:"flex min-w-0 max-w-[40rem] flex-col gap-6",children:[d("h2",{className:"px-1 text-2xl font-semibold tracking-tight",children:rj(e).label}),m]})]});if(a)return d(tde,{status:n});return S("div",{className:"mx-auto flex w-full max-w-[40rem] flex-col gap-6 pb-[max(2.5rem,env(safe-area-inset-bottom))]",children:[d(ade,{title:rj(e).label}),m]})}function ede({current:e}){let t=nj(),a=({id:r,label:n,icon:s})=>{let l=xa(r),c=r===e;return d("li",{children:S("a",{href:l,onClick:t(l),"aria-current":c?"page":void 0,className:N("flex h-10 items-center gap-3 rounded-lg px-3 text-[15px] transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",c?"bg-black/[0.08] font-medium text-foreground dark:bg-white/[0.1]":"text-foreground/80 hover:bg-black/[0.04] hover:text-foreground dark:hover:bg-white/[0.05]"),children:[d(s,{className:"size-[18px] shrink-0"}),d("span",{className:"truncate",children:n})]})},r)};return S("nav",{"aria-label":"Settings",className:"sticky top-2 flex flex-col gap-3 self-start",children:[d("h1",{className:"px-3 text-2xl font-semibold tracking-tight",children:"Settings"}),d("ul",{className:"flex flex-col gap-0.5",children:eR.map(a)}),d("div",{className:"mx-3 h-px bg-border","aria-hidden":!0}),d("ul",{className:"flex flex-col gap-0.5",children:a(tR)})]})}function tde({status:e}){let{navigate:t}=wt(),a=e?.profile,r=(l,c)=>d(it,{prefix:c?.prefix??d(l.icon,{className:"size-[18px] text-muted-foreground"}),title:c?.title??l.label,subtitle:l.description,onActivate:()=>t(xa(l.id))},l.id),[n,...s]=eR;return S("div",{className:"mx-auto flex w-full max-w-[40rem] flex-col gap-6 pb-[max(2.5rem,env(safe-area-inset-bottom))]",children:[d("h1",{className:"px-1 text-2xl font-semibold tracking-tight",children:"Settings"}),n&&d(Ze,{children:r(n,{title:a?.nickname??"Profile",prefix:d(dl,{nickname:a?.nickname??null,avatarUrl:a?.avatarUrl??null,avatarPreset:a?.avatarPreset??null,className:"size-10",textClassName:"text-base"})})}),d(Ze,{children:s.map((l)=>r(l))}),d(Ze,{children:r(tR,{prefix:d(oj,{className:"size-[22px]"})})})]})}function ade({title:e}){let t=nj(),a=xa();return S("header",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2",children:[S("a",{href:a,onClick:t(a),className:"-ml-2 flex w-fit items-center gap-0.5 rounded-full py-1.5 pr-3 pl-1.5 text-[15px] font-medium outline-none hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 active:bg-muted",children:[d(Pi,{className:"size-5","aria-hidden":!0}),"Settings"]}),d("h1",{className:"truncate text-center text-[17px] font-bold",children:e}),d("span",{"aria-hidden":!0})]})}function rde({status:e,onOk:t,onError:a}){let r=async(n)=>{try{return await le("/api/auth/profile",{method:"PATCH",body:JSON.stringify({nickname:n||null})}),await Ut(),t("Nickname saved."),null}catch(s){return Jue(s,"Couldn't save nickname.")}};return S(se,{children:[S("div",{className:"flex flex-col gap-5",children:[S("div",{className:"flex flex-col items-center gap-3 pt-1 text-center",children:[d(QH,{profile:e.profile,onResult:(n)=>("ok"in n)?t(n.ok):a(n.error)}),d("h2",{className:"max-w-full truncate px-2 text-xl font-semibold tracking-tight sm:text-2xl",children:e.profile.nickname??"Your profile"})]}),d(Ze,{title:"Profile",description:"Your name and picture appear on the lock screen and sidebar.",children:d(B8,{title:"Nickname",value:e.profile.nickname??"",placeholder:"Add a nickname",maxLength:40,autoComplete:"nickname",onSave:r})})]}),d(tV,{})]})}var ode={opencode:".agents/skills","claude-code":".claude/skills"};function nde(e,t){let a=t?"Install anyway":"Install";if(e.length===0)return a;if(e.length===Nt.length)return`${a} for both`;return`${a} for ${e.map((r)=>Ht[r]).join(" + ")}`}function sj({skill:e,projectName:t,installedAgents:a,starting:r,startError:n,onOpenChange:s,onConfirm:l}){let[c,f]=A({phase:"loading"}),[m,g]=A([]);U(()=>{if(!e)return;let v=Nt.filter((w)=>!a.includes(w));g(v.length>0?v:[...Nt])},[e]);let h=(v,w)=>g((C)=>Nt.filter((L)=>L===v?w:C.includes(L)));U(()=>{if(!e)return;let v=!1;f({phase:"loading"});let w=new URLSearchParams({source:e.source,skill:e.skillId});return le(`/api/skills/audit?${w}`).then((C)=>C.json()).then(({audit:C})=>{if(!v)f({phase:"ready",audit:C})}).catch((C)=>{if(!v)f({phase:"error",message:C instanceof we?C.message:"Failed to load the security audit."})}),()=>{v=!0}},[e]);let x=c.phase==="ready"&&c.audit.overall==="fail";return d(qi,{open:e!==null,onOpenChange:(v)=>{if(!r)s(v)},children:S(Ki,{className:"max-h-[calc(100dvh-2rem)] gap-5 overflow-y-auto sm:max-w-md",children:[S(Xi,{className:"text-left",children:[S("div",{className:"flex min-w-0 items-center gap-3",children:[e&&d(MI,{source:e.source}),S("div",{className:"flex min-w-0 flex-col gap-0.5",children:[S(Wi,{className:"truncate",title:e?.name,children:["Install ",e?.name]}),e&&S("p",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[d("span",{className:"truncate font-mono",title:e.source,children:e.source}),d("span",{"aria-hidden":!0,children:"·"}),S("span",{className:"shrink-0 tabular-nums",children:[D0(e.installs)," installs"]}),d("span",{"aria-hidden":!0,children:"·"}),S("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-0.5 font-medium text-foreground underline-offset-4 hover:underline",children:["skills.sh",d(Xo,{className:"size-3","aria-hidden":!0}),d("span",{className:"sr-only",children:"(opens in a new tab)"})]})]})]})]}),S($i,{className:"sr-only",children:["Choose which agents in ",t," get this skill, then review its security audit."]})]}),e&&S("div",{className:"flex min-w-0 flex-col gap-4 text-sm",children:[S("fieldset",{className:"flex flex-col gap-2",disabled:r,children:[S("legend",{className:"mb-2 text-xs text-muted-foreground",children:["Add to ",d("span",{className:"font-medium text-foreground",children:t})," for"]}),d("div",{className:"grid grid-cols-2 gap-2",children:Nt.map((v)=>d(ide,{agent:v,checked:m.includes(v),installed:a.includes(v),onChange:(w)=>h(v,w)},v))}),m.length===0&&d("p",{className:"text-xs text-muted-foreground",children:"Pick at least one agent."})]}),d(sde,{state:c}),n&&d("p",{role:"alert",className:"text-xs text-destructive",children:n})]}),S("div",{className:"flex flex-col gap-3",children:[d("p",{className:"text-xs text-muted-foreground",children:"Skills run with the agent's full permissions. Installation continues in the background — follow it in the notification."}),S(Yi,{children:[d(Zi,{disabled:r,children:"Cancel"}),d(Qi,{variant:x?"destructive":"default",disabled:r||!e||m.length===0,onClick:(v)=>{if(v.preventDefault(),e&&m.length>0)l(e,m)},children:r?S(se,{children:[d(fe,{"data-icon":"inline-start"}),"Starting…"]}):nde(m,x)})]})]})]})})}function ide({agent:e,checked:t,installed:a,onChange:r}){return S("label",{className:N("relative flex cursor-pointer flex-col gap-2.5 rounded-xl border p-3 transition-colors select-none","has-focus-visible:ring-[3px] has-focus-visible:ring-ring/50 has-disabled:cursor-not-allowed has-disabled:opacity-60",t?"border-primary bg-primary/5":"hover:border-foreground/20 hover:bg-accent/30"),children:[d("input",{type:"checkbox",checked:t,onChange:(n)=>r(n.target.checked),className:"peer sr-only"}),S("span",{className:"flex items-start justify-between",children:[d("span",{className:"flex size-8 items-center justify-center rounded-lg bg-muted text-foreground",children:d(wr,{agentType:e,className:"size-4"})}),d("span",{"aria-hidden":!0,className:N("flex size-5 items-center justify-center rounded-full border transition-colors",t?"border-primary bg-primary text-primary-foreground":"bg-background"),children:t&&d(Ke,{className:"size-3",strokeWidth:3})})]}),S("span",{className:"flex min-w-0 flex-col gap-0.5",children:[d("span",{className:"text-sm font-medium leading-5",children:Ht[e]}),d("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:a?t?"Installed · reinstall":"Installed":ode[e]})]})]})}function sde({state:e}){if(e.phase==="loading")return S("div",{role:"status","aria-busy":"true",className:N("rounded-xl border bg-muted/30","flex items-center gap-3 p-3"),children:[d("span",{className:"sr-only",children:"Loading security audit…"}),d(Fe,{className:"size-4 rounded-full"}),d(Fe,{className:"h-4 w-40"})]});if(e.phase==="error")return S("p",{className:N("rounded-xl border bg-muted/30","flex items-center gap-2 p-3 text-xs text-muted-foreground"),children:[d(Mi,{className:"size-4 shrink-0","aria-hidden":!0}),e.message]});let{audits:a,overall:r}=e.audit;if(a===null||r===null)return S("p",{className:N("rounded-xl border bg-muted/30","flex items-start gap-2 p-3 text-xs text-muted-foreground"),children:[d(Mi,{className:"size-4 shrink-0","aria-hidden":!0}),S("span",{children:[d("span",{className:"font-medium text-foreground",children:"Not audited yet."})," Review the skill on skills.sh before installing."]})]});let n=a.filter((l)=>l.status==="pass").length;return S(Lo,{defaultOpen:r!=="pass",className:"rounded-xl border bg-muted/30",children:[S(ai,{className:"group flex w-full items-center gap-2 rounded-xl p-3 text-left text-xs outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",children:[d(r==="pass"?$o:Wo,{className:N("size-4 shrink-0",r==="pass"?"text-emerald-600 dark:text-emerald-400":r==="warn"?"text-amber-600 dark:text-amber-400":"text-destructive"),"aria-hidden":!0}),d("span",{className:"font-medium",children:"Security audit"}),d("span",{className:N("rounded px-1.5 text-[11px] leading-5 font-medium",RI[r]),children:TI[r]}),S("span",{className:"ml-auto text-muted-foreground tabular-nums",children:[n,"/",a.length," passed"]}),d(yt,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-180","aria-hidden":!0})]}),d(To,{children:d("ul",{className:"flex flex-col gap-2 border-t px-3 py-3",children:a.map((l)=>S("li",{className:"flex items-start justify-between gap-3 text-xs",children:[S("span",{className:"flex min-w-0 flex-col",children:[d("span",{className:"font-medium",children:l.provider}),l.summary&&d("span",{className:"line-clamp-2 text-muted-foreground",title:l.summary,children:l.summary})]}),d("span",{className:N("shrink-0 rounded px-1.5 text-[11px] leading-5 font-medium",RI[l.status]),children:TI[l.status]})]},l.provider))})})]})}var lde=6;function lj({projects:e,selected:t,onSelect:a}){let[r,n]=A(!1),[s,l]=A(""),[c,f]=A(0),m=B(null),g=B(null),h=e.length>=lde,x=de(()=>{let L=s.trim().toLowerCase();if(L==="")return e;return e.filter((k)=>k.name.toLowerCase().includes(L)||k.path.toLowerCase().includes(L))},[e,s]);U(()=>{if(!r)return;l("");let L=e.findIndex((k)=>k.id===t?.id);f(L>=0?L:0)},[r,e,t?.id]),U(()=>{f(0)},[s]),U(()=>{m.current?.querySelector(`[data-index="${c}"]`)?.scrollIntoView({block:"nearest"})},[c]);let v=(L)=>{if(!L)return;a(L.id),n(!1)},w=(L)=>{if(L.key==="ArrowDown")L.preventDefault(),f((k)=>Math.min(k+1,x.length-1));else if(L.key==="ArrowUp")L.preventDefault(),f((k)=>Math.max(k-1,0));else if(L.key==="Enter")L.preventDefault(),v(x[c])},C=x[c]?`skills-project-${c}`:void 0;return S(Af,{open:r,onOpenChange:n,children:[d(Mf,{asChild:!0,children:S("button",{type:"button","aria-haspopup":"listbox","aria-label":t?`Install to project ${t.name}. Change project`:"Select a project",className:"group inline-flex h-9 max-w-full min-w-0 items-center gap-2 rounded-full border bg-card pr-2.5 pl-3 text-sm shadow-xs transition-colors outline-none hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[state=open]:border-ring",children:[d(_t,{className:N("size-4 shrink-0",t?"text-primary":"text-muted-foreground"),"aria-hidden":!0}),d("span",{className:"shrink-0 text-muted-foreground",children:"Install to"}),d("span",{className:N("truncate font-medium",!t&&"text-muted-foreground"),children:t?.name??"Select a project"}),d(Hc,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":!0})]})}),S(Pf,{align:"end",className:"w-80 max-w-[calc(100vw-2rem)] p-0",onOpenAutoFocus:(L)=>{L.preventDefault(),(g.current??m.current)?.focus()},children:[h&&S("div",{className:"flex items-center gap-2 border-b px-3",children:[d(la,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),d("input",{ref:g,type:"text",role:"combobox","aria-expanded":!0,"aria-controls":"skills-project-list","aria-activedescendant":C,"aria-label":"Search projects",value:s,onChange:(L)=>l(L.target.value),onKeyDown:w,placeholder:"Search projects…",className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),d("div",{ref:m,id:"skills-project-list",role:"listbox","aria-label":"Projects","aria-activedescendant":h?void 0:C,tabIndex:h?-1:0,onKeyDown:h?void 0:w,className:"max-h-72 overflow-y-auto p-1 outline-none",children:x.length===0?S("p",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:["No projects match “",s.trim(),"”."]}):x.map((L,k)=>{let I=L.id===t?.id;return S("div",{id:`skills-project-${k}`,"data-index":k,role:"option","aria-selected":I,tabIndex:-1,onMouseMove:()=>f(k),onClick:()=>v(L),onKeyDown:()=>{},className:N("flex cursor-pointer items-center gap-2.5 rounded-md px-2 py-2 text-sm",k===c&&"bg-accent text-accent-foreground"),children:[d(_t,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),S("span",{className:"flex min-w-0 flex-1 flex-col",children:[d("span",{className:"truncate font-medium",children:L.name}),d("span",{className:"truncate text-xs text-muted-foreground",children:L.path})]}),I&&d(Ke,{className:"size-4 shrink-0","aria-hidden":!0})]},L.id)})})]})]})}var cde=[],ude=350,dde=2;function dw(e,t){return e instanceof we?e.message:t}function fde(){try{return localStorage.getItem(CI)}catch{return null}}function pde(e){try{localStorage.setItem(CI,e)}catch{}}function uj(){let{pathname:e,navigate:t}=wt(),[a,r]=A(null),[n,s]=A(null),[l,c]=A(()=>cI(window.location.search));U(()=>{c(cI(window.location.search))},[e]),U(()=>{let g=!1;return le("/api/projects").then((h)=>h.json()).then(({projects:h})=>{if(!g)r(h)}).catch((h)=>{if(!g)r([]),s(dw(h,"Failed to load projects"))}),()=>{g=!0}},[]);let f=de(()=>a?K8(a,l,fde()):null,[a,l]);U(()=>{if(f&&f.id!==l)window.history.replaceState({},"",Il(f.id)),c(f.id)},[f,l]);let m=j((g)=>{pde(g),c(g),window.history.replaceState({},"",Il(g))},[]);return S("div",{className:"flex flex-col gap-6",children:[S("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[S("div",{className:"flex min-w-0 flex-col gap-1",children:[d("h1",{className:"text-2xl font-semibold tracking-tight",children:"Skills"}),S("p",{className:"text-sm text-muted-foreground",children:["Discover skills on"," ",S("a",{href:"https://skills.sh",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-foreground underline underline-offset-4",children:["skills.sh",d("span",{className:"sr-only",children:" (opens in a new tab)"})]})," ","and add them to your project's agent."]})]}),a===null?d(Fe,{className:"h-9 w-48 shrink-0 rounded-full"}):a.length>0&&d("div",{className:"min-w-0 shrink-0",children:d(lj,{projects:a,selected:f,onSelect:m})})]}),a===null?S("div",{className:"flex flex-col gap-4",children:[d(Fe,{className:"h-10 w-48"}),d(Fe,{className:"h-11 w-full rounded-xl"})]}):a.length===0?S(yu,{className:"border",children:[S(wu,{children:[d(Su,{variant:"icon",children:d(Yo,{})}),d(ku,{children:"No projects yet"}),d(Cu,{children:n??"Skills are installed per project. Create a project first."})]}),d(hh,{children:d(ae,{type:"button",onClick:()=>t(Br()),children:"Go to projects"})})]}):d(mde,{project:f},f?.id??"none")]})}function mde({project:e}){let[t,a]=A("browse"),[r,n]=A({browse:"",installed:""}),s=r[t],l=j((X)=>n((Z)=>({...Z,[t]:X})),[t]),[c,f]=A({phase:"idle"}),[m,g]=A(null),[h,x]=A(0),[v,w]=A({phase:"idle"}),[C,L]=A(!1),[k,I]=A(null),[T,R]=A(!1),[E,M]=A(null),P=L0(),O=B(null);U(()=>{let X=(Z)=>{if(Z.key!=="/"||Z.metaKey||Z.ctrlKey||Z.altKey)return;let te=Z.target;if(te&&(te.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(te.tagName)))return;Z.preventDefault(),O.current?.focus()};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[]),U(()=>{if(!e)return;let X=!1;return f((Z)=>Z.phase==="ready"?Z:{phase:"loading"}),Promise.allSettled(Nt.map((Z)=>le(`/api/projects/${e.id}/skills${ri(Z)}`).then((te)=>te.json()).then(({skills:te})=>te))).then((Z)=>{if(X)return;let te={},D=[];if(Z.forEach((Te,Le)=>{let H=Nt[Le];if(Te.status==="fulfilled")te[H]=Te.value;else D.push({agent:H,message:dw(Te.reason,"Failed to load skills")})}),D.length===Nt.length){f({phase:"error",message:D[0]?.message??"Failed to load skills"}),g(null);return}f({phase:"ready",data:N0(te)}),g(D.length>0?`Couldn't read ${D.map((Te)=>Ht[Te.agent]).join(", ")} skills: ${D[0]?.message}`:null)}),()=>{X=!0}},[e,h]);let F=s.trim(),z=r.browse.trim(),Y=z.length>=dde;U(()=>{if(!Y){w({phase:"idle"}),L(!1);return}let X=!1;w((te)=>te.phase==="ready"?te:{phase:"loading"}),L(!0);let Z=setTimeout(()=>{le(`/api/skills/search?${new URLSearchParams({q:z})}`).then((te)=>te.json()).then(({skills:te})=>{if(!X)w({phase:"ready",data:te})}).catch((te)=>{if(!X)w({phase:"error",message:dw(te,"Search failed")})}).finally(()=>{if(!X)L(!1)})},ude);return()=>{X=!0,clearTimeout(Z)}},[z,Y]);let q=c.phase==="ready"?c.data:cde,G=de(()=>c.phase==="ready"?LI(c.data,""):[],[c]),Q=de(()=>c.phase==="ready"?LI(c.data,r.installed):[],[c,r.installed]);U(()=>{if(!e)return;return N8((X)=>{if(X.projectId===e.id&&X.status==="succeeded")x((Z)=>Z+1)})},[e]);let re=async(X,Z)=>{if(!e)return;R(!0),M(null);try{await T8(e.id,X.source,X.skillId,Z),I(null)}catch(te){M(dw(te,"Failed to start the installation."))}finally{R(!1)}},J=t==="browse"?"Search skills.sh — e.g. react, testing, docs":"Filter installed skills";return d("div",{className:"flex flex-col gap-5",children:!e?d(yu,{className:"border",children:S(wu,{children:[d(Su,{variant:"icon",children:d(sa,{})}),d(ku,{children:"Choose where to install"}),d(Cu,{children:"Skills are added per project. Pick a project in the top right to browse and install skills."})]})}):S(se,{children:[S("div",{className:"flex flex-col gap-4",children:[S("div",{role:"tablist","aria-label":"Skill views",className:"flex items-center gap-1 border-b",children:[d(cj,{id:"browse",current:t,onSelect:a,children:"Browse"}),S(cj,{id:"installed",current:t,onSelect:a,children:["Installed",c.phase==="ready"&&d("span",{className:"rounded-full bg-muted px-1.5 text-[11px] leading-4 tabular-nums text-muted-foreground",children:G.length})]})]}),S("div",{className:"relative flex min-w-0 items-center",children:[d(la,{className:"pointer-events-none absolute left-3.5 size-4 text-muted-foreground","aria-hidden":!0}),d("input",{ref:O,type:"search",value:s,onChange:(X)=>l(X.target.value),onKeyDown:(X)=>{if(X.key==="Escape"&&s!=="")X.preventDefault(),l("")},placeholder:J,"aria-label":t==="browse"?"Search skills on skills.sh":"Filter installed skills","aria-describedby":"skills-search-hint",className:"h-11 w-full rounded-xl border bg-card pr-20 pl-10 text-sm shadow-xs outline-none transition-shadow placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-60 [&::-webkit-search-cancel-button]:hidden"}),S("div",{className:"absolute right-2 flex items-center gap-1",children:[C&&t==="browse"&&d(fe,{className:"size-4 text-muted-foreground"}),s!==""?d("button",{type:"button",onClick:()=>{l(""),O.current?.focus()},"aria-label":"Clear search",className:"flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",children:d(Ft,{className:"size-4"})}):d("kbd",{className:"hidden rounded border bg-muted px-1.5 font-mono text-[11px] text-muted-foreground sm:inline","aria-hidden":!0,children:"/"})]}),d("span",{id:"skills-search-hint",className:"sr-only",children:"Press slash to focus search, Escape to clear."})]})]}),d("div",{role:"tabpanel",id:`skills-panel-${t}`,"aria-labelledby":`skills-tab-${t}`,children:t==="browse"?d(gde,{query:F,canSearch:Y,results:v,installedAgents:(X)=>II(X,q),isInstalling:(X)=>D8(P,e.id,X.source,X.skillId)?.job.id??null,onSuggest:(X)=>{l(X),O.current?.focus()},onInstall:I}):d(hde,{state:c,warning:m,skills:Q,total:G.length,query:F,onBrowse:()=>{a("browse"),O.current?.focus()}})}),d(sj,{skill:k,projectName:e.name,installedAgents:k?II(k,q):[],starting:T,startError:E,onOpenChange:(X)=>{if(!X)I(null),M(null)},onConfirm:(X,Z)=>void re(X,Z)})]})})}function cj({id:e,current:t,onSelect:a,children:r}){let n=e===t;return d("button",{type:"button",role:"tab",id:`skills-tab-${e}`,"aria-selected":n,"aria-controls":`skills-panel-${e}`,tabIndex:n?0:-1,onClick:()=>a(e),onKeyDown:(s)=>{if(s.key==="ArrowRight"||s.key==="ArrowLeft"){s.preventDefault();let l=e==="browse"?"installed":"browse";a(l),document.getElementById(`skills-tab-${l}`)?.focus()}},className:N("-mb-px flex h-10 items-center gap-1.5 border-b-2 px-3 text-sm font-medium transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",n?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r})}function gde({query:e,canSearch:t,results:a,installedAgents:r,isInstalling:n,onSuggest:s,onInstall:l}){if(!t)return S("div",{className:"flex flex-col items-center gap-4 rounded-xl border border-dashed px-6 py-10 text-center",children:[d("span",{className:"flex size-11 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:d(la,{className:"size-5","aria-hidden":!0})}),S("div",{className:"flex flex-col gap-1",children:[d("p",{className:"text-sm font-medium",children:e.length===1?"Keep typing…":"Search the skills.sh directory"}),d("p",{className:"text-sm text-muted-foreground",children:"Type at least 2 characters, or start with a popular topic."})]}),d("div",{className:"flex flex-wrap justify-center gap-2",children:q8.map((c)=>d("button",{type:"button",onClick:()=>s(c),className:"rounded-full border bg-card px-3 py-1 text-xs font-medium text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground",children:c},c))})]});if(a.phase==="idle"||a.phase==="loading")return d(PI,{});if(a.phase==="error")return d("p",{role:"alert",className:"rounded-xl border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:a.message});if(a.data.length===0)return d(yu,{className:"border",children:S(wu,{children:[d(Su,{variant:"icon",children:d(la,{})}),d(ku,{children:"No skills found"}),S(Cu,{children:["Nothing on skills.sh matches “",e,"”. Try a broader keyword."]})]})});return S("section",{"aria-label":"Search results",className:"flex flex-col gap-3",children:[S("p",{className:"text-xs text-muted-foreground","aria-live":"polite",children:[a.data.length," ",a.data.length===1?"result":"results"," for “",e,"” · sorted by installs"]}),d(AI,{label:"Skills on skills.sh",children:a.data.map((c)=>{let f=n(c);return d(W8,{skill:c,installedAgents:r(c),installing:f!==null,onInstall:l,onShowProgress:()=>{if(f)E8(f)}},c.id)})})]})}function hde({state:e,warning:t,skills:a,total:r,query:n,onBrowse:s}){if(e.phase==="idle"||e.phase==="loading")return d(PI,{});if(e.phase==="error")return d("p",{role:"alert",className:"rounded-xl border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:e.message});let l=t&&d("p",{role:"status",className:"mb-3 text-xs text-muted-foreground",children:t});if(r===0)return S(se,{children:[l,S(yu,{className:"border",children:[S(wu,{children:[d(Su,{variant:"icon",children:d(sa,{})}),d(ku,{children:"No skills installed yet"}),d(Cu,{children:"Browse skills.sh to add your first skill to this project."})]}),d(hh,{children:S(ae,{type:"button",variant:"outline",onClick:s,children:[d(la,{"data-icon":"inline-start"}),"Browse skills"]})})]})]});if(a.length===0)return S("p",{className:"py-10 text-center text-sm text-muted-foreground",children:["No installed skills match “",n,"”."]});return S("section",{"aria-label":"Installed skills",className:"flex flex-col gap-3",children:[t&&d("p",{role:"status",className:"text-xs text-muted-foreground",children:t}),n!==""&&S("p",{className:"text-xs text-muted-foreground","aria-live":"polite",children:[a.length," of ",r," installed skills"]}),d(AI,{label:"Installed skills",children:a.map((c)=>d($8,{skill:c},`${c.source}:${c.name}`))})]})}function dj(){let{pathname:e}=wt(),t=LB(e),a=z8(e),r=t.name==="projects",n=t.name==="session";return S(v0,{children:[S(i8,{className:"h-dvh min-h-0 overflow-hidden",children:[d(y8,{route:t,data:a}),d(c8,{className:"min-h-0 min-w-0 overflow-hidden",children:S("div",{className:"relative flex h-full w-full flex-col overflow-x-hidden bg-background",children:[!n&&S("header",{className:"flex w-full shrink-0 items-center gap-3 px-3 py-3 sm:px-4",children:[d(w0,{className:"size-9 shrink-0"}),S("span",{className:"flex min-w-0 items-center gap-2 md:hidden",children:[d("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary p-1",children:d("img",{src:Cr,alt:"",className:"size-full"})}),d("span",{className:"truncate text-sm font-semibold tracking-tight",children:"KCG Code"})]})]}),t.name==="session"?d(WH,{projectId:t.projectId,sessionId:t.sessionId},`${t.projectId}/${t.sessionId}`):d("main",{className:N("min-h-0 flex-1 overflow-x-hidden overflow-y-auto bg-background",t.name==="project"&&"lg:overflow-y-hidden"),children:S("div",{className:r?"flex min-h-full flex-col px-4 py-6 sm:px-6 sm:py-10":t.name==="project"?"mx-auto w-full max-w-6xl px-4 pt-2 pb-12 sm:px-6 sm:pt-4 sm:pb-16 lg:h-full lg:pb-0":t.name==="skills"||t.name==="settings"?"mx-auto w-full max-w-5xl px-4 pt-2 pb-12 sm:px-6 sm:pt-4 sm:pb-16":"mx-auto w-full max-w-3xl px-4 pt-2 pb-12 sm:px-6 sm:pt-4 sm:pb-16",children:[t.name==="projects"&&d(jF,{}),t.name==="project"&&d(SF,{projectId:t.projectId},t.projectId),t.name==="skills"&&d(uj,{}),t.name==="settings"&&d(ij,{section:t.section,anchor:t.anchor,root:t.root===!0}),t.name==="not-found"&&d(xde,{})]})})]})})]}),d(_8,{})]})}function xde(){let{navigate:e}=wt();return S("div",{className:"flex flex-col items-center gap-4 py-10 text-center",children:[d("p",{className:"text-sm text-muted-foreground",children:"Page not found."}),d("a",{href:Br(),onClick:(t)=>{t.preventDefault(),e(Br())},className:"text-sm font-medium underline underline-offset-4",children:"Back to projects"})]})}var fj=({...e})=>{let{theme:t}=Cf();return d(FB,{theme:t,className:"toaster group",icons:{success:d(Nn,{className:"size-4"}),info:d(lg,{className:"size-4"}),warning:d(qa,{className:"size-4"}),error:d(ol,{className:"size-4"}),loading:d(_n,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})};function pj(){return d(gC,{features:LC,strict:!0,children:S(hC,{reducedMotion:"user",children:[d(kB,{children:d(dj,{})}),d(fj,{position:"top-center",closeButton:!0})]})})}var mj=document.getElementById("root");if(!mj)throw Error("Root element #root not found in index.html");var vde=d(Xh,{children:d(pj,{})});{Sk(mj).render(vde);let e=document.createElement("link");if(e.rel="manifest",e.href="/manifest.json",document.head.appendChild(e),typeof navigator<"u"&&"serviceWorker"in navigator)navigator.serviceWorker.register("/sw.js").catch(()=>{})}export{b,o,p,_,i,y,u};
|