@alexberardi/jarvis-admin 0.1.77 → 0.1.78
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/package.json +1 -1
- package/public/assets/index-CG0PSroa.js +18 -0
- package/public/index.html +1 -1
- package/server/dist/data/service-registry.json +1 -1
- package/server/dist/routes/models.d.ts.map +1 -1
- package/server/dist/routes/models.js +55 -2
- package/server/dist/routes/models.js.map +1 -1
- package/server/src/data/service-registry.json +1 -1
- package/public/assets/index-D7KODgJA.js +0 -18
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))i(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function o(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(d){if(d.ep)return;d.ep=!0;const f=o(d);fetch(d.href,f)}})();function Zx(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ou={exports:{}},cl={};var Bp;function qb(){if(Bp)return cl;Bp=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function o(i,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var v in d)v!=="key"&&(f[v]=d[v])}else f=d;return d=f.ref,{$$typeof:a,type:i,key:m,ref:d!==void 0?d:null,props:f}}return cl.Fragment=s,cl.jsx=o,cl.jsxs=o,cl}var qp;function Hb(){return qp||(qp=1,Ou.exports=qb()),Ou.exports}var l=Hb(),zu={exports:{}},_e={};var Hp;function Gb(){if(Hp)return _e;Hp=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),S=Symbol.iterator;function R(j){return j===null||typeof j!="object"?null:(j=S&&j[S]||j["@@iterator"],typeof j=="function"?j:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,_={};function O(j,D,G){this.props=j,this.context=D,this.refs=_,this.updater=G||w}O.prototype.isReactComponent={},O.prototype.setState=function(j,D){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,D,"setState")},O.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function k(){}k.prototype=O.prototype;function Y(j,D,G){this.props=j,this.context=D,this.refs=_,this.updater=G||w}var I=Y.prototype=new k;I.constructor=Y,E(I,O.prototype),I.isPureReactComponent=!0;var ne=Array.isArray;function ee(){}var H={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function ie(j,D,G){var Z=G.ref;return{$$typeof:a,type:j,key:D,ref:Z!==void 0?Z:null,props:G}}function re(j,D){return ie(j.type,D,j.props)}function oe(j){return typeof j=="object"&&j!==null&&j.$$typeof===a}function he(j){var D={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(G){return D[G]})}var Ee=/\/+/g;function Te(j,D){return typeof j=="object"&&j!==null&&j.key!=null?he(""+j.key):D.toString(36)}function ae(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(ee,ee):(j.status="pending",j.then(function(D){j.status==="pending"&&(j.status="fulfilled",j.value=D)},function(D){j.status==="pending"&&(j.status="rejected",j.reason=D)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function C(j,D,G,Z,se){var me=typeof j;(me==="undefined"||me==="boolean")&&(j=null);var ue=!1;if(j===null)ue=!0;else switch(me){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(j.$$typeof){case a:case s:ue=!0;break;case y:return ue=j._init,C(ue(j._payload),D,G,Z,se)}}if(ue)return se=se(j),ue=Z===""?"."+Te(j,0):Z,ne(se)?(G="",ue!=null&&(G=ue.replace(Ee,"$&/")+"/"),C(se,D,G,"",function(z){return z})):se!=null&&(oe(se)&&(se=re(se,G+(se.key==null||j&&j.key===se.key?"":(""+se.key).replace(Ee,"$&/")+"/")+ue)),D.push(se)),1;ue=0;var je=Z===""?".":Z+":";if(ne(j))for(var U=0;U<j.length;U++)Z=j[U],me=je+Te(Z,U),ue+=C(Z,D,G,me,se);else if(U=R(j),typeof U=="function")for(j=U.call(j),U=0;!(Z=j.next()).done;)Z=Z.value,me=je+Te(Z,U++),ue+=C(Z,D,G,me,se);else if(me==="object"){if(typeof j.then=="function")return C(ae(j),D,G,Z,se);throw D=String(j),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return ue}function F(j,D,G){if(j==null)return j;var Z=[],se=0;return C(j,Z,"","",function(me){return D.call(G,me,se++)}),Z}function X(j){if(j._status===-1){var D=j._result;D=D(),D.then(function(G){(j._status===0||j._status===-1)&&(j._status=1,j._result=G)},function(G){(j._status===0||j._status===-1)&&(j._status=2,j._result=G)}),j._status===-1&&(j._status=0,j._result=D)}if(j._status===1)return j._result.default;throw j._result}var ve=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},W={map:F,forEach:function(j,D,G){F(j,function(){D.apply(this,arguments)},G)},count:function(j){var D=0;return F(j,function(){D++}),D},toArray:function(j){return F(j,function(D){return D})||[]},only:function(j){if(!oe(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return _e.Activity=x,_e.Children=W,_e.Component=O,_e.Fragment=o,_e.Profiler=d,_e.PureComponent=Y,_e.StrictMode=i,_e.Suspense=g,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,_e.__COMPILER_RUNTIME={__proto__:null,c:function(j){return H.H.useMemoCache(j)}},_e.cache=function(j){return function(){return j.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(j,D,G){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var Z=E({},j.props),se=j.key;if(D!=null)for(me in D.key!==void 0&&(se=""+D.key),D)!K.call(D,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&D.ref===void 0||(Z[me]=D[me]);var me=arguments.length-2;if(me===1)Z.children=G;else if(1<me){for(var ue=Array(me),je=0;je<me;je++)ue[je]=arguments[je+2];Z.children=ue}return ie(j.type,se,Z)},_e.createContext=function(j){return j={$$typeof:m,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:f,_context:j},j},_e.createElement=function(j,D,G){var Z,se={},me=null;if(D!=null)for(Z in D.key!==void 0&&(me=""+D.key),D)K.call(D,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(se[Z]=D[Z]);var ue=arguments.length-2;if(ue===1)se.children=G;else if(1<ue){for(var je=Array(ue),U=0;U<ue;U++)je[U]=arguments[U+2];se.children=je}if(j&&j.defaultProps)for(Z in ue=j.defaultProps,ue)se[Z]===void 0&&(se[Z]=ue[Z]);return ie(j,me,se)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(j){return{$$typeof:v,render:j}},_e.isValidElement=oe,_e.lazy=function(j){return{$$typeof:y,_payload:{_status:-1,_result:j},_init:X}},_e.memo=function(j,D){return{$$typeof:h,type:j,compare:D===void 0?null:D}},_e.startTransition=function(j){var D=H.T,G={};H.T=G;try{var Z=j(),se=H.S;se!==null&&se(G,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(ee,ve)}catch(me){ve(me)}finally{D!==null&&G.types!==null&&(D.types=G.types),H.T=D}},_e.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},_e.use=function(j){return H.H.use(j)},_e.useActionState=function(j,D,G){return H.H.useActionState(j,D,G)},_e.useCallback=function(j,D){return H.H.useCallback(j,D)},_e.useContext=function(j){return H.H.useContext(j)},_e.useDebugValue=function(){},_e.useDeferredValue=function(j,D){return H.H.useDeferredValue(j,D)},_e.useEffect=function(j,D){return H.H.useEffect(j,D)},_e.useEffectEvent=function(j){return H.H.useEffectEvent(j)},_e.useId=function(){return H.H.useId()},_e.useImperativeHandle=function(j,D,G){return H.H.useImperativeHandle(j,D,G)},_e.useInsertionEffect=function(j,D){return H.H.useInsertionEffect(j,D)},_e.useLayoutEffect=function(j,D){return H.H.useLayoutEffect(j,D)},_e.useMemo=function(j,D){return H.H.useMemo(j,D)},_e.useOptimistic=function(j,D){return H.H.useOptimistic(j,D)},_e.useReducer=function(j,D,G){return H.H.useReducer(j,D,G)},_e.useRef=function(j){return H.H.useRef(j)},_e.useState=function(j){return H.H.useState(j)},_e.useSyncExternalStore=function(j,D,G){return H.H.useSyncExternalStore(j,D,G)},_e.useTransition=function(){return H.H.useTransition()},_e.version="19.2.4",_e}var Gp;function gd(){return Gp||(Gp=1,zu.exports=Gb()),zu.exports}var N=gd();const le=Zx(N);var Du={exports:{}},ul={},Uu={exports:{}},Lu={};var Qp;function Qb(){return Qp||(Qp=1,(function(a){function s(C,F){var X=C.length;C.push(F);e:for(;0<X;){var ve=X-1>>>1,W=C[ve];if(0<d(W,F))C[ve]=F,C[X]=W,X=ve;else break e}}function o(C){return C.length===0?null:C[0]}function i(C){if(C.length===0)return null;var F=C[0],X=C.pop();if(X!==F){C[0]=X;e:for(var ve=0,W=C.length,j=W>>>1;ve<j;){var D=2*(ve+1)-1,G=C[D],Z=D+1,se=C[Z];if(0>d(G,X))Z<W&&0>d(se,G)?(C[ve]=se,C[Z]=X,ve=Z):(C[ve]=G,C[D]=X,ve=D);else if(Z<W&&0>d(se,X))C[ve]=se,C[Z]=X,ve=Z;else break e}}return F}function d(C,F){var X=C.sortIndex-F.sortIndex;return X!==0?X:C.id-F.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();a.unstable_now=function(){return m.now()-v}}var g=[],h=[],y=1,x=null,S=3,R=!1,w=!1,E=!1,_=!1,O=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function I(C){for(var F=o(h);F!==null;){if(F.callback===null)i(h);else if(F.startTime<=C)i(h),F.sortIndex=F.expirationTime,s(g,F);else break;F=o(h)}}function ne(C){if(E=!1,I(C),!w)if(o(g)!==null)w=!0,ee||(ee=!0,he());else{var F=o(h);F!==null&&ae(ne,F.startTime-C)}}var ee=!1,H=-1,K=5,ie=-1;function re(){return _?!0:!(a.unstable_now()-ie<K)}function oe(){if(_=!1,ee){var C=a.unstable_now();ie=C;var F=!0;try{e:{w=!1,E&&(E=!1,k(H),H=-1),R=!0;var X=S;try{t:{for(I(C),x=o(g);x!==null&&!(x.expirationTime>C&&re());){var ve=x.callback;if(typeof ve=="function"){x.callback=null,S=x.priorityLevel;var W=ve(x.expirationTime<=C);if(C=a.unstable_now(),typeof W=="function"){x.callback=W,I(C),F=!0;break t}x===o(g)&&i(g),I(C)}else i(g);x=o(g)}if(x!==null)F=!0;else{var j=o(h);j!==null&&ae(ne,j.startTime-C),F=!1}}break e}finally{x=null,S=X,R=!1}F=void 0}}finally{F?he():ee=!1}}}var he;if(typeof Y=="function")he=function(){Y(oe)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Te=Ee.port2;Ee.port1.onmessage=oe,he=function(){Te.postMessage(null)}}else he=function(){O(oe,0)};function ae(C,F){H=O(function(){C(a.unstable_now())},F)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(C){C.callback=null},a.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<C?Math.floor(1e3/C):5},a.unstable_getCurrentPriorityLevel=function(){return S},a.unstable_next=function(C){switch(S){case 1:case 2:case 3:var F=3;break;default:F=S}var X=S;S=F;try{return C()}finally{S=X}},a.unstable_requestPaint=function(){_=!0},a.unstable_runWithPriority=function(C,F){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var X=S;S=C;try{return F()}finally{S=X}},a.unstable_scheduleCallback=function(C,F,X){var ve=a.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?ve+X:ve):X=ve,C){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=X+W,C={id:y++,callback:F,priorityLevel:C,startTime:X,expirationTime:W,sortIndex:-1},X>ve?(C.sortIndex=X,s(h,C),o(g)===null&&C===o(h)&&(E?(k(H),H=-1):E=!0,ae(ne,X-ve))):(C.sortIndex=W,s(g,C),w||R||(w=!0,ee||(ee=!0,he()))),C},a.unstable_shouldYield=re,a.unstable_wrapCallback=function(C){var F=S;return function(){var X=S;S=F;try{return C.apply(this,arguments)}finally{S=X}}}})(Lu)),Lu}var Vp;function Vb(){return Vp||(Vp=1,Uu.exports=Qb()),Uu.exports}var Bu={exports:{}},Rt={};var Fp;function Fb(){if(Fp)return Rt;Fp=1;var a=gd();function s(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(s(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,h,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:x==null?null:""+x,children:g,containerInfo:h,implementation:y}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Rt.createPortal=function(g,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(s(299));return f(g,h,null,y)},Rt.flushSync=function(g){var h=m.T,y=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=y,i.d.f()}},Rt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(g,h))},Rt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Rt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,x=v(y,h.crossOrigin),S=typeof h.integrity=="string"?h.integrity:void 0,R=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:R}):y==="script"&&i.d.X(g,{crossOrigin:x,integrity:S,fetchPriority:R,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Rt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=v(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},Rt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,x=v(y,h.crossOrigin);i.d.L(g,y,{crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Rt.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=v(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},Rt.requestFormReset=function(g){i.d.r(g)},Rt.unstable_batchedUpdates=function(g,h){return g(h)},Rt.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.2.4",Rt}var Yp;function Jx(){if(Yp)return Bu.exports;Yp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),Bu.exports=Fb(),Bu.exports}var Xp;function Yb(){if(Xp)return ul;Xp=1;var a=Vb(),s=gd(),o=Jx();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m(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 v(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 g(e){if(f(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(r=c.return,r!==null){n=r;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return g(c),e;if(u===r)return g(c),t;u=u.sibling}throw Error(i(188))}if(n.return!==r.return)n=c,r=u;else{for(var p=!1,b=c.child;b;){if(b===n){p=!0,n=c,r=u;break}if(b===r){p=!0,r=c,n=u;break}b=b.sibling}if(!p){for(b=u.child;b;){if(b===n){p=!0,n=u,r=c;break}if(b===r){p=!0,r=u,n=c;break}b=b.sibling}if(!p)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,S=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function he(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function Te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case O:return"Profiler";case _:return"StrictMode";case ne:return"Suspense";case ee:return"SuspenseList";case ie:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case Y:return e.displayName||"Context";case k:return(e._context.displayName||"Context")+".Consumer";case I:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:Te(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return Te(e(t))}catch{}}return null}var ae=Array.isArray,C=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},ve=[],W=-1;function j(e){return{current:e}}function D(e){0>W||(e.current=ve[W],ve[W]=null,W--)}function G(e,t){W++,ve[W]=e.current,e.current=t}var Z=j(null),se=j(null),me=j(null),ue=j(null);function je(e,t){switch(G(me,t),G(se,e),G(Z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?op(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=op(t),e=ip(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(Z),G(Z,e)}function U(){D(Z),D(se),D(me)}function z(e){e.memoizedState!==null&&G(ue,e);var t=Z.current,n=ip(t,e.type);t!==n&&(G(se,e),G(Z,n))}function Se(e){se.current===e&&(D(Z),D(se)),ue.current===e&&(D(ue),sl._currentValue=X)}var xe,Ut;function ct(e){if(xe===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||"",Ut=-1<n.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+xe+e+Ut}var Dn=!1;function mr(e,t){if(!e||Dn)return"";Dn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(Q){var q=Q}Reflect.construct(e,[],P)}else{try{P.call()}catch(Q){q=Q}e.call(P.prototype)}}else{try{throw Error()}catch(Q){q=Q}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(Q){if(Q&&q&&typeof Q.stack=="string")return[Q.stack,q.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=r.DetermineComponentFrameRoot(),p=u[0],b=u[1];if(p&&b){var T=p.split(`
|
|
4
|
-
`),B=b.split(`
|
|
5
|
-
`);for(c=r=0;r<T.length&&!T[r].includes("DetermineComponentFrameRoot");)r++;for(;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;if(r===T.length||c===B.length)for(r=T.length-1,c=B.length-1;1<=r&&0<=c&&T[r]!==B[c];)c--;for(;1<=r&&0<=c;r--,c--)if(T[r]!==B[c]){if(r!==1||c!==1)do if(r--,c--,0>c||T[r]!==B[c]){var $=`
|
|
6
|
-
`+T[r].replace(" at new "," at ");return e.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",e.displayName)),$}while(1<=r&&0<=c);break}}}finally{Dn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ct(n):""}function Un(e,t){switch(e.tag){case 26:case 27:case 5:return ct(e.type);case 16:return ct("Lazy");case 13:return e.child!==t&&t!==null?ct("Suspense Fallback"):ct("Suspense");case 19:return ct("SuspenseList");case 0:case 15:return mr(e.type,!1);case 11:return mr(e.type.render,!1);case 1:return mr(e.type,!0);case 31:return ct("Activity");default:return""}}function ps(e){try{var t="",n=null;do t+=Un(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
|
-
Error generating stack: `+r.message+`
|
|
8
|
-
`+r.stack}}var Jt=Object.prototype.hasOwnProperty,xs=a.unstable_scheduleCallback,vs=a.unstable_cancelCallback,Mt=a.unstable_shouldYield,nn=a.unstable_requestPaint,At=a.unstable_now,Ni=a.unstable_getCurrentPriorityLevel,Ln=a.unstable_ImmediatePriority,Cl=a.unstable_UserBlockingPriority,Bn=a.unstable_NormalPriority,gs=a.unstable_LowPriority,za=a.unstable_IdlePriority,Tl=a.log,rn=a.unstable_setDisableYieldValue,qn=null,Ot=null;function ga(e){if(typeof Tl=="function"&&rn(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(qn,e)}catch{}}var Tt=Math.clz32?Math.clz32:Ca,ji=Math.log,ys=Math.LN2;function Ca(e){return e>>>=0,e===0?32:31-(ji(e)/ys|0)|0}var hr=256,pr=262144,Hn=4194304;function Ta(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&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ce(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var c=0,u=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var b=r&134217727;return b!==0?(r=b&~u,r!==0?c=Ta(r):(p&=b,p!==0?c=Ta(p):n||(n=b&~e,n!==0&&(c=Ta(n))))):(b=r&~u,b!==0?c=Ta(b):p!==0?c=Ta(p):n||(n=r&~e,n!==0&&(c=Ta(n)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:c}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xt(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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var e=Hn;return Hn<<=1,(Hn&62914560)===0&&(Hn=4194304),e}function sn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Lt(e,t,n,r,c,u){var p=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var b=e.entanglements,T=e.expirationTimes,B=e.hiddenUpdates;for(n=p&~n;0<n;){var $=31-Tt(n),P=1<<$;b[$]=0,T[$]=-1;var q=B[$];if(q!==null)for(B[$]=null,$=0;$<q.length;$++){var Q=q[$];Q!==null&&(Q.lane&=-536870913)}n&=~P}r!==0&&Gn(e,r,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(p&~t))}function Gn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tt(n),c=1<<r;c&t|e[r]&t&&(e[r]|=t),n&=~c}}function qt(e,t){var n=t&-t;return n=(n&42)!==0?1:xr(n),(n&(e.suspendedLanes|t))!==0?0:n}function xr(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 ya(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Si(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:Mp(e.type))}function Xd(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var ln=Math.random().toString(36).slice(2),Nt="__reactFiber$"+ln,Ht="__reactProps$"+ln,vr="__reactContainer$"+ln,wi="__reactEvents$"+ln,_g="__reactListeners$"+ln,Rg="__reactHandles$"+ln,Kd="__reactResources$"+ln,bs="__reactMarker$"+ln;function Ei(e){delete e[Nt],delete e[Ht],delete e[wi],delete e[_g],delete e[Rg]}function gr(e){var t=e[Nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vr]||n[Nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pp(e);e!==null;){if(n=e[Nt])return n;e=pp(e)}return t}e=n,n=e.parentNode}return null}function yr(e){if(e=e[Nt]||e[vr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ns(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function br(e){var t=e[Kd];return t||(t=e[Kd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[bs]=!0}var $d=new Set,Zd={};function Qn(e,t){Nr(e,t),Nr(e+"Capture",t)}function Nr(e,t){for(Zd[e]=t,e=0;e<t.length;e++)$d.add(t[e])}var kg=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]*$"),Jd={},Pd={};function Mg(e){return Jt.call(Pd,e)?!0:Jt.call(Jd,e)?!1:kg.test(e)?Pd[e]=!0:(Jd[e]=!0,!1)}function _l(e,t,n){if(Mg(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){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,""+n)}}function Rl(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Da(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function la(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Id(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ag(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,u=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(p){n=""+p,u.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(p){n=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ci(e){if(!e._valueTracker){var t=Id(e)?"checked":"value";e._valueTracker=Ag(e,t,""+e[t])}}function Wd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Id(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function kl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Og=/[\n"\\]/g;function oa(e){return e.replace(Og,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ti(e,t,n,r,c,u,p,b){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+la(t)):e.value!==""+la(t)&&(e.value=""+la(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?_i(e,p,la(t)):n!=null?_i(e,p,la(n)):r!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+la(b):e.removeAttribute("name")}function ef(e,t,n,r,c,u,p,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ci(e);return}n=n!=null?""+la(n):"",t=t!=null?""+la(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=b?e.checked:!!r,e.defaultChecked=!!r,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),Ci(e)}function _i(e,t,n){t==="number"&&kl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function jr(e,t,n,r){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&r&&(e[n].defaultSelected=!0)}else{for(n=""+la(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function tf(e,t,n){if(t!=null&&(t=""+la(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+la(n):""}function af(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=la(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Ci(e)}function Sr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zg=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 nf(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||zg.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function rf(e,t,n){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&n[c]!==r&&nf(e,c,r)}else for(var u in t)t.hasOwnProperty(u)&&nf(e,u,t[u])}function Ri(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 Dg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ug=/^[\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 Ml(e){return Ug.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ua(){}var ki=null;function Mi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wr=null,Er=null;function sf(e){var t=yr(e);if(t&&(e=t.stateNode)){var n=e[Ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ti(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+oa(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var c=r[Ht]||null;if(!c)throw Error(i(90));Ti(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Wd(r)}break e;case"textarea":tf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&jr(e,!!n.multiple,t,!1)}}}var Ai=!1;function lf(e,t,n){if(Ai)return e(t,n);Ai=!0;try{var r=e(t);return r}finally{if(Ai=!1,(wr!==null||Er!==null)&&(yo(),wr&&(t=wr,e=Er,Er=wr=null,sf(t),e)))for(t=0;t<e.length;t++)sf(e[t])}}function js(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ht]||null;if(r===null)return null;n=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(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var La=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oi=!1;if(La)try{var Ss={};Object.defineProperty(Ss,"passive",{get:function(){Oi=!0}}),window.addEventListener("test",Ss,Ss),window.removeEventListener("test",Ss,Ss)}catch{Oi=!1}var on=null,zi=null,Al=null;function of(){if(Al)return Al;var e,t=zi,n=t.length,r,c="value"in on?on.value:on.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var p=n-e;for(r=1;r<=p&&t[n-r]===c[u-r];r++);return Al=c.slice(e,1<r?1-r:void 0)}function Ol(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 zl(){return!0}function cf(){return!1}function Gt(e){function t(n,r,c,u,p){this._reactName=n,this._targetInst=c,this.type=r,this.nativeEvent=u,this.target=p,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?zl:cf,this.isPropagationStopped=cf,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=Gt(Vn),ws=x({},Vn,{view:0,detail:0}),Lg=Gt(ws),Di,Ui,Es,Ul=x({},ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Es&&(Es&&e.type==="mousemove"?(Di=e.screenX-Es.screenX,Ui=e.screenY-Es.screenY):Ui=Di=0,Es=e),Di)},movementY:function(e){return"movementY"in e?e.movementY:Ui}}),uf=Gt(Ul),Bg=x({},Ul,{dataTransfer:0}),qg=Gt(Bg),Hg=x({},ws,{relatedTarget:0}),Li=Gt(Hg),Gg=x({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0}),Qg=Gt(Gg),Vg=x({},Vn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fg=Gt(Vg),Yg=x({},Vn,{data:0}),df=Gt(Yg),Xg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kg={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"},$g={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$g[e])?!!t[e]:!1}function Bi(){return Zg}var Jg=x({},ws,{key:function(e){if(e.key){var t=Xg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bi,charCode:function(e){return e.type==="keypress"?Ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pg=Gt(Jg),Ig=x({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ff=Gt(Ig),Wg=x({},ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bi}),ey=Gt(Wg),ty=x({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ay=Gt(ty),ny=x({},Ul,{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}),ry=Gt(ny),sy=x({},Vn,{newState:0,oldState:0}),ly=Gt(sy),oy=[9,13,27,32],qi=La&&"CompositionEvent"in window,Cs=null;La&&"documentMode"in document&&(Cs=document.documentMode);var iy=La&&"TextEvent"in window&&!Cs,mf=La&&(!qi||Cs&&8<Cs&&11>=Cs),hf=" ",pf=!1;function xf(e,t){switch(e){case"keyup":return oy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cr=!1;function cy(e,t){switch(e){case"compositionend":return vf(t);case"keypress":return t.which!==32?null:(pf=!0,hf);case"textInput":return e=t.data,e===hf&&pf?null:e;default:return null}}function uy(e,t){if(Cr)return e==="compositionend"||!qi&&xf(e,t)?(e=of(),Al=zi=on=null,Cr=!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 mf&&t.locale!=="ko"?null:t.data;default:return null}}var dy={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 gf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dy[e.type]:t==="textarea"}function yf(e,t,n,r){wr?Er?Er.push(r):Er=[r]:wr=r,t=Co(t,"onChange"),0<t.length&&(n=new Dl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ts=null,_s=null;function fy(e){tp(e,0)}function Ll(e){var t=Ns(e);if(Wd(t))return e}function bf(e,t){if(e==="change")return t}var Nf=!1;if(La){var Hi;if(La){var Gi="oninput"in document;if(!Gi){var jf=document.createElement("div");jf.setAttribute("oninput","return;"),Gi=typeof jf.oninput=="function"}Hi=Gi}else Hi=!1;Nf=Hi&&(!document.documentMode||9<document.documentMode)}function Sf(){Ts&&(Ts.detachEvent("onpropertychange",wf),_s=Ts=null)}function wf(e){if(e.propertyName==="value"&&Ll(_s)){var t=[];yf(t,_s,e,Mi(e)),lf(fy,t)}}function my(e,t,n){e==="focusin"?(Sf(),Ts=t,_s=n,Ts.attachEvent("onpropertychange",wf)):e==="focusout"&&Sf()}function hy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ll(_s)}function py(e,t){if(e==="click")return Ll(t)}function xy(e,t){if(e==="input"||e==="change")return Ll(t)}function vy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:vy;function Rs(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var c=n[r];if(!Jt.call(t,c)||!Pt(e[c],t[c]))return!1}return!0}function Ef(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cf(e,t){var n=Ef(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ef(n)}}function Tf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _f(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=kl(e.document)}return t}function Qi(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 gy=La&&"documentMode"in document&&11>=document.documentMode,Tr=null,Vi=null,ks=null,Fi=!1;function Rf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fi||Tr==null||Tr!==kl(r)||(r=Tr,"selectionStart"in r&&Qi(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}),ks&&Rs(ks,r)||(ks=r,r=Co(Vi,"onSelect"),0<r.length&&(t=new Dl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Fn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:Fn("Animation","AnimationEnd"),animationiteration:Fn("Animation","AnimationIteration"),animationstart:Fn("Animation","AnimationStart"),transitionrun:Fn("Transition","TransitionRun"),transitionstart:Fn("Transition","TransitionStart"),transitioncancel:Fn("Transition","TransitionCancel"),transitionend:Fn("Transition","TransitionEnd")},Yi={},kf={};La&&(kf=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);function Yn(e){if(Yi[e])return Yi[e];if(!_r[e])return e;var t=_r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in kf)return Yi[e]=t[n];return e}var Mf=Yn("animationend"),Af=Yn("animationiteration"),Of=Yn("animationstart"),yy=Yn("transitionrun"),by=Yn("transitionstart"),Ny=Yn("transitioncancel"),zf=Yn("transitionend"),Df=new Map,Xi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xi.push("scrollEnd");function ba(e,t){Df.set(e,t),Qn(t,[e])}var Bl=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)},ia=[],Rr=0,Ki=0;function ql(){for(var e=Rr,t=Ki=Rr=0;t<e;){var n=ia[t];ia[t++]=null;var r=ia[t];ia[t++]=null;var c=ia[t];ia[t++]=null;var u=ia[t];if(ia[t++]=null,r!==null&&c!==null){var p=r.pending;p===null?c.next=c:(c.next=p.next,p.next=c),r.pending=c}u!==0&&Uf(n,c,u)}}function Hl(e,t,n,r){ia[Rr++]=e,ia[Rr++]=t,ia[Rr++]=n,ia[Rr++]=r,Ki|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $i(e,t,n,r){return Hl(e,t,n,r),Gl(e)}function Xn(e,t){return Hl(e,null,null,t),Gl(e)}function Uf(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var c=!1,u=e.return;u!==null;)u.childLanes|=n,r=u.alternate,r!==null&&(r.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-Tt(n),e=u.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=n|536870912),u):null}function Gl(e){if(50<Is)throw Is=0,nu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kr={};function jy(e,t,n,r){this.tag=e,this.key=n,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 It(e,t,n,r){return new jy(e,t,n,r)}function Zi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ba(e,t){var n=e.alternate;return n===null?(n=It(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Lf(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ql(e,t,n,r,c,u){var p=0;if(r=e,typeof e=="function")Zi(e)&&(p=1);else if(typeof e=="string")p=Tb(e,n,Z.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ie:return e=It(31,n,t,c),e.elementType=ie,e.lanes=u,e;case E:return Kn(n.children,c,u,t);case _:p=8,c|=24;break;case O:return e=It(12,n,t,c|2),e.elementType=O,e.lanes=u,e;case ne:return e=It(13,n,t,c),e.elementType=ne,e.lanes=u,e;case ee:return e=It(19,n,t,c),e.elementType=ee,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:p=10;break e;case k:p=9;break e;case I:p=11;break e;case H:p=14;break e;case K:p=16,r=null;break e}p=29,n=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=It(p,n,t,c),t.elementType=e,t.type=r,t.lanes=u,t}function Kn(e,t,n,r){return e=It(7,e,r,t),e.lanes=n,e}function Ji(e,t,n){return e=It(6,e,null,t),e.lanes=n,e}function Bf(e){var t=It(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var qf=new WeakMap;function ca(e,t){if(typeof e=="object"&&e!==null){var n=qf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ps(t)},qf.set(e,t),t)}return{value:e,source:t,stack:ps(t)}}var Mr=[],Ar=0,Vl=null,Ms=0,ua=[],da=0,cn=null,_a=1,Ra="";function qa(e,t){Mr[Ar++]=Ms,Mr[Ar++]=Vl,Vl=e,Ms=t}function Hf(e,t,n){ua[da++]=_a,ua[da++]=Ra,ua[da++]=cn,cn=e;var r=_a;e=Ra;var c=32-Tt(r)-1;r&=~(1<<c),n+=1;var u=32-Tt(t)+c;if(30<u){var p=c-c%5;u=(r&(1<<p)-1).toString(32),r>>=p,c-=p,_a=1<<32-Tt(t)+c|n<<c|r,Ra=u+e}else _a=1<<u|n<<c|r,Ra=e}function Ii(e){e.return!==null&&(qa(e,1),Hf(e,1,0))}function Wi(e){for(;e===Vl;)Vl=Mr[--Ar],Mr[Ar]=null,Ms=Mr[--Ar],Mr[Ar]=null;for(;e===cn;)cn=ua[--da],ua[da]=null,Ra=ua[--da],ua[da]=null,_a=ua[--da],ua[da]=null}function Gf(e,t){ua[da++]=_a,ua[da++]=Ra,ua[da++]=cn,_a=t.id,Ra=t.overflow,cn=e}var jt=null,Ke=null,Le=!1,un=null,fa=!1,ec=Error(i(519));function dn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw As(ca(t,e)),ec}function Qf(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Nt]=e,t[Ht]=r,n){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(n=0;n<el.length;n++)ze(el[n],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),ef(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),af(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||sp(t.textContent,n)?(r.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),r.onScroll!=null&&ze("scroll",t),r.onScrollEnd!=null&&ze("scrollend",t),r.onClick!=null&&(t.onclick=Ua),t=!0):t=!1,t||dn(e,!0)}function Vf(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:fa=!1;return;case 27:case 3:fa=!0;return;default:jt=jt.return}}function Or(e){if(e!==jt)return!1;if(!Le)return Vf(e),Le=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||gu(e.type,e.memoizedProps)),n=!n),n&&Ke&&dn(e),Vf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=hp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=hp(e)}else t===27?(t=Ke,En(e.type)?(e=Su,Su=null,Ke=e):Ke=t):Ke=jt?ha(e.stateNode.nextSibling):null;return!0}function $n(){Ke=jt=null,Le=!1}function tc(){var e=un;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),un=null),e}function As(e){un===null?un=[e]:un.push(e)}var ac=j(null),Zn=null,Ha=null;function fn(e,t,n){G(ac,t._currentValue),t._currentValue=n}function Ga(e){e._currentValue=ac.current,D(ac)}function nc(e,t,n){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===n)break;e=e.return}}function rc(e,t,n,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var p=c.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=c;for(var T=0;T<t.length;T++)if(b.context===t[T]){u.lanes|=n,b=u.alternate,b!==null&&(b.lanes|=n),nc(u.return,n,e),r||(p=null);break e}u=b.next}}else if(c.tag===18){if(p=c.return,p===null)throw Error(i(341));p.lanes|=n,u=p.alternate,u!==null&&(u.lanes|=n),nc(p,n,e),p=null}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===e){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}}function zr(e,t,n,r){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var p=c.alternate;if(p===null)throw Error(i(387));if(p=p.memoizedProps,p!==null){var b=c.type;Pt(c.pendingProps.value,p.value)||(e!==null?e.push(b):e=[b])}}else if(c===ue.current){if(p=c.alternate,p===null)throw Error(i(387));p.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(sl):e=[sl])}c=c.return}e!==null&&rc(t,e,n,r),t.flags|=262144}function Fl(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Jn(e){Zn=e,Ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return Ff(Zn,e)}function Yl(e,t){return Zn===null&&Jn(e),Ff(e,t)}function Ff(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ha===null){if(e===null)throw Error(i(308));Ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ha=Ha.next=t;return n}var Sy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},wy=a.unstable_scheduleCallback,Ey=a.unstable_NormalPriority,rt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sc(){return{controller:new Sy,data:new Map,refCount:0}}function Os(e){e.refCount--,e.refCount===0&&wy(Ey,function(){e.controller.abort()})}var zs=null,lc=0,Dr=0,Ur=null;function Cy(e,t){if(zs===null){var n=zs=[];lc=0,Dr=cu(),Ur={status:"pending",value:void 0,then:function(r){n.push(r)}}}return lc++,t.then(Yf,Yf),t}function Yf(){if(--lc===0&&zs!==null){Ur!==null&&(Ur.status="fulfilled");var e=zs;zs=null,Dr=0,Ur=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ty(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),r}var Xf=C.S;C.S=function(e,t){Rh=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Cy(e,t),Xf!==null&&Xf(e,t)};var Pn=j(null);function oc(){var e=Pn.current;return e!==null?e:Xe.pooledCache}function Xl(e,t){t===null?G(Pn,Pn.current):G(Pn,t.pool)}function Kf(){var e=oc();return e===null?null:{parent:rt._currentValue,pool:e}}var Lr=Error(i(460)),ic=Error(i(474)),Kl=Error(i(542)),$l={then:function(){}};function $f(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ua,Ua),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Pf(e),e;default:if(typeof t.status=="string")t.then(Ua,Ua);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Pf(e),e}throw Wn=t,Lr}}function In(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Wn=n,Lr):n}}var Wn=null;function Jf(){if(Wn===null)throw Error(i(459));var e=Wn;return Wn=null,e}function Pf(e){if(e===Lr||e===Kl)throw Error(i(483))}var Br=null,Ds=0;function Zl(e){var t=Ds;return Ds+=1,Br===null&&(Br=[]),Zf(Br,e,t)}function Us(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Jl(e,t){throw t.$$typeof===S?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function If(e){function t(A,M){if(e){var L=A.deletions;L===null?(A.deletions=[M],A.flags|=16):L.push(M)}}function n(A,M){if(!e)return null;for(;M!==null;)t(A,M),M=M.sibling;return null}function r(A){for(var M=new Map;A!==null;)A.key!==null?M.set(A.key,A):M.set(A.index,A),A=A.sibling;return M}function c(A,M){return A=Ba(A,M),A.index=0,A.sibling=null,A}function u(A,M,L){return A.index=L,e?(L=A.alternate,L!==null?(L=L.index,L<M?(A.flags|=67108866,M):L):(A.flags|=67108866,M)):(A.flags|=1048576,M)}function p(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function b(A,M,L,J){return M===null||M.tag!==6?(M=Ji(L,A.mode,J),M.return=A,M):(M=c(M,L),M.return=A,M)}function T(A,M,L,J){var ge=L.type;return ge===E?$(A,M,L.props.children,J,L.key):M!==null&&(M.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===K&&In(ge)===M.type)?(M=c(M,L.props),Us(M,L),M.return=A,M):(M=Ql(L.type,L.key,L.props,null,A.mode,J),Us(M,L),M.return=A,M)}function B(A,M,L,J){return M===null||M.tag!==4||M.stateNode.containerInfo!==L.containerInfo||M.stateNode.implementation!==L.implementation?(M=Pi(L,A.mode,J),M.return=A,M):(M=c(M,L.children||[]),M.return=A,M)}function $(A,M,L,J,ge){return M===null||M.tag!==7?(M=Kn(L,A.mode,J,ge),M.return=A,M):(M=c(M,L),M.return=A,M)}function P(A,M,L){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Ji(""+M,A.mode,L),M.return=A,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case R:return L=Ql(M.type,M.key,M.props,null,A.mode,L),Us(L,M),L.return=A,L;case w:return M=Pi(M,A.mode,L),M.return=A,M;case K:return M=In(M),P(A,M,L)}if(ae(M)||he(M))return M=Kn(M,A.mode,L,null),M.return=A,M;if(typeof M.then=="function")return P(A,Zl(M),L);if(M.$$typeof===Y)return P(A,Yl(A,M),L);Jl(A,M)}return null}function q(A,M,L,J){var ge=M!==null?M.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return ge!==null?null:b(A,M,""+L,J);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case R:return L.key===ge?T(A,M,L,J):null;case w:return L.key===ge?B(A,M,L,J):null;case K:return L=In(L),q(A,M,L,J)}if(ae(L)||he(L))return ge!==null?null:$(A,M,L,J,null);if(typeof L.then=="function")return q(A,M,Zl(L),J);if(L.$$typeof===Y)return q(A,M,Yl(A,L),J);Jl(A,L)}return null}function Q(A,M,L,J,ge){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return A=A.get(L)||null,b(M,A,""+J,ge);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case R:return A=A.get(J.key===null?L:J.key)||null,T(M,A,J,ge);case w:return A=A.get(J.key===null?L:J.key)||null,B(M,A,J,ge);case K:return J=In(J),Q(A,M,L,J,ge)}if(ae(J)||he(J))return A=A.get(L)||null,$(M,A,J,ge,null);if(typeof J.then=="function")return Q(A,M,L,Zl(J),ge);if(J.$$typeof===Y)return Q(A,M,L,Yl(M,J),ge);Jl(M,J)}return null}function ce(A,M,L,J){for(var ge=null,Be=null,pe=M,ke=M=0,Ue=null;pe!==null&&ke<L.length;ke++){pe.index>ke?(Ue=pe,pe=null):Ue=pe.sibling;var qe=q(A,pe,L[ke],J);if(qe===null){pe===null&&(pe=Ue);break}e&&pe&&qe.alternate===null&&t(A,pe),M=u(qe,M,ke),Be===null?ge=qe:Be.sibling=qe,Be=qe,pe=Ue}if(ke===L.length)return n(A,pe),Le&&qa(A,ke),ge;if(pe===null){for(;ke<L.length;ke++)pe=P(A,L[ke],J),pe!==null&&(M=u(pe,M,ke),Be===null?ge=pe:Be.sibling=pe,Be=pe);return Le&&qa(A,ke),ge}for(pe=r(pe);ke<L.length;ke++)Ue=Q(pe,A,ke,L[ke],J),Ue!==null&&(e&&Ue.alternate!==null&&pe.delete(Ue.key===null?ke:Ue.key),M=u(Ue,M,ke),Be===null?ge=Ue:Be.sibling=Ue,Be=Ue);return e&&pe.forEach(function(kn){return t(A,kn)}),Le&&qa(A,ke),ge}function Ne(A,M,L,J){if(L==null)throw Error(i(151));for(var ge=null,Be=null,pe=M,ke=M=0,Ue=null,qe=L.next();pe!==null&&!qe.done;ke++,qe=L.next()){pe.index>ke?(Ue=pe,pe=null):Ue=pe.sibling;var kn=q(A,pe,qe.value,J);if(kn===null){pe===null&&(pe=Ue);break}e&&pe&&kn.alternate===null&&t(A,pe),M=u(kn,M,ke),Be===null?ge=kn:Be.sibling=kn,Be=kn,pe=Ue}if(qe.done)return n(A,pe),Le&&qa(A,ke),ge;if(pe===null){for(;!qe.done;ke++,qe=L.next())qe=P(A,qe.value,J),qe!==null&&(M=u(qe,M,ke),Be===null?ge=qe:Be.sibling=qe,Be=qe);return Le&&qa(A,ke),ge}for(pe=r(pe);!qe.done;ke++,qe=L.next())qe=Q(pe,A,ke,qe.value,J),qe!==null&&(e&&qe.alternate!==null&&pe.delete(qe.key===null?ke:qe.key),M=u(qe,M,ke),Be===null?ge=qe:Be.sibling=qe,Be=qe);return e&&pe.forEach(function(Bb){return t(A,Bb)}),Le&&qa(A,ke),ge}function Ye(A,M,L,J){if(typeof L=="object"&&L!==null&&L.type===E&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case R:e:{for(var ge=L.key;M!==null;){if(M.key===ge){if(ge=L.type,ge===E){if(M.tag===7){n(A,M.sibling),J=c(M,L.props.children),J.return=A,A=J;break e}}else if(M.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===K&&In(ge)===M.type){n(A,M.sibling),J=c(M,L.props),Us(J,L),J.return=A,A=J;break e}n(A,M);break}else t(A,M);M=M.sibling}L.type===E?(J=Kn(L.props.children,A.mode,J,L.key),J.return=A,A=J):(J=Ql(L.type,L.key,L.props,null,A.mode,J),Us(J,L),J.return=A,A=J)}return p(A);case w:e:{for(ge=L.key;M!==null;){if(M.key===ge)if(M.tag===4&&M.stateNode.containerInfo===L.containerInfo&&M.stateNode.implementation===L.implementation){n(A,M.sibling),J=c(M,L.children||[]),J.return=A,A=J;break e}else{n(A,M);break}else t(A,M);M=M.sibling}J=Pi(L,A.mode,J),J.return=A,A=J}return p(A);case K:return L=In(L),Ye(A,M,L,J)}if(ae(L))return ce(A,M,L,J);if(he(L)){if(ge=he(L),typeof ge!="function")throw Error(i(150));return L=ge.call(L),Ne(A,M,L,J)}if(typeof L.then=="function")return Ye(A,M,Zl(L),J);if(L.$$typeof===Y)return Ye(A,M,Yl(A,L),J);Jl(A,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,M!==null&&M.tag===6?(n(A,M.sibling),J=c(M,L),J.return=A,A=J):(n(A,M),J=Ji(L,A.mode,J),J.return=A,A=J),p(A)):n(A,M)}return function(A,M,L,J){try{Ds=0;var ge=Ye(A,M,L,J);return Br=null,ge}catch(pe){if(pe===Lr||pe===Kl)throw pe;var Be=It(29,pe,null,A.mode);return Be.lanes=J,Be.return=A,Be}}}var er=If(!0),Wf=If(!1),mn=!1;function cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uc(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 hn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(He&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=Gl(e),Uf(e,null,n),t}return Hl(e,r,t,n),Gl(e)}function Ls(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}function dc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var c=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var p={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=p:u=u.next=p,n=n.next}while(n!==null);u===null?c=u=t:u=u.next=t}else c=u=t;n={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var fc=!1;function Bs(){if(fc){var e=Ur;if(e!==null)throw e}}function qs(e,t,n,r){fc=!1;var c=e.updateQueue;mn=!1;var u=c.firstBaseUpdate,p=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var T=b,B=T.next;T.next=null,p===null?u=B:p.next=B,p=T;var $=e.alternate;$!==null&&($=$.updateQueue,b=$.lastBaseUpdate,b!==p&&(b===null?$.firstBaseUpdate=B:b.next=B,$.lastBaseUpdate=T))}if(u!==null){var P=c.baseState;p=0,$=B=T=null,b=u;do{var q=b.lane&-536870913,Q=q!==b.lane;if(Q?(De&q)===q:(r&q)===q){q!==0&&q===Dr&&(fc=!0),$!==null&&($=$.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ce=e,Ne=b;q=t;var Ye=n;switch(Ne.tag){case 1:if(ce=Ne.payload,typeof ce=="function"){P=ce.call(Ye,P,q);break e}P=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=Ne.payload,q=typeof ce=="function"?ce.call(Ye,P,q):ce,q==null)break e;P=x({},P,q);break e;case 2:mn=!0}}q=b.callback,q!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=c.callbacks,Q===null?c.callbacks=[q]:Q.push(q))}else Q={lane:q,tag:b.tag,payload:b.payload,callback:b.callback,next:null},$===null?(B=$=Q,T=P):$=$.next=Q,p|=q;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;Q=b,b=Q.next,Q.next=null,c.lastBaseUpdate=Q,c.shared.pending=null}}while(!0);$===null&&(T=P),c.baseState=T,c.firstBaseUpdate=B,c.lastBaseUpdate=$,u===null&&(c.shared.lanes=0),bn|=p,e.lanes=p,e.memoizedState=P}}function em(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function tm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)em(n[e],t)}var qr=j(null),Pl=j(0);function am(e,t){e=Ja,G(Pl,e),G(qr,t),Ja=e|t.baseLanes}function mc(){G(Pl,Ja),G(qr,qr.current)}function hc(){Ja=Pl.current,D(qr),D(Pl)}var Wt=j(null),ma=null;function xn(e){var t=e.alternate;G(tt,tt.current&1),G(Wt,e),ma===null&&(t===null||qr.current!==null||t.memoizedState!==null)&&(ma=e)}function pc(e){G(tt,tt.current),G(Wt,e),ma===null&&(ma=e)}function nm(e){e.tag===22?(G(tt,tt.current),G(Wt,e),ma===null&&(ma=e)):vn()}function vn(){G(tt,tt.current),G(Wt,Wt.current)}function ea(e){D(Wt),ma===e&&(ma=null),D(tt)}var tt=j(0);function Il(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Nu(n)||ju(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){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 Qa=0,Re=null,Ve=null,st=null,Wl=!1,Hr=!1,tr=!1,eo=0,Hs=0,Gr=null,_y=0;function We(){throw Error(i(321))}function xc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function vc(e,t,n,r,c,u){return Qa=u,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?Hm:Ac,tr=!1,u=n(r,c),tr=!1,Hr&&(u=sm(t,n,r,c)),rm(e),u}function rm(e){C.H=Vs;var t=Ve!==null&&Ve.next!==null;if(Qa=0,st=Ve=Re=null,Wl=!1,Hs=0,Gr=null,t)throw Error(i(300));e===null||lt||(e=e.dependencies,e!==null&&Fl(e)&&(lt=!0))}function sm(e,t,n,r){Re=e;var c=0;do{if(Hr&&(Gr=null),Hs=0,Hr=!1,25<=c)throw Error(i(301));if(c+=1,st=Ve=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}C.H=Gm,u=t(n,r)}while(Hr);return u}function Ry(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Gs(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Re.flags|=1024),t}function gc(){var e=eo!==0;return eo=0,e}function yc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function bc(e){if(Wl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wl=!1}Qa=0,st=Ve=Re=null,Hr=!1,Hs=eo=0,Gr=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?Re.memoizedState=st=e:st=st.next=e,st}function at(){if(Ve===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=st===null?Re.memoizedState:st.next;if(t!==null)st=t,Ve=e;else{if(e===null)throw Re.alternate===null?Error(i(467)):Error(i(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},st===null?Re.memoizedState=st=e:st=st.next=e}return st}function to(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gs(e){var t=Hs;return Hs+=1,Gr===null&&(Gr=[]),e=Zf(Gr,e,t),t=Re,(st===null?t.memoizedState:st.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?Hm:Ac),e}function ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gs(e);if(e.$$typeof===Y)return St(e)}throw Error(i(438,String(e)))}function Nc(e){var t=null,n=Re.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Re.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=to(),Re.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=re;return t.index++,n}function Va(e,t){return typeof t=="function"?t(e):t}function no(e){var t=at();return jc(t,Ve,e)}function jc(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var c=e.baseQueue,u=r.pending;if(u!==null){if(c!==null){var p=c.next;c.next=u.next,u.next=p}t.baseQueue=c=u,r.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var b=p=null,T=null,B=t,$=!1;do{var P=B.lane&-536870913;if(P!==B.lane?(De&P)===P:(Qa&P)===P){var q=B.revertLane;if(q===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),P===Dr&&($=!0);else if((Qa&q)===q){B=B.next,q===Dr&&($=!0);continue}else P={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},T===null?(b=T=P,p=u):T=T.next=P,Re.lanes|=q,bn|=q;P=B.action,tr&&n(u,P),u=B.hasEagerState?B.eagerState:n(u,P)}else q={lane:P,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},T===null?(b=T=q,p=u):T=T.next=q,Re.lanes|=P,bn|=P;B=B.next}while(B!==null&&B!==t);if(T===null?p=u:T.next=b,!Pt(u,e.memoizedState)&&(lt=!0,$&&(n=Ur,n!==null)))throw n;e.memoizedState=u,e.baseState=p,e.baseQueue=T,r.lastRenderedState=u}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Sc(e){var t=at(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,c=n.pending,u=t.memoizedState;if(c!==null){n.pending=null;var p=c=c.next;do u=e(u,p.action),p=p.next;while(p!==c);Pt(u,t.memoizedState)||(lt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,r]}function lm(e,t,n){var r=Re,c=at(),u=Le;if(u){if(n===void 0)throw Error(i(407));n=n()}else n=t();var p=!Pt((Ve||c).memoizedState,n);if(p&&(c.memoizedState=n,lt=!0),c=c.queue,Cc(cm.bind(null,r,c,e),[e]),c.getSnapshot!==t||p||st!==null&&st.memoizedState.tag&1){if(r.flags|=2048,Qr(9,{destroy:void 0},im.bind(null,r,c,n,t),null),Xe===null)throw Error(i(349));u||(Qa&127)!==0||om(r,t,n)}return n}function om(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t=to(),Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function im(e,t,n,r){t.value=n,t.getSnapshot=r,um(t)&&dm(e)}function cm(e,t,n){return n(function(){um(t)&&dm(e)})}function um(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function dm(e){var t=Xn(e,2);t!==null&&Xt(t,e,2)}function wc(e){var t=zt();if(typeof e=="function"){var n=e;if(e=n(),tr){ga(!0);try{n()}finally{ga(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:e},t}function fm(e,t,n,r){return e.baseState=n,jc(e,Ve,typeof r=="function"?r:Va)}function ky(e,t,n,r,c){if(lo(e))throw Error(i(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){u.listeners.push(p)}};C.T!==null?n(!0):u.isTransition=!1,r(u),n=t.pending,n===null?(u.next=t.pending=u,mm(t,u)):(u.next=n.next,t.pending=n.next=u)}}function mm(e,t){var n=t.action,r=t.payload,c=e.state;if(t.isTransition){var u=C.T,p={};C.T=p;try{var b=n(c,r),T=C.S;T!==null&&T(p,b),hm(e,t,b)}catch(B){Ec(e,t,B)}finally{u!==null&&p.types!==null&&(u.types=p.types),C.T=u}}else try{u=n(c,r),hm(e,t,u)}catch(B){Ec(e,t,B)}}function hm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){pm(e,t,r)},function(r){return Ec(e,t,r)}):pm(e,t,n)}function pm(e,t,n){t.status="fulfilled",t.value=n,xm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,mm(e,n)))}function Ec(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,xm(t),t=t.next;while(t!==r)}e.action=null}function xm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vm(e,t){return t}function gm(e,t){if(Le){var n=Xe.formState;if(n!==null){e:{var r=Re;if(Le){if(Ke){t:{for(var c=Ke,u=fa;c.nodeType!==8;){if(!u){c=null;break t}if(c=ha(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ke=ha(c.nextSibling),r=c.data==="F!";break e}}dn(r)}r=!1}r&&(t=n[0])}}return n=zt(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vm,lastRenderedState:t},n.queue=r,n=Lm.bind(null,Re,r),r.dispatch=n,r=wc(!1),u=Mc.bind(null,Re,!1,r.queue),r=zt(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,n=ky.bind(null,Re,c,u,n),c.dispatch=n,r.memoizedState=e,[t,n,!1]}function ym(e){var t=at();return bm(t,Ve,e)}function bm(e,t,n){if(t=jc(e,t,vm)[0],e=no(Va)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Gs(t)}catch(p){throw p===Lr?Kl:p}else r=t;t=at();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(Re.flags|=2048,Qr(9,{destroy:void 0},My.bind(null,c,n),null)),[r,u,e]}function My(e,t){e.action=t}function Nm(e){var t=at(),n=Ve;if(n!==null)return bm(t,n,e);at(),t=t.memoizedState,n=at();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qr(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Re.updateQueue,t===null&&(t=to(),Re.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function jm(){return at().memoizedState}function ro(e,t,n,r){var c=zt();Re.flags|=e,c.memoizedState=Qr(1|t,{destroy:void 0},n,r===void 0?null:r)}function so(e,t,n,r){var c=at();r=r===void 0?null:r;var u=c.memoizedState.inst;Ve!==null&&r!==null&&xc(r,Ve.memoizedState.deps)?c.memoizedState=Qr(t,u,n,r):(Re.flags|=e,c.memoizedState=Qr(1|t,u,n,r))}function Sm(e,t){ro(8390656,8,e,t)}function Cc(e,t){so(2048,8,e,t)}function Ay(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=to(),Re.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function wm(e){var t=at().memoizedState;return Ay({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Em(e,t){return so(4,2,e,t)}function Cm(e,t){return so(4,4,e,t)}function Tm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _m(e,t,n){n=n!=null?n.concat([e]):null,so(4,4,Tm.bind(null,t,e),n)}function Tc(){}function Rm(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&xc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function km(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&xc(t,r[1]))return r[0];if(r=e(),tr){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r}function _c(e,t,n){return n===void 0||(Qa&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Mh(),Re.lanes|=e,bn|=e,n)}function Mm(e,t,n,r){return Pt(n,t)?n:qr.current!==null?(e=_c(e,n,r),Pt(e,t)||(lt=!0),e):(Qa&42)===0||(Qa&1073741824)!==0&&(De&261930)===0?(lt=!0,e.memoizedState=n):(e=Mh(),Re.lanes|=e,bn|=e,t)}function Am(e,t,n,r,c){var u=F.p;F.p=u!==0&&8>u?u:8;var p=C.T,b={};C.T=b,Mc(e,!1,t,n);try{var T=c(),B=C.S;if(B!==null&&B(b,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var $=Ty(T,r);Qs(e,t,$,na(e))}else Qs(e,t,r,na(e))}catch(P){Qs(e,t,{then:function(){},status:"rejected",reason:P},na())}finally{F.p=u,p!==null&&b.types!==null&&(p.types=b.types),C.T=p}}function Oy(){}function Rc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var c=Om(e).queue;Am(e,c,t,X,n===null?Oy:function(){return zm(e),n(r)})}function Om(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:X},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zm(e){var t=Om(e);t.next===null&&(t=e.alternate.memoizedState),Qs(e,t.next.queue,{},na())}function kc(){return St(sl)}function Dm(){return at().memoizedState}function Um(){return at().memoizedState}function zy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=na();e=hn(n);var r=pn(t,e,n);r!==null&&(Xt(r,t,n),Ls(r,t,n)),t={cache:sc()},e.payload=t;return}t=t.return}}function Dy(e,t,n){var r=na();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lo(e)?Bm(t,n):(n=$i(e,t,n,r),n!==null&&(Xt(n,e,r),qm(n,t,r)))}function Lm(e,t,n){var r=na();Qs(e,t,n,r)}function Qs(e,t,n,r){var c={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lo(e))Bm(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var p=t.lastRenderedState,b=u(p,n);if(c.hasEagerState=!0,c.eagerState=b,Pt(b,p))return Hl(e,t,c,0),Xe===null&&ql(),!1}catch{}if(n=$i(e,t,c,r),n!==null)return Xt(n,e,r),qm(n,t,r),!0}return!1}function Mc(e,t,n,r){if(r={lane:2,revertLane:cu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lo(e)){if(t)throw Error(i(479))}else t=$i(e,n,r,2),t!==null&&Xt(t,e,2)}function lo(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function Bm(e,t){Hr=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qm(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}var Vs={readContext:St,use:ao,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};Vs.useEffectEvent=We;var Hm={readContext:St,use:ao,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Sm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ro(4194308,4,Tm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){ro(4,2,e,t)},useMemo:function(e,t){var n=zt();t=t===void 0?null:t;var r=e();if(tr){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zt();if(n!==void 0){var c=n(t);if(tr){ga(!0);try{n(t)}finally{ga(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=Dy.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=wc(e);var t=e.queue,n=Lm.bind(null,Re,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Tc,useDeferredValue:function(e,t){var n=zt();return _c(n,e,t)},useTransition:function(){var e=wc(!1);return e=Am.bind(null,Re,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Re,c=zt();if(Le){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xe===null)throw Error(i(349));(De&127)!==0||om(r,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,Sm(cm.bind(null,r,u,e),[e]),r.flags|=2048,Qr(9,{destroy:void 0},im.bind(null,r,u,n,t),null),n},useId:function(){var e=zt(),t=Xe.identifierPrefix;if(Le){var n=Ra,r=_a;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=eo++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=_y++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kc,useFormState:gm,useActionState:gm,useOptimistic:function(e){var t=zt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Mc.bind(null,Re,!0,n),n.dispatch=t,[e,t]},useMemoCache:Nc,useCacheRefresh:function(){return zt().memoizedState=zy.bind(null,Re)},useEffectEvent:function(e){var t=zt(),n={impl:e};return t.memoizedState=n,function(){if((He&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ac={readContext:St,use:ao,useCallback:Rm,useContext:St,useEffect:Cc,useImperativeHandle:_m,useInsertionEffect:Em,useLayoutEffect:Cm,useMemo:km,useReducer:no,useRef:jm,useState:function(){return no(Va)},useDebugValue:Tc,useDeferredValue:function(e,t){var n=at();return Mm(n,Ve.memoizedState,e,t)},useTransition:function(){var e=no(Va)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:lm,useId:Dm,useHostTransitionStatus:kc,useFormState:ym,useActionState:ym,useOptimistic:function(e,t){var n=at();return fm(n,Ve,e,t)},useMemoCache:Nc,useCacheRefresh:Um};Ac.useEffectEvent=wm;var Gm={readContext:St,use:ao,useCallback:Rm,useContext:St,useEffect:Cc,useImperativeHandle:_m,useInsertionEffect:Em,useLayoutEffect:Cm,useMemo:km,useReducer:Sc,useRef:jm,useState:function(){return Sc(Va)},useDebugValue:Tc,useDeferredValue:function(e,t){var n=at();return Ve===null?_c(n,e,t):Mm(n,Ve.memoizedState,e,t)},useTransition:function(){var e=Sc(Va)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:lm,useId:Dm,useHostTransitionStatus:kc,useFormState:Nm,useActionState:Nm,useOptimistic:function(e,t){var n=at();return Ve!==null?fm(n,Ve,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Nc,useCacheRefresh:Um};Gm.useEffectEvent=wm;function Oc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:x({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=na(),c=hn(r);c.payload=t,n!=null&&(c.callback=n),t=pn(e,c,r),t!==null&&(Xt(t,e,r),Ls(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=na(),c=hn(r);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=pn(e,c,r),t!==null&&(Xt(t,e,r),Ls(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=na(),r=hn(n);r.tag=2,t!=null&&(r.callback=t),t=pn(e,r,n),t!==null&&(Xt(t,e,n),Ls(t,e,n))}};function Qm(e,t,n,r,c,u,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,p):t.prototype&&t.prototype.isPureReactComponent?!Rs(n,r)||!Rs(c,u):!0}function Vm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zc.enqueueReplaceState(t,t.state,null)}function ar(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=x({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Fm(e){Bl(e)}function Ym(e){console.error(e)}function Xm(e){Bl(e)}function oo(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Km(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Dc(e,t,n){return n=hn(n),n.tag=3,n.payload={element:null},n.callback=function(){oo(e,t)},n}function $m(e){return e=hn(e),e.tag=3,e}function Zm(e,t,n,r){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var u=r.value;e.payload=function(){return c(u)},e.callback=function(){Km(t,n,r)}}var p=n.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){Km(t,n,r),typeof c!="function"&&(Nn===null?Nn=new Set([this]):Nn.add(this));var b=r.stack;this.componentDidCatch(r.value,{componentStack:b!==null?b:""})})}function Uy(e,t,n,r,c){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&zr(t,n,c,!0),n=Wt.current,n!==null){switch(n.tag){case 31:case 13:return ma===null?bo():n.alternate===null&&et===0&&(et=3),n.flags&=-257,n.flags|=65536,n.lanes=c,r===$l?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),lu(e,r,c)),!1;case 22:return n.flags|=65536,r===$l?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),lu(e,r,c)),!1}throw Error(i(435,n.tag))}return lu(e,r,c),bo(),!1}if(Le)return t=Wt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==ec&&(e=Error(i(422),{cause:r}),As(ca(e,n)))):(r!==ec&&(t=Error(i(423),{cause:r}),As(ca(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=ca(r,n),c=Dc(e.stateNode,r,c),dc(e,c),et!==4&&(et=2)),!1;var u=Error(i(520),{cause:r});if(u=ca(u,n),Ps===null?Ps=[u]:Ps.push(u),et!==4&&(et=2),t===null)return!0;r=ca(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=Dc(n.stateNode,r,e),dc(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Nn===null||!Nn.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=$m(c),Zm(c,e,n,r),dc(n,c),!1}n=n.return}while(n!==null);return!1}var Uc=Error(i(461)),lt=!1;function wt(e,t,n,r){t.child=e===null?Wf(t,null,n,r):er(t,e.child,n,r)}function Jm(e,t,n,r,c){n=n.render;var u=t.ref;if("ref"in r){var p={};for(var b in r)b!=="ref"&&(p[b]=r[b])}else p=r;return Jn(t),r=vc(e,t,n,p,u,c),b=gc(),e!==null&&!lt?(yc(e,t,c),Fa(e,t,c)):(Le&&b&&Ii(t),t.flags|=1,wt(e,t,r,c),t.child)}function Pm(e,t,n,r,c){if(e===null){var u=n.type;return typeof u=="function"&&!Zi(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Im(e,t,u,r,c)):(e=Ql(n.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Fc(e,c)){var p=u.memoizedProps;if(n=n.compare,n=n!==null?n:Rs,n(p,r)&&e.ref===t.ref)return Fa(e,t,c)}return t.flags|=1,e=Ba(u,r),e.ref=t.ref,e.return=t,t.child=e}function Im(e,t,n,r,c){if(e!==null){var u=e.memoizedProps;if(Rs(u,r)&&e.ref===t.ref)if(lt=!1,t.pendingProps=r=u,Fc(e,c))(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,Fa(e,t,c)}return Lc(e,t,n,r,c)}function Wm(e,t,n,r){var c=r.children,u=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(u=u!==null?u.baseLanes|n:n,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~u}else r=0,t.child=null;return eh(e,t,u,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xl(t,u!==null?u.cachePool:null),u!==null?am(t,u):mc(),nm(t);else return r=t.lanes=536870912,eh(e,t,u!==null?u.baseLanes|n:n,n,r)}else u!==null?(Xl(t,u.cachePool),am(t,u),vn(),t.memoizedState=null):(e!==null&&Xl(t,null),mc(),vn());return wt(e,t,c,n),t.child}function Fs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function eh(e,t,n,r,c){var u=oc();return u=u===null?null:{parent:rt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Xl(t,null),mc(),nm(t),e!==null&&zr(e,t,r,!0),t.childLanes=c,null}function io(e,t){return t=uo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function th(e,t,n){return er(t,e.child,null,n),e=io(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function Ly(e,t,n){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(r.mode==="hidden")return e=io(t,r),t.lanes=536870912,Fs(null,e);if(pc(t),(e=Ke)?(e=mp(e,fa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cn!==null?{id:_a,overflow:Ra}:null,retryLane:536870912,hydrationErrors:null},n=Bf(e),n.return=t,t.child=n,jt=t,Ke=null)):e=null,e===null)throw dn(t);return t.lanes=536870912,null}return io(t,r)}var u=e.memoizedState;if(u!==null){var p=u.dehydrated;if(pc(t),c)if(t.flags&256)t.flags&=-257,t=th(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(lt||zr(e,t,n,!1),c=(n&e.childLanes)!==0,lt||c){if(r=Xe,r!==null&&(p=qt(r,n),p!==0&&p!==u.retryLane))throw u.retryLane=p,Xn(e,p),Xt(r,e,p),Uc;bo(),t=th(e,t,n)}else e=u.treeContext,Ke=ha(p.nextSibling),jt=t,Le=!0,un=null,fa=!1,e!==null&&Gf(t,e),t=io(t,r),t.flags|=4096;return t}return e=Ba(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function co(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Lc(e,t,n,r,c){return Jn(t),n=vc(e,t,n,r,void 0,c),r=gc(),e!==null&&!lt?(yc(e,t,c),Fa(e,t,c)):(Le&&r&&Ii(t),t.flags|=1,wt(e,t,n,c),t.child)}function ah(e,t,n,r,c,u){return Jn(t),t.updateQueue=null,n=sm(t,r,n,c),rm(e),r=gc(),e!==null&&!lt?(yc(e,t,u),Fa(e,t,u)):(Le&&r&&Ii(t),t.flags|=1,wt(e,t,n,u),t.child)}function nh(e,t,n,r,c){if(Jn(t),t.stateNode===null){var u=kr,p=n.contextType;typeof p=="object"&&p!==null&&(u=St(p)),u=new n(r,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=zc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=r,u.state=t.memoizedState,u.refs={},cc(t),p=n.contextType,u.context=typeof p=="object"&&p!==null?St(p):kr,u.state=t.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(Oc(t,n,p,r),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(p=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),p!==u.state&&zc.enqueueReplaceState(u,u.state,null),qs(t,r,u,c),Bs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,T=ar(n,b);u.props=T;var B=u.context,$=n.contextType;p=kr,typeof $=="object"&&$!==null&&(p=St($));var P=n.getDerivedStateFromProps;$=typeof P=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,$||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||B!==p)&&Vm(t,u,r,p),mn=!1;var q=t.memoizedState;u.state=q,qs(t,r,u,c),Bs(),B=t.memoizedState,b||q!==B||mn?(typeof P=="function"&&(Oc(t,n,P,r),B=t.memoizedState),(T=mn||Qm(t,n,T,r,q,B,p))?($||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=B),u.props=r,u.state=B,u.context=p,r=T):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,uc(e,t),p=t.memoizedProps,$=ar(n,p),u.props=$,P=t.pendingProps,q=u.context,B=n.contextType,T=kr,typeof B=="object"&&B!==null&&(T=St(B)),b=n.getDerivedStateFromProps,(B=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==P||q!==T)&&Vm(t,u,r,T),mn=!1,q=t.memoizedState,u.state=q,qs(t,r,u,c),Bs();var Q=t.memoizedState;p!==P||q!==Q||mn||e!==null&&e.dependencies!==null&&Fl(e.dependencies)?(typeof b=="function"&&(Oc(t,n,b,r),Q=t.memoizedState),($=mn||Qm(t,n,$,r,q,Q,T)||e!==null&&e.dependencies!==null&&Fl(e.dependencies))?(B||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,Q,T),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,Q,T)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=Q),u.props=r,u.state=Q,u.context=T,r=$):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),r=!1)}return u=r,co(e,t),r=(t.flags&128)!==0,u||r?(u=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&r?(t.child=er(t,e.child,null,c),t.child=er(t,null,n,c)):wt(e,t,n,c),t.memoizedState=u.state,e=t.child):e=Fa(e,t,c),e}function rh(e,t,n,r){return $n(),t.flags|=256,wt(e,t,n,r),t.child}var Bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Kf()}}function Hc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=aa),e}function sh(e,t,n){var r=t.pendingProps,c=!1,u=(t.flags&128)!==0,p;if((p=u)||(p=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),p&&(c=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?xn(t):vn(),(e=Ke)?(e=mp(e,fa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cn!==null?{id:_a,overflow:Ra}:null,retryLane:536870912,hydrationErrors:null},n=Bf(e),n.return=t,t.child=n,jt=t,Ke=null)):e=null,e===null)throw dn(t);return ju(e)?t.lanes=32:t.lanes=536870912,null}var b=r.children;return r=r.fallback,c?(vn(),c=t.mode,b=uo({mode:"hidden",children:b},c),r=Kn(r,c,n,null),b.return=t,r.return=t,b.sibling=r,t.child=b,r=t.child,r.memoizedState=qc(n),r.childLanes=Hc(e,p,n),t.memoizedState=Bc,Fs(null,r)):(xn(t),Gc(t,b))}var T=e.memoizedState;if(T!==null&&(b=T.dehydrated,b!==null)){if(u)t.flags&256?(xn(t),t.flags&=-257,t=Qc(e,t,n)):t.memoizedState!==null?(vn(),t.child=e.child,t.flags|=128,t=null):(vn(),b=r.fallback,c=t.mode,r=uo({mode:"visible",children:r.children},c),b=Kn(b,c,n,null),b.flags|=2,r.return=t,b.return=t,r.sibling=b,t.child=r,er(t,e.child,null,n),r=t.child,r.memoizedState=qc(n),r.childLanes=Hc(e,p,n),t.memoizedState=Bc,t=Fs(null,r));else if(xn(t),ju(b)){if(p=b.nextSibling&&b.nextSibling.dataset,p)var B=p.dgst;p=B,r=Error(i(419)),r.stack="",r.digest=p,As({value:r,source:null,stack:null}),t=Qc(e,t,n)}else if(lt||zr(e,t,n,!1),p=(n&e.childLanes)!==0,lt||p){if(p=Xe,p!==null&&(r=qt(p,n),r!==0&&r!==T.retryLane))throw T.retryLane=r,Xn(e,r),Xt(p,e,r),Uc;Nu(b)||bo(),t=Qc(e,t,n)}else Nu(b)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Ke=ha(b.nextSibling),jt=t,Le=!0,un=null,fa=!1,e!==null&&Gf(t,e),t=Gc(t,r.children),t.flags|=4096);return t}return c?(vn(),b=r.fallback,c=t.mode,T=e.child,B=T.sibling,r=Ba(T,{mode:"hidden",children:r.children}),r.subtreeFlags=T.subtreeFlags&65011712,B!==null?b=Ba(B,b):(b=Kn(b,c,n,null),b.flags|=2),b.return=t,r.return=t,r.sibling=b,t.child=r,Fs(null,r),r=t.child,b=e.child.memoizedState,b===null?b=qc(n):(c=b.cachePool,c!==null?(T=rt._currentValue,c=c.parent!==T?{parent:T,pool:T}:c):c=Kf(),b={baseLanes:b.baseLanes|n,cachePool:c}),r.memoizedState=b,r.childLanes=Hc(e,p,n),t.memoizedState=Bc,Fs(e.child,r)):(xn(t),n=e.child,e=n.sibling,n=Ba(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=n,t.memoizedState=null,n)}function Gc(e,t){return t=uo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function uo(e,t){return e=It(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return er(t,e.child,null,n),e=Gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),nc(e.return,t,n)}function Vc(e,t,n,r,c,u){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:c,treeForkCount:u}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=r,p.tail=n,p.tailMode=c,p.treeForkCount=u)}function oh(e,t,n){var r=t.pendingProps,c=r.revealOrder,u=r.tail;r=r.children;var p=tt.current,b=(p&2)!==0;if(b?(p=p&1|2,t.flags|=128):p&=1,G(tt,p),wt(e,t,r,n),r=Le?Ms:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lh(e,n,t);else if(e.tag===19)lh(e,n,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(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&Il(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Vc(t,!1,c,n,u,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Il(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Vc(t,!0,n,null,u,r);break;case"together":Vc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Fa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(zr(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ba(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ba(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fl(e)))}function By(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),fn(t,rt,e.memoizedState.cache),$n();break;case 27:case 5:z(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:fn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,pc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(xn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?sh(e,t,n):(xn(t),e=Fa(e,t,n),e!==null?e.sibling:null);xn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(zr(e,t,n,!1),r=(n&t.childLanes)!==0),c){if(r)return oh(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),G(tt,tt.current),r)break;return null;case 22:return t.lanes=0,Wm(e,t,n,t.pendingProps);case 24:fn(t,rt,e.memoizedState.cache)}return Fa(e,t,n)}function ih(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)lt=!0;else{if(!Fc(e,n)&&(t.flags&128)===0)return lt=!1,By(e,t,n);lt=(e.flags&131072)!==0}else lt=!1,Le&&(t.flags&1048576)!==0&&Hf(t,Ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=In(t.elementType),t.type=e,typeof e=="function")Zi(e)?(r=ar(e,r),t.tag=1,t=nh(null,t,e,r,n)):(t.tag=0,t=Lc(null,t,e,r,n));else{if(e!=null){var c=e.$$typeof;if(c===I){t.tag=11,t=Jm(null,t,e,r,n);break e}else if(c===H){t.tag=14,t=Pm(null,t,e,r,n);break e}}throw t=Te(e)||e,Error(i(306,t,""))}}return t;case 0:return Lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,c=ar(r,t.pendingProps),nh(e,t,r,c,n);case 3:e:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var u=t.memoizedState;c=u.element,uc(e,t),qs(t,r,null,n);var p=t.memoizedState;if(r=p.cache,fn(t,rt,r),r!==u.cache&&rc(t,[rt],n,!0),Bs(),r=p.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=rh(e,t,r,n);break e}else if(r!==c){c=ca(Error(i(424)),t),As(c),t=rh(e,t,r,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ke=ha(e.firstChild),jt=t,Le=!0,un=null,fa=!0,n=Wf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($n(),r===c){t=Fa(e,t,n);break e}wt(e,t,r,n)}t=t.child}return t;case 26:return co(e,t),e===null?(n=yp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Le||(n=t.type,e=t.pendingProps,r=To(me.current).createElement(n),r[Nt]=t,r[Ht]=e,Et(r,n,e),vt(r),t.stateNode=r):t.memoizedState=yp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return z(t),e===null&&Le&&(r=t.stateNode=xp(t.type,t.pendingProps,me.current),jt=t,fa=!0,c=Ke,En(t.type)?(Su=c,Ke=ha(r.firstChild)):Ke=c),wt(e,t,t.pendingProps.children,n),co(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=r=Ke)&&(r=hb(r,t.type,t.pendingProps,fa),r!==null?(t.stateNode=r,jt=t,Ke=ha(r.firstChild),fa=!1,c=!0):c=!1),c||dn(t)),z(t),c=t.type,u=t.pendingProps,p=e!==null?e.memoizedProps:null,r=u.children,gu(c,u)?r=null:p!==null&&gu(c,p)&&(t.flags|=32),t.memoizedState!==null&&(c=vc(e,t,Ry,null,null,n),sl._currentValue=c),co(e,t),wt(e,t,r,n),t.child;case 6:return e===null&&Le&&((e=n=Ke)&&(n=pb(n,t.pendingProps,fa),n!==null?(t.stateNode=n,jt=t,Ke=null,e=!0):e=!1),e||dn(t)),null;case 13:return sh(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=er(t,null,r,n):wt(e,t,r,n),t.child;case 11:return Jm(e,t,t.type,t.pendingProps,n);case 7:return wt(e,t,t.pendingProps,n),t.child;case 8:return wt(e,t,t.pendingProps.children,n),t.child;case 12:return wt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,fn(t,t.type,r.value),wt(e,t,r.children,n),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Jn(t),c=St(c),r=r(c),t.flags|=1,wt(e,t,r,n),t.child;case 14:return Pm(e,t,t.type,t.pendingProps,n);case 15:return Im(e,t,t.type,t.pendingProps,n);case 19:return oh(e,t,n);case 31:return Ly(e,t,n);case 22:return Wm(e,t,n,t.pendingProps);case 24:return Jn(t),r=St(rt),e===null?(c=oc(),c===null&&(c=Xe,u=sc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:r,cache:c},cc(t),fn(t,rt,c)):((e.lanes&n)!==0&&(uc(e,t),qs(t,null,null,n),Bs()),c=e.memoizedState,u=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),fn(t,rt,r)):(r=u.cache,fn(t,rt,r),r!==c.cache&&rc(t,[rt],n,!0))),wt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ya(e){e.flags|=4}function Yc(e,t,n,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Dh())e.flags|=8192;else throw Wn=$l,ic}else e.flags&=-16777217}function ch(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wp(t))if(Dh())e.flags|=8192;else throw Wn=$l,ic}function fo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_t():536870912,e.lanes|=t,Xr|=t)}function Ys(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qy(e,t,n){var r=t.pendingProps;switch(Wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return $e(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ga(rt),U(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Or(t)?Ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tc())),$e(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Ya(t),u!==null?($e(t),ch(t,u)):($e(t),Yc(t,c,null,r,n))):u?u!==e.memoizedState?(Ya(t),$e(t),ch(t,u)):($e(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ya(t),$e(t),Yc(t,c,e,r,n)),null;case 27:if(Se(t),n=me.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ya(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return $e(t),null}e=Z.current,Or(t)?Qf(t):(e=xp(c,r,n),t.stateNode=e,Ya(t))}return $e(t),null;case 5:if(Se(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ya(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return $e(t),null}if(u=Z.current,Or(t))Qf(t);else{var p=To(me.current);switch(u){case 1:u=p.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=p.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=p.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?p.createElement("select",{is:r.is}):p.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?p.createElement(c,{is:r.is}):p.createElement(c)}}u[Nt]=t,u[Ht]=r;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)u.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=u;e:switch(Et(u,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ya(t)}}return $e(t),Yc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ya(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=me.current,Or(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,c=jt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||sp(e.nodeValue,n)),e||dn(t,!0)}else e=To(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return $e(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Or(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Nt]=t}else $n(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else n=tc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(i(558))}return $e(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Or(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Nt]=t}else $n(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),c=!1}else c=tc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==c&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fo(t,t.updateQueue),$e(t),null);case 4:return U(),e===null&&mu(t.stateNode.containerInfo),$e(t),null;case 10:return Ga(t.type),$e(t),null;case 19:if(D(tt),r=t.memoizedState,r===null)return $e(t),null;if(c=(t.flags&128)!==0,u=r.rendering,u===null)if(c)Ys(r,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Il(e),u!==null){for(t.flags|=128,Ys(r,!1),e=u.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Lf(n,e),n=n.sibling;return G(tt,tt.current&1|2),Le&&qa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&At()>vo&&(t.flags|=128,c=!0,Ys(r,!1),t.lanes=4194304)}else{if(!c)if(e=Il(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),Ys(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!Le)return $e(t),null}else 2*At()-r.renderingStartTime>vo&&n!==536870912&&(t.flags|=128,c=!0,Ys(r,!1),t.lanes=4194304);r.isBackwards?(u.sibling=t.child,t.child=u):(e=r.last,e!==null?e.sibling=u:t.child=u,r.last=u)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=At(),e.sibling=null,n=tt.current,G(tt,c?n&1|2:n&1),Le&&qa(t,r.treeForkCount),e):($e(t),null);case 22:case 23:return ea(t),hc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),n=t.updateQueue,n!==null&&fo(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&D(Pn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ga(rt),$e(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hy(e,t){switch(Wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ga(rt),U(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(i(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(tt),null;case 4:return U(),null;case 10:return Ga(t.type),null;case 22:case 23:return ea(t),hc(),e!==null&&D(Pn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ga(rt),null;case 25:return null;default:return null}}function uh(e,t){switch(Wi(t),t.tag){case 3:Ga(rt),U();break;case 26:case 27:case 5:Se(t);break;case 4:U();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:D(tt);break;case 10:Ga(t.type);break;case 22:case 23:ea(t),hc(),e!==null&&D(Pn);break;case 24:Ga(rt)}}function Xs(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var c=r.next;n=c;do{if((n.tag&e)===e){r=void 0;var u=n.create,p=n.inst;r=u(),p.destroy=r}n=n.next}while(n!==c)}}catch(b){Qe(t,t.return,b)}}function gn(e,t,n){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var u=c.next;r=u;do{if((r.tag&e)===e){var p=r.inst,b=p.destroy;if(b!==void 0){p.destroy=void 0,c=t;var T=n,B=b;try{B()}catch($){Qe(c,T,$)}}}r=r.next}while(r!==u)}}catch($){Qe(t,t.return,$)}}function dh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{tm(t,n)}catch(r){Qe(e,e.return,r)}}}function fh(e,t,n){n.props=ar(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Qe(e,t,r)}}function Ks(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(c){Qe(e,t,c)}}function ka(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(c){Qe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){Qe(e,t,c)}else n.current=null}function mh(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(c){Qe(e,e.return,c)}}function Xc(e,t,n){try{var r=e.stateNode;ib(r,e.type,n,t),r[Ht]=t}catch(c){Qe(e,e.return,c)}}function hh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&En(e.type)||e.tag===4}function Kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&En(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ua));else if(r!==4&&(r===27&&En(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function mo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&En(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(mo(e,t,n),e=e.sibling;e!==null;)mo(e,t,n),e=e.sibling}function ph(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Et(t,r,n),t[Nt]=e,t[Ht]=n}catch(u){Qe(e,e.return,u)}}var Xa=!1,ot=!1,Zc=!1,xh=typeof WeakSet=="function"?WeakSet:Set,gt=null;function Gy(e,t){if(e=e.containerInfo,xu=zo,e=_f(e),Qi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var c=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var p=0,b=-1,T=-1,B=0,$=0,P=e,q=null;t:for(;;){for(var Q;P!==n||c!==0&&P.nodeType!==3||(b=p+c),P!==u||r!==0&&P.nodeType!==3||(T=p+r),P.nodeType===3&&(p+=P.nodeValue.length),(Q=P.firstChild)!==null;)q=P,P=Q;for(;;){if(P===e)break t;if(q===n&&++B===c&&(b=p),q===u&&++$===r&&(T=p),(Q=P.nextSibling)!==null)break;P=q,q=P.parentNode}P=Q}n=b===-1||T===-1?null:{start:b,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(vu={focusedElem:e,selectionRange:n},zo=!1,gt=t;gt!==null;)if(t=gt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gt=e;else for(;gt!==null;){switch(t=gt,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,c=u.memoizedProps,u=u.memoizedState,r=n.stateNode;try{var ce=ar(n.type,c);e=r.getSnapshotBeforeUpdate(ce,u),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){Qe(n,n.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)bu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,gt=e;break}gt=t.return}}function vh(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:$a(e,n),r&4&&Xs(5,n);break;case 1:if($a(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(p){Qe(n,n.return,p)}else{var c=ar(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Qe(n,n.return,p)}}r&64&&dh(n),r&512&&Ks(n,n.return);break;case 3:if($a(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{tm(e,t)}catch(p){Qe(n,n.return,p)}}break;case 27:t===null&&r&4&&ph(n);case 26:case 5:$a(e,n),t===null&&r&4&&mh(n),r&512&&Ks(n,n.return);break;case 12:$a(e,n);break;case 31:$a(e,n),r&4&&bh(e,n);break;case 13:$a(e,n),r&4&&Nh(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Jy.bind(null,n),xb(e,n))));break;case 22:if(r=n.memoizedState!==null||Xa,!r){t=t!==null&&t.memoizedState!==null||ot,c=Xa;var u=ot;Xa=r,(ot=t)&&!u?Za(e,n,(n.subtreeFlags&8772)!==0):$a(e,n),Xa=c,ot=u}break;case 30:break;default:$a(e,n)}}function gh(e){var t=e.alternate;t!==null&&(e.alternate=null,gh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ei(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 Je=null,Qt=!1;function Ka(e,t,n){for(n=n.child;n!==null;)yh(e,t,n),n=n.sibling}function yh(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(qn,n)}catch{}switch(n.tag){case 26:ot||ka(n,t),Ka(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ot||ka(n,t);var r=Je,c=Qt;En(n.type)&&(Je=n.stateNode,Qt=!1),Ka(e,t,n),al(n.stateNode),Je=r,Qt=c;break;case 5:ot||ka(n,t);case 6:if(r=Je,c=Qt,Je=null,Ka(e,t,n),Je=r,Qt=c,Je!==null)if(Qt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(n.stateNode)}catch(u){Qe(n,t,u)}else try{Je.removeChild(n.stateNode)}catch(u){Qe(n,t,u)}break;case 18:Je!==null&&(Qt?(e=Je,dp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),es(e)):dp(Je,n.stateNode));break;case 4:r=Je,c=Qt,Je=n.stateNode.containerInfo,Qt=!0,Ka(e,t,n),Je=r,Qt=c;break;case 0:case 11:case 14:case 15:gn(2,n,t),ot||gn(4,n,t),Ka(e,t,n);break;case 1:ot||(ka(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&fh(n,t,r)),Ka(e,t,n);break;case 21:Ka(e,t,n);break;case 22:ot=(r=ot)||n.memoizedState!==null,Ka(e,t,n),ot=r;break;default:Ka(e,t,n)}}function bh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{es(e)}catch(n){Qe(t,t.return,n)}}}function Nh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{es(e)}catch(n){Qe(t,t.return,n)}}function Qy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xh),t;default:throw Error(i(435,e.tag))}}function ho(e,t){var n=Qy(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var c=Py.bind(null,e,r);r.then(c,c)}})}function Vt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var c=n[r],u=e,p=t,b=p;e:for(;b!==null;){switch(b.tag){case 27:if(En(b.type)){Je=b.stateNode,Qt=!1;break e}break;case 5:Je=b.stateNode,Qt=!1;break e;case 3:case 4:Je=b.stateNode.containerInfo,Qt=!0;break e}b=b.return}if(Je===null)throw Error(i(160));yh(u,p,c),Je=null,Qt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)jh(t,e),t=t.sibling}var Na=null;function jh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Ft(e),r&4&&(gn(3,e,e.return),Xs(3,e),gn(5,e,e.return));break;case 1:Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),r&64&&Xa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var c=Na;if(Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),r&4){var u=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":u=c.getElementsByTagName("title")[0],(!u||u[bs]||u[Nt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(r),c.head.insertBefore(u,c.querySelector("head > title"))),Et(u,r,n),u[Nt]=e,vt(u),r=u;break e;case"link":var p=jp("link","href",c).get(r+(n.href||""));if(p){for(var b=0;b<p.length;b++)if(u=p[b],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){p.splice(b,1);break t}}u=c.createElement(r),Et(u,r,n),c.head.appendChild(u);break;case"meta":if(p=jp("meta","content",c).get(r+(n.content||""))){for(b=0;b<p.length;b++)if(u=p[b],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){p.splice(b,1);break t}}u=c.createElement(r),Et(u,r,n),c.head.appendChild(u);break;default:throw Error(i(468,r))}u[Nt]=e,vt(u),r=u}e.stateNode=r}else Sp(c,e.type,e.stateNode);else e.stateNode=Np(c,r,e.memoizedProps);else u!==r?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,r===null?Sp(c,e.type,e.stateNode):Np(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),n!==null&&r&4&&Xc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),e.flags&32){c=e.stateNode;try{Sr(c,"")}catch(ce){Qe(e,e.return,ce)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Xc(e,c,n!==null?n.memoizedProps:c)),r&1024&&(Zc=!0);break;case 6:if(Vt(t,e),Ft(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ce){Qe(e,e.return,ce)}}break;case 3:if(ko=null,c=Na,Na=_o(t.containerInfo),Vt(t,e),Na=c,Ft(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{es(t.containerInfo)}catch(ce){Qe(e,e.return,ce)}Zc&&(Zc=!1,Sh(e));break;case 4:r=Na,Na=_o(e.stateNode.containerInfo),Vt(t,e),Ft(e),Na=r;break;case 12:Vt(t,e),Ft(e);break;case 31:Vt(t,e),Ft(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 13:Vt(t,e),Ft(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(xo=At()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 22:c=e.memoizedState!==null;var T=n!==null&&n.memoizedState!==null,B=Xa,$=ot;if(Xa=B||c,ot=$||T,Vt(t,e),ot=$,Xa=B,Ft(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||T||Xa||ot||nr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){T=n=t;try{if(u=T.stateNode,c)p=u.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{b=T.stateNode;var P=T.memoizedProps.style,q=P!=null&&P.hasOwnProperty("display")?P.display:null;b.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(ce){Qe(T,T.return,ce)}}}else if(t.tag===6){if(n===null){T=t;try{T.stateNode.nodeValue=c?"":T.memoizedProps}catch(ce){Qe(T,T.return,ce)}}}else if(t.tag===18){if(n===null){T=t;try{var Q=T.stateNode;c?fp(Q,!0):fp(T.stateNode,!1)}catch(ce){Qe(T,T.return,ce)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ho(e,n))));break;case 19:Vt(t,e),Ft(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 30:break;case 21:break;default:Vt(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(hh(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode,u=Kc(e);mo(e,u,c);break;case 5:var p=n.stateNode;n.flags&32&&(Sr(p,""),n.flags&=-33);var b=Kc(e);mo(e,b,p);break;case 3:case 4:var T=n.stateNode.containerInfo,B=Kc(e);$c(e,B,T);break;default:throw Error(i(161))}}catch($){Qe(e,e.return,$)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function $a(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vh(e,t.alternate,t),t=t.sibling}function nr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:gn(4,t,t.return),nr(t);break;case 1:ka(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&fh(t,t.return,n),nr(t);break;case 27:al(t.stateNode);case 26:case 5:ka(t,t.return),nr(t);break;case 22:t.memoizedState===null&&nr(t);break;case 30:nr(t);break;default:nr(t)}e=e.sibling}}function Za(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,u=t,p=u.flags;switch(u.tag){case 0:case 11:case 15:Za(c,u,n),Xs(4,u);break;case 1:if(Za(c,u,n),r=u,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(B){Qe(r,r.return,B)}if(r=u,c=r.updateQueue,c!==null){var b=r.stateNode;try{var T=c.shared.hiddenCallbacks;if(T!==null)for(c.shared.hiddenCallbacks=null,c=0;c<T.length;c++)em(T[c],b)}catch(B){Qe(r,r.return,B)}}n&&p&64&&dh(u),Ks(u,u.return);break;case 27:ph(u);case 26:case 5:Za(c,u,n),n&&r===null&&p&4&&mh(u),Ks(u,u.return);break;case 12:Za(c,u,n);break;case 31:Za(c,u,n),n&&p&4&&bh(c,u);break;case 13:Za(c,u,n),n&&p&4&&Nh(c,u);break;case 22:u.memoizedState===null&&Za(c,u,n),Ks(u,u.return);break;case 30:break;default:Za(c,u,n)}t=t.sibling}}function Jc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Os(n))}function Pc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Os(e))}function ja(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wh(e,t,n,r),t=t.sibling}function wh(e,t,n,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ja(e,t,n,r),c&2048&&Xs(9,t);break;case 1:ja(e,t,n,r);break;case 3:ja(e,t,n,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Os(e)));break;case 12:if(c&2048){ja(e,t,n,r),e=t.stateNode;try{var u=t.memoizedProps,p=u.id,b=u.onPostCommit;typeof b=="function"&&b(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Qe(t,t.return,T)}}else ja(e,t,n,r);break;case 31:ja(e,t,n,r);break;case 13:ja(e,t,n,r);break;case 23:break;case 22:u=t.stateNode,p=t.alternate,t.memoizedState!==null?u._visibility&2?ja(e,t,n,r):$s(e,t):u._visibility&2?ja(e,t,n,r):(u._visibility|=2,Vr(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Jc(p,t);break;case 24:ja(e,t,n,r),c&2048&&Pc(t.alternate,t);break;default:ja(e,t,n,r)}}function Vr(e,t,n,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,p=t,b=n,T=r,B=p.flags;switch(p.tag){case 0:case 11:case 15:Vr(u,p,b,T,c),Xs(8,p);break;case 23:break;case 22:var $=p.stateNode;p.memoizedState!==null?$._visibility&2?Vr(u,p,b,T,c):$s(u,p):($._visibility|=2,Vr(u,p,b,T,c)),c&&B&2048&&Jc(p.alternate,p);break;case 24:Vr(u,p,b,T,c),c&&B&2048&&Pc(p.alternate,p);break;default:Vr(u,p,b,T,c)}t=t.sibling}}function $s(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,c=r.flags;switch(r.tag){case 22:$s(n,r),c&2048&&Jc(r.alternate,r);break;case 24:$s(n,r),c&2048&&Pc(r.alternate,r);break;default:$s(n,r)}t=t.sibling}}var Zs=8192;function Fr(e,t,n){if(e.subtreeFlags&Zs)for(e=e.child;e!==null;)Eh(e,t,n),e=e.sibling}function Eh(e,t,n){switch(e.tag){case 26:Fr(e,t,n),e.flags&Zs&&e.memoizedState!==null&&_b(n,Na,e.memoizedState,e.memoizedProps);break;case 5:Fr(e,t,n);break;case 3:case 4:var r=Na;Na=_o(e.stateNode.containerInfo),Fr(e,t,n),Na=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zs,Zs=16777216,Fr(e,t,n),Zs=r):Fr(e,t,n));break;default:Fr(e,t,n)}}function Ch(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 Js(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gt=r,_h(r,e)}Ch(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Th(e),e=e.sibling}function Th(e){switch(e.tag){case 0:case 11:case 15:Js(e),e.flags&2048&&gn(9,e,e.return);break;case 3:Js(e);break;case 12:Js(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,po(e)):Js(e);break;default:Js(e)}}function po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gt=r,_h(r,e)}Ch(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gn(8,t,t.return),po(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,po(t));break;default:po(t)}e=e.sibling}}function _h(e,t){for(;gt!==null;){var n=gt;switch(n.tag){case 0:case 11:case 15:gn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Os(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,gt=r;else e:for(n=e;gt!==null;){r=gt;var c=r.sibling,u=r.return;if(gh(r),r===n){gt=null;break e}if(c!==null){c.return=u,gt=c;break e}gt=u}}}var Vy={getCacheForType:function(e){var t=St(rt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return St(rt).controller.signal}},Fy=typeof WeakMap=="function"?WeakMap:Map,He=0,Xe=null,Oe=null,De=0,Ge=0,ta=null,yn=!1,Yr=!1,Ic=!1,Ja=0,et=0,bn=0,rr=0,Wc=0,aa=0,Xr=0,Ps=null,Yt=null,eu=!1,xo=0,Rh=0,vo=1/0,go=null,Nn=null,ut=0,jn=null,Kr=null,Pa=0,tu=0,au=null,kh=null,Is=0,nu=null;function na(){return(He&2)!==0&&De!==0?De&-De:C.T!==null?cu():Si()}function Mh(){if(aa===0)if((De&536870912)===0||Le){var e=pr;pr<<=1,(pr&3932160)===0&&(pr=262144),aa=e}else aa=536870912;return e=Wt.current,e!==null&&(e.flags|=32),aa}function Xt(e,t,n){(e===Xe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&($r(e,0),Sn(e,De,aa,!1)),Ie(e,n),((He&2)===0||e!==Xe)&&(e===Xe&&((He&2)===0&&(rr|=n),et===4&&Sn(e,De,aa,!1)),Ma(e))}function Ah(e,t,n){if((He&6)!==0)throw Error(i(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ze(e,t),c=r?Ky(e,t):su(e,t,!0),u=r;do{if(c===0){Yr&&!r&&Sn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Yy(n)){c=su(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var b=e;c=Ps;var T=b.current.memoizedState.isDehydrated;if(T&&($r(b,p).flags|=256),p=su(b,p,!1),p!==2){if(Ic&&!T){b.errorRecoveryDisabledLanes|=u,rr|=u,c=4;break e}u=Yt,Yt=c,u!==null&&(Yt===null?Yt=u:Yt.push.apply(Yt,u))}c=p}if(u=!1,c!==2)continue}}if(c===1){$r(e,0),Sn(e,t,0,!0);break}e:{switch(r=e,u=c,u){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Sn(r,t,aa,!yn);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=xo+300-At(),10<c)){if(Sn(r,t,aa,!yn),Ce(r,0,!0)!==0)break e;Pa=t,r.timeoutHandle=cp(Oh.bind(null,r,n,Yt,go,eu,t,aa,rr,Xr,yn,u,"Throttled",-0,0),c);break e}Oh(r,n,Yt,go,eu,t,aa,rr,Xr,yn,u,null,-0,0)}}break}while(!0);Ma(e)}function Oh(e,t,n,r,c,u,p,b,T,B,$,P,q,Q){if(e.timeoutHandle=-1,P=t.subtreeFlags,P&8192||(P&16785408)===16785408){P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ua},Eh(t,u,P);var ce=(u&62914560)===u?xo-At():(u&4194048)===u?Rh-At():0;if(ce=Rb(P,ce),ce!==null){Pa=u,e.cancelPendingCommit=ce(Gh.bind(null,e,t,u,n,r,c,p,b,T,$,P,null,q,Q)),Sn(e,u,p,!B);return}}Gh(e,t,u,n,r,c,p,b,T)}function Yy(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var c=n[r],u=c.getSnapshot;c=c.value;try{if(!Pt(u(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Sn(e,t,n,r){t&=~Wc,t&=~rr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var u=31-Tt(c),p=1<<u;r[u]=-1,c&=~p}n!==0&&Gn(e,n,t)}function yo(){return(He&6)===0?(Ws(0),!1):!0}function ru(){if(Oe!==null){if(Ge===0)var e=Oe.return;else e=Oe,Ha=Zn=null,bc(e),Br=null,Ds=0,e=Oe;for(;e!==null;)uh(e.alternate,e),e=e.return;Oe=null}}function $r(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,db(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Pa=0,ru(),Xe=e,Oe=n=Ba(e.current,null),De=t,Ge=0,ta=null,yn=!1,Yr=Ze(e,t),Ic=!1,Xr=aa=Wc=rr=bn=et=0,Yt=Ps=null,eu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Tt(r),u=1<<c;t|=e[c],r&=~u}return Ja=t,ql(),n}function zh(e,t){Re=null,C.H=Vs,t===Lr||t===Kl?(t=Jf(),Ge=3):t===ic?(t=Jf(),Ge=4):Ge=t===Uc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,Oe===null&&(et=1,oo(e,ca(t,e.current)))}function Dh(){var e=Wt.current;return e===null?!0:(De&4194048)===De?ma===null:(De&62914560)===De||(De&536870912)!==0?e===ma:!1}function Uh(){var e=C.H;return C.H=Vs,e===null?Vs:e}function Lh(){var e=C.A;return C.A=Vy,e}function bo(){et=4,yn||(De&4194048)!==De&&Wt.current!==null||(Yr=!0),(bn&134217727)===0&&(rr&134217727)===0||Xe===null||Sn(Xe,De,aa,!1)}function su(e,t,n){var r=He;He|=2;var c=Uh(),u=Lh();(Xe!==e||De!==t)&&(go=null,$r(e,t)),t=!1;var p=et;e:do try{if(Ge!==0&&Oe!==null){var b=Oe,T=ta;switch(Ge){case 8:ru(),p=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(t=!0);var B=Ge;if(Ge=0,ta=null,Zr(e,b,T,B),n&&Yr){p=0;break e}break;default:B=Ge,Ge=0,ta=null,Zr(e,b,T,B)}}Xy(),p=et;break}catch($){zh(e,$)}while(!0);return t&&e.shellSuspendCounter++,Ha=Zn=null,He=r,C.H=c,C.A=u,Oe===null&&(Xe=null,De=0,ql()),p}function Xy(){for(;Oe!==null;)Bh(Oe)}function Ky(e,t){var n=He;He|=2;var r=Uh(),c=Lh();Xe!==e||De!==t?(go=null,vo=At()+500,$r(e,t)):Yr=Ze(e,t);e:do try{if(Ge!==0&&Oe!==null){t=Oe;var u=ta;t:switch(Ge){case 1:Ge=0,ta=null,Zr(e,t,u,1);break;case 2:case 9:if($f(u)){Ge=0,ta=null,qh(t);break}t=function(){Ge!==2&&Ge!==9||Xe!==e||(Ge=7),Ma(e)},u.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:$f(u)?(Ge=0,ta=null,qh(t)):(Ge=0,ta=null,Zr(e,t,u,7));break;case 5:var p=null;switch(Oe.tag){case 26:p=Oe.memoizedState;case 5:case 27:var b=Oe;if(p?wp(p):b.stateNode.complete){Ge=0,ta=null;var T=b.sibling;if(T!==null)Oe=T;else{var B=b.return;B!==null?(Oe=B,No(B)):Oe=null}break t}}Ge=0,ta=null,Zr(e,t,u,5);break;case 6:Ge=0,ta=null,Zr(e,t,u,6);break;case 8:ru(),et=6;break e;default:throw Error(i(462))}}$y();break}catch($){zh(e,$)}while(!0);return Ha=Zn=null,C.H=r,C.A=c,He=n,Oe!==null?0:(Xe=null,De=0,ql(),et)}function $y(){for(;Oe!==null&&!Mt();)Bh(Oe)}function Bh(e){var t=ih(e.alternate,e,Ja);e.memoizedProps=e.pendingProps,t===null?No(e):Oe=t}function qh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=ah(n,t,t.pendingProps,t.type,void 0,De);break;case 11:t=ah(n,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:bc(t);default:uh(n,t),t=Oe=Lf(t,Ja),t=ih(n,t,Ja)}e.memoizedProps=e.pendingProps,t===null?No(e):Oe=t}function Zr(e,t,n,r){Ha=Zn=null,bc(t),Br=null,Ds=0;var c=t.return;try{if(Uy(e,c,t,n,De)){et=1,oo(e,ca(n,e.current)),Oe=null;return}}catch(u){if(c!==null)throw Oe=c,u;et=1,oo(e,ca(n,e.current)),Oe=null;return}t.flags&32768?(Le||r===1?e=!0:Yr||(De&536870912)!==0?e=!1:(yn=e=!0,(r===2||r===9||r===3||r===6)&&(r=Wt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Hh(t,e)):No(t)}function No(e){var t=e;do{if((t.flags&32768)!==0){Hh(t,yn);return}e=t.return;var n=qy(t.alternate,t,Ja);if(n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);et===0&&(et=5)}function Hh(e,t){do{var n=Hy(e.alternate,e);if(n!==null){n.flags&=32767,Oe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=n}while(e!==null);et=6,Oe=null}function Gh(e,t,n,r,c,u,p,b,T){e.cancelPendingCommit=null;do jo();while(ut!==0);if((He&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(u=t.lanes|t.childLanes,u|=Ki,Lt(e,n,u,p,b,T),e===Xe&&(Oe=Xe=null,De=0),Kr=t,jn=e,Pa=n,tu=u,au=c,kh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Iy(Bn,function(){return Xh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=C.T,C.T=null,c=F.p,F.p=2,p=He,He|=4;try{Gy(e,t,n)}finally{He=p,F.p=c,C.T=r}}ut=1,Qh(),Vh(),Fh()}}function Qh(){if(ut===1){ut=0;var e=jn,t=Kr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var r=F.p;F.p=2;var c=He;He|=4;try{jh(t,e);var u=vu,p=_f(e.containerInfo),b=u.focusedElem,T=u.selectionRange;if(p!==b&&b&&b.ownerDocument&&Tf(b.ownerDocument.documentElement,b)){if(T!==null&&Qi(b)){var B=T.start,$=T.end;if($===void 0&&($=B),"selectionStart"in b)b.selectionStart=B,b.selectionEnd=Math.min($,b.value.length);else{var P=b.ownerDocument||document,q=P&&P.defaultView||window;if(q.getSelection){var Q=q.getSelection(),ce=b.textContent.length,Ne=Math.min(T.start,ce),Ye=T.end===void 0?Ne:Math.min(T.end,ce);!Q.extend&&Ne>Ye&&(p=Ye,Ye=Ne,Ne=p);var A=Cf(b,Ne),M=Cf(b,Ye);if(A&&M&&(Q.rangeCount!==1||Q.anchorNode!==A.node||Q.anchorOffset!==A.offset||Q.focusNode!==M.node||Q.focusOffset!==M.offset)){var L=P.createRange();L.setStart(A.node,A.offset),Q.removeAllRanges(),Ne>Ye?(Q.addRange(L),Q.extend(M.node,M.offset)):(L.setEnd(M.node,M.offset),Q.addRange(L))}}}}for(P=[],Q=b;Q=Q.parentNode;)Q.nodeType===1&&P.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<P.length;b++){var J=P[b];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}zo=!!xu,vu=xu=null}finally{He=c,F.p=r,C.T=n}}e.current=t,ut=2}}function Vh(){if(ut===2){ut=0;var e=jn,t=Kr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var r=F.p;F.p=2;var c=He;He|=4;try{vh(e,t.alternate,t)}finally{He=c,F.p=r,C.T=n}}ut=3}}function Fh(){if(ut===4||ut===3){ut=0,nn();var e=jn,t=Kr,n=Pa,r=kh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ut=5:(ut=0,Kr=jn=null,Yh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Nn=null),ya(n),t=t.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(qn,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=C.T,c=F.p,F.p=2,C.T=null;try{for(var u=e.onRecoverableError,p=0;p<r.length;p++){var b=r[p];u(b.value,{componentStack:b.stack})}}finally{C.T=t,F.p=c}}(Pa&3)!==0&&jo(),Ma(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===nu?Is++:(Is=0,nu=e):Is=0,Ws(0)}}function Yh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Os(t)))}function jo(){return Qh(),Vh(),Fh(),Xh()}function Xh(){if(ut!==5)return!1;var e=jn,t=tu;tu=0;var n=ya(Pa),r=C.T,c=F.p;try{F.p=32>n?32:n,C.T=null,n=au,au=null;var u=jn,p=Pa;if(ut=0,Kr=jn=null,Pa=0,(He&6)!==0)throw Error(i(331));var b=He;if(He|=4,Th(u.current),wh(u,u.current,p,n),He=b,Ws(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(qn,u)}catch{}return!0}finally{F.p=c,C.T=r,Yh(e,t)}}function Kh(e,t,n){t=ca(n,t),t=Dc(e.stateNode,t,2),e=pn(e,t,2),e!==null&&(Ie(e,2),Ma(e))}function Qe(e,t,n){if(e.tag===3)Kh(e,e,n);else for(;t!==null;){if(t.tag===3){Kh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Nn===null||!Nn.has(r))){e=ca(n,e),n=$m(2),r=pn(t,n,2),r!==null&&(Zm(n,r,t,e),Ie(r,2),Ma(r));break}}t=t.return}}function lu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fy;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(n)||(Ic=!0,c.add(n),e=Zy.bind(null,e,t,n),t.then(e,e))}function Zy(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xe===e&&(De&n)===n&&(et===4||et===3&&(De&62914560)===De&&300>At()-xo?(He&2)===0&&$r(e,0):Wc|=n,Xr===De&&(Xr=0)),Ma(e)}function $h(e,t){t===0&&(t=_t()),e=Xn(e,t),e!==null&&(Ie(e,t),Ma(e))}function Jy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$h(e,n)}function Py(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),$h(e,n)}function Iy(e,t){return xs(e,t)}var So=null,Jr=null,ou=!1,wo=!1,iu=!1,wn=0;function Ma(e){e!==Jr&&e.next===null&&(Jr===null?So=Jr=e:Jr=Jr.next=e),wo=!0,ou||(ou=!0,eb())}function Ws(e,t){if(!iu&&wo){iu=!0;do for(var n=!1,r=So;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var u=0;else{var p=r.suspendedLanes,b=r.pingedLanes;u=(1<<31-Tt(42|e)+1)-1,u&=c&~(p&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Ih(r,u))}else u=De,u=Ce(r,r===Xe?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||Ze(r,u)||(n=!0,Ih(r,u));r=r.next}while(n);iu=!1}}function Wy(){Zh()}function Zh(){wo=ou=!1;var e=0;wn!==0&&ub()&&(e=wn);for(var t=At(),n=null,r=So;r!==null;){var c=r.next,u=Jh(r,t);u===0?(r.next=null,n===null?So=c:n.next=c,c===null&&(Jr=n)):(n=r,(e!==0||(u&3)!==0)&&(wo=!0)),r=c}ut!==0&&ut!==5||Ws(e),wn!==0&&(wn=0)}function Jh(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var p=31-Tt(u),b=1<<p,T=c[p];T===-1?((b&n)===0||(b&r)!==0)&&(c[p]=xt(b,t)):T<=t&&(e.expiredLanes|=b),u&=~b}if(t=Xe,n=De,n=Ce(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&vs(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&vs(r),ya(n)){case 2:case 8:n=Cl;break;case 32:n=Bn;break;case 268435456:n=za;break;default:n=Bn}return r=Ph.bind(null,e),n=xs(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&vs(r),e.callbackPriority=2,e.callbackNode=null,2}function Ph(e,t){if(ut!==0&&ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(jo()&&e.callbackNode!==n)return null;var r=De;return r=Ce(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ah(e,r,t),Jh(e,At()),e.callbackNode!=null&&e.callbackNode===n?Ph.bind(null,e):null)}function Ih(e,t){if(jo())return null;Ah(e,t,!0)}function eb(){fb(function(){(He&6)!==0?xs(Ln,Wy):Zh()})}function cu(){if(wn===0){var e=Dr;e===0&&(e=hr,hr<<=1,(hr&261888)===0&&(hr=256)),wn=e}return wn}function Wh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ml(""+e)}function ep(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function tb(e,t,n,r,c){if(t==="submit"&&n&&n.stateNode===c){var u=Wh((c[Ht]||null).action),p=r.submitter;p&&(t=(t=p[Ht]||null)?Wh(t.formAction):p.getAttribute("formAction"),t!==null&&(u=t,p=null));var b=new Dl("action","action",null,r,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wn!==0){var T=p?ep(c,p):new FormData(c);Rc(n,{pending:!0,data:T,method:c.method,action:u},null,T)}}else typeof u=="function"&&(b.preventDefault(),T=p?ep(c,p):new FormData(c),Rc(n,{pending:!0,data:T,method:c.method,action:u},u,T))},currentTarget:c}]})}}for(var uu=0;uu<Xi.length;uu++){var du=Xi[uu],ab=du.toLowerCase(),nb=du[0].toUpperCase()+du.slice(1);ba(ab,"on"+nb)}ba(Mf,"onAnimationEnd"),ba(Af,"onAnimationIteration"),ba(Of,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(yy,"onTransitionRun"),ba(by,"onTransitionStart"),ba(Ny,"onTransitionCancel"),ba(zf,"onTransitionEnd"),Nr("onMouseEnter",["mouseout","mouseover"]),Nr("onMouseLeave",["mouseout","mouseover"]),Nr("onPointerEnter",["pointerout","pointerover"]),Nr("onPointerLeave",["pointerout","pointerover"]),Qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var el="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(" "),rb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(el));function tp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],c=r.event;r=r.listeners;e:{var u=void 0;if(t)for(var p=r.length-1;0<=p;p--){var b=r[p],T=b.instance,B=b.currentTarget;if(b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=B;try{u(c)}catch($){Bl($)}c.currentTarget=null,u=T}else for(p=0;p<r.length;p++){if(b=r[p],T=b.instance,B=b.currentTarget,b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=B;try{u(c)}catch($){Bl($)}c.currentTarget=null,u=T}}}}function ze(e,t){var n=t[wi];n===void 0&&(n=t[wi]=new Set);var r=e+"__bubble";n.has(r)||(ap(t,e,2,!1),n.add(r))}function fu(e,t,n){var r=0;t&&(r|=4),ap(n,e,r,t)}var Eo="_reactListening"+Math.random().toString(36).slice(2);function mu(e){if(!e[Eo]){e[Eo]=!0,$d.forEach(function(n){n!=="selectionchange"&&(rb.has(n)||fu(n,!1,e),fu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Eo]||(t[Eo]=!0,fu("selectionchange",!1,t))}}function ap(e,t,n,r){switch(Mp(t)){case 2:var c=Ab;break;case 8:c=Ob;break;default:c=_u}n=c.bind(null,t,n,e),c=void 0,!Oi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function hu(e,t,n,r,c){var u=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var p=r.tag;if(p===3||p===4){var b=r.stateNode.containerInfo;if(b===c)break;if(p===4)for(p=r.return;p!==null;){var T=p.tag;if((T===3||T===4)&&p.stateNode.containerInfo===c)return;p=p.return}for(;b!==null;){if(p=gr(b),p===null)return;if(T=p.tag,T===5||T===6||T===26||T===27){r=u=p;continue e}b=b.parentNode}}r=r.return}lf(function(){var B=u,$=Mi(n),P=[];e:{var q=Df.get(e);if(q!==void 0){var Q=Dl,ce=e;switch(e){case"keypress":if(Ol(n)===0)break e;case"keydown":case"keyup":Q=Pg;break;case"focusin":ce="focus",Q=Li;break;case"focusout":ce="blur",Q=Li;break;case"beforeblur":case"afterblur":Q=Li;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=qg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=ey;break;case Mf:case Af:case Of:Q=Qg;break;case zf:Q=ay;break;case"scroll":case"scrollend":Q=Lg;break;case"wheel":Q=ry;break;case"copy":case"cut":case"paste":Q=Fg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=ff;break;case"toggle":case"beforetoggle":Q=ly}var Ne=(t&4)!==0,Ye=!Ne&&(e==="scroll"||e==="scrollend"),A=Ne?q!==null?q+"Capture":null:q;Ne=[];for(var M=B,L;M!==null;){var J=M;if(L=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||L===null||A===null||(J=js(M,A),J!=null&&Ne.push(tl(M,J,L))),Ye)break;M=M.return}0<Ne.length&&(q=new Q(q,ce,null,n,$),P.push({event:q,listeners:Ne}))}}if((t&7)===0){e:{if(q=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",q&&n!==ki&&(ce=n.relatedTarget||n.fromElement)&&(gr(ce)||ce[vr]))break e;if((Q||q)&&(q=$.window===$?$:(q=$.ownerDocument)?q.defaultView||q.parentWindow:window,Q?(ce=n.relatedTarget||n.toElement,Q=B,ce=ce?gr(ce):null,ce!==null&&(Ye=f(ce),Ne=ce.tag,ce!==Ye||Ne!==5&&Ne!==27&&Ne!==6)&&(ce=null)):(Q=null,ce=B),Q!==ce)){if(Ne=uf,J="onMouseLeave",A="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=ff,J="onPointerLeave",A="onPointerEnter",M="pointer"),Ye=Q==null?q:Ns(Q),L=ce==null?q:Ns(ce),q=new Ne(J,M+"leave",Q,n,$),q.target=Ye,q.relatedTarget=L,J=null,gr($)===B&&(Ne=new Ne(A,M+"enter",ce,n,$),Ne.target=L,Ne.relatedTarget=Ye,J=Ne),Ye=J,Q&&ce)t:{for(Ne=sb,A=Q,M=ce,L=0,J=A;J;J=Ne(J))L++;J=0;for(var ge=M;ge;ge=Ne(ge))J++;for(;0<L-J;)A=Ne(A),L--;for(;0<J-L;)M=Ne(M),J--;for(;L--;){if(A===M||M!==null&&A===M.alternate){Ne=A;break t}A=Ne(A),M=Ne(M)}Ne=null}else Ne=null;Q!==null&&np(P,q,Q,Ne,!1),ce!==null&&Ye!==null&&np(P,Ye,ce,Ne,!0)}}e:{if(q=B?Ns(B):window,Q=q.nodeName&&q.nodeName.toLowerCase(),Q==="select"||Q==="input"&&q.type==="file")var Be=bf;else if(gf(q))if(Nf)Be=xy;else{Be=hy;var pe=my}else Q=q.nodeName,!Q||Q.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?B&&Ri(B.elementType)&&(Be=bf):Be=py;if(Be&&(Be=Be(e,B))){yf(P,Be,n,$);break e}pe&&pe(e,q,B),e==="focusout"&&B&&q.type==="number"&&B.memoizedProps.value!=null&&_i(q,"number",q.value)}switch(pe=B?Ns(B):window,e){case"focusin":(gf(pe)||pe.contentEditable==="true")&&(Tr=pe,Vi=B,ks=null);break;case"focusout":ks=Vi=Tr=null;break;case"mousedown":Fi=!0;break;case"contextmenu":case"mouseup":case"dragend":Fi=!1,Rf(P,n,$);break;case"selectionchange":if(gy)break;case"keydown":case"keyup":Rf(P,n,$)}var ke;if(qi)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Cr?xf(e,n)&&(Ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ue="onCompositionStart");Ue&&(mf&&n.locale!=="ko"&&(Cr||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Cr&&(ke=of()):(on=$,zi="value"in on?on.value:on.textContent,Cr=!0)),pe=Co(B,Ue),0<pe.length&&(Ue=new df(Ue,e,null,n,$),P.push({event:Ue,listeners:pe}),ke?Ue.data=ke:(ke=vf(n),ke!==null&&(Ue.data=ke)))),(ke=iy?cy(e,n):uy(e,n))&&(Ue=Co(B,"onBeforeInput"),0<Ue.length&&(pe=new df("onBeforeInput","beforeinput",null,n,$),P.push({event:pe,listeners:Ue}),pe.data=ke)),tb(P,e,B,n,$)}tp(P,t)})}function tl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Co(e,t){for(var n=t+"Capture",r=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=js(e,n),c!=null&&r.unshift(tl(e,c,u)),c=js(e,t),c!=null&&r.push(tl(e,c,u))),e.tag===3)return r;e=e.return}return[]}function sb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function np(e,t,n,r,c){for(var u=t._reactName,p=[];n!==null&&n!==r;){var b=n,T=b.alternate,B=b.stateNode;if(b=b.tag,T!==null&&T===r)break;b!==5&&b!==26&&b!==27||B===null||(T=B,c?(B=js(n,u),B!=null&&p.unshift(tl(n,B,T))):c||(B=js(n,u),B!=null&&p.push(tl(n,B,T)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var lb=/\r\n?/g,ob=/\u0000|\uFFFD/g;function rp(e){return(typeof e=="string"?e:""+e).replace(lb,`
|
|
9
|
-
`).replace(ob,"")}function sp(e,t){return t=rp(t),rp(e)===t}function Fe(e,t,n,r,c,u){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Sr(e,""+r);break;case"className":Rl(e,"class",r);break;case"tabIndex":Rl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(e,n,r);break;case"style":rf(e,r,u);break;case"data":if(t!=="object"){Rl(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Ml(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"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 u=="function"&&(n==="formAction"?(t!=="input"&&Fe(e,t,"name",c.name,c,null),Fe(e,t,"formEncType",c.formEncType,c,null),Fe(e,t,"formMethod",c.formMethod,c,null),Fe(e,t,"formTarget",c.formTarget,c,null)):(Fe(e,t,"encType",c.encType,c,null),Fe(e,t,"method",c.method,c,null),Fe(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Ml(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Ua);break;case"onScroll":r!=null&&ze("scroll",e);break;case"onScrollEnd":r!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}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}n=Ml(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);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(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ze("beforetoggle",e),ze("toggle",e),_l(e,"popover",r);break;case"xlinkActuate":Da(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Da(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Da(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Da(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Da(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Da(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Da(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Da(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Da(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":_l(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Dg.get(n)||n,_l(e,n,r))}}function pu(e,t,n,r,c,u){switch(n){case"style":rf(e,r,u);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&Sr(e,""+r);break;case"onScroll":r!=null&&ze("scroll",e);break;case"onScrollEnd":r!=null&&ze("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ua);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zd.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),u=e[Ht]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof r=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,c);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):_l(e,n,r)}}}function Et(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var r=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var p=n[u];if(p!=null)switch(u){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Fe(e,t,u,p,n,null)}}c&&Fe(e,t,"srcSet",n.srcSet,n,null),r&&Fe(e,t,"src",n.src,n,null);return;case"input":ze("invalid",e);var b=u=p=c=null,T=null,B=null;for(r in n)if(n.hasOwnProperty(r)){var $=n[r];if($!=null)switch(r){case"name":c=$;break;case"type":p=$;break;case"checked":T=$;break;case"defaultChecked":B=$;break;case"value":u=$;break;case"defaultValue":b=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,t));break;default:Fe(e,t,r,$,n,null)}}ef(e,u,b,T,B,p,c,!1);return;case"select":ze("invalid",e),r=p=u=null;for(c in n)if(n.hasOwnProperty(c)&&(b=n[c],b!=null))switch(c){case"value":u=b;break;case"defaultValue":p=b;break;case"multiple":r=b;default:Fe(e,t,c,b,n,null)}t=u,n=p,e.multiple=!!r,t!=null?jr(e,!!r,t,!1):n!=null&&jr(e,!!r,n,!0);return;case"textarea":ze("invalid",e),u=c=r=null;for(p in n)if(n.hasOwnProperty(p)&&(b=n[p],b!=null))switch(p){case"value":r=b;break;case"defaultValue":c=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(i(91));break;default:Fe(e,t,p,b,n,null)}af(e,r,c,u);return;case"option":for(T in n)n.hasOwnProperty(T)&&(r=n[T],r!=null)&&(T==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Fe(e,t,T,r,n,null));return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(r=0;r<el.length;r++)ze(el[r],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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(B in n)if(n.hasOwnProperty(B)&&(r=n[B],r!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Fe(e,t,B,r,n,null)}return;default:if(Ri(t)){for($ in n)n.hasOwnProperty($)&&(r=n[$],r!==void 0&&pu(e,t,$,r,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(r=n[b],r!=null&&Fe(e,t,b,r,n,null))}function ib(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,p=null,b=null,T=null,B=null,$=null;for(Q in n){var P=n[Q];if(n.hasOwnProperty(Q)&&P!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":T=P;default:r.hasOwnProperty(Q)||Fe(e,t,Q,null,r,P)}}for(var q in r){var Q=r[q];if(P=n[q],r.hasOwnProperty(q)&&(Q!=null||P!=null))switch(q){case"type":u=Q;break;case"name":c=Q;break;case"checked":B=Q;break;case"defaultChecked":$=Q;break;case"value":p=Q;break;case"defaultValue":b=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,t));break;default:Q!==P&&Fe(e,t,q,Q,r,P)}}Ti(e,p,b,T,B,$,u,c);return;case"select":Q=p=b=q=null;for(u in n)if(T=n[u],n.hasOwnProperty(u)&&T!=null)switch(u){case"value":break;case"multiple":Q=T;default:r.hasOwnProperty(u)||Fe(e,t,u,null,r,T)}for(c in r)if(u=r[c],T=n[c],r.hasOwnProperty(c)&&(u!=null||T!=null))switch(c){case"value":q=u;break;case"defaultValue":b=u;break;case"multiple":p=u;default:u!==T&&Fe(e,t,c,u,r,T)}t=b,n=p,r=Q,q!=null?jr(e,!!n,q,!1):!!r!=!!n&&(t!=null?jr(e,!!n,t,!0):jr(e,!!n,n?[]:"",!1));return;case"textarea":Q=q=null;for(b in n)if(c=n[b],n.hasOwnProperty(b)&&c!=null&&!r.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Fe(e,t,b,null,r,c)}for(p in r)if(c=r[p],u=n[p],r.hasOwnProperty(p)&&(c!=null||u!=null))switch(p){case"value":q=c;break;case"defaultValue":Q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==u&&Fe(e,t,p,c,r,u)}tf(e,q,Q);return;case"option":for(var ce in n)q=n[ce],n.hasOwnProperty(ce)&&q!=null&&!r.hasOwnProperty(ce)&&(ce==="selected"?e.selected=!1:Fe(e,t,ce,null,r,q));for(T in r)q=r[T],Q=n[T],r.hasOwnProperty(T)&&q!==Q&&(q!=null||Q!=null)&&(T==="selected"?e.selected=q&&typeof q!="function"&&typeof q!="symbol":Fe(e,t,T,q,r,Q));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 Ne in n)q=n[Ne],n.hasOwnProperty(Ne)&&q!=null&&!r.hasOwnProperty(Ne)&&Fe(e,t,Ne,null,r,q);for(B in r)if(q=r[B],Q=n[B],r.hasOwnProperty(B)&&q!==Q&&(q!=null||Q!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,t));break;default:Fe(e,t,B,q,r,Q)}return;default:if(Ri(t)){for(var Ye in n)q=n[Ye],n.hasOwnProperty(Ye)&&q!==void 0&&!r.hasOwnProperty(Ye)&&pu(e,t,Ye,void 0,r,q);for($ in r)q=r[$],Q=n[$],!r.hasOwnProperty($)||q===Q||q===void 0&&Q===void 0||pu(e,t,$,q,r,Q);return}}for(var A in n)q=n[A],n.hasOwnProperty(A)&&q!=null&&!r.hasOwnProperty(A)&&Fe(e,t,A,null,r,q);for(P in r)q=r[P],Q=n[P],!r.hasOwnProperty(P)||q===Q||q==null&&Q==null||Fe(e,t,P,q,r,Q)}function lp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var c=n[r],u=c.transferSize,p=c.initiatorType,b=c.duration;if(u&&b&&lp(p)){for(p=0,b=c.responseEnd,r+=1;r<n.length;r++){var T=n[r],B=T.startTime;if(B>b)break;var $=T.transferSize,P=T.initiatorType;$&&lp(P)&&(T=T.responseEnd,p+=$*(T<b?1:(b-B)/(T-B)))}if(--r,t+=8*(u+p)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xu=null,vu=null;function To(e){return e.nodeType===9?e:e.ownerDocument}function op(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 ip(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 gu(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 yu=null;function ub(){var e=window.event;return e&&e.type==="popstate"?e===yu?!1:(yu=e,!0):(yu=null,!1)}var cp=typeof setTimeout=="function"?setTimeout:void 0,db=typeof clearTimeout=="function"?clearTimeout:void 0,up=typeof Promise=="function"?Promise:void 0,fb=typeof queueMicrotask=="function"?queueMicrotask:typeof up<"u"?function(e){return up.resolve(null).then(e).catch(mb)}:cp;function mb(e){setTimeout(function(){throw e})}function En(e){return e==="head"}function dp(e,t){var n=t,r=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(c),es(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")al(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,al(n);for(var u=n.firstChild;u;){var p=u.nextSibling,b=u.nodeName;u[bs]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=p}}else n==="body"&&al(e.ownerDocument.body);n=c}while(n);es(t)}function fp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function bu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":bu(n),Ei(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function hb(e,t,n,r){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[bs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=ha(e.nextSibling),e===null)break}return null}function pb(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ha(e.nextSibling),e===null))return null;return e}function mp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ha(e.nextSibling),e===null))return null;return e}function Nu(e){return e.data==="$?"||e.data==="$~"}function ju(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function xb(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ha(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 Su=null;function hp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ha(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function pp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function xp(e,t,n){switch(t=To(n),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function al(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ei(e)}var pa=new Map,vp=new Set;function _o(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ia=F.d;F.d={f:vb,r:gb,D:yb,C:bb,L:Nb,m:jb,X:wb,S:Sb,M:Eb};function vb(){var e=Ia.f(),t=yo();return e||t}function gb(e){var t=yr(e);t!==null&&t.tag===5&&t.type==="form"?zm(t):Ia.r(e)}var Pr=typeof document>"u"?null:document;function gp(e,t,n){var r=Pr;if(r&&typeof t=="string"&&t){var c=oa(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),vp.has(c)||(vp.add(c),e={rel:e,crossOrigin:n,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Et(t,"link",e),vt(t),r.head.appendChild(t)))}}function yb(e){Ia.D(e),gp("dns-prefetch",e,null)}function bb(e,t){Ia.C(e,t),gp("preconnect",e,t)}function Nb(e,t,n){Ia.L(e,t,n);var r=Pr;if(r&&e&&t){var c='link[rel="preload"][as="'+oa(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+oa(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+oa(n.imageSizes)+'"]')):c+='[href="'+oa(e)+'"]';var u=c;switch(t){case"style":u=Ir(e);break;case"script":u=Wr(e)}pa.has(u)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),pa.set(u,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(nl(u))||t==="script"&&r.querySelector(rl(u))||(t=r.createElement("link"),Et(t,"link",e),vt(t),r.head.appendChild(t)))}}function jb(e,t){Ia.m(e,t);var n=Pr;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+oa(r)+'"][href="'+oa(e)+'"]',u=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Wr(e)}if(!pa.has(u)&&(e=x({rel:"modulepreload",href:e},t),pa.set(u,e),n.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(rl(u)))return}r=n.createElement("link"),Et(r,"link",e),vt(r),n.head.appendChild(r)}}}function Sb(e,t,n){Ia.S(e,t,n);var r=Pr;if(r&&e){var c=br(r).hoistableStyles,u=Ir(e);t=t||"default";var p=c.get(u);if(!p){var b={loading:0,preload:null};if(p=r.querySelector(nl(u)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=pa.get(u))&&wu(e,n);var T=p=r.createElement("link");vt(T),Et(T,"link",e),T._p=new Promise(function(B,$){T.onload=B,T.onerror=$}),T.addEventListener("load",function(){b.loading|=1}),T.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Ro(p,t,r)}p={type:"stylesheet",instance:p,count:1,state:b},c.set(u,p)}}}function wb(e,t){Ia.X(e,t);var n=Pr;if(n&&e){var r=br(n).hoistableScripts,c=Wr(e),u=r.get(c);u||(u=n.querySelector(rl(c)),u||(e=x({src:e,async:!0},t),(t=pa.get(c))&&Eu(e,t),u=n.createElement("script"),vt(u),Et(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function Eb(e,t){Ia.M(e,t);var n=Pr;if(n&&e){var r=br(n).hoistableScripts,c=Wr(e),u=r.get(c);u||(u=n.querySelector(rl(c)),u||(e=x({src:e,async:!0,type:"module"},t),(t=pa.get(c))&&Eu(e,t),u=n.createElement("script"),vt(u),Et(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function yp(e,t,n,r){var c=(c=me.current)?_o(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ir(n.href),n=br(c).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ir(n.href);var u=br(c).hoistableStyles,p=u.get(e);if(p||(c=c.ownerDocument||c,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,p),(u=c.querySelector(nl(e)))&&!u._p&&(p.instance=u,p.state.loading=5),pa.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},pa.set(e,n),u||Cb(c,e,n,p.state))),t&&r===null)throw Error(i(528,""));return p}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wr(n),n=br(c).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ir(e){return'href="'+oa(e)+'"'}function nl(e){return'link[rel="stylesheet"]['+e+"]"}function bp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function Cb(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Et(t,"link",n),vt(t),e.head.appendChild(t))}function Wr(e){return'[src="'+oa(e)+'"]'}function rl(e){return"script[async]"+e}function Np(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+oa(n.href)+'"]');if(r)return t.instance=r,vt(r),r;var c=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),vt(r),Et(r,"style",c),Ro(r,n.precedence,e),t.instance=r;case"stylesheet":c=Ir(n.href);var u=e.querySelector(nl(c));if(u)return t.state.loading|=4,t.instance=u,vt(u),u;r=bp(n),(c=pa.get(c))&&wu(r,c),u=(e.ownerDocument||e).createElement("link"),vt(u);var p=u;return p._p=new Promise(function(b,T){p.onload=b,p.onerror=T}),Et(u,"link",r),t.state.loading|=4,Ro(u,n.precedence,e),t.instance=u;case"script":return u=Wr(n.src),(c=e.querySelector(rl(u)))?(t.instance=c,vt(c),c):(r=n,(c=pa.get(u))&&(r=x({},n),Eu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),vt(c),Et(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ro(r,n.precedence,e));return t.instance}function Ro(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,u=c,p=0;p<r.length;p++){var b=r[p];if(b.dataset.precedence===t)u=b;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function wu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Eu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ko=null;function jp(e,t,n){if(ko===null){var r=new Map,c=ko=new Map;c.set(n,r)}else c=ko,r=c.get(n),r||(r=new Map,c.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var u=n[c];if(!(u[bs]||u[Nt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var p=u.getAttribute(t)||"";p=e+p;var b=r.get(p);b?b.push(u):r.set(p,[u])}}return r}function Sp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Tb(e,t,n){if(n===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 wp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function _b(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=Ir(r.href),u=t.querySelector(nl(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,vt(u);return}u=t.ownerDocument||t,r=bp(r),(c=pa.get(c))&&wu(r,c),u=u.createElement("link"),vt(u);var p=u;p._p=new Promise(function(b,T){p.onload=b,p.onerror=T}),Et(u,"link",r),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Mo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Cu=0;function Rb(e,t){return e.stylesheets&&e.count===0&&Oo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Oo(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Cu===0&&(Cu=62500*cb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Oo(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Cu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Oo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ao=null;function Oo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ao=new Map,t.forEach(kb,e),Ao=null,Mo.call(e))}function kb(e,t){if(!(t.state.loading&4)){var n=Ao.get(e);if(n)var r=n.get(null);else{n=new Map,Ao.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var p=c[u];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),r=p)}r&&n.set(null,r)}c=t.instance,p=c.getAttribute("data-precedence"),u=n.get(p)||r,u===r&&n.set(null,c),n.set(p,c),this.count++,r=Mo.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var sl={$$typeof:Y,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function Mb(e,t,n,r,c,u,p,b,T){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=sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sn(0),this.hiddenUpdates=sn(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function Ep(e,t,n,r,c,u,p,b,T,B,$,P){return e=new Mb(e,t,n,p,T,B,$,P,b),t=1,u===!0&&(t|=24),u=It(3,null,null,t),e.current=u,u.stateNode=e,t=sc(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:r,isDehydrated:n,cache:t},cc(u),e}function Cp(e){return e?(e=kr,e):kr}function Tp(e,t,n,r,c,u){c=Cp(c),r.context===null?r.context=c:r.pendingContext=c,r=hn(t),r.payload={element:n},u=u===void 0?null:u,u!==null&&(r.callback=u),n=pn(e,r,t),n!==null&&(Xt(n,e,t),Ls(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Tu(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function Rp(e){if(e.tag===13||e.tag===31){var t=Xn(e,67108864);t!==null&&Xt(t,e,67108864),Tu(e,67108864)}}function kp(e){if(e.tag===13||e.tag===31){var t=na();t=xr(t);var n=Xn(e,t);n!==null&&Xt(n,e,t),Tu(e,t)}}var zo=!0;function Ab(e,t,n,r){var c=C.T;C.T=null;var u=F.p;try{F.p=2,_u(e,t,n,r)}finally{F.p=u,C.T=c}}function Ob(e,t,n,r){var c=C.T;C.T=null;var u=F.p;try{F.p=8,_u(e,t,n,r)}finally{F.p=u,C.T=c}}function _u(e,t,n,r){if(zo){var c=Ru(r);if(c===null)hu(e,t,r,Do,n),Ap(e,r);else if(Db(c,e,t,n,r))r.stopPropagation();else if(Ap(e,r),t&4&&-1<zb.indexOf(e)){for(;c!==null;){var u=yr(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var p=Ta(u.pendingLanes);if(p!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;p;){var T=1<<31-Tt(p);b.entanglements[1]|=T,p&=~T}Ma(u),(He&6)===0&&(vo=At()+500,Ws(0))}}break;case 31:case 13:b=Xn(u,2),b!==null&&Xt(b,u,2),yo(),Tu(u,2)}if(u=Ru(r),u===null&&hu(e,t,r,Do,n),u===c)break;c=u}c!==null&&r.stopPropagation()}else hu(e,t,r,null,n)}}function Ru(e){return e=Mi(e),ku(e)}var Do=null;function ku(e){if(Do=null,e=gr(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=v(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Do=e,null}function Mp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ni()){case Ln:return 2;case Cl:return 8;case Bn:case gs:return 32;case za:return 268435456;default:return 32}default:return 32}}var Mu=!1,Cn=null,Tn=null,_n=null,ll=new Map,ol=new Map,Rn=[],zb="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 Ap(e,t){switch(e){case"focusin":case"focusout":Cn=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ol.delete(t.pointerId)}}function il(e,t,n,r,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:u,targetContainers:[c]},t!==null&&(t=yr(t),t!==null&&Rp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Db(e,t,n,r,c){switch(t){case"focusin":return Cn=il(Cn,e,t,n,r,c),!0;case"dragenter":return Tn=il(Tn,e,t,n,r,c),!0;case"mouseover":return _n=il(_n,e,t,n,r,c),!0;case"pointerover":var u=c.pointerId;return ll.set(u,il(ll.get(u)||null,e,t,n,r,c)),!0;case"gotpointercapture":return u=c.pointerId,ol.set(u,il(ol.get(u)||null,e,t,n,r,c)),!0}return!1}function Op(e){var t=gr(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,Xd(e.priority,function(){kp(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,Xd(e.priority,function(){kp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ru(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ki=r,n.target.dispatchEvent(r),ki=null}else return t=yr(n),t!==null&&Rp(t),e.blockedOn=n,!1;t.shift()}return!0}function zp(e,t,n){Uo(e)&&n.delete(t)}function Ub(){Mu=!1,Cn!==null&&Uo(Cn)&&(Cn=null),Tn!==null&&Uo(Tn)&&(Tn=null),_n!==null&&Uo(_n)&&(_n=null),ll.forEach(zp),ol.forEach(zp)}function Lo(e,t){e.blockedOn===t&&(e.blockedOn=null,Mu||(Mu=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Ub)))}var Bo=null;function Dp(e){Bo!==e&&(Bo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Bo===e&&(Bo=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(ku(r||n)===null)continue;break}var u=yr(n);u!==null&&(e.splice(t,3),t-=3,Rc(u,{pending:!0,data:c,method:n.method,action:r},r,c))}}))}function es(e){function t(T){return Lo(T,e)}Cn!==null&&Lo(Cn,e),Tn!==null&&Lo(Tn,e),_n!==null&&Lo(_n,e),ll.forEach(t),ol.forEach(t);for(var n=0;n<Rn.length;n++){var r=Rn[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Rn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var c=n[r],u=n[r+1],p=c[Ht]||null;if(typeof u=="function")p||Dp(n);else if(p){var b=null;if(u&&u.hasAttribute("formAction")){if(c=u,p=u[Ht]||null)b=p.formAction;else if(ku(c)!==null)continue}else b=p.action;typeof b=="function"?n[r+1]=b:(n.splice(r,3),r-=3),Dp(n)}}}function Up(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(p){return c=p})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Au(e){this._internalRoot=e}qo.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,r=na();Tp(n,r,e,t,null,null)},qo.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Tp(e.current,2,null,e,null,null),yo(),t[vr]=null}};function qo(e){this._internalRoot=e}qo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Si();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&Op(e)}};var Lp=s.version;if(Lp!=="19.2.4")throw Error(i(527,Lp,"19.2.4"));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Lb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ho=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ho.isDisabled&&Ho.supportsFiber)try{qn=Ho.inject(Lb),Ot=Ho}catch{}}return ul.createRoot=function(e,t){if(!d(e))throw Error(i(299));var n=!1,r="",c=Fm,u=Ym,p=Xm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Ep(e,1,!1,null,null,n,r,null,c,u,p,Up),e[vr]=t.current,mu(e),new Au(t)},ul.hydrateRoot=function(e,t,n){if(!d(e))throw Error(i(299));var r=!1,c="",u=Fm,p=Ym,b=Xm,T=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=Ep(e,1,!0,t,n??null,r,c,T,u,p,b,Up),t.context=Cp(null),n=t.current,r=na(),r=xr(r),c=hn(r),c.callback=null,pn(n,c,r),n=r,t.current.lanes=n,Ie(t,n),Ma(t),e[vr]=t.current,mu(e),new qo(t)},ul.version="19.2.4",ul}var Kp;function Xb(){if(Kp)return Du.exports;Kp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),Du.exports=Yb(),Du.exports}var Kb=Xb();var $p="popstate";function $b(a={}){function s(i,d){let{pathname:f,search:m,hash:v}=i.location;return td("",{pathname:f,search:m,hash:v},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function o(i,d){return typeof d=="string"?d:vl(d)}return Jb(s,o,null,a)}function Pe(a,s){if(a===!1||a===null||typeof a>"u")throw new Error(s)}function Sa(a,s){if(!a){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function Zb(){return Math.random().toString(36).substring(2,10)}function Zp(a,s){return{usr:a.state,key:a.key,idx:s}}function td(a,s,o=null,i){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof s=="string"?is(s):s,state:o,key:s&&s.key||i||Zb()}}function vl({pathname:a="/",search:s="",hash:o=""}){return s&&s!=="?"&&(a+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function is(a){let s={};if(a){let o=a.indexOf("#");o>=0&&(s.hash=a.substring(o),a=a.substring(0,o));let i=a.indexOf("?");i>=0&&(s.search=a.substring(i),a=a.substring(0,i)),a&&(s.pathname=a)}return s}function Jb(a,s,o,i={}){let{window:d=document.defaultView,v5Compat:f=!1}=i,m=d.history,v="POP",g=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function x(){v="POP";let _=y(),O=_==null?null:_-h;h=_,g&&g({action:v,location:E.location,delta:O})}function S(_,O){v="PUSH";let k=td(E.location,_,O);h=y()+1;let Y=Zp(k,h),I=E.createHref(k);try{m.pushState(Y,"",I)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;d.location.assign(I)}f&&g&&g({action:v,location:E.location,delta:1})}function R(_,O){v="REPLACE";let k=td(E.location,_,O);h=y();let Y=Zp(k,h),I=E.createHref(k);m.replaceState(Y,"",I),f&&g&&g({action:v,location:E.location,delta:0})}function w(_){return Pb(_)}let E={get action(){return v},get location(){return a(d,m)},listen(_){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener($p,x),g=_,()=>{d.removeEventListener($p,x),g=null}},createHref(_){return s(d,_)},createURL:w,encodeLocation(_){let O=w(_);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:S,replace:R,go(_){return m.go(_)}};return E}function Pb(a,s=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),Pe(o,"No window.location.(origin|href) available to create URL");let i=typeof a=="string"?a:vl(a);return i=i.replace(/ $/,"%20"),!s&&i.startsWith("//")&&(i=o+i),new URL(i,o)}function Px(a,s,o="/"){return Ib(a,s,o,!1)}function Ib(a,s,o,i){let d=typeof s=="string"?is(s):s,f=an(d.pathname||"/",o);if(f==null)return null;let m=Ix(a);Wb(m);let v=null;for(let g=0;v==null&&g<m.length;++g){let h=u0(f);v=i0(m[g],h,i)}return v}function Ix(a,s=[],o=[],i="",d=!1){let f=(m,v,g=d,h)=>{let y={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:v,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&g)return;Pe(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let x=tn([i,y.relativePath]),S=o.concat(y);m.children&&m.children.length>0&&(Pe(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Ix(m.children,s,S,x,g)),!(m.path==null&&!m.index)&&s.push({path:x,score:l0(x,m.index),routesMeta:S})};return a.forEach((m,v)=>{if(m.path===""||!m.path?.includes("?"))f(m,v);else for(let g of Wx(m.path))f(m,v,!0,g)}),s}function Wx(a){let s=a.split("/");if(s.length===0)return[];let[o,...i]=s,d=o.endsWith("?"),f=o.replace(/\?$/,"");if(i.length===0)return d?[f,""]:[f];let m=Wx(i.join("/")),v=[];return v.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&v.push(...m),v.map(g=>a.startsWith("/")&&g===""?"/":g)}function Wb(a){a.sort((s,o)=>s.score!==o.score?o.score-s.score:o0(s.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var e0=/^:[\w-]+$/,t0=3,a0=2,n0=1,r0=10,s0=-2,Jp=a=>a==="*";function l0(a,s){let o=a.split("/"),i=o.length;return o.some(Jp)&&(i+=s0),s&&(i+=a0),o.filter(d=>!Jp(d)).reduce((d,f)=>d+(e0.test(f)?t0:f===""?n0:r0),i)}function o0(a,s){return a.length===s.length&&a.slice(0,-1).every((i,d)=>i===s[d])?a[a.length-1]-s[s.length-1]:0}function i0(a,s,o=!1){let{routesMeta:i}=a,d={},f="/",m=[];for(let v=0;v<i.length;++v){let g=i[v],h=v===i.length-1,y=f==="/"?s:s.slice(f.length)||"/",x=ai({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),S=g.route;if(!x&&h&&o&&!i[i.length-1].route.index&&(x=ai({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!x)return null;Object.assign(d,x.params),m.push({params:d,pathname:tn([f,x.pathname]),pathnameBase:h0(tn([f,x.pathnameBase])),route:S}),x.pathnameBase!=="/"&&(f=tn([f,x.pathnameBase]))}return m}function ai(a,s){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=c0(a.path,a.caseSensitive,a.end),d=s.match(o);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),v=d.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:x},S)=>{if(y==="*"){let w=v[S]||"";m=f.slice(0,f.length-w.length).replace(/(.)\/+$/,"$1")}const R=v[S];return x&&!R?h[y]=void 0:h[y]=(R||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:a}}function c0(a,s=!1,o=!0){Sa(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let i=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,v,g)=>(i.push({paramName:v,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,s?void 0:"i"),i]}function u0(a){try{return a.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return Sa(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),a}}function an(a,s){if(s==="/")return a;if(!a.toLowerCase().startsWith(s.toLowerCase()))return null;let o=s.endsWith("/")?s.length-1:s.length,i=a.charAt(o);return i&&i!=="/"?null:a.slice(o)||"/"}var d0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function f0(a,s="/"){let{pathname:o,search:i="",hash:d=""}=typeof a=="string"?is(a):a,f;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?f=Pp(o.substring(1),"/"):f=Pp(o,s)):f=s,{pathname:f,search:p0(i),hash:x0(d)}}function Pp(a,s){let o=s.replace(/\/+$/,"").split("/");return a.split("/").forEach(d=>{d===".."?o.length>1&&o.pop():d!=="."&&o.push(d)}),o.length>1?o.join("/"):"/"}function qu(a,s,o,i){return`Cannot include a '${a}' character in a manually specified \`to.${s}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function m0(a){return a.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function yd(a){let s=m0(a);return s.map((o,i)=>i===s.length-1?o.pathname:o.pathnameBase)}function bd(a,s,o,i=!1){let d;typeof a=="string"?d=is(a):(d={...a},Pe(!d.pathname||!d.pathname.includes("?"),qu("?","pathname","search",d)),Pe(!d.pathname||!d.pathname.includes("#"),qu("#","pathname","hash",d)),Pe(!d.search||!d.search.includes("#"),qu("#","search","hash",d)));let f=a===""||d.pathname==="",m=f?"/":d.pathname,v;if(m==null)v=o;else{let x=s.length-1;if(!i&&m.startsWith("..")){let S=m.split("/");for(;S[0]==="..";)S.shift(),x-=1;d.pathname=S.join("/")}v=x>=0?s[x]:"/"}let g=f0(d,v),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var tn=a=>a.join("/").replace(/\/\/+/g,"/"),h0=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),p0=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,x0=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,v0=class{constructor(a,s,o,i=!1){this.status=a,this.statusText=s||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function g0(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function y0(a){return a.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ev=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tv(a,s){let o=a;if(typeof o!="string"||!d0.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,d=!1;if(ev)try{let f=new URL(window.location.href),m=o.startsWith("//")?new URL(f.protocol+o):new URL(o),v=an(m.pathname,s);m.origin===f.origin&&v!=null?o=v+m.search+m.hash:d=!0}catch{Sa(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:d,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var av=["POST","PUT","PATCH","DELETE"];new Set(av);var b0=["GET",...av];new Set(b0);var cs=N.createContext(null);cs.displayName="DataRouter";var ci=N.createContext(null);ci.displayName="DataRouterState";var N0=N.createContext(!1),nv=N.createContext({isTransitioning:!1});nv.displayName="ViewTransition";var j0=N.createContext(new Map);j0.displayName="Fetchers";var S0=N.createContext(null);S0.displayName="Await";var sa=N.createContext(null);sa.displayName="Navigation";var yl=N.createContext(null);yl.displayName="Location";var va=N.createContext({outlet:null,matches:[],isDataRoute:!1});va.displayName="Route";var Nd=N.createContext(null);Nd.displayName="RouteError";var rv="REACT_ROUTER_ERROR",w0="REDIRECT",E0="ROUTE_ERROR_RESPONSE";function C0(a){if(a.startsWith(`${rv}:${w0}:{`))try{let s=JSON.parse(a.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function T0(a){if(a.startsWith(`${rv}:${E0}:{`))try{let s=JSON.parse(a.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new v0(s.status,s.statusText,s.data)}catch{}}function _0(a,{relative:s}={}){Pe(us(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=N.useContext(sa),{hash:d,pathname:f,search:m}=bl(a,{relative:s}),v=f;return o!=="/"&&(v=f==="/"?o:tn([o,f])),i.createHref({pathname:v,search:m,hash:d})}function us(){return N.useContext(yl)!=null}function zn(){return Pe(us(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(yl).location}var sv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lv(a){N.useContext(sa).static||N.useLayoutEffect(a)}function wa(){let{isDataRoute:a}=N.useContext(va);return a?F0():R0()}function R0(){Pe(us(),"useNavigate() may be used only in the context of a <Router> component.");let a=N.useContext(cs),{basename:s,navigator:o}=N.useContext(sa),{matches:i}=N.useContext(va),{pathname:d}=zn(),f=JSON.stringify(yd(i)),m=N.useRef(!1);return lv(()=>{m.current=!0}),N.useCallback((g,h={})=>{if(Sa(m.current,sv),!m.current)return;if(typeof g=="number"){o.go(g);return}let y=bd(g,JSON.parse(f),d,h.relative==="path");a==null&&s!=="/"&&(y.pathname=y.pathname==="/"?s:tn([s,y.pathname])),(h.replace?o.replace:o.push)(y,h.state,h)},[s,o,f,d,a])}var k0=N.createContext(null);function M0(a){let s=N.useContext(va).outlet;return N.useMemo(()=>s&&N.createElement(k0.Provider,{value:a},s),[s,a])}function A0(){let{matches:a}=N.useContext(va),s=a[a.length-1];return s?s.params:{}}function bl(a,{relative:s}={}){let{matches:o}=N.useContext(va),{pathname:i}=zn(),d=JSON.stringify(yd(o));return N.useMemo(()=>bd(a,JSON.parse(d),i,s==="path"),[a,d,i,s])}function O0(a,s){return ov(a,s)}function ov(a,s,o,i,d){Pe(us(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=N.useContext(sa),{matches:m}=N.useContext(va),v=m[m.length-1],g=v?v.params:{},h=v?v.pathname:"/",y=v?v.pathnameBase:"/",x=v&&v.route;{let k=x&&x.path||"";cv(h,!x||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
-
|
|
11
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let S=zn(),R;if(s){let k=typeof s=="string"?is(s):s;Pe(y==="/"||k.pathname?.startsWith(y),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${k.pathname}" was given in the \`location\` prop.`),R=k}else R=S;let w=R.pathname||"/",E=w;if(y!=="/"){let k=y.replace(/^\//,"").split("/");E="/"+w.replace(/^\//,"").split("/").slice(k.length).join("/")}let _=Px(a,{pathname:E});Sa(x||_!=null,`No routes matched location "${R.pathname}${R.search}${R.hash}" `),Sa(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${R.pathname}${R.search}${R.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let O=B0(_&&_.map(k=>Object.assign({},k,{params:Object.assign({},g,k.params),pathname:tn([y,f.encodeLocation?f.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?y:tn([y,f.encodeLocation?f.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),m,o,i,d);return s&&O?N.createElement(yl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...R},navigationType:"POP"}},O):O}function z0(){let a=V0(),s=g0(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),o=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",a),m=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:f},"ErrorBoundary")," or"," ",N.createElement("code",{style:f},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},s),o?N.createElement("pre",{style:d},o):null,m)}var D0=N.createElement(z0,null),iv=class extends N.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,s){return s.location!==a.location||s.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:s.error,location:s.location,revalidation:a.revalidation||s.revalidation}}componentDidCatch(a,s){this.props.onError?this.props.onError(a,s):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const o=T0(a.digest);o&&(a=o)}let s=a!==void 0?N.createElement(va.Provider,{value:this.props.routeContext},N.createElement(Nd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?N.createElement(U0,{error:a},s):s}};iv.contextType=N0;var Hu=new WeakMap;function U0({children:a,error:s}){let{basename:o}=N.useContext(sa);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let i=C0(s.digest);if(i){let d=Hu.get(s);if(d)throw d;let f=tv(i.location,o);if(ev&&!Hu.get(s))if(f.isExternal||i.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:i.replace}));throw Hu.set(s,m),m}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function L0({routeContext:a,match:s,children:o}){let i=N.useContext(cs);return i&&i.static&&i.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=s.route.id),N.createElement(va.Provider,{value:a},o)}function B0(a,s=[],o=null,i=null,d=null){if(a==null){if(!o)return null;if(o.errors)a=o.matches;else if(s.length===0&&!o.initialized&&o.matches.length>0)a=o.matches;else return null}let f=a,m=o?.errors;if(m!=null){let y=f.findIndex(x=>x.route.id&&m?.[x.route.id]!==void 0);Pe(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,y+1))}let v=!1,g=-1;if(o)for(let y=0;y<f.length;y++){let x=f[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(g=y),x.route.id){let{loaderData:S,errors:R}=o,w=x.route.loader&&!S.hasOwnProperty(x.route.id)&&(!R||R[x.route.id]===void 0);if(x.route.lazy||w){v=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let h=o&&i?(y,x)=>{i(y,{location:o.location,params:o.matches?.[0]?.params??{},unstable_pattern:y0(o.matches),errorInfo:x})}:void 0;return f.reduceRight((y,x,S)=>{let R,w=!1,E=null,_=null;o&&(R=m&&x.route.id?m[x.route.id]:void 0,E=x.route.errorElement||D0,v&&(g<0&&S===0?(cv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,_=null):g===S&&(w=!0,_=x.route.hydrateFallbackElement||null)));let O=s.concat(f.slice(0,S+1)),k=()=>{let Y;return R?Y=E:w?Y=_:x.route.Component?Y=N.createElement(x.route.Component,null):x.route.element?Y=x.route.element:Y=y,N.createElement(L0,{match:x,routeContext:{outlet:y,matches:O,isDataRoute:o!=null},children:Y})};return o&&(x.route.ErrorBoundary||x.route.errorElement||S===0)?N.createElement(iv,{location:o.location,revalidation:o.revalidation,component:E,error:R,children:k(),routeContext:{outlet:null,matches:O,isDataRoute:!0},onError:h}):k()},null)}function jd(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function q0(a){let s=N.useContext(cs);return Pe(s,jd(a)),s}function H0(a){let s=N.useContext(ci);return Pe(s,jd(a)),s}function G0(a){let s=N.useContext(va);return Pe(s,jd(a)),s}function Sd(a){let s=G0(a),o=s.matches[s.matches.length-1];return Pe(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function Q0(){return Sd("useRouteId")}function V0(){let a=N.useContext(Nd),s=H0("useRouteError"),o=Sd("useRouteError");return a!==void 0?a:s.errors?.[o]}function F0(){let{router:a}=q0("useNavigate"),s=Sd("useNavigate"),o=N.useRef(!1);return lv(()=>{o.current=!0}),N.useCallback(async(d,f={})=>{Sa(o.current,sv),o.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:s,...f}))},[a,s])}var Ip={};function cv(a,s,o){!s&&!Ip[a]&&(Ip[a]=!0,Sa(!1,o))}N.memo(Y0);function Y0({routes:a,future:s,state:o,onError:i}){return ov(a,void 0,o,i,s)}function ni({to:a,replace:s,state:o,relative:i}){Pe(us(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=N.useContext(sa);Sa(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=N.useContext(va),{pathname:m}=zn(),v=wa(),g=bd(a,yd(f),m,i==="path"),h=JSON.stringify(g);return N.useEffect(()=>{v(JSON.parse(h),{replace:s,state:o,relative:i})},[v,h,i,s,o]),null}function X0(a){return M0(a.context)}function ft(a){Pe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function K0({basename:a="/",children:s=null,location:o,navigationType:i="POP",navigator:d,static:f=!1,unstable_useTransitions:m}){Pe(!us(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let v=a.replace(/^\/*/,"/"),g=N.useMemo(()=>({basename:v,navigator:d,static:f,unstable_useTransitions:m,future:{}}),[v,d,f,m]);typeof o=="string"&&(o=is(o));let{pathname:h="/",search:y="",hash:x="",state:S=null,key:R="default"}=o,w=N.useMemo(()=>{let E=an(h,v);return E==null?null:{location:{pathname:E,search:y,hash:x,state:S,key:R},navigationType:i}},[v,h,y,x,S,R,i]);return Sa(w!=null,`<Router basename="${v}"> is not able to match the URL "${h}${y}${x}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:N.createElement(sa.Provider,{value:g},N.createElement(yl.Provider,{children:s,value:w}))}function $0({children:a,location:s}){return O0(ad(a),s)}function ad(a,s=[]){let o=[];return N.Children.forEach(a,(i,d)=>{if(!N.isValidElement(i))return;let f=[...s,d];if(i.type===N.Fragment){o.push.apply(o,ad(i.props.children,f));return}Pe(i.type===ft,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let m={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(m.children=ad(i.props.children,f)),o.push(m)}),o}var Jo="get",Po="application/x-www-form-urlencoded";function ui(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function Z0(a){return ui(a)&&a.tagName.toLowerCase()==="button"}function J0(a){return ui(a)&&a.tagName.toLowerCase()==="form"}function P0(a){return ui(a)&&a.tagName.toLowerCase()==="input"}function I0(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function W0(a,s){return a.button===0&&(!s||s==="_self")&&!I0(a)}var Go=null;function e1(){if(Go===null)try{new FormData(document.createElement("form"),0),Go=!1}catch{Go=!0}return Go}var t1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gu(a){return a!=null&&!t1.has(a)?(Sa(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Po}"`),null):a}function a1(a,s){let o,i,d,f,m;if(J0(a)){let v=a.getAttribute("action");i=v?an(v,s):null,o=a.getAttribute("method")||Jo,d=Gu(a.getAttribute("enctype"))||Po,f=new FormData(a)}else if(Z0(a)||P0(a)&&(a.type==="submit"||a.type==="image")){let v=a.form;if(v==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||v.getAttribute("action");if(i=g?an(g,s):null,o=a.getAttribute("formmethod")||v.getAttribute("method")||Jo,d=Gu(a.getAttribute("formenctype"))||Gu(v.getAttribute("enctype"))||Po,f=new FormData(v,a),!e1()){let{name:h,type:y,value:x}=a;if(y==="image"){let S=h?`${h}.`:"";f.append(`${S}x`,"0"),f.append(`${S}y`,"0")}else h&&f.append(h,x)}}else{if(ui(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Jo,i=null,d=Po,m=a}return f&&d==="text/plain"&&(m=f,f=void 0),{action:i,method:o.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function wd(a,s){if(a===!1||a===null||typeof a>"u")throw new Error(s)}function n1(a,s,o,i){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return o?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${i}`:d.pathname=`${d.pathname}.${i}`:d.pathname==="/"?d.pathname=`_root.${i}`:s&&an(d.pathname,s)==="/"?d.pathname=`${s.replace(/\/$/,"")}/_root.${i}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${i}`,d}async function r1(a,s){if(a.id in s)return s[a.id];try{let o=await import(a.module);return s[a.id]=o,o}catch(o){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function s1(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function l1(a,s,o){let i=await Promise.all(a.map(async d=>{let f=s.routes[d.route.id];if(f){let m=await r1(f,o);return m.links?m.links():[]}return[]}));return u1(i.flat(1).filter(s1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Wp(a,s,o,i,d,f){let m=(g,h)=>o[h]?g.route.id!==o[h].route.id:!0,v=(g,h)=>o[h].pathname!==g.pathname||o[h].route.path?.endsWith("*")&&o[h].params["*"]!==g.params["*"];return f==="assets"?s.filter((g,h)=>m(g,h)||v(g,h)):f==="data"?s.filter((g,h)=>{let y=i.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||v(g,h))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function o1(a,s,{includeHydrateFallback:o}={}){return i1(a.map(i=>{let d=s.routes[i.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),o&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function i1(a){return[...new Set(a)]}function c1(a){let s={},o=Object.keys(a).sort();for(let i of o)s[i]=a[i];return s}function u1(a,s){let o=new Set;return new Set(s),a.reduce((i,d)=>{let f=JSON.stringify(c1(d));return o.has(f)||(o.add(f),i.push({key:f,link:d})),i},[])}function uv(){let a=N.useContext(cs);return wd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function d1(){let a=N.useContext(ci);return wd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Ed=N.createContext(void 0);Ed.displayName="FrameworkContext";function dv(){let a=N.useContext(Ed);return wd(a,"You must render this element inside a <HydratedRouter> element"),a}function f1(a,s){let o=N.useContext(Ed),[i,d]=N.useState(!1),[f,m]=N.useState(!1),{onFocus:v,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:x}=s,S=N.useRef(null);N.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let E=O=>{O.forEach(k=>{m(k.isIntersecting)})},_=new IntersectionObserver(E,{threshold:.5});return S.current&&_.observe(S.current),()=>{_.disconnect()}}},[a]),N.useEffect(()=>{if(i){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[i]);let R=()=>{d(!0)},w=()=>{d(!1),m(!1)};return o?a!=="intent"?[f,S,{}]:[f,S,{onFocus:dl(v,R),onBlur:dl(g,w),onMouseEnter:dl(h,R),onMouseLeave:dl(y,w),onTouchStart:dl(x,R)}]:[!1,S,{}]}function dl(a,s){return o=>{a&&a(o),o.defaultPrevented||s(o)}}function m1({page:a,...s}){let{router:o}=uv(),i=N.useMemo(()=>Px(o.routes,a,o.basename),[o.routes,a,o.basename]);return i?N.createElement(p1,{page:a,matches:i,...s}):null}function h1(a){let{manifest:s,routeModules:o}=dv(),[i,d]=N.useState([]);return N.useEffect(()=>{let f=!1;return l1(a,s,o).then(m=>{f||d(m)}),()=>{f=!0}},[a,s,o]),i}function p1({page:a,matches:s,...o}){let i=zn(),{future:d,manifest:f,routeModules:m}=dv(),{basename:v}=uv(),{loaderData:g,matches:h}=d1(),y=N.useMemo(()=>Wp(a,s,h,f,i,"data"),[a,s,h,f,i]),x=N.useMemo(()=>Wp(a,s,h,f,i,"assets"),[a,s,h,f,i]),S=N.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,_=!1;if(s.forEach(k=>{let Y=f.routes[k.route.id];!Y||!Y.hasLoader||(!y.some(I=>I.route.id===k.route.id)&&k.route.id in g&&m[k.route.id]?.shouldRevalidate||Y.hasClientLoader?_=!0:E.add(k.route.id))}),E.size===0)return[];let O=n1(a,v,d.unstable_trailingSlashAwareDataRequests,"data");return _&&E.size>0&&O.searchParams.set("_routes",s.filter(k=>E.has(k.route.id)).map(k=>k.route.id).join(",")),[O.pathname+O.search]},[v,d.unstable_trailingSlashAwareDataRequests,g,i,f,y,s,a,m]),R=N.useMemo(()=>o1(x,f),[x,f]),w=h1(x);return N.createElement(N.Fragment,null,S.map(E=>N.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),R.map(E=>N.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),w.map(({key:E,link:_})=>N.createElement("link",{key:E,nonce:o.nonce,..._,crossOrigin:_.crossOrigin??o.crossOrigin})))}function x1(...a){return s=>{a.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var v1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{v1&&(window.__reactRouterVersion="7.13.0")}catch{}function g1({basename:a,children:s,unstable_useTransitions:o,window:i}){let d=N.useRef();d.current==null&&(d.current=$b({window:i,v5Compat:!0}));let f=d.current,[m,v]=N.useState({action:f.action,location:f.location}),g=N.useCallback(h=>{o===!1?v(h):N.startTransition(()=>v(h))},[o]);return N.useLayoutEffect(()=>f.listen(g),[f,g]),N.createElement(K0,{basename:a,children:s,location:m.location,navigationType:m.action,navigator:f,unstable_useTransitions:o})}var fv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cd=N.forwardRef(function({onClick:s,discover:o="render",prefetch:i="none",relative:d,reloadDocument:f,replace:m,state:v,target:g,to:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:S,...R},w){let{basename:E,unstable_useTransitions:_}=N.useContext(sa),O=typeof h=="string"&&fv.test(h),k=tv(h,E);h=k.to;let Y=_0(h,{relative:d}),[I,ne,ee]=f1(i,R),H=N1(h,{replace:m,state:v,target:g,preventScrollReset:y,relative:d,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:_});function K(re){s&&s(re),re.defaultPrevented||H(re)}let ie=N.createElement("a",{...R,...ee,href:k.absoluteURL||Y,onClick:k.isExternal||f?s:K,ref:x1(w,ne),target:g,"data-discover":!O&&o==="render"?"true":void 0});return I&&!O?N.createElement(N.Fragment,null,ie,N.createElement(m1,{page:Y})):ie});Cd.displayName="Link";var mv=N.forwardRef(function({"aria-current":s="page",caseSensitive:o=!1,className:i="",end:d=!1,style:f,to:m,viewTransition:v,children:g,...h},y){let x=bl(m,{relative:h.relative}),S=zn(),R=N.useContext(ci),{navigator:w,basename:E}=N.useContext(sa),_=R!=null&&C1(x)&&v===!0,O=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,k=S.pathname,Y=R&&R.navigation&&R.navigation.location?R.navigation.location.pathname:null;o||(k=k.toLowerCase(),Y=Y?Y.toLowerCase():null,O=O.toLowerCase()),Y&&E&&(Y=an(Y,E)||Y);const I=O!=="/"&&O.endsWith("/")?O.length-1:O.length;let ne=k===O||!d&&k.startsWith(O)&&k.charAt(I)==="/",ee=Y!=null&&(Y===O||!d&&Y.startsWith(O)&&Y.charAt(O.length)==="/"),H={isActive:ne,isPending:ee,isTransitioning:_},K=ne?s:void 0,ie;typeof i=="function"?ie=i(H):ie=[i,ne?"active":null,ee?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let re=typeof f=="function"?f(H):f;return N.createElement(Cd,{...h,"aria-current":K,className:ie,ref:y,style:re,to:m,viewTransition:v},typeof g=="function"?g(H):g)});mv.displayName="NavLink";var y1=N.forwardRef(({discover:a="render",fetcherKey:s,navigate:o,reloadDocument:i,replace:d,state:f,method:m=Jo,action:v,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:S,...R},w)=>{let{unstable_useTransitions:E}=N.useContext(sa),_=w1(),O=E1(v,{relative:h}),k=m.toLowerCase()==="get"?"get":"post",Y=typeof v=="string"&&fv.test(v),I=ne=>{if(g&&g(ne),ne.defaultPrevented)return;ne.preventDefault();let ee=ne.nativeEvent.submitter,H=ee?.getAttribute("formmethod")||m,K=()=>_(ee||ne.currentTarget,{fetcherKey:s,method:H,navigate:o,replace:d,state:f,relative:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:S});E&&o!==!1?N.startTransition(()=>K()):K()};return N.createElement("form",{ref:w,method:k,action:O,onSubmit:i?g:I,...R,"data-discover":!Y&&a==="render"?"true":void 0})});y1.displayName="Form";function b1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hv(a){let s=N.useContext(cs);return Pe(s,b1(a)),s}function N1(a,{target:s,replace:o,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v,unstable_useTransitions:g}={}){let h=wa(),y=zn(),x=bl(a,{relative:f});return N.useCallback(S=>{if(W0(S,s)){S.preventDefault();let R=o!==void 0?o:vl(y)===vl(x),w=()=>h(a,{replace:R,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v});g?N.startTransition(()=>w()):w()}},[y,h,x,o,i,s,a,d,f,m,v,g])}var j1=0,S1=()=>`__${String(++j1)}__`;function w1(){let{router:a}=hv("useSubmit"),{basename:s}=N.useContext(sa),o=Q0(),i=a.fetch,d=a.navigate;return N.useCallback(async(f,m={})=>{let{action:v,method:g,encType:h,formData:y,body:x}=a1(f,s);if(m.navigate===!1){let S=m.fetcherKey||S1();await i(S,o,m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await d(m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:o,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,d,s,o])}function E1(a,{relative:s}={}){let{basename:o}=N.useContext(sa),i=N.useContext(va);Pe(i,"useFormAction must be used inside a RouteContext");let[d]=i.matches.slice(-1),f={...bl(a||".",{relative:s})},m=zn();if(a==null){f.search=m.search;let v=new URLSearchParams(f.search),g=v.getAll("index");if(g.some(y=>y==="")){v.delete("index"),g.filter(x=>x).forEach(x=>v.append("index",x));let y=v.toString();f.search=y?`?${y}`:""}}return(!a||a===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(f.pathname=f.pathname==="/"?o:tn([o,f.pathname])),vl(f)}function C1(a,{relative:s}={}){let o=N.useContext(nv);Pe(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=hv("useViewTransitionState"),d=bl(a,{relative:s});if(!o.isTransitioning)return!1;let f=an(o.currentLocation.pathname,i)||o.currentLocation.pathname,m=an(o.nextLocation.pathname,i)||o.nextLocation.pathname;return ai(d.pathname,m)!=null||ai(d.pathname,f)!=null}var T1=Jx();const _1=Zx(T1);var ds=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},R1={setTimeout:(a,s)=>setTimeout(a,s),clearTimeout:a=>clearTimeout(a),setInterval:(a,s)=>setInterval(a,s),clearInterval:a=>clearInterval(a)},k1=class{#e=R1;#t=!1;setTimeoutProvider(a){this.#e=a}setTimeout(a,s){return this.#e.setTimeout(a,s)}clearTimeout(a){this.#e.clearTimeout(a)}setInterval(a,s){return this.#e.setInterval(a,s)}clearInterval(a){this.#e.clearInterval(a)}},lr=new k1;function M1(a){setTimeout(a,0)}var cr=typeof window>"u"||"Deno"in globalThis;function Dt(){}function A1(a,s){return typeof a=="function"?a(s):a}function nd(a){return typeof a=="number"&&a>=0&&a!==1/0}function pv(a,s){return Math.max(a+(s||0)-Date.now(),0)}function An(a,s){return typeof a=="function"?a(s):a}function xa(a,s){return typeof a=="function"?a(s):a}function ex(a,s){const{type:o="all",exact:i,fetchStatus:d,predicate:f,queryKey:m,stale:v}=a;if(m){if(i){if(s.queryHash!==Td(m,s.options))return!1}else if(!gl(s.queryKey,m))return!1}if(o!=="all"){const g=s.isActive();if(o==="active"&&!g||o==="inactive"&&g)return!1}return!(typeof v=="boolean"&&s.isStale()!==v||d&&d!==s.state.fetchStatus||f&&!f(s))}function tx(a,s){const{exact:o,status:i,predicate:d,mutationKey:f}=a;if(f){if(!s.options.mutationKey)return!1;if(o){if(ur(s.options.mutationKey)!==ur(f))return!1}else if(!gl(s.options.mutationKey,f))return!1}return!(i&&s.state.status!==i||d&&!d(s))}function Td(a,s){return(s?.queryKeyHashFn||ur)(a)}function ur(a){return JSON.stringify(a,(s,o)=>rd(o)?Object.keys(o).sort().reduce((i,d)=>(i[d]=o[d],i),{}):o)}function gl(a,s){return a===s?!0:typeof a!=typeof s?!1:a&&s&&typeof a=="object"&&typeof s=="object"?Object.keys(s).every(o=>gl(a[o],s[o])):!1}var O1=Object.prototype.hasOwnProperty;function xv(a,s,o=0){if(a===s)return a;if(o>500)return s;const i=ax(a)&&ax(s);if(!i&&!(rd(a)&&rd(s)))return s;const f=(i?a:Object.keys(a)).length,m=i?s:Object.keys(s),v=m.length,g=i?new Array(v):{};let h=0;for(let y=0;y<v;y++){const x=i?y:m[y],S=a[x],R=s[x];if(S===R){g[x]=S,(i?y<f:O1.call(a,x))&&h++;continue}if(S===null||R===null||typeof S!="object"||typeof R!="object"){g[x]=R;continue}const w=xv(S,R,o+1);g[x]=w,w===S&&h++}return f===v&&h===f?a:g}function ri(a,s){if(!s||Object.keys(a).length!==Object.keys(s).length)return!1;for(const o in a)if(a[o]!==s[o])return!1;return!0}function ax(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function rd(a){if(!nx(a))return!1;const s=a.constructor;if(s===void 0)return!0;const o=s.prototype;return!(!nx(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function nx(a){return Object.prototype.toString.call(a)==="[object Object]"}function z1(a){return new Promise(s=>{lr.setTimeout(s,a)})}function sd(a,s,o){return typeof o.structuralSharing=="function"?o.structuralSharing(a,s):o.structuralSharing!==!1?xv(a,s):s}function D1(a,s,o=0){const i=[...a,s];return o&&i.length>o?i.slice(1):i}function U1(a,s,o=0){const i=[s,...a];return o&&i.length>o?i.slice(0,-1):i}var _d=Symbol();function vv(a,s){return!a.queryFn&&s?.initialPromise?()=>s.initialPromise:!a.queryFn||a.queryFn===_d?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function Rd(a,s){return typeof a=="function"?a(...s):!!a}function L1(a,s,o){let i=!1,d;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(d??=s(),i||(i=!0,d.aborted?o():d.addEventListener("abort",o,{once:!0})),d)}),a}var B1=class extends ds{#e;#t;#a;constructor(){super(),this.#a=a=>{if(!cr&&window.addEventListener){const s=()=>a();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#a=a,this.#t?.(),this.#t=a(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()})}setFocused(a){this.#e!==a&&(this.#e=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(s=>{s(a)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},kd=new B1;function ld(){let a,s;const o=new Promise((d,f)=>{a=d,s=f});o.status="pending",o.catch(()=>{});function i(d){Object.assign(o,d),delete o.resolve,delete o.reject}return o.resolve=d=>{i({status:"fulfilled",value:d}),a(d)},o.reject=d=>{i({status:"rejected",reason:d}),s(d)},o}var q1=M1;function H1(){let a=[],s=0,o=v=>{v()},i=v=>{v()},d=q1;const f=v=>{s?a.push(v):d(()=>{o(v)})},m=()=>{const v=a;a=[],v.length&&d(()=>{i(()=>{v.forEach(g=>{o(g)})})})};return{batch:v=>{let g;s++;try{g=v()}finally{s--,s||m()}return g},batchCalls:v=>(...g)=>{f(()=>{v(...g)})},schedule:f,setNotifyFunction:v=>{o=v},setBatchNotifyFunction:v=>{i=v},setScheduler:v=>{d=v}}}var mt=H1(),G1=class extends ds{#e=!0;#t;#a;constructor(){super(),this.#a=a=>{if(!cr&&window.addEventListener){const s=()=>a(!0),o=()=>a(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#a=a,this.#t?.(),this.#t=a(this.setOnline.bind(this))}setOnline(a){this.#e!==a&&(this.#e=a,this.listeners.forEach(o=>{o(a)}))}isOnline(){return this.#e}},si=new G1;function Q1(a){return Math.min(1e3*2**a,3e4)}function gv(a){return(a??"online")==="online"?si.isOnline():!0}var od=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function yv(a){let s=!1,o=0,i;const d=ld(),f=()=>d.status!=="pending",m=E=>{if(!f()){const _=new od(E);S(_),a.onCancel?.(_)}},v=()=>{s=!0},g=()=>{s=!1},h=()=>kd.isFocused()&&(a.networkMode==="always"||si.isOnline())&&a.canRun(),y=()=>gv(a.networkMode)&&a.canRun(),x=E=>{f()||(i?.(),d.resolve(E))},S=E=>{f()||(i?.(),d.reject(E))},R=()=>new Promise(E=>{i=_=>{(f()||h())&&E(_)},a.onPause?.()}).then(()=>{i=void 0,f()||a.onContinue?.()}),w=()=>{if(f())return;let E;const _=o===0?a.initialPromise:void 0;try{E=_??a.fn()}catch(O){E=Promise.reject(O)}Promise.resolve(E).then(x).catch(O=>{if(f())return;const k=a.retry??(cr?0:3),Y=a.retryDelay??Q1,I=typeof Y=="function"?Y(o,O):Y,ne=k===!0||typeof k=="number"&&o<k||typeof k=="function"&&k(o,O);if(s||!ne){S(O);return}o++,a.onFail?.(o,O),z1(I).then(()=>h()?void 0:R()).then(()=>{s?S(O):w()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(i?.(),d),cancelRetry:v,continueRetry:g,canStart:y,start:()=>(y()?w():R().then(w),d)}}var bv=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nd(this.gcTime)&&(this.#e=lr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(cr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(lr.clearTimeout(this.#e),this.#e=void 0)}},V1=class extends bv{#e;#t;#a;#r;#n;#l;#o;constructor(a){super(),this.#o=!1,this.#l=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#r=a.client,this.#a=this.#r.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#e=sx(this.options),this.state=a.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(a){if(this.options={...this.#l,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=sx(this.options);s.data!==void 0&&(this.setState(rx(s.data,s.dataUpdatedAt)),this.#e=s)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(a,s){const o=sd(this.state.data,a,this.options);return this.#s({data:o,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),o}setState(a,s){this.#s({type:"setState",state:a,setStateOptions:s})}cancel(a){const s=this.#n?.promise;return this.#n?.cancel(a),s?s.then(Dt).catch(Dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(a=>xa(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_d||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>An(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!pv(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(s=>s.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(s=>s.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(s=>s!==a),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(a,s){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(a&&this.setOptions(a),!this.options.queryFn){const v=this.observers.find(g=>g.options.queryFn);v&&this.setOptions(v.options)}const o=new AbortController,i=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(this.#o=!0,o.signal)})},d=()=>{const v=vv(this.options,s),h=(()=>{const y={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(y),y})();return this.#o=!1,this.options.persister?this.options.persister(v,h,this):v(h)},m=(()=>{const v={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:d};return i(v),v})();this.options.behavior?.onFetch(m,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#s({type:"fetch",meta:m.fetchOptions?.meta}),this.#n=yv({initialPromise:s?.initialPromise,fn:m.fetchFn,onCancel:v=>{v instanceof od&&v.revert&&this.setState({...this.#t,fetchStatus:"idle"}),o.abort()},onFail:(v,g)=>{this.#s({type:"failed",failureCount:v,error:g})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const v=await this.#n.start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),this.#a.config.onSuccess?.(v,this),this.#a.config.onSettled?.(v,this.state.error,this),v}catch(v){if(v instanceof od){if(v.silent)return this.#n.promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw this.#s({type:"error",error:v}),this.#a.config.onError?.(v,this),this.#a.config.onSettled?.(this.state.data,v,this),v}finally{this.scheduleGc()}}#s(a){const s=o=>{switch(a.type){case"failed":return{...o,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...Nv(o.data,this.options),fetchMeta:a.meta??null};case"success":const i={...o,...rx(a.data,a.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=a.manual?i:void 0,i;case"error":const d=a.error;return{...o,error:d,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...a.state}}};this.state=s(this.state),mt.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:a})})}};function Nv(a,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gv(s.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function rx(a,s){return{data:a,dataUpdatedAt:s??Date.now(),error:null,isInvalidated:!1,status:"success"}}function sx(a){const s=typeof a.initialData=="function"?a.initialData():a.initialData,o=s!==void 0,i=o?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:o?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var F1=class extends ds{constructor(a,s){super(),this.options=s,this.#e=a,this.#s=null,this.#o=ld(),this.bindMethods(),this.setOptions(s)}#e;#t=void 0;#a=void 0;#r=void 0;#n;#l;#o;#s;#p;#f;#m;#c;#u;#i;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),lx(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return id(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return id(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#N(),this.#t.removeObserver(this)}setOptions(a){const s=this.options,o=this.#t;if(this.options=this.#e.defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xa(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#t.setOptions(this.options),s._defaulted&&!ri(this.options,s)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&ox(this.#t,o,this.options,s)&&this.#d(),this.updateResult(),i&&(this.#t!==o||xa(this.options.enabled,this.#t)!==xa(s.enabled,this.#t)||An(this.options.staleTime,this.#t)!==An(s.staleTime,this.#t))&&this.#x();const d=this.#v();i&&(this.#t!==o||xa(this.options.enabled,this.#t)!==xa(s.enabled,this.#t)||d!==this.#i)&&this.#g(d)}getOptimisticResult(a){const s=this.#e.getQueryCache().build(this.#e,a),o=this.createResult(s,a);return X1(this,o)&&(this.#r=o,this.#l=this.options,this.#n=this.#t.state),o}getCurrentResult(){return this.#r}trackResult(a,s){return new Proxy(a,{get:(o,i)=>(this.trackProp(i),s?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,i))})}trackProp(a){this.#h.add(a)}getCurrentQuery(){return this.#t}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const s=this.#e.defaultQueryOptions(a),o=this.#e.getQueryCache().build(this.#e,s);return o.fetch().then(()=>this.createResult(o,s))}fetch(a){return this.#d({...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(a){this.#j();let s=this.#t.fetch(this.options,a);return a?.throwOnError||(s=s.catch(Dt)),s}#x(){this.#b();const a=An(this.options.staleTime,this.#t);if(cr||this.#r.isStale||!nd(a))return;const o=pv(this.#r.dataUpdatedAt,a)+1;this.#c=lr.setTimeout(()=>{this.#r.isStale||this.updateResult()},o)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(a){this.#N(),this.#i=a,!(cr||xa(this.options.enabled,this.#t)===!1||!nd(this.#i)||this.#i===0)&&(this.#u=lr.setInterval(()=>{(this.options.refetchIntervalInBackground||kd.isFocused())&&this.#d()},this.#i))}#y(){this.#x(),this.#g(this.#v())}#b(){this.#c&&(lr.clearTimeout(this.#c),this.#c=void 0)}#N(){this.#u&&(lr.clearInterval(this.#u),this.#u=void 0)}createResult(a,s){const o=this.#t,i=this.options,d=this.#r,f=this.#n,m=this.#l,g=a!==o?a.state:this.#a,{state:h}=a;let y={...h},x=!1,S;if(s._optimisticResults){const K=this.hasListeners(),ie=!K&&lx(a,s),re=K&&ox(a,o,s,i);(ie||re)&&(y={...y,...Nv(h.data,a.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:R,errorUpdatedAt:w,status:E}=y;S=y.data;let _=!1;if(s.placeholderData!==void 0&&S===void 0&&E==="pending"){let K;d?.isPlaceholderData&&s.placeholderData===m?.placeholderData?(K=d.data,_=!0):K=typeof s.placeholderData=="function"?s.placeholderData(this.#m?.state.data,this.#m):s.placeholderData,K!==void 0&&(E="success",S=sd(d?.data,K,s),x=!0)}if(s.select&&S!==void 0&&!_)if(d&&S===f?.data&&s.select===this.#p)S=this.#f;else try{this.#p=s.select,S=s.select(S),S=sd(d?.data,S,s),this.#f=S,this.#s=null}catch(K){this.#s=K}this.#s&&(R=this.#s,S=this.#f,w=Date.now(),E="error");const O=y.fetchStatus==="fetching",k=E==="pending",Y=E==="error",I=k&&O,ne=S!==void 0,H={status:E,fetchStatus:y.fetchStatus,isPending:k,isSuccess:E==="success",isError:Y,isInitialLoading:I,isLoading:I,data:S,dataUpdatedAt:y.dataUpdatedAt,error:R,errorUpdatedAt:w,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>g.dataUpdateCount||y.errorUpdateCount>g.errorUpdateCount,isFetching:O,isRefetching:O&&!k,isLoadingError:Y&&!ne,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:Y&&ne,isStale:Md(a,s),refetch:this.refetch,promise:this.#o,isEnabled:xa(s.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const K=H.data!==void 0,ie=H.status==="error"&&!K,re=Ee=>{ie?Ee.reject(H.error):K&&Ee.resolve(H.data)},oe=()=>{const Ee=this.#o=H.promise=ld();re(Ee)},he=this.#o;switch(he.status){case"pending":a.queryHash===o.queryHash&&re(he);break;case"fulfilled":(ie||H.data!==he.value)&&oe();break;case"rejected":(!ie||H.error!==he.reason)&&oe();break}}return H}updateResult(){const a=this.#r,s=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#l=this.options,this.#n.data!==void 0&&(this.#m=this.#t),ri(s,a))return;this.#r=s;const o=()=>{if(!a)return!0;const{notifyOnChangeProps:i}=this.options,d=typeof i=="function"?i():i;if(d==="all"||!d&&!this.#h.size)return!0;const f=new Set(d??this.#h);return this.options.throwOnError&&f.add("error"),Object.keys(this.#r).some(m=>{const v=m;return this.#r[v]!==a[v]&&f.has(v)})};this.#S({listeners:o()})}#j(){const a=this.#e.getQueryCache().build(this.#e,this.options);if(a===this.#t)return;const s=this.#t;this.#t=a,this.#a=a.state,this.hasListeners()&&(s?.removeObserver(this),a.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(a){mt.batch(()=>{a.listeners&&this.listeners.forEach(s=>{s(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Y1(a,s){return xa(s.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&s.retryOnMount===!1)}function lx(a,s){return Y1(a,s)||a.state.data!==void 0&&id(a,s,s.refetchOnMount)}function id(a,s,o){if(xa(s.enabled,a)!==!1&&An(s.staleTime,a)!=="static"){const i=typeof o=="function"?o(a):o;return i==="always"||i!==!1&&Md(a,s)}return!1}function ox(a,s,o,i){return(a!==s||xa(i.enabled,a)===!1)&&(!o.suspense||a.state.status!=="error")&&Md(a,o)}function Md(a,s){return xa(s.enabled,a)!==!1&&a.isStaleByTime(An(s.staleTime,a))}function X1(a,s){return!ri(a.getCurrentResult(),s)}function ix(a){return{onFetch:(s,o)=>{const i=s.options,d=s.fetchOptions?.meta?.fetchMore?.direction,f=s.state.data?.pages||[],m=s.state.data?.pageParams||[];let v={pages:[],pageParams:[]},g=0;const h=async()=>{let y=!1;const x=w=>{L1(w,()=>s.signal,()=>y=!0)},S=vv(s.options,s.fetchOptions),R=async(w,E,_)=>{if(y)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const ee={client:s.client,queryKey:s.queryKey,pageParam:E,direction:_?"backward":"forward",meta:s.options.meta};return x(ee),ee})(),Y=await S(k),{maxPages:I}=s.options,ne=_?U1:D1;return{pages:ne(w.pages,Y,I),pageParams:ne(w.pageParams,E,I)}};if(d&&f.length){const w=d==="backward",E=w?K1:cx,_={pages:f,pageParams:m},O=E(i,_);v=await R(_,O,w)}else{const w=a??f.length;do{const E=g===0?m[0]??i.initialPageParam:cx(i,v);if(g>0&&E==null)break;v=await R(v,E),g++}while(g<w)}return v};s.options.persister?s.fetchFn=()=>s.options.persister?.(h,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},o):s.fetchFn=h}}}function cx(a,{pages:s,pageParams:o}){const i=s.length-1;return s.length>0?a.getNextPageParam(s[i],s,o[i],o):void 0}function K1(a,{pages:s,pageParams:o}){return s.length>0?a.getPreviousPageParam?.(s[0],s,o[0],o):void 0}var $1=class extends bv{#e;#t;#a;#r;constructor(a){super(),this.#e=a.client,this.mutationId=a.mutationId,this.#a=a.mutationCache,this.#t=[],this.state=a.state||jv(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#t.includes(a)||(this.#t.push(a),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#t=this.#t.filter(s=>s!==a),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#a.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(a){const s=()=>{this.#n({type:"continue"})},o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=yv({fn:()=>this.options.mutationFn?this.options.mutationFn(a,o):Promise.reject(new Error("No mutationFn found")),onFail:(f,m)=>{this.#n({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#n({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)});const i=this.state.status==="pending",d=!this.#r.canStart();try{if(i)s();else{this.#n({type:"pending",variables:a,isPaused:d}),this.#a.config.onMutate&&await this.#a.config.onMutate(a,this,o);const m=await this.options.onMutate?.(a,o);m!==this.state.context&&this.#n({type:"pending",context:m,variables:a,isPaused:d})}const f=await this.#r.start();return await this.#a.config.onSuccess?.(f,a,this.state.context,this,o),await this.options.onSuccess?.(f,a,this.state.context,o),await this.#a.config.onSettled?.(f,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(f,null,a,this.state.context,o),this.#n({type:"success",data:f}),f}catch(f){try{await this.#a.config.onError?.(f,a,this.state.context,this,o)}catch(m){Promise.reject(m)}try{await this.options.onError?.(f,a,this.state.context,o)}catch(m){Promise.reject(m)}try{await this.#a.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,o)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,o)}catch(m){Promise.reject(m)}throw this.#n({type:"error",error:f}),f}finally{this.#a.runNext(this)}}#n(a){const s=o=>{switch(a.type){case"failed":return{...o,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...o,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:a.error,failureCount:o.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=s(this.state),mt.batch(()=>{this.#t.forEach(o=>{o.onMutationUpdate(a)}),this.#a.notify({mutation:this,type:"updated",action:a})})}};function jv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Z1=class extends ds{constructor(a={}){super(),this.config=a,this.#e=new Set,this.#t=new Map,this.#a=0}#e;#t;#a;build(a,s,o){const i=new $1({client:a,mutationCache:this,mutationId:++this.#a,options:a.defaultMutationOptions(s),state:o});return this.add(i),i}add(a){this.#e.add(a);const s=Qo(a);if(typeof s=="string"){const o=this.#t.get(s);o?o.push(a):this.#t.set(s,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#e.delete(a)){const s=Qo(a);if(typeof s=="string"){const o=this.#t.get(s);if(o)if(o.length>1){const i=o.indexOf(a);i!==-1&&o.splice(i,1)}else o[0]===a&&this.#t.delete(s)}}this.notify({type:"removed",mutation:a})}canRun(a){const s=Qo(a);if(typeof s=="string"){const i=this.#t.get(s)?.find(d=>d.state.status==="pending");return!i||i===a}else return!0}runNext(a){const s=Qo(a);return typeof s=="string"?this.#t.get(s)?.find(i=>i!==a&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){mt.batch(()=>{this.#e.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(a){const s={exact:!0,...a};return this.getAll().find(o=>tx(s,o))}findAll(a={}){return this.getAll().filter(s=>tx(a,s))}notify(a){mt.batch(()=>{this.listeners.forEach(s=>{s(a)})})}resumePausedMutations(){const a=this.getAll().filter(s=>s.state.isPaused);return mt.batch(()=>Promise.all(a.map(s=>s.continue().catch(Dt))))}};function Qo(a){return a.options.scope?.id}var J1=class extends ds{#e;#t=void 0;#a;#r;constructor(s,o){super(),this.#e=s,this.setOptions(o),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){const o=this.options;this.options=this.#e.defaultMutationOptions(s),ri(this.options,o)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),o?.mutationKey&&this.options.mutationKey&&ur(o.mutationKey)!==ur(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(s){this.#n(),this.#l(s)}getCurrentResult(){return this.#t}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#n(),this.#l()}mutate(s,o){return this.#r=o,this.#a?.removeObserver(this),this.#a=this.#e.getMutationCache().build(this.#e,this.options),this.#a.addObserver(this),this.#a.execute(s)}#n(){const s=this.#a?.state??jv();this.#t={...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset}}#l(s){mt.batch(()=>{if(this.#r&&this.hasListeners()){const o=this.#t.variables,i=this.#t.context,d={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(s?.type==="success"){try{this.#r.onSuccess?.(s.data,o,i,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(s.data,null,o,i,d)}catch(f){Promise.reject(f)}}else if(s?.type==="error"){try{this.#r.onError?.(s.error,o,i,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(void 0,s.error,o,i,d)}catch(f){Promise.reject(f)}}}this.listeners.forEach(o=>{o(this.#t)})})}},P1=class extends ds{constructor(a={}){super(),this.config=a,this.#e=new Map}#e;build(a,s,o){const i=s.queryKey,d=s.queryHash??Td(i,s);let f=this.get(d);return f||(f=new V1({client:a,queryKey:i,queryHash:d,options:a.defaultQueryOptions(s),state:o,defaultOptions:a.getQueryDefaults(i)}),this.add(f)),f}add(a){this.#e.has(a.queryHash)||(this.#e.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const s=this.#e.get(a.queryHash);s&&(a.destroy(),s===a&&this.#e.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){mt.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#e.get(a)}getAll(){return[...this.#e.values()]}find(a){const s={exact:!0,...a};return this.getAll().find(o=>ex(s,o))}findAll(a={}){const s=this.getAll();return Object.keys(a).length>0?s.filter(o=>ex(a,o)):s}notify(a){mt.batch(()=>{this.listeners.forEach(s=>{s(a)})})}onFocus(){mt.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){mt.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},I1=class{#e;#t;#a;#r;#n;#l;#o;#s;constructor(a={}){this.#e=a.queryCache||new P1,this.#t=a.mutationCache||new Z1,this.#a=a.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#o=kd.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=si.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(a){return this.#e.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#t.findAll({...a,status:"pending"}).length}getQueryData(a){const s=this.defaultQueryOptions({queryKey:a});return this.#e.get(s.queryHash)?.state.data}ensureQueryData(a){const s=this.defaultQueryOptions(a),o=this.#e.build(this,s),i=o.state.data;return i===void 0?this.fetchQuery(a):(a.revalidateIfStale&&o.isStaleByTime(An(s.staleTime,o))&&this.prefetchQuery(s),Promise.resolve(i))}getQueriesData(a){return this.#e.findAll(a).map(({queryKey:s,state:o})=>{const i=o.data;return[s,i]})}setQueryData(a,s,o){const i=this.defaultQueryOptions({queryKey:a}),f=this.#e.get(i.queryHash)?.state.data,m=A1(s,f);if(m!==void 0)return this.#e.build(this,i).setData(m,{...o,manual:!0})}setQueriesData(a,s,o){return mt.batch(()=>this.#e.findAll(a).map(({queryKey:i})=>[i,this.setQueryData(i,s,o)]))}getQueryState(a){const s=this.defaultQueryOptions({queryKey:a});return this.#e.get(s.queryHash)?.state}removeQueries(a){const s=this.#e;mt.batch(()=>{s.findAll(a).forEach(o=>{s.remove(o)})})}resetQueries(a,s){const o=this.#e;return mt.batch(()=>(o.findAll(a).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...a},s)))}cancelQueries(a,s={}){const o={revert:!0,...s},i=mt.batch(()=>this.#e.findAll(a).map(d=>d.cancel(o)));return Promise.all(i).then(Dt).catch(Dt)}invalidateQueries(a,s={}){return mt.batch(()=>(this.#e.findAll(a).forEach(o=>{o.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},s)))}refetchQueries(a,s={}){const o={...s,cancelRefetch:s.cancelRefetch??!0},i=mt.batch(()=>this.#e.findAll(a).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,o);return o.throwOnError||(f=f.catch(Dt)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(i).then(Dt)}fetchQuery(a){const s=this.defaultQueryOptions(a);s.retry===void 0&&(s.retry=!1);const o=this.#e.build(this,s);return o.isStaleByTime(An(s.staleTime,o))?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Dt).catch(Dt)}fetchInfiniteQuery(a){return a.behavior=ix(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Dt).catch(Dt)}ensureInfiniteQueryData(a){return a.behavior=ix(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return si.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#a}setDefaultOptions(a){this.#a=a}setQueryDefaults(a,s){this.#r.set(ur(a),{queryKey:a,defaultOptions:s})}getQueryDefaults(a){const s=[...this.#r.values()],o={};return s.forEach(i=>{gl(a,i.queryKey)&&Object.assign(o,i.defaultOptions)}),o}setMutationDefaults(a,s){this.#n.set(ur(a),{mutationKey:a,defaultOptions:s})}getMutationDefaults(a){const s=[...this.#n.values()],o={};return s.forEach(i=>{gl(a,i.mutationKey)&&Object.assign(o,i.defaultOptions)}),o}defaultQueryOptions(a){if(a._defaulted)return a;const s={...this.#a.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return s.queryHash||(s.queryHash=Td(s.queryKey,s)),s.refetchOnReconnect===void 0&&(s.refetchOnReconnect=s.networkMode!=="always"),s.throwOnError===void 0&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===_d&&(s.enabled=!1),s}defaultMutationOptions(a){return a?._defaulted?a:{...this.#a.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Sv=N.createContext(void 0),pt=a=>{const s=N.useContext(Sv);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},W1=({client:a,children:s})=>(N.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),l.jsx(Sv.Provider,{value:a,children:s})),wv=N.createContext(!1),e2=()=>N.useContext(wv);wv.Provider;function t2(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var a2=N.createContext(t2()),n2=()=>N.useContext(a2),r2=(a,s,o)=>{const i=o?.state.error&&typeof a.throwOnError=="function"?Rd(a.throwOnError,[o.state.error,o]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||i)&&(s.isReset()||(a.retryOnMount=!1))},s2=a=>{N.useEffect(()=>{a.clearReset()},[a])},l2=({result:a,errorResetBoundary:s,throwOnError:o,query:i,suspense:d})=>a.isError&&!s.isReset()&&!a.isFetching&&i&&(d&&a.data===void 0||Rd(o,[a.error,i])),o2=a=>{if(a.suspense){const o=d=>d==="static"?d:Math.max(d??1e3,1e3),i=a.staleTime;a.staleTime=typeof i=="function"?(...d)=>o(i(...d)):o(i),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},i2=(a,s)=>a.isLoading&&a.isFetching&&!s,c2=(a,s)=>a?.suspense&&s.isPending,ux=(a,s,o)=>s.fetchOptimistic(a).catch(()=>{o.clearReset()});function u2(a,s,o){const i=e2(),d=n2(),f=pt(),m=f.defaultQueryOptions(a);f.getDefaultOptions().queries?._experimental_beforeQuery?.(m);const v=f.getQueryCache().get(m.queryHash);m._optimisticResults=i?"isRestoring":"optimistic",o2(m),r2(m,d,v),s2(d);const g=!f.getQueryCache().get(m.queryHash),[h]=N.useState(()=>new s(f,m)),y=h.getOptimisticResult(m),x=!i&&a.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(S=>{const R=x?h.subscribe(mt.batchCalls(S)):Dt;return h.updateResult(),R},[h,x]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(m)},[m,h]),c2(m,y))throw ux(m,h,d);if(l2({result:y,errorResetBoundary:d,throwOnError:m.throwOnError,query:v,suspense:m.suspense}))throw y.error;return f.getDefaultOptions().queries?._experimental_afterQuery?.(m,y),m.experimental_prefetchInRender&&!cr&&i2(y,i)&&(g?ux(m,h,d):v?.promise)?.catch(Dt).finally(()=>{h.updateResult()}),m.notifyOnChangeProps?y:h.trackResult(y)}function yt(a,s){return u2(a,F1)}function bt(a,s){const o=pt(),[i]=N.useState(()=>new J1(o,a));N.useEffect(()=>{i.setOptions(a)},[i,a]);const d=N.useSyncExternalStore(N.useCallback(m=>i.subscribe(mt.batchCalls(m)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),f=N.useCallback((m,v)=>{i.mutate(m,v).catch(Dt)},[i]);if(d.error&&Rd(i.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}function d2(a){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",s.appendChild(o),o.styleSheet?o.styleSheet.cssText=a:o.appendChild(document.createTextNode(a))}const f2=a=>{switch(a){case"success":return p2;case"info":return v2;case"warning":return x2;case"error":return g2;default:return null}},m2=Array(12).fill(0),h2=({visible:a,className:s})=>le.createElement("div",{className:["sonner-loading-wrapper",s].filter(Boolean).join(" "),"data-visible":a},le.createElement("div",{className:"sonner-spinner"},m2.map((o,i)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),p2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("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"})),x2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("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"})),v2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("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"})),g2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("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"})),y2=le.createElement("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"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),b2=()=>{const[a,s]=le.useState(document.hidden);return le.useEffect(()=>{const o=()=>{s(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a};let cd=1;class N2{constructor(){this.subscribe=s=>(this.subscribers.push(s),()=>{const o=this.subscribers.indexOf(s);this.subscribers.splice(o,1)}),this.publish=s=>{this.subscribers.forEach(o=>o(s))},this.addToast=s=>{this.publish(s),this.toasts=[...this.toasts,s]},this.create=s=>{var o;const{message:i,...d}=s,f=typeof s?.id=="number"||((o=s.id)==null?void 0:o.length)>0?s.id:cd++,m=this.toasts.find(g=>g.id===f),v=s.dismissible===void 0?!0:s.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),m?this.toasts=this.toasts.map(g=>g.id===f?(this.publish({...g,...s,id:f,title:i}),{...g,...s,id:f,dismissible:v,title:i}):g):this.addToast({title:i,...d,dismissible:v,id:f}),f},this.dismiss=s=>(s?(this.dismissedToasts.add(s),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:s,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(i=>i({id:o.id,dismiss:!0}))}),s),this.message=(s,o)=>this.create({...o,message:s}),this.error=(s,o)=>this.create({...o,message:s,type:"error"}),this.success=(s,o)=>this.create({...o,type:"success",message:s}),this.info=(s,o)=>this.create({...o,type:"info",message:s}),this.warning=(s,o)=>this.create({...o,type:"warning",message:s}),this.loading=(s,o)=>this.create({...o,type:"loading",message:s}),this.promise=(s,o)=>{if(!o)return;let i;o.loading!==void 0&&(i=this.create({...o,promise:s,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const d=Promise.resolve(s instanceof Function?s():s);let f=i!==void 0,m;const v=d.then(async h=>{if(m=["resolve",h],le.isValidElement(h))f=!1,this.create({id:i,type:"default",message:h});else if(S2(h)&&!h.ok){f=!1;const x=typeof o.error=="function"?await o.error(`HTTP error! status: ${h.status}`):o.error,S=typeof o.description=="function"?await o.description(`HTTP error! status: ${h.status}`):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:S,...w})}else if(h instanceof Error){f=!1;const x=typeof o.error=="function"?await o.error(h):o.error,S=typeof o.description=="function"?await o.description(h):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:S,...w})}else if(o.success!==void 0){f=!1;const x=typeof o.success=="function"?await o.success(h):o.success,S=typeof o.description=="function"?await o.description(h):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"success",description:S,...w})}}).catch(async h=>{if(m=["reject",h],o.error!==void 0){f=!1;const y=typeof o.error=="function"?await o.error(h):o.error,x=typeof o.description=="function"?await o.description(h):o.description,R=typeof y=="object"&&!le.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:x,...R})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),o.finally==null||o.finally.call(o)}),g=()=>new Promise((h,y)=>v.then(()=>m[0]==="reject"?y(m[1]):h(m[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:g}:Object.assign(i,{unwrap:g})},this.custom=(s,o)=>{const i=o?.id||cd++;return this.create({jsx:s(i),id:i,...o}),i},this.getActiveToasts=()=>this.toasts.filter(s=>!this.dismissedToasts.has(s.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Kt=new N2,j2=(a,s)=>{const o=s?.id||cd++;return Kt.addToast({title:a,...s,id:o}),o},S2=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",w2=j2,E2=()=>Kt.toasts,C2=()=>Kt.getActiveToasts(),Me=Object.assign(w2,{success:Kt.success,info:Kt.info,warning:Kt.warning,error:Kt.error,custom:Kt.custom,message:Kt.message,promise:Kt.promise,dismiss:Kt.dismiss,loading:Kt.loading},{getHistory:E2,getToasts:C2});d2("[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}[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(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);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]{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 Vo(a){return a.label!==void 0}const T2=3,_2="24px",R2="16px",dx=4e3,k2=356,M2=14,A2=45,O2=200;function Aa(...a){return a.filter(Boolean).join(" ")}function z2(a){const[s,o]=a.split("-"),i=[];return s&&i.push(s),o&&i.push(o),i}const D2=a=>{var s,o,i,d,f,m,v,g,h;const{invert:y,toast:x,unstyled:S,interacting:R,setHeights:w,visibleToasts:E,heights:_,index:O,toasts:k,expanded:Y,removeToast:I,defaultRichColors:ne,closeButton:ee,style:H,cancelButtonStyle:K,actionButtonStyle:ie,className:re="",descriptionClassName:oe="",duration:he,position:Ee,gap:Te,expandByDefault:ae,classNames:C,icons:F,closeButtonAriaLabel:X="Close toast"}=a,[ve,W]=le.useState(null),[j,D]=le.useState(null),[G,Z]=le.useState(!1),[se,me]=le.useState(!1),[ue,je]=le.useState(!1),[U,z]=le.useState(!1),[Se,xe]=le.useState(!1),[Ut,ct]=le.useState(0),[Dn,mr]=le.useState(0),Un=le.useRef(x.duration||he||dx),ps=le.useRef(null),Jt=le.useRef(null),xs=O===0,vs=O+1<=E,Mt=x.type,nn=x.dismissible!==!1,At=x.className||"",Ni=x.descriptionClassName||"",Ln=le.useMemo(()=>_.findIndex(Ce=>Ce.toastId===x.id)||0,[_,x.id]),Cl=le.useMemo(()=>{var Ce;return(Ce=x.closeButton)!=null?Ce:ee},[x.closeButton,ee]),Bn=le.useMemo(()=>x.duration||he||dx,[x.duration,he]),gs=le.useRef(0),za=le.useRef(0),Tl=le.useRef(0),rn=le.useRef(null),[qn,Ot]=Ee.split("-"),ga=le.useMemo(()=>_.reduce((Ce,Ze,xt)=>xt>=Ln?Ce:Ce+Ze.height,0),[_,Ln]),Tt=b2(),ji=x.invert||y,ys=Mt==="loading";za.current=le.useMemo(()=>Ln*Te+ga,[Ln,ga]),le.useEffect(()=>{Un.current=Bn},[Bn]),le.useEffect(()=>{Z(!0)},[]),le.useEffect(()=>{const Ce=Jt.current;if(Ce){const Ze=Ce.getBoundingClientRect().height;return mr(Ze),w(xt=>[{toastId:x.id,height:Ze,position:x.position},...xt]),()=>w(xt=>xt.filter(_t=>_t.toastId!==x.id))}},[w,x.id]),le.useLayoutEffect(()=>{if(!G)return;const Ce=Jt.current,Ze=Ce.style.height;Ce.style.height="auto";const xt=Ce.getBoundingClientRect().height;Ce.style.height=Ze,mr(xt),w(_t=>_t.find(Ie=>Ie.toastId===x.id)?_t.map(Ie=>Ie.toastId===x.id?{...Ie,height:xt}:Ie):[{toastId:x.id,height:xt,position:x.position},..._t])},[G,x.title,x.description,w,x.id,x.jsx,x.action,x.cancel]);const Ca=le.useCallback(()=>{me(!0),ct(za.current),w(Ce=>Ce.filter(Ze=>Ze.toastId!==x.id)),setTimeout(()=>{I(x)},O2)},[x,I,w,za]);le.useEffect(()=>{if(x.promise&&Mt==="loading"||x.duration===1/0||x.type==="loading")return;let Ce;return Y||R||Tt?(()=>{if(Tl.current<gs.current){const _t=new Date().getTime()-gs.current;Un.current=Un.current-_t}Tl.current=new Date().getTime()})():Un.current!==1/0&&(gs.current=new Date().getTime(),Ce=setTimeout(()=>{x.onAutoClose==null||x.onAutoClose.call(x,x),Ca()},Un.current)),()=>clearTimeout(Ce)},[Y,R,x,Mt,Tt,Ca]),le.useEffect(()=>{x.delete&&(Ca(),x.onDismiss==null||x.onDismiss.call(x,x))},[Ca,x.delete]);function hr(){var Ce;if(F?.loading){var Ze;return le.createElement("div",{className:Aa(C?.loader,x==null||(Ze=x.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":Mt==="loading"},F.loading)}return le.createElement(h2,{className:Aa(C?.loader,x==null||(Ce=x.classNames)==null?void 0:Ce.loader),visible:Mt==="loading"})}const pr=x.icon||F?.[Mt]||f2(Mt);var Hn,Ta;return le.createElement("li",{tabIndex:0,ref:Jt,className:Aa(re,At,C?.toast,x==null||(s=x.classNames)==null?void 0:s.toast,C?.default,C?.[Mt],x==null||(o=x.classNames)==null?void 0:o[Mt]),"data-sonner-toast":"","data-rich-colors":(Hn=x.richColors)!=null?Hn:ne,"data-styled":!(x.jsx||x.unstyled||S),"data-mounted":G,"data-promise":!!x.promise,"data-swiped":Se,"data-removed":se,"data-visible":vs,"data-y-position":qn,"data-x-position":Ot,"data-index":O,"data-front":xs,"data-swiping":ue,"data-dismissible":nn,"data-type":Mt,"data-invert":ji,"data-swipe-out":U,"data-swipe-direction":j,"data-expanded":!!(Y||ae&&G),"data-testid":x.testId,style:{"--index":O,"--toasts-before":O,"--z-index":k.length-O,"--offset":`${se?Ut:za.current}px`,"--initial-height":ae?"auto":`${Dn}px`,...H,...x.style},onDragEnd:()=>{je(!1),W(null),rn.current=null},onPointerDown:Ce=>{Ce.button!==2&&(ys||!nn||(ps.current=new Date,ct(za.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(je(!0),rn.current={x:Ce.clientX,y:Ce.clientY})))},onPointerUp:()=>{var Ce,Ze,xt;if(U||!nn)return;rn.current=null;const _t=Number(((Ce=Jt.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sn=Number(((Ze=Jt.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ie=new Date().getTime()-((xt=ps.current)==null?void 0:xt.getTime()),Lt=ve==="x"?_t:sn,Gn=Math.abs(Lt)/Ie;if(Math.abs(Lt)>=A2||Gn>.11){ct(za.current),x.onDismiss==null||x.onDismiss.call(x,x),D(ve==="x"?_t>0?"right":"left":sn>0?"down":"up"),Ca(),z(!0);return}else{var Bt,qt;(Bt=Jt.current)==null||Bt.style.setProperty("--swipe-amount-x","0px"),(qt=Jt.current)==null||qt.style.setProperty("--swipe-amount-y","0px")}xe(!1),je(!1),W(null)},onPointerMove:Ce=>{var Ze,xt,_t;if(!rn.current||!nn||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;const Ie=Ce.clientY-rn.current.y,Lt=Ce.clientX-rn.current.x;var Gn;const Bt=(Gn=a.swipeDirections)!=null?Gn:z2(Ee);!ve&&(Math.abs(Lt)>1||Math.abs(Ie)>1)&&W(Math.abs(Lt)>Math.abs(Ie)?"x":"y");let qt={x:0,y:0};const xr=ya=>1/(1.5+Math.abs(ya)/20);if(ve==="y"){if(Bt.includes("top")||Bt.includes("bottom"))if(Bt.includes("top")&&Ie<0||Bt.includes("bottom")&&Ie>0)qt.y=Ie;else{const ya=Ie*xr(Ie);qt.y=Math.abs(ya)<Math.abs(Ie)?ya:Ie}}else if(ve==="x"&&(Bt.includes("left")||Bt.includes("right")))if(Bt.includes("left")&&Lt<0||Bt.includes("right")&&Lt>0)qt.x=Lt;else{const ya=Lt*xr(Lt);qt.x=Math.abs(ya)<Math.abs(Lt)?ya:Lt}(Math.abs(qt.x)>0||Math.abs(qt.y)>0)&&xe(!0),(xt=Jt.current)==null||xt.style.setProperty("--swipe-amount-x",`${qt.x}px`),(_t=Jt.current)==null||_t.style.setProperty("--swipe-amount-y",`${qt.y}px`)}},Cl&&!x.jsx&&Mt!=="loading"?le.createElement("button",{"aria-label":X,"data-disabled":ys,"data-close-button":!0,onClick:ys||!nn?()=>{}:()=>{Ca(),x.onDismiss==null||x.onDismiss.call(x,x)},className:Aa(C?.closeButton,x==null||(i=x.classNames)==null?void 0:i.closeButton)},(Ta=F?.close)!=null?Ta:y2):null,(Mt||x.icon||x.promise)&&x.icon!==null&&(F?.[Mt]!==null||x.icon)?le.createElement("div",{"data-icon":"",className:Aa(C?.icon,x==null||(d=x.classNames)==null?void 0:d.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||hr():null,x.type!=="loading"?pr:null):null,le.createElement("div",{"data-content":"",className:Aa(C?.content,x==null||(f=x.classNames)==null?void 0:f.content)},le.createElement("div",{"data-title":"",className:Aa(C?.title,x==null||(m=x.classNames)==null?void 0:m.title)},x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title),x.description?le.createElement("div",{"data-description":"",className:Aa(oe,Ni,C?.description,x==null||(v=x.classNames)==null?void 0:v.description)},typeof x.description=="function"?x.description():x.description):null),le.isValidElement(x.cancel)?x.cancel:x.cancel&&Vo(x.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||K,onClick:Ce=>{Vo(x.cancel)&&nn&&(x.cancel.onClick==null||x.cancel.onClick.call(x.cancel,Ce),Ca())},className:Aa(C?.cancelButton,x==null||(g=x.classNames)==null?void 0:g.cancelButton)},x.cancel.label):null,le.isValidElement(x.action)?x.action:x.action&&Vo(x.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||ie,onClick:Ce=>{Vo(x.action)&&(x.action.onClick==null||x.action.onClick.call(x.action,Ce),!Ce.defaultPrevented&&Ca())},className:Aa(C?.actionButton,x==null||(h=x.classNames)==null?void 0:h.actionButton)},x.action.label):null)};function fx(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function U2(a,s){const o={};return[a,s].forEach((i,d)=>{const f=d===1,m=f?"--mobile-offset":"--offset",v=f?R2:_2;function g(h){["top","right","bottom","left"].forEach(y=>{o[`${m}-${y}`]=typeof h=="number"?`${h}px`:h})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(h=>{i[h]===void 0?o[`${m}-${h}`]=v:o[`${m}-${h}`]=typeof i[h]=="number"?`${i[h]}px`:i[h]}):g(v)}),o}const L2=le.forwardRef(function(s,o){const{id:i,invert:d,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:v,closeButton:g,className:h,offset:y,mobileOffset:x,theme:S="light",richColors:R,duration:w,style:E,visibleToasts:_=T2,toastOptions:O,dir:k=fx(),gap:Y=M2,icons:I,containerAriaLabel:ne="Notifications"}=s,[ee,H]=le.useState([]),K=le.useMemo(()=>i?ee.filter(G=>G.toasterId===i):ee.filter(G=>!G.toasterId),[ee,i]),ie=le.useMemo(()=>Array.from(new Set([f].concat(K.filter(G=>G.position).map(G=>G.position)))),[K,f]),[re,oe]=le.useState([]),[he,Ee]=le.useState(!1),[Te,ae]=le.useState(!1),[C,F]=le.useState(S!=="system"?S:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=le.useRef(null),ve=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=le.useRef(null),j=le.useRef(!1),D=le.useCallback(G=>{H(Z=>{var se;return(se=Z.find(me=>me.id===G.id))!=null&&se.delete||Kt.dismiss(G.id),Z.filter(({id:me})=>me!==G.id)})},[]);return le.useEffect(()=>Kt.subscribe(G=>{if(G.dismiss){requestAnimationFrame(()=>{H(Z=>Z.map(se=>se.id===G.id?{...se,delete:!0}:se))});return}setTimeout(()=>{_1.flushSync(()=>{H(Z=>{const se=Z.findIndex(me=>me.id===G.id);return se!==-1?[...Z.slice(0,se),{...Z[se],...G},...Z.slice(se+1)]:[G,...Z]})})})}),[ee]),le.useEffect(()=>{if(S!=="system"){F(S);return}if(S==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:Z})=>{F(Z?"dark":"light")})}catch{G.addListener(({matches:se})=>{try{F(se?"dark":"light")}catch(me){console.error(me)}})}},[S]),le.useEffect(()=>{ee.length<=1&&Ee(!1)},[ee]),le.useEffect(()=>{const G=Z=>{var se;if(m.every(je=>Z[je]||Z.code===je)){var ue;Ee(!0),(ue=X.current)==null||ue.focus()}Z.code==="Escape"&&(document.activeElement===X.current||(se=X.current)!=null&&se.contains(document.activeElement))&&Ee(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[m]),le.useEffect(()=>{if(X.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,j.current=!1)}},[X.current]),le.createElement("section",{ref:o,"aria-label":`${ne} ${ve}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ie.map((G,Z)=>{var se;const[me,ue]=G.split("-");return K.length?le.createElement("ol",{key:G,dir:k==="auto"?fx():k,tabIndex:-1,ref:X,className:h,"data-sonner-toaster":!0,"data-sonner-theme":C,"data-y-position":me,"data-x-position":ue,style:{"--front-toast-height":`${((se=re[0])==null?void 0:se.height)||0}px`,"--width":`${k2}px`,"--gap":`${Y}px`,...E,...U2(y,x)},onBlur:je=>{j.current&&!je.currentTarget.contains(je.relatedTarget)&&(j.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:je=>{je.target instanceof HTMLElement&&je.target.dataset.dismissible==="false"||j.current||(j.current=!0,W.current=je.relatedTarget)},onMouseEnter:()=>Ee(!0),onMouseMove:()=>Ee(!0),onMouseLeave:()=>{Te||Ee(!1)},onDragEnd:()=>Ee(!1),onPointerDown:je=>{je.target instanceof HTMLElement&&je.target.dataset.dismissible==="false"||ae(!0)},onPointerUp:()=>ae(!1)},K.filter(je=>!je.position&&Z===0||je.position===G).map((je,U)=>{var z,Se;return le.createElement(D2,{key:je.id,icons:I,index:U,toast:je,defaultRichColors:R,duration:(z=O?.duration)!=null?z:w,className:O?.className,descriptionClassName:O?.descriptionClassName,invert:d,visibleToasts:_,closeButton:(Se=O?.closeButton)!=null?Se:g,interacting:Te,position:G,style:O?.style,unstyled:O?.unstyled,classNames:O?.classNames,cancelButtonStyle:O?.cancelButtonStyle,actionButtonStyle:O?.actionButtonStyle,closeButtonAriaLabel:O?.closeButtonAriaLabel,removeToast:D,toasts:K.filter(xe=>xe.position==je.position),heights:re.filter(xe=>xe.position==je.position),setHeights:oe,expandByDefault:v,gap:Y,expanded:he,swipeDirections:s.swipeDirections})})):null}))}),Ev=N.createContext(void 0),Cv="jarvis-admin-theme";function B2(){const a=localStorage.getItem(Cv);return a==="light"||a==="dark"?a:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function q2({children:a}){const[s,o]=N.useState(B2);N.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark"),localStorage.setItem(Cv,s)},[s]);const i=N.useCallback(()=>{o(d=>d==="dark"?"light":"dark")},[]);return l.jsx(Ev.Provider,{value:{theme:s,toggleTheme:i},children:a})}function H2(){const a=N.useContext(Ev);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}function Tv(a,s){return function(){return a.apply(s,arguments)}}const{toString:G2}=Object.prototype,{getPrototypeOf:Ad}=Object,{iterator:di,toStringTag:_v}=Symbol,fi=(a=>s=>{const o=G2.call(s);return a[o]||(a[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Ea=a=>(a=a.toLowerCase(),s=>fi(s)===a),mi=a=>s=>typeof s===a,{isArray:fs}=Array,ls=mi("undefined");function Nl(a){return a!==null&&!ls(a)&&a.constructor!==null&&!ls(a.constructor)&&$t(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const Rv=Ea("ArrayBuffer");function Q2(a){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(a):s=a&&a.buffer&&Rv(a.buffer),s}const V2=mi("string"),$t=mi("function"),kv=mi("number"),jl=a=>a!==null&&typeof a=="object",F2=a=>a===!0||a===!1,Io=a=>{if(fi(a)!=="object")return!1;const s=Ad(a);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(_v in a)&&!(di in a)},Y2=a=>{if(!jl(a)||Nl(a))return!1;try{return Object.keys(a).length===0&&Object.getPrototypeOf(a)===Object.prototype}catch{return!1}},X2=Ea("Date"),K2=Ea("File"),$2=Ea("Blob"),Z2=Ea("FileList"),J2=a=>jl(a)&&$t(a.pipe),P2=a=>{let s;return a&&(typeof FormData=="function"&&a instanceof FormData||$t(a.append)&&((s=fi(a))==="formdata"||s==="object"&&$t(a.toString)&&a.toString()==="[object FormData]"))},I2=Ea("URLSearchParams"),[W2,eN,tN,aN]=["ReadableStream","Request","Response","Headers"].map(Ea),nN=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sl(a,s,{allOwnKeys:o=!1}={}){if(a===null||typeof a>"u")return;let i,d;if(typeof a!="object"&&(a=[a]),fs(a))for(i=0,d=a.length;i<d;i++)s.call(null,a[i],i,a);else{if(Nl(a))return;const f=o?Object.getOwnPropertyNames(a):Object.keys(a),m=f.length;let v;for(i=0;i<m;i++)v=f[i],s.call(null,a[v],v,a)}}function Mv(a,s){if(Nl(a))return null;s=s.toLowerCase();const o=Object.keys(a);let i=o.length,d;for(;i-- >0;)if(d=o[i],s===d.toLowerCase())return d;return null}const or=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Av=a=>!ls(a)&&a!==or;function ud(){const{caseless:a,skipUndefined:s}=Av(this)&&this||{},o={},i=(d,f)=>{const m=a&&Mv(o,f)||f;Io(o[m])&&Io(d)?o[m]=ud(o[m],d):Io(d)?o[m]=ud({},d):fs(d)?o[m]=d.slice():(!s||!ls(d))&&(o[m]=d)};for(let d=0,f=arguments.length;d<f;d++)arguments[d]&&Sl(arguments[d],i);return o}const rN=(a,s,o,{allOwnKeys:i}={})=>(Sl(s,(d,f)=>{o&&$t(d)?Object.defineProperty(a,f,{value:Tv(d,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(a,f,{value:d,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),a),sN=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),lN=(a,s,o,i)=>{a.prototype=Object.create(s.prototype,i),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(a,"super",{value:s.prototype}),o&&Object.assign(a.prototype,o)},oN=(a,s,o,i)=>{let d,f,m;const v={};if(s=s||{},a==null)return s;do{for(d=Object.getOwnPropertyNames(a),f=d.length;f-- >0;)m=d[f],(!i||i(m,a,s))&&!v[m]&&(s[m]=a[m],v[m]=!0);a=o!==!1&&Ad(a)}while(a&&(!o||o(a,s))&&a!==Object.prototype);return s},iN=(a,s,o)=>{a=String(a),(o===void 0||o>a.length)&&(o=a.length),o-=s.length;const i=a.indexOf(s,o);return i!==-1&&i===o},cN=a=>{if(!a)return null;if(fs(a))return a;let s=a.length;if(!kv(s))return null;const o=new Array(s);for(;s-- >0;)o[s]=a[s];return o},uN=(a=>s=>a&&s instanceof a)(typeof Uint8Array<"u"&&Ad(Uint8Array)),dN=(a,s)=>{const i=(a&&a[di]).call(a);let d;for(;(d=i.next())&&!d.done;){const f=d.value;s.call(a,f[0],f[1])}},fN=(a,s)=>{let o;const i=[];for(;(o=a.exec(s))!==null;)i.push(o);return i},mN=Ea("HTMLFormElement"),hN=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,i,d){return i.toUpperCase()+d}),mx=(({hasOwnProperty:a})=>(s,o)=>a.call(s,o))(Object.prototype),pN=Ea("RegExp"),Ov=(a,s)=>{const o=Object.getOwnPropertyDescriptors(a),i={};Sl(o,(d,f)=>{let m;(m=s(d,f,a))!==!1&&(i[f]=m||d)}),Object.defineProperties(a,i)},xN=a=>{Ov(a,(s,o)=>{if($t(a)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const i=a[o];if($t(i)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},vN=(a,s)=>{const o={},i=d=>{d.forEach(f=>{o[f]=!0})};return fs(a)?i(a):i(String(a).split(s)),o},gN=()=>{},yN=(a,s)=>a!=null&&Number.isFinite(a=+a)?a:s;function bN(a){return!!(a&&$t(a.append)&&a[_v]==="FormData"&&a[di])}const NN=a=>{const s=new Array(10),o=(i,d)=>{if(jl(i)){if(s.indexOf(i)>=0)return;if(Nl(i))return i;if(!("toJSON"in i)){s[d]=i;const f=fs(i)?[]:{};return Sl(i,(m,v)=>{const g=o(m,d+1);!ls(g)&&(f[v]=g)}),s[d]=void 0,f}}return i};return o(a,0)},jN=Ea("AsyncFunction"),SN=a=>a&&(jl(a)||$t(a))&&$t(a.then)&&$t(a.catch),zv=((a,s)=>a?setImmediate:s?((o,i)=>(or.addEventListener("message",({source:d,data:f})=>{d===or&&f===o&&i.length&&i.shift()()},!1),d=>{i.push(d),or.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",$t(or.postMessage)),wN=typeof queueMicrotask<"u"?queueMicrotask.bind(or):typeof process<"u"&&process.nextTick||zv,EN=a=>a!=null&&$t(a[di]),V={isArray:fs,isArrayBuffer:Rv,isBuffer:Nl,isFormData:P2,isArrayBufferView:Q2,isString:V2,isNumber:kv,isBoolean:F2,isObject:jl,isPlainObject:Io,isEmptyObject:Y2,isReadableStream:W2,isRequest:eN,isResponse:tN,isHeaders:aN,isUndefined:ls,isDate:X2,isFile:K2,isBlob:$2,isRegExp:pN,isFunction:$t,isStream:J2,isURLSearchParams:I2,isTypedArray:uN,isFileList:Z2,forEach:Sl,merge:ud,extend:rN,trim:nN,stripBOM:sN,inherits:lN,toFlatObject:oN,kindOf:fi,kindOfTest:Ea,endsWith:iN,toArray:cN,forEachEntry:dN,matchAll:fN,isHTMLForm:mN,hasOwnProperty:mx,hasOwnProp:mx,reduceDescriptors:Ov,freezeMethods:xN,toObjectSet:vN,toCamelCase:hN,noop:gN,toFiniteNumber:yN,findKey:Mv,global:or,isContextDefined:Av,isSpecCompliantForm:bN,toJSONObject:NN,isAsyncFn:jN,isThenable:SN,setImmediate:zv,asap:wN,isIterable:EN};let we=class Dv extends Error{static from(s,o,i,d,f,m){const v=new Dv(s.message,o||s.code,i,d,f);return v.cause=s,v.name=s.name,m&&Object.assign(v,m),v}constructor(s,o,i,d,f){super(s),this.name="AxiosError",this.isAxiosError=!0,o&&(this.code=o),i&&(this.config=i),d&&(this.request=d),f&&(this.response=f,this.status=f.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}};we.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";we.ERR_BAD_OPTION="ERR_BAD_OPTION";we.ECONNABORTED="ECONNABORTED";we.ETIMEDOUT="ETIMEDOUT";we.ERR_NETWORK="ERR_NETWORK";we.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";we.ERR_DEPRECATED="ERR_DEPRECATED";we.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";we.ERR_BAD_REQUEST="ERR_BAD_REQUEST";we.ERR_CANCELED="ERR_CANCELED";we.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";we.ERR_INVALID_URL="ERR_INVALID_URL";const CN=null;function dd(a){return V.isPlainObject(a)||V.isArray(a)}function Uv(a){return V.endsWith(a,"[]")?a.slice(0,-2):a}function hx(a,s,o){return a?a.concat(s).map(function(d,f){return d=Uv(d),!o&&f?"["+d+"]":d}).join(o?".":""):s}function TN(a){return V.isArray(a)&&!a.some(dd)}const _N=V.toFlatObject(V,{},null,function(s){return/^is[A-Z]/.test(s)});function hi(a,s,o){if(!V.isObject(a))throw new TypeError("target must be an object");s=s||new FormData,o=V.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!V.isUndefined(_[E])});const i=o.metaTokens,d=o.visitor||y,f=o.dots,m=o.indexes,g=(o.Blob||typeof Blob<"u"&&Blob)&&V.isSpecCompliantForm(s);if(!V.isFunction(d))throw new TypeError("visitor must be a function");function h(w){if(w===null)return"";if(V.isDate(w))return w.toISOString();if(V.isBoolean(w))return w.toString();if(!g&&V.isBlob(w))throw new we("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(w)||V.isTypedArray(w)?g&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function y(w,E,_){let O=w;if(w&&!_&&typeof w=="object"){if(V.endsWith(E,"{}"))E=i?E:E.slice(0,-2),w=JSON.stringify(w);else if(V.isArray(w)&&TN(w)||(V.isFileList(w)||V.endsWith(E,"[]"))&&(O=V.toArray(w)))return E=Uv(E),O.forEach(function(Y,I){!(V.isUndefined(Y)||Y===null)&&s.append(m===!0?hx([E],I,f):m===null?E:E+"[]",h(Y))}),!1}return dd(w)?!0:(s.append(hx(_,E,f),h(w)),!1)}const x=[],S=Object.assign(_N,{defaultVisitor:y,convertValue:h,isVisitable:dd});function R(w,E){if(!V.isUndefined(w)){if(x.indexOf(w)!==-1)throw Error("Circular reference detected in "+E.join("."));x.push(w),V.forEach(w,function(O,k){(!(V.isUndefined(O)||O===null)&&d.call(s,O,V.isString(k)?k.trim():k,E,S))===!0&&R(O,E?E.concat(k):[k])}),x.pop()}}if(!V.isObject(a))throw new TypeError("data must be an object");return R(a),s}function px(a){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Od(a,s){this._pairs=[],a&&hi(a,this,s)}const Lv=Od.prototype;Lv.append=function(s,o){this._pairs.push([s,o])};Lv.toString=function(s){const o=s?function(i){return s.call(this,i,px)}:px;return this._pairs.map(function(d){return o(d[0])+"="+o(d[1])},"").join("&")};function RN(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Bv(a,s,o){if(!s)return a;const i=o&&o.encode||RN,d=V.isFunction(o)?{serialize:o}:o,f=d&&d.serialize;let m;if(f?m=f(s,d):m=V.isURLSearchParams(s)?s.toString():new Od(s,d).toString(i),m){const v=a.indexOf("#");v!==-1&&(a=a.slice(0,v)),a+=(a.indexOf("?")===-1?"?":"&")+m}return a}class xx{constructor(){this.handlers=[]}use(s,o,i){return this.handlers.push({fulfilled:s,rejected:o,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){V.forEach(this.handlers,function(i){i!==null&&s(i)})}}const qv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kN=typeof URLSearchParams<"u"?URLSearchParams:Od,MN=typeof FormData<"u"?FormData:null,AN=typeof Blob<"u"?Blob:null,ON={isBrowser:!0,classes:{URLSearchParams:kN,FormData:MN,Blob:AN},protocols:["http","https","file","blob","url","data"]},zd=typeof window<"u"&&typeof document<"u",fd=typeof navigator=="object"&&navigator||void 0,zN=zd&&(!fd||["ReactNative","NativeScript","NS"].indexOf(fd.product)<0),DN=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",UN=zd&&window.location.href||"http://localhost",LN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zd,hasStandardBrowserEnv:zN,hasStandardBrowserWebWorkerEnv:DN,navigator:fd,origin:UN},Symbol.toStringTag,{value:"Module"})),kt={...LN,...ON};function BN(a,s){return hi(a,new kt.classes.URLSearchParams,{visitor:function(o,i,d,f){return kt.isNode&&V.isBuffer(o)?(this.append(i,o.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...s})}function qN(a){return V.matchAll(/\w+|\[(\w*)]/g,a).map(s=>s[0]==="[]"?"":s[1]||s[0])}function HN(a){const s={},o=Object.keys(a);let i;const d=o.length;let f;for(i=0;i<d;i++)f=o[i],s[f]=a[f];return s}function Hv(a){function s(o,i,d,f){let m=o[f++];if(m==="__proto__")return!0;const v=Number.isFinite(+m),g=f>=o.length;return m=!m&&V.isArray(d)?d.length:m,g?(V.hasOwnProp(d,m)?d[m]=[d[m],i]:d[m]=i,!v):((!d[m]||!V.isObject(d[m]))&&(d[m]=[]),s(o,i,d[m],f)&&V.isArray(d[m])&&(d[m]=HN(d[m])),!v)}if(V.isFormData(a)&&V.isFunction(a.entries)){const o={};return V.forEachEntry(a,(i,d)=>{s(qN(i),d,o,0)}),o}return null}function GN(a,s,o){if(V.isString(a))try{return(s||JSON.parse)(a),V.trim(a)}catch(i){if(i.name!=="SyntaxError")throw i}return(o||JSON.stringify)(a)}const wl={transitional:qv,adapter:["xhr","http","fetch"],transformRequest:[function(s,o){const i=o.getContentType()||"",d=i.indexOf("application/json")>-1,f=V.isObject(s);if(f&&V.isHTMLForm(s)&&(s=new FormData(s)),V.isFormData(s))return d?JSON.stringify(Hv(s)):s;if(V.isArrayBuffer(s)||V.isBuffer(s)||V.isStream(s)||V.isFile(s)||V.isBlob(s)||V.isReadableStream(s))return s;if(V.isArrayBufferView(s))return s.buffer;if(V.isURLSearchParams(s))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),s.toString();let v;if(f){if(i.indexOf("application/x-www-form-urlencoded")>-1)return BN(s,this.formSerializer).toString();if((v=V.isFileList(s))||i.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return hi(v?{"files[]":s}:s,g&&new g,this.formSerializer)}}return f||d?(o.setContentType("application/json",!1),GN(s)):s}],transformResponse:[function(s){const o=this.transitional||wl.transitional,i=o&&o.forcedJSONParsing,d=this.responseType==="json";if(V.isResponse(s)||V.isReadableStream(s))return s;if(s&&V.isString(s)&&(i&&!this.responseType||d)){const m=!(o&&o.silentJSONParsing)&&d;try{return JSON.parse(s,this.parseReviver)}catch(v){if(m)throw v.name==="SyntaxError"?we.from(v,we.ERR_BAD_RESPONSE,this,null,this.response):v}}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],a=>{wl.headers[a]={}});const QN=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),VN=a=>{const s={};let o,i,d;return a&&a.split(`
|
|
12
|
-
`).forEach(function(m){d=m.indexOf(":"),o=m.substring(0,d).trim().toLowerCase(),i=m.substring(d+1).trim(),!(!o||s[o]&&QN[o])&&(o==="set-cookie"?s[o]?s[o].push(i):s[o]=[i]:s[o]=s[o]?s[o]+", "+i:i)}),s},vx=Symbol("internals");function fl(a){return a&&String(a).trim().toLowerCase()}function Wo(a){return a===!1||a==null?a:V.isArray(a)?a.map(Wo):String(a)}function FN(a){const s=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=o.exec(a);)s[i[1]]=i[2];return s}const YN=a=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(a.trim());function Qu(a,s,o,i,d){if(V.isFunction(i))return i.call(this,s,o);if(d&&(s=o),!!V.isString(s)){if(V.isString(i))return s.indexOf(i)!==-1;if(V.isRegExp(i))return i.test(s)}}function XN(a){return a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,o,i)=>o.toUpperCase()+i)}function KN(a,s){const o=V.toCamelCase(" "+s);["get","set","has"].forEach(i=>{Object.defineProperty(a,i+o,{value:function(d,f,m){return this[i].call(this,s,d,f,m)},configurable:!0})})}let Zt=class{constructor(s){s&&this.set(s)}set(s,o,i){const d=this;function f(v,g,h){const y=fl(g);if(!y)throw new Error("header name must be a non-empty string");const x=V.findKey(d,y);(!x||d[x]===void 0||h===!0||h===void 0&&d[x]!==!1)&&(d[x||g]=Wo(v))}const m=(v,g)=>V.forEach(v,(h,y)=>f(h,y,g));if(V.isPlainObject(s)||s instanceof this.constructor)m(s,o);else if(V.isString(s)&&(s=s.trim())&&!YN(s))m(VN(s),o);else if(V.isObject(s)&&V.isIterable(s)){let v={},g,h;for(const y of s){if(!V.isArray(y))throw TypeError("Object iterator must return a key-value pair");v[h=y[0]]=(g=v[h])?V.isArray(g)?[...g,y[1]]:[g,y[1]]:y[1]}m(v,o)}else s!=null&&f(o,s,i);return this}get(s,o){if(s=fl(s),s){const i=V.findKey(this,s);if(i){const d=this[i];if(!o)return d;if(o===!0)return FN(d);if(V.isFunction(o))return o.call(this,d,i);if(V.isRegExp(o))return o.exec(d);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,o){if(s=fl(s),s){const i=V.findKey(this,s);return!!(i&&this[i]!==void 0&&(!o||Qu(this,this[i],i,o)))}return!1}delete(s,o){const i=this;let d=!1;function f(m){if(m=fl(m),m){const v=V.findKey(i,m);v&&(!o||Qu(i,i[v],v,o))&&(delete i[v],d=!0)}}return V.isArray(s)?s.forEach(f):f(s),d}clear(s){const o=Object.keys(this);let i=o.length,d=!1;for(;i--;){const f=o[i];(!s||Qu(this,this[f],f,s,!0))&&(delete this[f],d=!0)}return d}normalize(s){const o=this,i={};return V.forEach(this,(d,f)=>{const m=V.findKey(i,f);if(m){o[m]=Wo(d),delete o[f];return}const v=s?XN(f):String(f).trim();v!==f&&delete o[f],o[v]=Wo(d),i[v]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const o=Object.create(null);return V.forEach(this,(i,d)=>{i!=null&&i!==!1&&(o[d]=s&&V.isArray(i)?i.join(", "):i)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,o])=>s+": "+o).join(`
|
|
13
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...o){const i=new this(s);return o.forEach(d=>i.set(d)),i}static accessor(s){const i=(this[vx]=this[vx]={accessors:{}}).accessors,d=this.prototype;function f(m){const v=fl(m);i[v]||(KN(d,m),i[v]=!0)}return V.isArray(s)?s.forEach(f):f(s),this}};Zt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);V.reduceDescriptors(Zt.prototype,({value:a},s)=>{let o=s[0].toUpperCase()+s.slice(1);return{get:()=>a,set(i){this[o]=i}}});V.freezeMethods(Zt);function Vu(a,s){const o=this||wl,i=s||o,d=Zt.from(i.headers);let f=i.data;return V.forEach(a,function(v){f=v.call(o,f,d.normalize(),s?s.status:void 0)}),d.normalize(),f}function Gv(a){return!!(a&&a.__CANCEL__)}let El=class extends we{constructor(s,o,i){super(s??"canceled",we.ERR_CANCELED,o,i),this.name="CanceledError",this.__CANCEL__=!0}};function Qv(a,s,o){const i=o.config.validateStatus;!o.status||!i||i(o.status)?a(o):s(new we("Request failed with status code "+o.status,[we.ERR_BAD_REQUEST,we.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function $N(a){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return s&&s[1]||""}function ZN(a,s){a=a||10;const o=new Array(a),i=new Array(a);let d=0,f=0,m;return s=s!==void 0?s:1e3,function(g){const h=Date.now(),y=i[f];m||(m=h),o[d]=g,i[d]=h;let x=f,S=0;for(;x!==d;)S+=o[x++],x=x%a;if(d=(d+1)%a,d===f&&(f=(f+1)%a),h-m<s)return;const R=y&&h-y;return R?Math.round(S*1e3/R):void 0}}function JN(a,s){let o=0,i=1e3/s,d,f;const m=(h,y=Date.now())=>{o=y,d=null,f&&(clearTimeout(f),f=null),a(...h)};return[(...h)=>{const y=Date.now(),x=y-o;x>=i?m(h,y):(d=h,f||(f=setTimeout(()=>{f=null,m(d)},i-x)))},()=>d&&m(d)]}const li=(a,s,o=3)=>{let i=0;const d=ZN(50,250);return JN(f=>{const m=f.loaded,v=f.lengthComputable?f.total:void 0,g=m-i,h=d(g),y=m<=v;i=m;const x={loaded:m,total:v,progress:v?m/v:void 0,bytes:g,rate:h||void 0,estimated:h&&v&&y?(v-m)/h:void 0,event:f,lengthComputable:v!=null,[s?"download":"upload"]:!0};a(x)},o)},gx=(a,s)=>{const o=a!=null;return[i=>s[0]({lengthComputable:o,total:a,loaded:i}),s[1]]},yx=a=>(...s)=>V.asap(()=>a(...s)),PN=kt.hasStandardBrowserEnv?((a,s)=>o=>(o=new URL(o,kt.origin),a.protocol===o.protocol&&a.host===o.host&&(s||a.port===o.port)))(new URL(kt.origin),kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent)):()=>!0,IN=kt.hasStandardBrowserEnv?{write(a,s,o,i,d,f,m){if(typeof document>"u")return;const v=[`${a}=${encodeURIComponent(s)}`];V.isNumber(o)&&v.push(`expires=${new Date(o).toUTCString()}`),V.isString(i)&&v.push(`path=${i}`),V.isString(d)&&v.push(`domain=${d}`),f===!0&&v.push("secure"),V.isString(m)&&v.push(`SameSite=${m}`),document.cookie=v.join("; ")},read(a){if(typeof document>"u")return null;const s=document.cookie.match(new RegExp("(?:^|; )"+a+"=([^;]*)"));return s?decodeURIComponent(s[1]):null},remove(a){this.write(a,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function WN(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function ej(a,s){return s?a.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):a}function Vv(a,s,o){let i=!WN(s);return a&&(i||o==!1)?ej(a,s):s}const bx=a=>a instanceof Zt?{...a}:a;function dr(a,s){s=s||{};const o={};function i(h,y,x,S){return V.isPlainObject(h)&&V.isPlainObject(y)?V.merge.call({caseless:S},h,y):V.isPlainObject(y)?V.merge({},y):V.isArray(y)?y.slice():y}function d(h,y,x,S){if(V.isUndefined(y)){if(!V.isUndefined(h))return i(void 0,h,x,S)}else return i(h,y,x,S)}function f(h,y){if(!V.isUndefined(y))return i(void 0,y)}function m(h,y){if(V.isUndefined(y)){if(!V.isUndefined(h))return i(void 0,h)}else return i(void 0,y)}function v(h,y,x){if(x in s)return i(h,y);if(x in a)return i(void 0,h)}const g={url:f,method:f,data:f,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:v,headers:(h,y,x)=>d(bx(h),bx(y),x,!0)};return V.forEach(Object.keys({...a,...s}),function(y){const x=g[y]||d,S=x(a[y],s[y],y);V.isUndefined(S)&&x!==v||(o[y]=S)}),o}const Fv=a=>{const s=dr({},a);let{data:o,withXSRFToken:i,xsrfHeaderName:d,xsrfCookieName:f,headers:m,auth:v}=s;if(s.headers=m=Zt.from(m),s.url=Bv(Vv(s.baseURL,s.url,s.allowAbsoluteUrls),a.params,a.paramsSerializer),v&&m.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):""))),V.isFormData(o)){if(kt.hasStandardBrowserEnv||kt.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(V.isFunction(o.getHeaders)){const g=o.getHeaders(),h=["content-type","content-length"];Object.entries(g).forEach(([y,x])=>{h.includes(y.toLowerCase())&&m.set(y,x)})}}if(kt.hasStandardBrowserEnv&&(i&&V.isFunction(i)&&(i=i(s)),i||i!==!1&&PN(s.url))){const g=d&&f&&IN.read(f);g&&m.set(d,g)}return s},tj=typeof XMLHttpRequest<"u",aj=tj&&function(a){return new Promise(function(o,i){const d=Fv(a);let f=d.data;const m=Zt.from(d.headers).normalize();let{responseType:v,onUploadProgress:g,onDownloadProgress:h}=d,y,x,S,R,w;function E(){R&&R(),w&&w(),d.cancelToken&&d.cancelToken.unsubscribe(y),d.signal&&d.signal.removeEventListener("abort",y)}let _=new XMLHttpRequest;_.open(d.method.toUpperCase(),d.url,!0),_.timeout=d.timeout;function O(){if(!_)return;const Y=Zt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),ne={data:!v||v==="text"||v==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:Y,config:a,request:_};Qv(function(H){o(H),E()},function(H){i(H),E()},ne),_=null}"onloadend"in _?_.onloadend=O:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(O)},_.onabort=function(){_&&(i(new we("Request aborted",we.ECONNABORTED,a,_)),_=null)},_.onerror=function(I){const ne=I&&I.message?I.message:"Network Error",ee=new we(ne,we.ERR_NETWORK,a,_);ee.event=I||null,i(ee),_=null},_.ontimeout=function(){let I=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded";const ne=d.transitional||qv;d.timeoutErrorMessage&&(I=d.timeoutErrorMessage),i(new we(I,ne.clarifyTimeoutError?we.ETIMEDOUT:we.ECONNABORTED,a,_)),_=null},f===void 0&&m.setContentType(null),"setRequestHeader"in _&&V.forEach(m.toJSON(),function(I,ne){_.setRequestHeader(ne,I)}),V.isUndefined(d.withCredentials)||(_.withCredentials=!!d.withCredentials),v&&v!=="json"&&(_.responseType=d.responseType),h&&([S,w]=li(h,!0),_.addEventListener("progress",S)),g&&_.upload&&([x,R]=li(g),_.upload.addEventListener("progress",x),_.upload.addEventListener("loadend",R)),(d.cancelToken||d.signal)&&(y=Y=>{_&&(i(!Y||Y.type?new El(null,a,_):Y),_.abort(),_=null)},d.cancelToken&&d.cancelToken.subscribe(y),d.signal&&(d.signal.aborted?y():d.signal.addEventListener("abort",y)));const k=$N(d.url);if(k&&kt.protocols.indexOf(k)===-1){i(new we("Unsupported protocol "+k+":",we.ERR_BAD_REQUEST,a));return}_.send(f||null)})},nj=(a,s)=>{const{length:o}=a=a?a.filter(Boolean):[];if(s||o){let i=new AbortController,d;const f=function(h){if(!d){d=!0,v();const y=h instanceof Error?h:this.reason;i.abort(y instanceof we?y:new El(y instanceof Error?y.message:y))}};let m=s&&setTimeout(()=>{m=null,f(new we(`timeout of ${s}ms exceeded`,we.ETIMEDOUT))},s);const v=()=>{a&&(m&&clearTimeout(m),m=null,a.forEach(h=>{h.unsubscribe?h.unsubscribe(f):h.removeEventListener("abort",f)}),a=null)};a.forEach(h=>h.addEventListener("abort",f));const{signal:g}=i;return g.unsubscribe=()=>V.asap(v),g}},rj=function*(a,s){let o=a.byteLength;if(o<s){yield a;return}let i=0,d;for(;i<o;)d=i+s,yield a.slice(i,d),i=d},sj=async function*(a,s){for await(const o of lj(a))yield*rj(o,s)},lj=async function*(a){if(a[Symbol.asyncIterator]){yield*a;return}const s=a.getReader();try{for(;;){const{done:o,value:i}=await s.read();if(o)break;yield i}}finally{await s.cancel()}},Nx=(a,s,o,i)=>{const d=sj(a,s);let f=0,m,v=g=>{m||(m=!0,i&&i(g))};return new ReadableStream({async pull(g){try{const{done:h,value:y}=await d.next();if(h){v(),g.close();return}let x=y.byteLength;if(o){let S=f+=x;o(S)}g.enqueue(new Uint8Array(y))}catch(h){throw v(h),h}},cancel(g){return v(g),d.return()}},{highWaterMark:2})},jx=64*1024,{isFunction:Fo}=V,oj=(({Request:a,Response:s})=>({Request:a,Response:s}))(V.global),{ReadableStream:Sx,TextEncoder:wx}=V.global,Ex=(a,...s)=>{try{return!!a(...s)}catch{return!1}},ij=a=>{a=V.merge.call({skipUndefined:!0},oj,a);const{fetch:s,Request:o,Response:i}=a,d=s?Fo(s):typeof fetch=="function",f=Fo(o),m=Fo(i);if(!d)return!1;const v=d&&Fo(Sx),g=d&&(typeof wx=="function"?(w=>E=>w.encode(E))(new wx):async w=>new Uint8Array(await new o(w).arrayBuffer())),h=f&&v&&Ex(()=>{let w=!1;const E=new o(kt.origin,{body:new Sx,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!E}),y=m&&v&&Ex(()=>V.isReadableStream(new i("").body)),x={stream:y&&(w=>w.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!x[w]&&(x[w]=(E,_)=>{let O=E&&E[w];if(O)return O.call(E);throw new we(`Response type '${w}' is not supported`,we.ERR_NOT_SUPPORT,_)})});const S=async w=>{if(w==null)return 0;if(V.isBlob(w))return w.size;if(V.isSpecCompliantForm(w))return(await new o(kt.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(V.isArrayBufferView(w)||V.isArrayBuffer(w))return w.byteLength;if(V.isURLSearchParams(w)&&(w=w+""),V.isString(w))return(await g(w)).byteLength},R=async(w,E)=>{const _=V.toFiniteNumber(w.getContentLength());return _??S(E)};return async w=>{let{url:E,method:_,data:O,signal:k,cancelToken:Y,timeout:I,onDownloadProgress:ne,onUploadProgress:ee,responseType:H,headers:K,withCredentials:ie="same-origin",fetchOptions:re}=Fv(w),oe=s||fetch;H=H?(H+"").toLowerCase():"text";let he=nj([k,Y&&Y.toAbortSignal()],I),Ee=null;const Te=he&&he.unsubscribe&&(()=>{he.unsubscribe()});let ae;try{if(ee&&h&&_!=="get"&&_!=="head"&&(ae=await R(K,O))!==0){let j=new o(E,{method:"POST",body:O,duplex:"half"}),D;if(V.isFormData(O)&&(D=j.headers.get("content-type"))&&K.setContentType(D),j.body){const[G,Z]=gx(ae,li(yx(ee)));O=Nx(j.body,jx,G,Z)}}V.isString(ie)||(ie=ie?"include":"omit");const C=f&&"credentials"in o.prototype,F={...re,signal:he,method:_.toUpperCase(),headers:K.normalize().toJSON(),body:O,duplex:"half",credentials:C?ie:void 0};Ee=f&&new o(E,F);let X=await(f?oe(Ee,re):oe(E,F));const ve=y&&(H==="stream"||H==="response");if(y&&(ne||ve&&Te)){const j={};["status","statusText","headers"].forEach(se=>{j[se]=X[se]});const D=V.toFiniteNumber(X.headers.get("content-length")),[G,Z]=ne&&gx(D,li(yx(ne),!0))||[];X=new i(Nx(X.body,jx,G,()=>{Z&&Z(),Te&&Te()}),j)}H=H||"text";let W=await x[V.findKey(x,H)||"text"](X,w);return!ve&&Te&&Te(),await new Promise((j,D)=>{Qv(j,D,{data:W,headers:Zt.from(X.headers),status:X.status,statusText:X.statusText,config:w,request:Ee})})}catch(C){throw Te&&Te(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new we("Network Error",we.ERR_NETWORK,w,Ee),{cause:C.cause||C}):we.from(C,C&&C.code,w,Ee)}}},cj=new Map,Yv=a=>{let s=a&&a.env||{};const{fetch:o,Request:i,Response:d}=s,f=[i,d,o];let m=f.length,v=m,g,h,y=cj;for(;v--;)g=f[v],h=y.get(g),h===void 0&&y.set(g,h=v?new Map:ij(s)),y=h;return h};Yv();const Dd={http:CN,xhr:aj,fetch:{get:Yv}};V.forEach(Dd,(a,s)=>{if(a){try{Object.defineProperty(a,"name",{value:s})}catch{}Object.defineProperty(a,"adapterName",{value:s})}});const Cx=a=>`- ${a}`,uj=a=>V.isFunction(a)||a===null||a===!1;function dj(a,s){a=V.isArray(a)?a:[a];const{length:o}=a;let i,d;const f={};for(let m=0;m<o;m++){i=a[m];let v;if(d=i,!uj(i)&&(d=Dd[(v=String(i)).toLowerCase()],d===void 0))throw new we(`Unknown adapter '${v}'`);if(d&&(V.isFunction(d)||(d=d.get(s))))break;f[v||"#"+m]=d}if(!d){const m=Object.entries(f).map(([g,h])=>`adapter ${g} `+(h===!1?"is not supported by the environment":"is not available in the build"));let v=o?m.length>1?`since :
|
|
14
|
-
`+m.map(Cx).join(`
|
|
15
|
-
`):" "+Cx(m[0]):"as no adapter specified";throw new we("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return d}const Xv={getAdapter:dj,adapters:Dd};function Fu(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new El(null,a)}function Tx(a){return Fu(a),a.headers=Zt.from(a.headers),a.data=Vu.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),Xv.getAdapter(a.adapter||wl.adapter,a)(a).then(function(i){return Fu(a),i.data=Vu.call(a,a.transformResponse,i),i.headers=Zt.from(i.headers),i},function(i){return Gv(i)||(Fu(a),i&&i.response&&(i.response.data=Vu.call(a,a.transformResponse,i.response),i.response.headers=Zt.from(i.response.headers))),Promise.reject(i)})}const Kv="1.13.4",pi={};["object","boolean","number","function","string","symbol"].forEach((a,s)=>{pi[a]=function(i){return typeof i===a||"a"+(s<1?"n ":" ")+a}});const _x={};pi.transitional=function(s,o,i){function d(f,m){return"[Axios v"+Kv+"] Transitional option '"+f+"'"+m+(i?". "+i:"")}return(f,m,v)=>{if(s===!1)throw new we(d(m," has been removed"+(o?" in "+o:"")),we.ERR_DEPRECATED);return o&&!_x[m]&&(_x[m]=!0,console.warn(d(m," has been deprecated since v"+o+" and will be removed in the near future"))),s?s(f,m,v):!0}};pi.spelling=function(s){return(o,i)=>(console.warn(`${i} is likely a misspelling of ${s}`),!0)};function fj(a,s,o){if(typeof a!="object")throw new we("options must be an object",we.ERR_BAD_OPTION_VALUE);const i=Object.keys(a);let d=i.length;for(;d-- >0;){const f=i[d],m=s[f];if(m){const v=a[f],g=v===void 0||m(v,f,a);if(g!==!0)throw new we("option "+f+" must be "+g,we.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new we("Unknown option "+f,we.ERR_BAD_OPTION)}}const ei={assertOptions:fj,validators:pi},Oa=ei.validators;let ir=class{constructor(s){this.defaults=s||{},this.interceptors={request:new xx,response:new xx}}async request(s,o){try{return await this._request(s,o)}catch(i){if(i instanceof Error){let d={};Error.captureStackTrace?Error.captureStackTrace(d):d=new Error;const f=d.stack?d.stack.replace(/^.+\n/,""):"";try{i.stack?f&&!String(i.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
|
16
|
-
`+f):i.stack=f}catch{}}throw i}}_request(s,o){typeof s=="string"?(o=o||{},o.url=s):o=s||{},o=dr(this.defaults,o);const{transitional:i,paramsSerializer:d,headers:f}=o;i!==void 0&&ei.assertOptions(i,{silentJSONParsing:Oa.transitional(Oa.boolean),forcedJSONParsing:Oa.transitional(Oa.boolean),clarifyTimeoutError:Oa.transitional(Oa.boolean)},!1),d!=null&&(V.isFunction(d)?o.paramsSerializer={serialize:d}:ei.assertOptions(d,{encode:Oa.function,serialize:Oa.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),ei.assertOptions(o,{baseUrl:Oa.spelling("baseURL"),withXsrfToken:Oa.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let m=f&&V.merge(f.common,f[o.method]);f&&V.forEach(["delete","get","head","post","put","patch","common"],w=>{delete f[w]}),o.headers=Zt.concat(m,f);const v=[];let g=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(o)===!1||(g=g&&E.synchronous,v.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let y,x=0,S;if(!g){const w=[Tx.bind(this),void 0];for(w.unshift(...v),w.push(...h),S=w.length,y=Promise.resolve(o);x<S;)y=y.then(w[x++],w[x++]);return y}S=v.length;let R=o;for(;x<S;){const w=v[x++],E=v[x++];try{R=w(R)}catch(_){E.call(this,_);break}}try{y=Tx.call(this,R)}catch(w){return Promise.reject(w)}for(x=0,S=h.length;x<S;)y=y.then(h[x++],h[x++]);return y}getUri(s){s=dr(this.defaults,s);const o=Vv(s.baseURL,s.url,s.allowAbsoluteUrls);return Bv(o,s.params,s.paramsSerializer)}};V.forEach(["delete","get","head","options"],function(s){ir.prototype[s]=function(o,i){return this.request(dr(i||{},{method:s,url:o,data:(i||{}).data}))}});V.forEach(["post","put","patch"],function(s){function o(i){return function(f,m,v){return this.request(dr(v||{},{method:s,headers:i?{"Content-Type":"multipart/form-data"}:{},url:f,data:m}))}}ir.prototype[s]=o(),ir.prototype[s+"Form"]=o(!0)});let mj=class $v{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(f){o=f});const i=this;this.promise.then(d=>{if(!i._listeners)return;let f=i._listeners.length;for(;f-- >0;)i._listeners[f](d);i._listeners=null}),this.promise.then=d=>{let f;const m=new Promise(v=>{i.subscribe(v),f=v}).then(d);return m.cancel=function(){i.unsubscribe(f)},m},s(function(f,m,v){i.reason||(i.reason=new El(f,m,v),o(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const o=this._listeners.indexOf(s);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const s=new AbortController,o=i=>{s.abort(i)};return this.subscribe(o),s.signal.unsubscribe=()=>this.unsubscribe(o),s.signal}static source(){let s;return{token:new $v(function(d){s=d}),cancel:s}}};function hj(a){return function(o){return a.apply(null,o)}}function pj(a){return V.isObject(a)&&a.isAxiosError===!0}const md={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(md).forEach(([a,s])=>{md[s]=a});function Zv(a){const s=new ir(a),o=Tv(ir.prototype.request,s);return V.extend(o,ir.prototype,s,{allOwnKeys:!0}),V.extend(o,s,null,{allOwnKeys:!0}),o.create=function(d){return Zv(dr(a,d))},o}const nt=Zv(wl);nt.Axios=ir;nt.CanceledError=El;nt.CancelToken=mj;nt.isCancel=Gv;nt.VERSION=Kv;nt.toFormData=hi;nt.AxiosError=we;nt.Cancel=nt.CanceledError;nt.all=function(s){return Promise.all(s)};nt.spread=hj;nt.isAxiosError=pj;nt.mergeConfig=dr;nt.AxiosHeaders=Zt;nt.formToJSON=a=>Hv(V.isHTMLForm(a)?new FormData(a):a);nt.getAdapter=Xv.getAdapter;nt.HttpStatusCode=md;nt.default=nt;const{Axios:d3,AxiosError:f3,CanceledError:m3,isCancel:h3,CancelToken:p3,VERSION:x3,all:v3,Cancel:g3,isAxiosError:y3,spread:b3,toFormData:N3,AxiosHeaders:j3,HttpStatusCode:S3,formToJSON:w3,getAdapter:E3,mergeConfig:C3}=nt,be=nt.create({baseURL:""});function rs(a){a?be.defaults.headers.common.Authorization=`Bearer ${a}`:delete be.defaults.headers.common.Authorization}let hd=null;function xj(a){hd=a}let Jv=null;function vj(a){Jv=a}be.interceptors.request.use(a=>{if(!a.headers.Authorization){const s=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token");s&&(a.headers.Authorization=`Bearer ${s}`)}return a});be.interceptors.response.use(a=>a,async a=>{const s=a.config;if(s.url?.startsWith("/api/auth/"))return Promise.reject(a);if(a.response?.status===401&&!s._retry&&hd){s._retry=!0;const o=await hd();if(o)return s.headers.Authorization=`Bearer ${o}`,be(s);Jv?.()}return Promise.reject(a)});async function gj(){const{data:a}=await be.get("/api/auth/setup-status");return a}async function Pv(a,s,o){const{data:i}=await be.post("/api/auth/setup",{email:a,password:s,username:o});return i}async function yj(a,s){const{data:o}=await be.post("/api/auth/login",{email:a,password:s});return o}async function bj(a){const{data:s}=await be.post("/api/auth/refresh",{refresh_token:a});return s}const Iv=N.createContext(void 0),ml="jarvis-admin:access_token",ts="jarvis-admin:refresh_token",Yo="jarvis-admin:user",Nj=600*1e3;function jj({children:a}){const[s,o]=N.useState(()=>{const g=localStorage.getItem(ml),h=localStorage.getItem(ts),y=localStorage.getItem(Yo);if(g&&h&&y)try{const x=JSON.parse(y);return rs(g),{user:x,accessToken:g,refreshToken:h,isAuthenticated:!0,isLoading:!1,error:null}}catch{}return{user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null}}),i=N.useCallback(()=>{localStorage.removeItem(ml),localStorage.removeItem(ts),localStorage.removeItem(Yo),rs(null),o({user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null})},[]),d=N.useCallback(async()=>{const g=localStorage.getItem(ts);if(!g)return null;try{const h=await bj(g),y=h.access_token,x=h.refresh_token??g;return localStorage.setItem(ml,y),localStorage.setItem(ts,x),rs(y),o(S=>({...S,accessToken:y,refreshToken:x})),y}catch{return i(),null}},[i]);N.useEffect(()=>{xj(d),vj(i)},[d,i]),N.useEffect(()=>{if(!s.isAuthenticated)return;const g=setInterval(()=>{d()},Nj);return()=>clearInterval(g)},[s.isAuthenticated,d]);const f=N.useCallback(async(g,h)=>{o(y=>({...y,error:null,isLoading:!0}));try{const y=await yj(g,h);if(!y.user.is_superuser){o(x=>({...x,isLoading:!1,error:"Admin access required. This account is not a superuser."}));return}localStorage.setItem(ml,y.access_token),localStorage.setItem(ts,y.refresh_token),localStorage.setItem(Yo,JSON.stringify(y.user)),rs(y.access_token),o({user:y.user,accessToken:y.access_token,refreshToken:y.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(y){const x=y?.response?.data?.detail??"Login failed";o(S=>({...S,isLoading:!1,error:x}))}},[]),m=N.useCallback(async(g,h,y)=>{o(x=>({...x,error:null,isLoading:!0}));try{const x=await Pv(g,h,y);localStorage.setItem(ml,x.access_token),localStorage.setItem(ts,x.refresh_token),localStorage.setItem(Yo,JSON.stringify(x.user)),rs(x.access_token),o({user:x.user,accessToken:x.access_token,refreshToken:x.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(x){const S=x?.response?.data?.detail??"Setup failed";o(R=>({...R,isLoading:!1,error:S}))}},[]),v=N.useMemo(()=>({state:s,login:f,setup:m,logout:i}),[s,f,m,i]);return l.jsx(Iv.Provider,{value:v,children:a})}function Ud(){const a=N.useContext(Iv);if(!a)throw new Error("useAuth must be used within AuthProvider");return a}const Wv=(...a)=>a.filter((s,o,i)=>!!s&&s.trim()!==""&&i.indexOf(s)===o).join(" ").trim();const Sj=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const wj=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,o,i)=>i?i.toUpperCase():o.toLowerCase());const Rx=a=>{const s=wj(a);return s.charAt(0).toUpperCase()+s.slice(1)};var Ej={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Cj=a=>{for(const s in a)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1};const Tj=N.forwardRef(({color:a="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:d="",children:f,iconNode:m,...v},g)=>N.createElement("svg",{ref:g,...Ej,width:s,height:s,stroke:a,strokeWidth:i?Number(o)*24/Number(s):o,className:Wv("lucide",d),...!f&&!Cj(v)&&{"aria-hidden":"true"},...v},[...m.map(([h,y])=>N.createElement(h,y)),...Array.isArray(f)?f:[f]]));const ye=(a,s)=>{const o=N.forwardRef(({className:i,...d},f)=>N.createElement(Tj,{ref:f,iconNode:s,className:Wv(`lucide-${Sj(Rx(a))}`,`lucide-${a}`,i),...d}));return o.displayName=Rx(a),o};const _j=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Rj=ye("activity",_j);const kj=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Mj=ye("box",kj);const Aj=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Oj=ye("boxes",Aj);const zj=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],pd=ye("brain",zj);const Dj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xi=ye("check",Dj);const Uj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ld=ye("chevron-down",Uj);const Lj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eg=ye("chevron-right",Lj);const Bj=[["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"}]],Bd=ye("circle-alert",Bj);const qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],tg=ye("circle-arrow-up",qj);const Hj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Gj=ye("circle-check-big",Hj);const Qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ht=ye("circle-check",Qj);const Vj=[["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"}]],xl=ye("circle-x",Vj);const Fj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],os=ye("circle",Fj);const Yj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Xj=ye("clock",Yj);const Kj=[["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"}]],qd=ye("copy",Kj);const $j=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],On=ye("cpu",$j);const Zj=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Jj=ye("database",Zj);const Pj=[["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"}]],en=ye("download",Pj);const Ij=[["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"}]],Wj=ye("external-link",Ij);const eS=[["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"}]],ag=ye("file-text",eS);const tS=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],xd=ye("git-merge",tS);const aS=[["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"}]],nS=ye("globe",aS);const rS=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Hd=ye("hard-drive",rS);const sS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],lS=ye("info",sS);const oS=[["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"}]],iS=ye("key-round",oS);const cS=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],uS=ye("key",cS);const dS=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],fS=ye("layout-dashboard",dS);const mS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ct=ye("loader-circle",mS);const hS=[["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"}]],pS=ye("lock-open",hS);const xS=[["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"}]],vi=ye("lock",xS);const vS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],gS=ye("log-out",vS);const yS=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],kx=ye("mic",yS);const bS=[["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"}]],NS=ye("monitor",bS);const jS=[["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"}]],SS=ye("moon",jS);const wS=[["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"}]],ES=ye("pencil",wS);const CS=[["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"}]],ng=ye("play",CS);const TS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ti=ye("plus",TS);const _S=[["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"}]],it=ye("refresh-cw",_S);const RS=[["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"}]],gi=ye("rotate-ccw",RS);const kS=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Gd=ye("rotate-cw",kS);const MS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],AS=ye("search",MS);const OS=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Qd=ye("server",OS);const zS=[["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"}]],rg=ye("settings",zS);const DS=[["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"}]],US=ye("shield-check",DS);const LS=[["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"}]],BS=ye("sparkles",LS);const qS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],HS=ye("square",qS);const GS=[["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"}]],QS=ye("sun",GS);const VS=[["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"}]],yi=ye("trash-2",VS);const FS=[["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"}]],ra=ye("triangle-alert",FS);const YS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],XS=ye("user-x",YS);const KS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],$S=ye("users",KS);const ZS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vd=ye("x",ZS);const JS=[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],PS=ye("zap-off",JS);const IS=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],oi=ye("zap",IS);function sg(a){var s,o,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var d=a.length;for(s=0;s<d;s++)a[s]&&(o=sg(a[s]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function WS(){for(var a,s,o=0,i="",d=arguments.length;o<d;o++)(a=arguments[o])&&(s=sg(a))&&(i&&(i+=" "),i+=s);return i}const ew=(a,s)=>{const o=new Array(a.length+s.length);for(let i=0;i<a.length;i++)o[i]=a[i];for(let i=0;i<s.length;i++)o[a.length+i]=s[i];return o},tw=(a,s)=>({classGroupId:a,validator:s}),lg=(a=new Map,s=null,o)=>({nextPart:a,validators:s,classGroupId:o}),ii="-",Mx=[],aw="arbitrary..",nw=a=>{const s=sw(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return rw(m);const v=m.split(ii),g=v[0]===""&&v.length>1?1:0;return og(v,g,s)},getConflictingClassGroupIds:(m,v)=>{if(v){const g=i[m],h=o[m];return g?h?ew(h,g):g:h||Mx}return o[m]||Mx}}},og=(a,s,o)=>{if(a.length-s===0)return o.classGroupId;const d=a[s],f=o.nextPart.get(d);if(f){const h=og(a,s+1,f);if(h)return h}const m=o.validators;if(m===null)return;const v=s===0?a.join(ii):a.slice(s).join(ii),g=m.length;for(let h=0;h<g;h++){const y=m[h];if(y.validator(v))return y.classGroupId}},rw=a=>a.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=a.slice(1,-1),o=s.indexOf(":"),i=s.slice(0,o);return i?aw+i:void 0})(),sw=a=>{const{theme:s,classGroups:o}=a;return lw(o,s)},lw=(a,s)=>{const o=lg();for(const i in a){const d=a[i];Fd(d,o,i,s)}return o},Fd=(a,s,o,i)=>{const d=a.length;for(let f=0;f<d;f++){const m=a[f];ow(m,s,o,i)}},ow=(a,s,o,i)=>{if(typeof a=="string"){iw(a,s,o);return}if(typeof a=="function"){cw(a,s,o,i);return}uw(a,s,o,i)},iw=(a,s,o)=>{const i=a===""?s:ig(s,a);i.classGroupId=o},cw=(a,s,o,i)=>{if(dw(a)){Fd(a(i),s,o,i);return}s.validators===null&&(s.validators=[]),s.validators.push(tw(o,a))},uw=(a,s,o,i)=>{const d=Object.entries(a),f=d.length;for(let m=0;m<f;m++){const[v,g]=d[m];Fd(g,ig(s,v),o,i)}},ig=(a,s)=>{let o=a;const i=s.split(ii),d=i.length;for(let f=0;f<d;f++){const m=i[f];let v=o.nextPart.get(m);v||(v=lg(),o.nextPart.set(m,v)),o=v}return o},dw=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,fw=a=>{if(a<1)return{get:()=>{},set:()=>{}};let s=0,o=Object.create(null),i=Object.create(null);const d=(f,m)=>{o[f]=m,s++,s>a&&(s=0,i=o,o=Object.create(null))};return{get(f){let m=o[f];if(m!==void 0)return m;if((m=i[f])!==void 0)return d(f,m),m},set(f,m){f in o?o[f]=m:d(f,m)}}},vd="!",Ax=":",mw=[],Ox=(a,s,o,i,d)=>({modifiers:a,hasImportantModifier:s,baseClassName:o,maybePostfixModifierPosition:i,isExternal:d}),hw=a=>{const{prefix:s,experimentalParseClassName:o}=a;let i=d=>{const f=[];let m=0,v=0,g=0,h;const y=d.length;for(let E=0;E<y;E++){const _=d[E];if(m===0&&v===0){if(_===Ax){f.push(d.slice(g,E)),g=E+1;continue}if(_==="/"){h=E;continue}}_==="["?m++:_==="]"?m--:_==="("?v++:_===")"&&v--}const x=f.length===0?d:d.slice(g);let S=x,R=!1;x.endsWith(vd)?(S=x.slice(0,-1),R=!0):x.startsWith(vd)&&(S=x.slice(1),R=!0);const w=h&&h>g?h-g:void 0;return Ox(f,R,S,w)};if(s){const d=s+Ax,f=i;i=m=>m.startsWith(d)?f(m.slice(d.length)):Ox(mw,!1,m,void 0,!0)}if(o){const d=i;i=f=>o({className:f,parseClassName:d})}return i},pw=a=>{const s=new Map;return a.orderSensitiveModifiers.forEach((o,i)=>{s.set(o,1e6+i)}),o=>{const i=[];let d=[];for(let f=0;f<o.length;f++){const m=o[f],v=m[0]==="[",g=s.has(m);v||g?(d.length>0&&(d.sort(),i.push(...d),d=[]),i.push(m)):d.push(m)}return d.length>0&&(d.sort(),i.push(...d)),i}},xw=a=>({cache:fw(a.cacheSize),parseClassName:hw(a),sortModifiers:pw(a),...nw(a)}),vw=/\s+/,gw=(a,s)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:d,sortModifiers:f}=s,m=[],v=a.trim().split(vw);let g="";for(let h=v.length-1;h>=0;h-=1){const y=v[h],{isExternal:x,modifiers:S,hasImportantModifier:R,baseClassName:w,maybePostfixModifierPosition:E}=o(y);if(x){g=y+(g.length>0?" "+g:g);continue}let _=!!E,O=i(_?w.substring(0,E):w);if(!O){if(!_){g=y+(g.length>0?" "+g:g);continue}if(O=i(w),!O){g=y+(g.length>0?" "+g:g);continue}_=!1}const k=S.length===0?"":S.length===1?S[0]:f(S).join(":"),Y=R?k+vd:k,I=Y+O;if(m.indexOf(I)>-1)continue;m.push(I);const ne=d(O,_);for(let ee=0;ee<ne.length;++ee){const H=ne[ee];m.push(Y+H)}g=y+(g.length>0?" "+g:g)}return g},yw=(...a)=>{let s=0,o,i,d="";for(;s<a.length;)(o=a[s++])&&(i=cg(o))&&(d&&(d+=" "),d+=i);return d},cg=a=>{if(typeof a=="string")return a;let s,o="";for(let i=0;i<a.length;i++)a[i]&&(s=cg(a[i]))&&(o&&(o+=" "),o+=s);return o},bw=(a,...s)=>{let o,i,d,f;const m=g=>{const h=s.reduce((y,x)=>x(y),a());return o=xw(h),i=o.cache.get,d=o.cache.set,f=v,v(g)},v=g=>{const h=i(g);if(h)return h;const y=gw(g,o);return d(g,y),y};return f=m,(...g)=>f(yw(...g))},Nw=[],dt=a=>{const s=o=>o[a]||Nw;return s.isThemeGetter=!0,s},ug=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jw=/^\d+\/\d+$/,Sw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ww=/\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$/,Ew=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Cw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,as=a=>jw.test(a),Ae=a=>!!a&&!Number.isNaN(Number(a)),Mn=a=>!!a&&Number.isInteger(Number(a)),Yu=a=>a.endsWith("%")&&Ae(a.slice(0,-1)),Wa=a=>Sw.test(a),_w=()=>!0,Rw=a=>ww.test(a)&&!Ew.test(a),fg=()=>!1,kw=a=>Cw.test(a),Mw=a=>Tw.test(a),Aw=a=>!de(a)&&!fe(a),Ow=a=>ms(a,pg,fg),de=a=>ug.test(a),sr=a=>ms(a,xg,Rw),Xu=a=>ms(a,Bw,Ae),zx=a=>ms(a,mg,fg),zw=a=>ms(a,hg,Mw),Xo=a=>ms(a,vg,kw),fe=a=>dg.test(a),hl=a=>hs(a,xg),Dw=a=>hs(a,qw),Dx=a=>hs(a,mg),Uw=a=>hs(a,pg),Lw=a=>hs(a,hg),Ko=a=>hs(a,vg,!0),ms=(a,s,o)=>{const i=ug.exec(a);return i?i[1]?s(i[1]):o(i[2]):!1},hs=(a,s,o=!1)=>{const i=dg.exec(a);return i?i[1]?s(i[1]):o:!1},mg=a=>a==="position"||a==="percentage",hg=a=>a==="image"||a==="url",pg=a=>a==="length"||a==="size"||a==="bg-size",xg=a=>a==="length",Bw=a=>a==="number",qw=a=>a==="family-name",vg=a=>a==="shadow",Hw=()=>{const a=dt("color"),s=dt("font"),o=dt("text"),i=dt("font-weight"),d=dt("tracking"),f=dt("leading"),m=dt("breakpoint"),v=dt("container"),g=dt("spacing"),h=dt("radius"),y=dt("shadow"),x=dt("inset-shadow"),S=dt("text-shadow"),R=dt("drop-shadow"),w=dt("blur"),E=dt("perspective"),_=dt("aspect"),O=dt("ease"),k=dt("animate"),Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ne=()=>[...I(),fe,de],ee=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],K=()=>[fe,de,g],ie=()=>[as,"full","auto",...K()],re=()=>[Mn,"none","subgrid",fe,de],oe=()=>["auto",{span:["full",Mn,fe,de]},Mn,fe,de],he=()=>[Mn,"auto",fe,de],Ee=()=>["auto","min","max","fr",fe,de],Te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...K()],F=()=>[as,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...K()],X=()=>[a,fe,de],ve=()=>[...I(),Dx,zx,{position:[fe,de]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",Uw,Ow,{size:[fe,de]}],D=()=>[Yu,hl,sr],G=()=>["","none","full",h,fe,de],Z=()=>["",Ae,hl,sr],se=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Ae,Yu,Dx,zx],je=()=>["","none",w,fe,de],U=()=>["none",Ae,fe,de],z=()=>["none",Ae,fe,de],Se=()=>[Ae,fe,de],xe=()=>[as,"full",...K()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wa],breakpoint:[Wa],color:[_w],container:[Wa],"drop-shadow":[Wa],ease:["in","out","in-out"],font:[Aw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wa],shadow:[Wa],spacing:["px",Ae],text:[Wa],"text-shadow":[Wa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",as,de,fe,_]}],container:["container"],columns:[{columns:[Ae,de,fe,v]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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:ne()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ie()}],"inset-x":[{"inset-x":ie()}],"inset-y":[{"inset-y":ie()}],start:[{start:ie()}],end:[{end:ie()}],top:[{top:ie()}],right:[{right:ie()}],bottom:[{bottom:ie()}],left:[{left:ie()}],visibility:["visible","invisible","collapse"],z:[{z:[Mn,"auto",fe,de]}],basis:[{basis:[as,"full","auto",v,...K()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,as,"auto","initial","none",de]}],grow:[{grow:["",Ae,fe,de]}],shrink:[{shrink:["",Ae,fe,de]}],order:[{order:[Mn,"first","last","none",fe,de]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ee()}],"auto-rows":[{"auto-rows":Ee()}],gap:[{gap:K()}],"gap-x":[{"gap-x":K()}],"gap-y":[{"gap-y":K()}],"justify-content":[{justify:[...Te(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...Te()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":Te()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:K()}],px:[{px:K()}],py:[{py:K()}],ps:[{ps:K()}],pe:[{pe:K()}],pt:[{pt:K()}],pr:[{pr:K()}],pb:[{pb:K()}],pl:[{pl:K()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":K()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":K()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[v,"screen",...F()]}],"min-w":[{"min-w":[v,"screen","none",...F()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[m]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",o,hl,sr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,fe,Xu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yu,de]}],"font-family":[{font:[Dw,de,s]}],"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:[d,fe,de]}],"line-clamp":[{"line-clamp":[Ae,"none",fe,Xu]}],leading:[{leading:[f,...K()]}],"list-image":[{"list-image":["none",fe,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",fe,sr]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Ae,"auto",fe,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ve()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mn,fe,de],radial:["",fe,de],conic:[Mn,fe,de]},Lw,zw]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,fe,de]}],"outline-w":[{outline:["",Ae,hl,sr]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",y,Ko,Xo]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",x,Ko,Xo]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Ae,sr]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",S,Ko,Xo]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Ae,fe,de]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[fe,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"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":I()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ve()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,de]}],filter:[{filter:["","none",fe,de]}],blur:[{blur:je()}],brightness:[{brightness:[Ae,fe,de]}],contrast:[{contrast:[Ae,fe,de]}],"drop-shadow":[{"drop-shadow":["","none",R,Ko,Xo]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Ae,fe,de]}],"hue-rotate":[{"hue-rotate":[Ae,fe,de]}],invert:[{invert:["",Ae,fe,de]}],saturate:[{saturate:[Ae,fe,de]}],sepia:[{sepia:["",Ae,fe,de]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,de]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,fe,de]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,fe,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,fe,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,fe,de]}],"backdrop-invert":[{"backdrop-invert":["",Ae,fe,de]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,fe,de]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,fe,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,fe,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":K()}],"border-spacing-x":[{"border-spacing-x":K()}],"border-spacing-y":[{"border-spacing-y":K()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",fe,de]}],ease:[{ease:["linear","initial",O,fe,de]}],delay:[{delay:[Ae,fe,de]}],animate:[{animate:["none",k,fe,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,fe,de]}],"perspective-origin":[{"perspective-origin":ne()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:z()}],"scale-x":[{"scale-x":z()}],"scale-y":[{"scale-y":z()}],"scale-z":[{"scale-z":z()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[fe,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:ne()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,de]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,de]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Ae,hl,sr,Xu]}],stroke:[{stroke:["none",...X()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Gw=bw(Hw);function te(...a){return Gw(WS(a))}async function Qw(){const{data:a}=await be.get("/api/system/info");return a}function Vw(){return yt({queryKey:["system-info"],queryFn:Qw,staleTime:6e4})}function Fw(a){const s=Math.floor(a/86400),o=Math.floor(a%86400/3600);if(s>0)return`${s}d ${o}h`;const i=Math.floor(a%3600/60);return o>0?`${o}h ${i}m`:`${i}m`}function Yw(){const{data:a}=Vw();return a?l.jsxs("div",{className:"border-t border-[var(--color-border)] px-3 py-2 text-[10px] text-[var(--color-text-muted)]",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(On,{size:10}),l.jsxs("span",{children:[a.cpuCount," cores"]}),l.jsx("span",{className:"mx-0.5",children:"|"}),l.jsx(Hd,{size:10}),l.jsxs("span",{children:[Math.round(a.totalMemoryMb/1024),"GB"]})]}),l.jsxs("div",{className:"mt-0.5",children:[a.hostname," · up ",Fw(a.uptime)," · v",a.version]})]}):null}const Xw=[{label:"Dashboard",icon:fS,path:"/dashboard"},{label:"Settings",icon:rg,path:"/settings"},{label:"Services",icon:Qd,path:"/services"},{label:"Models",icon:Mj,path:"/models"},{label:"Quick Sets",icon:oi,path:"/quick-sets"},{label:"Traces",icon:Rj,path:"/traces"},{label:"Nodes",icon:On,path:"/nodes"},{label:"Users",icon:$S,path:"/users"},{label:"Native",icon:Oj,path:"/native-services"}];function Kw(){return l.jsxs("aside",{className:"flex w-56 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsx("div",{className:"flex h-14 items-center border-b border-[var(--color-border)] px-4",children:l.jsx("span",{className:"text-lg font-bold text-[var(--color-primary)]",children:"Jarvis"})}),l.jsx("nav",{className:"flex-1 space-y-1 p-2",children:Xw.map(a=>l.jsxs(mv,{to:a.path,className:({isActive:s})=>te("flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",s?"bg-[var(--color-primary)]/10 text-[var(--color-primary)]":"text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-text)]"),children:[l.jsx(a.icon,{size:18}),a.label]},a.path))}),l.jsx(Yw,{})]})}function $w(){const{state:a,logout:s}=Ud(),{theme:o,toggleTheme:i}=H2();return l.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-[var(--color-border)] bg-[var(--color-surface)] px-6",children:[l.jsx("h2",{className:"text-sm font-medium text-[var(--color-text-muted)]",children:"Admin Dashboard"}),l.jsxs("div",{className:"flex items-center gap-3",children:[a.user&&l.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:a.user.email}),l.jsx("button",{onClick:i,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",title:`Switch to ${o==="dark"?"light":"dark"} mode`,children:o==="dark"?l.jsx(QS,{size:18}):l.jsx(SS,{size:18})}),l.jsx("button",{onClick:s,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-red-500",title:"Logout",children:l.jsx(gS,{size:18})})]})]})}function Zw(){const{state:a}=Ud();return a.isLoading?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading..."})}):a.isAuthenticated?l.jsxs("div",{className:"flex h-screen bg-[var(--color-background)]",children:[l.jsx(Kw,{}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx($w,{}),l.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:l.jsx(X0,{})})]})]}):l.jsx(ni,{to:"/login",replace:!0})}function Jw(){const{state:a,login:s,setup:o}=Ud(),i=wa(),[d,f]=N.useState("loading"),[m,v]=N.useState(""),[g,h]=N.useState(""),[y,x]=N.useState(""),[S,R]=N.useState(""),[w,E]=N.useState(null);if(N.useEffect(()=>{let I=!1;async function ne(){try{const{data:ee}=await be.get("/api/setup/status");if(!I&&!ee.configured){i("/setup",{replace:!0});return}}catch{if(!I){i("/setup",{replace:!0});return}}try{const ee=await gj();I||f(ee.needs_setup?"setup":"login")}catch{I||f("login")}}return ne(),()=>{I=!0}},[i]),a.isAuthenticated)return l.jsx(ni,{to:"/settings",replace:!0});const _=I=>{I.preventDefault(),s(m,y)},O=I=>{if(I.preventDefault(),E(null),y!==S){E("Passwords do not match");return}if(y.length<8){E("Password must be at least 8 characters");return}o(m,y,g||void 0)},k=te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]"),Y=w??a.error;return d==="loading"?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-border)] border-t-[var(--color-primary)]"})})})}):l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:d==="setup"?l.jsxs(l.Fragment,{children:[l.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),l.jsx("p",{className:"mb-6 text-center text-sm text-[var(--color-text-muted)]",children:"Set up your first administrator account to get started."}),l.jsxs("form",{onSubmit:O,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:I=>v(I.target.value),className:k,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"username",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Username"}),l.jsx("input",{id:"username",type:"text",required:!0,autoComplete:"username",value:g,onChange:I=>h(I.target.value),className:k,placeholder:"admin"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:y,onChange:I=>x(I.target.value),className:k})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),l.jsx("input",{id:"confirm-password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:S,onChange:I=>R(I.target.value),className:k})]}),Y&&l.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:Y}),l.jsx("button",{type:"submit",disabled:a.isLoading,className:te("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50","transition-opacity"),children:a.isLoading?"Creating account...":"Create Admin Account"})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("h1",{className:"mb-6 text-center text-2xl font-bold text-[var(--color-text)]",children:"Jarvis Admin"}),l.jsxs("form",{onSubmit:_,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:I=>v(I.target.value),className:k,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",required:!0,autoComplete:"current-password",value:y,onChange:I=>x(I.target.value),className:k})]}),Y&&l.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:Y}),l.jsx("button",{type:"submit",disabled:a.isLoading,className:te("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50","transition-opacity"),children:a.isLoading?"Signing in...":"Sign in"})]})]})})})}async function Pw(){const{data:a}=await be.get("/api/settings/");return a}async function Iw(a,s,o){const{data:i}=await be.put(`/api/settings/${encodeURIComponent(a)}/${s}`,{value:o});return i}function Ww(){return yt({queryKey:["settings"],queryFn:Pw,staleTime:3e4})}function gg(){const a=pt();return bt({mutationFn:({serviceName:s,key:o,value:i})=>Iw(s,o,i),onSuccess:()=>{a.invalidateQueries({queryKey:["settings"]})}})}function eE({setting:a,onSave:s,onCancel:o,isSaving:i}){const[d,f]=N.useState(()=>a.value_type==="json"?JSON.stringify(a.value,null,2):a.value_type==="bool"?"":String(a.value??"")),[m,v]=N.useState(()=>!!a.value),[g,h]=N.useState(null),y=!!a.options?.length,x=y&&!a.options.includes(d),[S,R]=N.useState(x),w=_=>{_.preventDefault();let O;switch(a.value_type){case"bool":O=m;break;case"int":if(O=parseInt(d,10),isNaN(O)){h("Must be a whole number");return}h(null);break;case"float":if(O=parseFloat(d),isNaN(O)){h("Must be a number");return}h(null);break;case"json":try{O=JSON.parse(d),h(null)}catch{h("Invalid JSON");return}break;default:O=d}s(O)},E=te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-2 focus:ring-[var(--color-primary)]");return l.jsxs("form",{onSubmit:w,className:"flex items-center gap-2",children:[y?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{value:S?"__other__":d,onChange:_=>{_.target.value==="__other__"?(R(!0),f("")):(R(!1),f(_.target.value))},className:te(E,"max-w-xs"),children:[a.options.map(_=>l.jsx("option",{value:String(_),children:String(_)},String(_))),l.jsx("option",{value:"__other__",children:"Other..."})]}),S&&l.jsx("input",{type:"text",value:d,onChange:_=>f(_.target.value),placeholder:"Custom value",className:te(E,"max-w-xs"),autoFocus:!0})]}):a.value_type==="bool"?l.jsx("button",{type:"button",onClick:()=>v(_=>!_),className:te("relative h-6 w-11 rounded-full transition-colors",m?"bg-[var(--color-primary)]":"bg-[var(--color-border)]"),children:l.jsx("span",{className:te("absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform",m&&"translate-x-5")})}):a.value_type==="json"?l.jsxs("div",{className:"flex-1",children:[l.jsx("textarea",{value:d,onChange:_=>{f(_.target.value),h(null)},rows:4,className:te(E,"font-mono text-xs")}),g&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:g})]}):l.jsxs("div",{children:[l.jsx("input",{type:a.value_type==="int"||a.value_type==="float"?"number":a.is_secret?"password":"text",step:a.value_type==="float"?"any":void 0,value:d,onChange:_=>{f(_.target.value),h(null)},className:te(E,"max-w-xs")}),g&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:g})]}),l.jsx("button",{type:"submit",disabled:i,className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:i?"Saving...":"Save"}),l.jsx("button",{type:"button",onClick:o,className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})}function tE(a){return a.is_secret?"********":a.value===null||a.value===void 0?"(not set)":a.value_type==="json"?JSON.stringify(a.value):String(a.value)}const aE={string:"bg-blue-500/10 text-blue-500",int:"bg-emerald-500/10 text-emerald-500",float:"bg-emerald-500/10 text-emerald-500",bool:"bg-amber-500/10 text-amber-500",json:"bg-purple-500/10 text-purple-500"};function nE({setting:a,serviceName:s,onRestartService:o}){const[i,d]=N.useState(!1),f=gg(),m=v=>{f.mutate({serviceName:s,key:a.key,value:v},{onSuccess:g=>{d(!1),g.requires_reload?Me.warning(`Setting updated. ${s} requires a restart to apply.`,o?{action:{label:"Restart",onClick:o}}:void 0):Me.success("Setting updated")},onError:g=>{Me.error(`Failed to update: ${g.message}`)}})};return l.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg px-3 py-2 hover:bg-[var(--color-surface-alt)]",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"text-sm font-medium text-[var(--color-text)]",children:a.key}),l.jsx("span",{className:te("rounded px-1.5 py-0.5 text-[10px] font-medium",aE[a.value_type]??"bg-gray-500/10 text-gray-500"),children:a.value_type}),a.from_db&&l.jsx("span",{title:"Stored in database",children:l.jsx(Jj,{size:12,className:"text-[var(--color-tertiary)]"})}),a.requires_reload&&l.jsx("span",{title:"Requires service restart",children:l.jsx(ra,{size:12,className:"text-amber-500"})})]}),a.description&&l.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:a.description}),i?l.jsx("div",{className:"mt-2",children:l.jsx(eE,{setting:a,onSave:m,onCancel:()=>d(!1),isSaving:f.isPending})}):l.jsx("p",{className:"mt-1 font-mono text-xs text-[var(--color-text-muted)]",children:tE(a)})]}),!i&&l.jsx("button",{onClick:()=>d(!0),className:"shrink-0 rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-primary)]",title:"Edit",children:l.jsx(ES,{size:14})})]})}function rE({category:a,settings:s,serviceName:o,onRestartService:i}){const[d,f]=N.useState(!0);return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>f(m=>!m),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[d?l.jsx(Ld,{size:14}):l.jsx(eg,{size:14}),a,l.jsxs("span",{className:"font-normal",children:["(",s.length,")"]})]}),d&&l.jsx("div",{className:"space-y-0.5",children:s.map(m=>l.jsx(nE,{setting:m,serviceName:o,onRestartService:i},m.key))})]})}async function sE(){const{data:a}=await be.get("/api/containers");return a}async function lE(a){const{data:s}=await be.post(`/api/containers/${a}/restart`);return s}function yg(){return yt({queryKey:["containers"],queryFn:sE,staleTime:1e4,refetchInterval:1e4})}function bg(){const a=pt();return bt({mutationFn:s=>lE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["containers"]})}})}function oE({result:a,defaultExpanded:s=!1}){const[o,i]=N.useState(s),{data:d}=yg(),f=bg(),m=N.useCallback(()=>{const g=d?.containers.find(h=>h.name.includes(a.service_name)||h.name.includes(a.service_name.replace("jarvis-","")));g?f.mutate(g.id,{onSuccess:()=>Me.success(`${a.service_name} is restarting...`),onError:h=>Me.error(`Restart failed: ${h.message}`)}):Me.error(`Could not find container for ${a.service_name}`)},[d,a.service_name,f]),v=N.useMemo(()=>{const g=new Map;for(const h of a.settings){const y=g.get(h.category)??[];g.set(h.category,[...y,h])}return g},[a]);return l.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsxs("button",{onClick:()=>i(g=>!g),className:"flex w-full items-center gap-3 px-4 py-3 text-left hover:bg-[var(--color-surface-alt)]",children:[o?l.jsx(Ld,{size:18,className:"text-[var(--color-text-muted)]"}):l.jsx(eg,{size:18,className:"text-[var(--color-text-muted)]"}),l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.service_name}),a.success?l.jsx(ht,{size:16,className:"text-[var(--color-secondary)]"}):l.jsx(xl,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a.success?`${a.settings.length} settings`:a.error??"Error"}),a.latency_ms!=null&&l.jsxs("span",{className:te("ml-auto text-xs",a.latency_ms>500?"text-amber-500":"text-[var(--color-text-muted)]"),children:[Math.round(a.latency_ms),"ms"]})]}),o&&a.success&&l.jsx("div",{className:"space-y-2 border-t border-[var(--color-border)] px-2 py-3",children:[...v.entries()].map(([g,h])=>l.jsx(rE,{category:g,settings:h,serviceName:a.service_name,onRestartService:m},g))}),o&&!a.success&&l.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-3",children:l.jsx("p",{className:"text-sm text-red-500",children:a.error??"Failed to fetch settings"})})]})}function iE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=Ww(),[m,v]=N.useState(""),g=N.useMemo(()=>{if(!a)return[];if(!m.trim())return a.services;const h=m.toLowerCase();return a.services.map(y=>({...y,settings:y.settings.filter(x=>x.key.toLowerCase().includes(h)||x.category.toLowerCase().includes(h)||(x.description?.toLowerCase().includes(h)??!1))})).filter(y=>y.settings.length>0||y.service_name.toLowerCase().includes(h))},[a,m]);return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load settings"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Settings"}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[a&&l.jsxs("span",{children:[a.successful_services,"/",a.total_services," services"]}),l.jsx("button",{onClick:()=>d(),disabled:f,className:te("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),l.jsxs("div",{className:"relative",children:[l.jsx(AS,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),l.jsx("input",{type:"text",value:m,onChange:h=>v(h.target.value),placeholder:"Search settings...",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] py-2 pl-9 pr-3","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"space-y-3",children:[g.map((h,y)=>l.jsx(oE,{result:h,defaultExpanded:y===0},h.service_name)),g.length===0&&l.jsx("p",{className:"py-8 text-center text-sm text-[var(--color-text-muted)]",children:m?"No settings match your search":"No services found"})]})]})}async function cE(){const{data:a}=await be.get("/api/services/registry");return a}async function uE(a){const{data:s}=await be.post("/api/services/register",a);return s}async function dE(a){const{data:s}=await be.post("/api/services/rotate-key",a);return s}async function fE(a){const{data:s}=await be.post("/api/services/probe",a);return s}async function mE(a){const{data:s}=await be.post("/api/services/register",{services:[{name:a.name,host:a.host,port:a.port,scheme:a.scheme,health_path:a.health_path,description:a.description}]});return s}async function hE(a){await be.delete(`/api/services/${encodeURIComponent(a)}`)}async function pE(){const{data:a}=await be.get("/api/services/suggestions");return a}function xE(){return yt({queryKey:["service-registry"],queryFn:cE,staleTime:3e4})}function vE(){const a=pt();return bt({mutationFn:uE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function gE(){const a=pt();return bt({mutationFn:dE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function yE(){const a=pt();return bt({mutationFn:mE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function bE(){const a=pt();return bt({mutationFn:hE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function NE(){return yt({queryKey:["service-suggestions"],queryFn:pE,staleTime:6e4})}function Ux({ok:a,label:s}){return l.jsxs("span",{className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[a?l.jsx(xi,{size:12}):l.jsx(Vd,{size:12}),s]})}function jE({status:a,error:s,latency:o}){return a==="idle"?null:a==="probing"?l.jsx("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:l.jsx(Ct,{size:12,className:"animate-spin"})}):a==="healthy"?l.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 dark:text-green-400",children:[l.jsx(os,{size:8,fill:"currentColor"}),o!=null&&`${o}ms`]}):l.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",title:s,children:[l.jsx(os,{size:8,fill:"currentColor"}),s||"Unreachable"]})}function SE({entry:a,checked:s,host:o,port:i,scheme:d,onToggle:f,onHostChange:m,onPortChange:v,onSchemeChange:g,onHostBlur:h,onPortBlur:y,onRotateKey:x,onDelete:S,disabled:R,rotating:w,deleting:E,healthStatus:_,healthError:O,healthLatency:k}){return l.jsxs("div",{className:te("flex flex-wrap items-center gap-3 rounded-lg border border-[var(--color-border)] p-3","bg-[var(--color-surface)] transition-colors",s&&"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5"),children:[l.jsx("input",{type:"checkbox",checked:s,onChange:f,disabled:R,className:"h-4 w-4 rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),l.jsxs("div",{className:"min-w-[180px] flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-[var(--color-text)]",children:[a.name,a.custom&&l.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"custom"})]}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:a.description})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ux,{ok:a.config_registered,label:"Config"}),l.jsx(Ux,{ok:a.auth_registered,label:"Auth"}),a.custom&&S&&l.jsxs("button",{onClick:S,disabled:R||E,className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium","bg-red-500/10 text-red-600 dark:text-red-400","hover:bg-red-500/20","disabled:opacity-50"),title:"Remove custom service",children:[l.jsx(yi,{size:12,className:E?"animate-spin":""}),"Remove"]}),a.auth_registered&&l.jsxs("button",{onClick:x,disabled:R||w,className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium","bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]","hover:bg-[var(--color-primary)]/10 hover:text-[var(--color-primary)]","disabled:opacity-50"),title:"Rotate app key",children:[l.jsx(Gd,{size:12,className:w?"animate-spin":""}),"Rotate Key"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{value:d,onChange:Y=>g(Y.target.value),disabled:R,className:te("rounded border px-1.5 py-1 text-xs font-mono",d==="https"?"border-green-500/40 bg-green-500/10 text-green-600 dark:text-green-400":d==="mqtt"||d==="mqtts"?"border-purple-500/40 bg-purple-500/10 text-purple-600 dark:text-purple-400":d==="ws"||d==="wss"?"border-blue-500/40 bg-blue-500/10 text-blue-600 dark:text-blue-400":"border-[var(--color-border)] bg-[var(--color-background)] text-[var(--color-text-muted)]","disabled:opacity-50"),title:"Scheme",children:[l.jsx("option",{value:"http",children:"http"}),l.jsx("option",{value:"https",children:"https"}),l.jsx("option",{value:"mqtt",children:"mqtt"}),l.jsx("option",{value:"mqtts",children:"mqtts"}),l.jsx("option",{value:"ws",children:"ws"}),l.jsx("option",{value:"wss",children:"wss"})]}),l.jsx("input",{type:"text",value:o,onChange:Y=>m(Y.target.value),onBlur:h,disabled:R,placeholder:"host",className:te("w-36 rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1","text-xs text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]","disabled:opacity-50")}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:":"}),l.jsx("input",{type:"number",value:i,onChange:Y=>v(Number(Y.target.value)),onBlur:y,disabled:R,className:te("w-20 rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1","text-xs text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]","disabled:opacity-50")}),l.jsx(jE,{status:_,error:O,latency:k})]})]})}const Lx={name:"",host:"localhost",port:"",scheme:"http",health_path:"/health",description:""};function wE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=xE(),m=vE(),v=gE(),g=yE(),h=bE(),{data:y}=NE(),[x,S]=N.useState({}),[R,w]=N.useState(null),[E,_]=N.useState(null),[O,k]=N.useState(null),[Y,I]=N.useState(null),[ne,ee]=N.useState(null),[H,K]=N.useState({}),[ie,re]=N.useState(!1),[oe,he]=N.useState(Lx),[Ee,Te]=N.useState(!1),ae=N.useRef(null),C=N.useMemo(()=>new Set(a?.services.map(U=>U.name)??[]),[a]),F=N.useMemo(()=>{const z=(y?.suggestions??[]).filter(xe=>!C.has(xe.id));if(!oe.name.trim())return z;const Se=oe.name.toLowerCase();return z.filter(xe=>xe.id.toLowerCase().includes(Se)||xe.name.toLowerCase().includes(Se)||xe.description.toLowerCase().includes(Se))},[y,C,oe.name]),X=N.useCallback(U=>{he({name:U.id,description:U.description,host:"localhost",port:String(U.port),scheme:"http",health_path:U.healthCheck}),Te(!1)},[]);N.useEffect(()=>{const U=z=>{ae.current&&!ae.current.contains(z.target)&&Te(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[]);const ve=N.useCallback(U=>{if(x[U])return x[U];const z=a?.services.find(Se=>Se.name===U);return z?{checked:z.config_registered,host:z.current_host??"localhost",port:z.current_port??z.default_port,scheme:z.current_scheme??"http"}:{checked:!1,host:"localhost",port:0,scheme:"http"}},[x,a]),W=N.useCallback((U,z)=>{S(Se=>{const xe=Se[U]??{checked:!1,host:"localhost",port:0};return{...Se,[U]:{...xe,...z}}})},[]),j=N.useCallback(async(U,z,Se,xe,Ut="http")=>{if(!(!z||!Se)){K(ct=>({...ct,[U]:{status:"probing"}}));try{const ct=await fE({host:z,port:Se,health_path:xe,scheme:Ut});K(Dn=>({...Dn,[U]:{status:ct.healthy?"healthy":"unhealthy",error:ct.error??void 0,latency:ct.latency_ms??void 0}}))}catch{K(ct=>({...ct,[U]:{status:"unhealthy",error:"Request failed"}}))}}},[]),D=N.useCallback(()=>{if(!a)return;const U=a.services.filter(z=>ve(z.name).checked).map(z=>{const Se=ve(z.name);return{name:z.name,host:Se.host,port:Se.port,scheme:Se.scheme}});if(U.length===0){Me.error("No services selected");return}w(null),_(null),m.mutate({services:U},{onSuccess:z=>{w(z.results);const Se=z.results.filter(Ut=>Ut.config_ok&&Ut.auth_ok).length,xe=z.results.length;Se===xe?Me.success(`All ${xe} services registered`):Me.warning(`${Se}/${xe} services registered successfully`)},onError:z=>{Me.error(`Registration failed: ${z.message}`)}})},[a,ve,m]),G=N.useCallback(U=>{k(U),_(null),v.mutate({service_name:U},{onSuccess:z=>{_(z),k(null),Me.success(`Key rotated for ${U}`)},onError:z=>{k(null),Me.error(`Key rotation failed: ${z.message}`)}})},[v]),Z=N.useCallback(U=>{I(U),h.mutate(U,{onSuccess:()=>{I(null),Me.success(`Removed ${U}`)},onError:z=>{I(null),Me.error(`Failed to remove: ${z.message}`)}})},[h]),se=N.useCallback(()=>{const U=parseInt(oe.port,10);if(!oe.name.trim()){Me.error("Service name is required");return}if(!U||U<1||U>65535){Me.error("Port must be between 1 and 65535");return}g.mutate({name:oe.name.trim(),host:oe.host.trim()||"localhost",port:U,scheme:oe.scheme,health_path:oe.health_path.trim()||"/health",description:oe.description.trim()},{onSuccess:z=>{const Se=z.results[0];Se?.config_ok?(Me.success(`Added ${oe.name.trim()}`),he(Lx),re(!1)):Me.error(`Failed to add: ${Se?.error??"Unknown error"}`)},onError:z=>{Me.error(`Failed to add service: ${z.message}`)}})},[oe,g]),me=N.useCallback(U=>{navigator.clipboard.writeText(U).then(()=>{ee(U),setTimeout(()=>ee(null),2e3)})},[]),ue=a?.services.filter(U=>ve(U.name).checked).length??0,je=R?.some(U=>U.env_written)||E?.env_written===!0;return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load service registry"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Services"}),l.jsx("span",{className:"rounded-full bg-[var(--color-surface-alt)] px-2.5 py-0.5 text-xs font-medium text-[var(--color-text-muted)]",children:a?.services.length??0})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>re(U=>!U),className:te("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium",ie?"bg-[var(--color-surface-alt)] text-[var(--color-text)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[ie?l.jsx(Vd,{size:14}):l.jsx(ti,{size:14}),ie?"Cancel":"Add Service"]}),l.jsx("button",{onClick:()=>d(),disabled:f,className:te("rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),ie&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Add Service"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{ref:ae,className:"relative",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Service"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:"text",value:oe.name,onChange:U=>{he(z=>({...z,name:U.target.value})),Te(!0)},onFocus:()=>Te(!0),placeholder:"Select or type a service name...",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5 pr-8","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")}),l.jsx("button",{type:"button",onClick:()=>Te(U=>!U),className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:l.jsx(Ld,{size:14})})]}),Ee&&F.length>0&&l.jsx("div",{className:"absolute z-10 mt-1 max-h-48 w-full overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] shadow-lg",children:F.map(U=>l.jsxs("button",{type:"button",onClick:()=>X(U),className:"flex w-full flex-col px-3 py-2 text-left hover:bg-[var(--color-surface-alt)]",children:[l.jsxs("span",{className:"text-sm font-medium text-[var(--color-text)]",children:[U.name,l.jsxs("span",{className:"ml-2 font-normal text-[var(--color-text-muted)]",children:[":",U.port]})]}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:U.description})]},U.id))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Description"}),l.jsx("input",{type:"text",value:oe.description,onChange:U=>he(z=>({...z,description:U.target.value})),placeholder:"e.g. Camera streaming via WebRTC",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Host"}),l.jsx("input",{type:"text",value:oe.host,onChange:U=>he(z=>({...z,host:U.target.value})),placeholder:"localhost",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Port"}),l.jsx("input",{type:"number",value:oe.port,onChange:U=>he(z=>({...z,port:U.target.value})),placeholder:"e.g. 1984",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"w-20",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Scheme"}),l.jsxs("select",{value:oe.scheme,onChange:U=>he(z=>({...z,scheme:U.target.value})),className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]"),children:[l.jsx("option",{value:"http",children:"http"}),l.jsx("option",{value:"https",children:"https"}),l.jsx("option",{value:"mqtt",children:"mqtt"}),l.jsx("option",{value:"mqtts",children:"mqtts"}),l.jsx("option",{value:"ws",children:"ws"}),l.jsx("option",{value:"wss",children:"wss"})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Health Path"}),l.jsx("input",{type:"text",value:oe.health_path,onChange:U=>he(z=>({...z,health_path:U.target.value})),placeholder:"/health",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]})]}),l.jsx("div",{className:"mt-3 flex justify-end",children:l.jsx("button",{onClick:se,disabled:g.isPending||!oe.name.trim()||!oe.port,className:te("rounded-lg bg-[var(--color-primary)] px-4 py-1.5 text-sm font-medium text-white","hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"),children:g.isPending?"Adding...":"Add Service"})})]}),l.jsx("div",{className:"space-y-2",children:a?.services.map(U=>{const z=ve(U.name),Se=H[U.name]??{status:"idle"};return l.jsx(SE,{entry:U,checked:z.checked,host:z.host,port:z.port,scheme:z.scheme,onToggle:()=>{const xe=!z.checked;W(U.name,{...z,checked:xe}),xe?j(U.name,z.host,z.port,U.health_path,z.scheme):K(Ut=>({...Ut,[U.name]:{status:"idle"}}))},onHostChange:xe=>W(U.name,{...z,host:xe}),onPortChange:xe=>W(U.name,{...z,port:xe}),onSchemeChange:xe=>W(U.name,{...z,scheme:xe}),onHostBlur:()=>{z.checked&&j(U.name,z.host,z.port,U.health_path,z.scheme)},onPortBlur:()=>{z.checked&&j(U.name,z.host,z.port,U.health_path,z.scheme)},onRotateKey:()=>G(U.name),onDelete:()=>Z(U.name),disabled:m.isPending,rotating:O===U.name,deleting:Y===U.name,healthStatus:Se.status,healthError:Se.error,healthLatency:Se.latency},U.name)})}),l.jsx("button",{onClick:D,disabled:m.isPending||ue===0,className:te("rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white","hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"),children:m.isPending?"Registering...":`Register Selected (${ue})`}),E&&l.jsx(EE,{serviceName:E.service_name,appKey:E.app_key,envWritten:E.env_written,copiedKey:ne,onCopy:me,label:"Rotated Key"}),R&&l.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Registration Results"}),R.map(U=>l.jsxs("div",{className:te("flex flex-wrap items-center gap-3 rounded-lg border p-3 text-sm",U.config_ok&&U.auth_ok?"border-green-500/20 bg-green-500/5":"border-yellow-500/20 bg-yellow-500/5"),children:[l.jsx("span",{className:"min-w-[180px] font-medium text-[var(--color-text)]",children:U.name}),l.jsxs("span",{className:te("text-xs",U.config_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Config: ",U.config_ok?"OK":"Failed"]}),l.jsxs("span",{className:te("text-xs",U.auth_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Auth: ",U.auth_ok?U.auth_created?"Created":"Exists":"Failed"]}),U.env_written!==null&&l.jsxs("span",{className:te("text-xs",U.env_written?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",U.env_written?"Written":"Failed"]}),U.error&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),U.error]}),U.auth_created&&U.app_key&&l.jsxs("div",{className:"mt-1 w-full",children:[l.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),"App key (shown once only):"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"flex-1 overflow-x-auto rounded bg-[var(--color-background)] px-2 py-1 font-mono text-xs text-[var(--color-text)]",children:U.app_key}),l.jsx("button",{onClick:()=>me(U.app_key),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:ne===U.app_key?l.jsx(xi,{size:14,className:"text-green-500"}):l.jsx(qd,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]},U.name))]}),je&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-blue-500/20 bg-blue-500/5 p-3",children:[l.jsx(lS,{size:16,className:"mt-0.5 shrink-0 text-blue-500"}),l.jsx("p",{className:"text-sm text-[var(--color-text)]",children:"Services whose .env files were updated need to be restarted to pick up the new credentials. Restart each affected service's container or process."})]})]})}function EE({serviceName:a,appKey:s,envWritten:o,copiedKey:i,onCopy:d,label:f}){return l.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:[f,": ",a]}),l.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-3",children:[o!==null&&l.jsxs("span",{className:te("mb-2 inline-block text-xs",o?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",o?"Written":"Failed"]}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),"New app key (shown once only):"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"flex-1 overflow-x-auto rounded bg-[var(--color-background)] px-2 py-1 font-mono text-xs text-[var(--color-text)]",children:s}),l.jsx("button",{onClick:()=>d(s),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:i===s?l.jsx(xi,{size:14,className:"text-green-500"}):l.jsx(qd,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]})]})}async function CE(){const{data:a}=await be.get("/api/llm-setup/status");return a}async function TE(a){const{data:s}=await be.post("/api/llm-setup/configure",{settings:a});return s}async function _E(a,s,o){const{data:i}=await be.post("/api/llm-setup/download",{repo:a,filename:s,token:o});return i}function RE(){return yt({queryKey:["llm-status"],queryFn:CE,staleTime:3e4,retry:1})}function Ng(){const a=pt();return bt({mutationFn:s=>TE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function kE(){return bt({mutationFn:({repo:a,filename:s,token:o})=>_E(a,s,o)})}async function Yd(){const{data:a}=await be.get("/api/install/status");return a}async function ME(a){const s=a?.length?{services:a.join(",")}:{},{data:o}=await be.get("/api/install/preflight",{params:s});return o}async function AE(){const{data:a}=await be.get("/api/install/hardware");return a}async function Bx(a){const{data:s}=await be.post("/api/install/generate",a);return s}async function jg(){const{data:a}=await be.get("/api/install/registry");return a}async function OE(){const{data:a}=await be.get("/api/install/defaults");return a}const zE={running:"bg-emerald-500",exited:"bg-red-500",restarting:"bg-amber-500",paused:"bg-amber-500",created:"bg-gray-400",dead:"bg-red-700"};function DE(a){return a.match(/^Up (.+)$/)?.[1]??null}function qx({container:a,onRestart:s,isRestarting:o}){const i=DE(a.status),d=a.ports.find(f=>f.public)?.public;return l.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[l.jsx("div",{className:te("h-2.5 w-2.5 rounded-full",zE[a.state]??"bg-gray-400")}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:a.displayName??a.name}),a.description&&l.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:a.description})]}),l.jsx("span",{className:te("rounded-full px-2 py-0.5 text-xs font-medium",a.state==="running"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-red-500/10 text-red-600 dark:text-red-400"),children:a.state})]}),l.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-2",children:l.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-text-muted)]",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[i&&l.jsxs("span",{children:["Up ",i]}),d&&l.jsxs("span",{children:[":",d]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[d&&l.jsx("a",{href:`http://localhost:${d}/health`,target:"_blank",rel:"noopener noreferrer",className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Open health endpoint",children:l.jsx(Wj,{size:13})}),l.jsx("button",{onClick:()=>s(a.id),disabled:o,className:te("rounded p-1 hover:bg-[var(--color-surface-alt)]",o&&"animate-spin"),title:"Restart",children:l.jsx(Gd,{size:13})})]})]})})]})}async function UE(){const{data:a}=await be.get("/api/update/check");return a}function Sg(){return yt({queryKey:["update-check"],queryFn:UE,staleTime:300*1e3,retry:1,refetchOnWindowFocus:!1})}const Hx="jarvis-update-dismissed-version";function Gx(){const a=wa(),{data:s}=Sg(),[o,i]=N.useState(()=>s?.latestVersion?localStorage.getItem(Hx)===s.latestVersion:!1);return!s?.updateAvailable||o?null:l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(tg,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Jarvis v",s.latestVersion," available"]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["You have v",s.currentVersion]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[s.releaseUrl&&l.jsx("a",{href:s.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Release notes"}),l.jsx("button",{onClick:()=>{localStorage.setItem(Hx,s.latestVersion),i(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/update"),className:"rounded-lg bg-green-600 px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Update"})]})]})}const Ku="jarvis-admin:llm-setup-dismissed";function LE(){const a=wa(),[s,o]=N.useState(!1),{data:i,isLoading:d,isError:f,error:m,refetch:v,isFetching:g}=yg(),h=bg(),y=RE(),[x,S]=N.useState(()=>!!localStorage.getItem(Ku));N.useEffect(()=>{Yd().then(k=>{k.deployMode==="compose-export"&&o(!0)}).catch(()=>{})},[]);const R=!!y.data&&!y.data.configured&&!x,w=k=>{h.mutate(k,{onSuccess:()=>Me.success("Container restart initiated"),onError:Y=>Me.error(`Restart failed: ${Y.message}`)})};if(s)return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),l.jsx(Gx,{}),R&&l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(pd,{size:20,className:"text-[var(--color-primary)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem(Ku,"true"),S(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/llm-setup"),className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Set up LLM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xd,{size:20,className:"text-[var(--color-text-muted)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Sync compose to latest registry"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Regenerate docker-compose.yml, apply changes, and re-register services with config-service"})]})]}),l.jsx("button",{onClick:()=>a("/reconcile"),className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:"Sync now"})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-8 text-center",children:[l.jsx(Qd,{size:32,className:"mx-auto mb-3 text-[var(--color-text-muted)]"}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Running in Docker Compose mode"}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Container management is handled by your Docker environment (TrueNAS, Portainer, etc.). Use your platform's tools to view container status, logs, and restarts."})]})]});if(d)return l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})});if(f)return l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load containers"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:m?.message??"Unknown error"}),l.jsx("button",{onClick:()=>v(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]});const E=i?.containers??[],_=E.filter(k=>k.state==="running"),O=E.filter(k=>k.state!=="running");return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("span",{children:[_.length,"/",E.length," running"]}),l.jsx("button",{onClick:()=>v(),disabled:g,className:te("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",g&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),l.jsx(Gx,{}),R&&l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(pd,{size:20,className:"text-[var(--color-primary)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem(Ku,"true"),S(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/llm-setup"),className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Set up LLM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xd,{size:20,className:"text-[var(--color-text-muted)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Sync compose to latest registry"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Regenerate docker-compose.yml and apply changes — adds new background workers and services without recreating unchanged containers"})]})]}),l.jsx("button",{onClick:()=>a("/reconcile"),className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:"Sync now"})]}),E.length===0&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:i?.error?i.error:"No Jarvis containers found. Is Docker running?"})}),_.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Running"}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:_.map(k=>l.jsx(qx,{container:k,onRestart:w,isRestarting:h.isPending&&h.variables===k.id},k.id))})]}),O.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Stopped"}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:O.map(k=>l.jsx(qx,{container:k,onRestart:w,isRestarting:h.isPending&&h.variables===k.id},k.id))})]})]})}async function BE(){const{data:a}=await be.get("/api/nodes");return a}async function qE(a){const{data:s}=await be.get(`/api/nodes/${a}/nodes`);return s}async function HE(a){const{data:s}=await be.post(`/api/nodes/${a}/train-adapter`);return s}function GE(){return yt({queryKey:["households"],queryFn:BE,staleTime:3e4})}function QE(a){return yt({queryKey:["household-nodes",a],queryFn:()=>qE(a),enabled:!!a,staleTime:3e4})}function VE(){const a=pt();return bt({mutationFn:HE,onSuccess:()=>{a.invalidateQueries({queryKey:["household-nodes"]})}})}function FE({node:a,onTrain:s,isTraining:o}){return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(On,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.name})]}),l.jsxs("span",{className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a.is_active?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-500"),children:[a.is_active?l.jsx(oi,{size:10}):l.jsx(PS,{size:10}),a.is_active?"Active":"Inactive"]})]}),l.jsxs("div",{className:"mt-3 space-y-1 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"ID:"})," ",a.node_id]}),a.services.length>0&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Services:"})," ",a.services.join(", ")]})]}),l.jsx("div",{className:"mt-4",children:l.jsx("button",{onClick:()=>s(a.node_id),disabled:o||!a.is_active,className:te("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",o||!a.is_active?"cursor-not-allowed bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:o?l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(it,{size:12,className:"animate-spin"}),"Training..."]}):"Train Adapter"})})]})}function YE({householdId:a,householdName:s}){const{data:o,isLoading:i,isError:d}=QE(a),f=VE(),m=v=>{f.mutate(v,{onSuccess:g=>Me.success(`Training triggered for ${v} (request: ${g.request_id.slice(0,8)}...)`),onError:g=>Me.error(`Training failed: ${g.message}`)})};return l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:s}),i&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:18})}),d&&l.jsx("p",{className:"py-4 text-center text-sm text-red-500",children:"Failed to load nodes"}),o&&o.length===0&&l.jsx("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:"No nodes registered in this household"}),o&&o.length>0&&l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:o.map(v=>l.jsx(FE,{node:v,onTrain:m,isTraining:f.isPending&&f.variables===v.node_id},v.node_id))})]})}function XE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=GE();return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load households"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Nodes"}),l.jsx("button",{onClick:()=>d(),disabled:f,className:te("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14,className:"text-[var(--color-text-muted)]"})})]}),(!a||a.length===0)&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No households found. Register a household in jarvis-auth first."})}),a?.map(m=>l.jsx(YE,{householdId:m.id,householdName:m.name},m.id))]})}async function KE(){const{data:a}=await be.get("/api/admin/households");return a}async function $E(){const{data:a}=await be.get("/api/admin/nodes");return a}async function ZE(){const{data:a}=await be.get("/api/admin/users");return a}async function JE(a,s={}){const{data:o}=await be.post(`/api/admin/users/${a}/temp-password`,s);return o}function PE(){return yt({queryKey:["admin-users"],queryFn:ZE,staleTime:3e4})}function IE(){const a=pt();return bt({mutationFn:({userId:s,options:o})=>JE(s,o),onSuccess:()=>{a.invalidateQueries({queryKey:["admin-users"]})}})}function $u({tone:a,children:s}){const o={green:"bg-green-500/10 text-green-500",red:"bg-red-500/10 text-red-500",amber:"bg-amber-500/10 text-amber-500",blue:"bg-blue-500/10 text-blue-500"};return l.jsx("span",{className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",o[a]),children:s})}function WE({result:a,email:s,onDismiss:o}){const i=async()=>{try{await navigator.clipboard.writeText(a.temp_password),Me.success("Temporary password copied")}catch{Me.error("Copy failed — select it manually")}};return l.jsxs("div",{className:"rounded-lg border border-amber-500/40 bg-amber-500/5 p-4",children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Temporary password for ",s]}),l.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-[var(--color-surface-alt)] px-3 py-1.5 font-mono text-base tracking-wide text-[var(--color-text)]",children:a.temp_password}),l.jsx("button",{onClick:i,className:"rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:l.jsx(qd,{size:14,className:"text-[var(--color-text-muted)]"})})]}),l.jsxs("p",{className:"mt-2 text-xs text-[var(--color-text-muted)]",children:["Shown once — it is not stored anywhere. Valid until"," ",new Date(a.expires_at).toLocaleString(),". All of the user's sessions were signed out; on their next login they'll be asked to set a new password."]}),l.jsx("button",{onClick:o,className:"mt-3 rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs font-medium text-white hover:opacity-90",children:"Done"})]})}function e4({user:a,onCancel:s,onConfirm:o,isPending:i}){const[d,f]=N.useState(""),m=d.length>0&&d.length<8;return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("p",{className:"text-sm text-[var(--color-text)]",children:["Reset the password for ",l.jsx("span",{className:"font-medium",children:a.email}),"? This signs the user out everywhere and replaces their password with a temporary one they must change at next login."]}),l.jsxs("div",{className:"mt-3",children:[l.jsx("input",{type:"text",value:d,onChange:v=>f(v.target.value),placeholder:"Custom temp password (optional — leave blank to generate)",className:"w-full max-w-md rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"}),m&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Must be at least 8 characters"})]}),l.jsxs("div",{className:"mt-3 flex gap-2",children:[l.jsx("button",{onClick:()=>o(d||null),disabled:i||m,className:te("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",i||m?"cursor-not-allowed bg-[var(--color-surface)] text-[var(--color-text-muted)]":"bg-red-500 text-white hover:opacity-90"),children:i?l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(it,{size:12,className:"animate-spin"}),"Resetting..."]}):"Reset password"}),l.jsx("button",{onClick:s,disabled:i,className:"rounded-lg px-3 py-1.5 text-xs font-medium text-[var(--color-text-muted)] hover:bg-[var(--color-surface)]",children:"Cancel"})]})]})}function t4({user:a}){const[s,o]=N.useState("idle"),[i,d]=N.useState(null),f=IE(),m=v=>{f.mutate({userId:a.id,options:v?{temp_password:v}:{}},{onSuccess:g=>{o("idle"),d(g)},onError:g=>Me.error(`Reset failed: ${g.message}`)})};return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.email}),a.is_superuser&&l.jsxs($u,{tone:"blue",children:[l.jsx(US,{size:10}),"Superuser"]}),!a.is_active&&l.jsxs($u,{tone:"red",children:[l.jsx(XS,{size:10}),"Deactivated"]}),a.must_change_password&&l.jsxs($u,{tone:"amber",children:[l.jsx(Xj,{size:10}),"Temp password"]})]}),l.jsxs("div",{className:"mt-1 space-y-0.5 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Username:"})," ",a.username]}),a.households.length>0&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Households:"})," ",a.households.map(v=>`${v.household_name} (${v.role})`).join(", ")]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Created:"})," ",new Date(a.created_at).toLocaleDateString()]})]})]}),s==="idle"&&!i&&l.jsxs("button",{onClick:()=>o("confirm"),disabled:!a.is_active,title:a.is_active?void 0:"Reactivate the account first",className:te("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",a.is_active?"bg-[var(--color-surface-alt)] text-[var(--color-text)] hover:bg-[var(--color-primary)]/10 hover:text-[var(--color-primary)]":"cursor-not-allowed bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[l.jsx(iS,{size:12}),"Reset password"]})]}),s==="confirm"&&l.jsx("div",{className:"mt-3",children:l.jsx(e4,{user:a,onCancel:()=>o("idle"),onConfirm:m,isPending:f.isPending})}),i&&l.jsx("div",{className:"mt-3",children:l.jsx(WE,{result:i,email:a.email,onDismiss:()=>d(null)})})]})}function a4(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=PE();return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load users"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Users"}),l.jsx("button",{onClick:()=>d(),disabled:f,className:te("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14,className:"text-[var(--color-text-muted)]"})})]}),a&&a.length===0&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No users found."})}),l.jsx("div",{className:"space-y-3",children:a?.map(m=>l.jsx(t4,{user:m},m.id))})]})}async function n4(){const{data:a}=await be.get("/api/native-services");return a}async function r4(a){const{data:s}=await be.post(`/api/native-services/${a}/restart`);return s}async function s4(a){const{data:s}=await be.post(`/api/native-services/${a}/stop`);return s}async function l4(a){const{data:s}=await be.post(`/api/native-services/${a}/uninstall`);return s}async function o4(a,s="stderr",o=200){const{data:i}=await be.get(`/api/native-services/${a}/logs`,{params:{stream:s,lines:o}});return i}const bi=["native-services"];function i4(){return yt({queryKey:bi,queryFn:n4,staleTime:5e3,refetchInterval:5e3})}function wg(){const a=pt();return bt({mutationFn:s=>r4(s),onSuccess:()=>a.invalidateQueries({queryKey:bi})})}function c4(){const a=pt();return bt({mutationFn:s=>s4(s),onSuccess:()=>a.invalidateQueries({queryKey:bi})})}function u4(){const a=pt();return bt({mutationFn:s=>l4(s),onSuccess:()=>a.invalidateQueries({queryKey:bi})})}function d4(a,s,o){return yt({queryKey:["native-services-logs",a,s],queryFn:()=>o4(a,s,200),enabled:o,staleTime:3e3,refetchInterval:o?3e3:!1})}function f4(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=i4();return s?l.jsx("div",{className:"p-6",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading native services…"})}):o?l.jsx("div",{className:"p-6",children:l.jsx(h4,{message:i instanceof Error?i.message:String(i)})}):a?a.supported?l.jsxs("div",{className:"p-6",children:[l.jsxs("header",{className:"mb-4 flex items-start justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Native Services"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["macOS LaunchAgents — these services run outside Docker so they can use the Apple GPU (MLX / Metal / MPS). Status reflects ",l.jsx("code",{children:"launchctl print"}),"."]})]}),l.jsxs("button",{type:"button",onClick:()=>d(),disabled:f,className:te("flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors",f&&"opacity-50"),children:[l.jsx(it,{size:14,className:f?"animate-spin":""}),"Refresh"]})]}),a.services.length===0?l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No native-capable services are registered. Re-run the install wizard to add them."})}):l.jsx("div",{className:"space-y-3",children:a.services.map(m=>l.jsx(m4,{service:m},m.id))})]}):l.jsxs("div",{className:"p-6",children:[l.jsxs("header",{className:"mb-4",children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Native Services"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Manage Jarvis services running as macOS LaunchAgents."})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Native services are only available on macOS. On Linux all services run in Docker."})})]}):null}function m4({service:a}){const s=wg(),o=c4(),i=u4(),[d,f]=N.useState(!1),[m,v]=N.useState("stderr"),g=d4(a.id,m,d),{status:h}=a;async function y(w,E){try{await w,Me.success(E)}catch(_){Me.error(_ instanceof Error?_.message:String(_))}}async function x(){confirm(`Uninstall ${a.id}? The LaunchAgent will be removed; source files at ${h.sourceDir??"~/.jarvis/native"} stay on disk.`)&&await y(i.mutateAsync(a.id),`${a.id} uninstalled`)}const S=h.installed?h.running?`Running (pid ${h.pid??"?"})`:"Installed, stopped":"Not installed",R=h.installed?h.running?"bg-green-500":"bg-amber-500":"bg-[var(--color-text-muted)]/30";return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:te("h-2.5 w-2.5 shrink-0 rounded-full",R)}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:a.name}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",h.port??a.port]}),l.jsx("code",{className:"text-xs text-[var(--color-text-muted)]",children:h.label})]}),l.jsxs("p",{className:"ml-5 mt-0.5 text-xs text-[var(--color-text-muted)]",children:[S,h.sourceDir&&l.jsxs("span",{className:"ml-2 opacity-60",children:["· ",h.sourceDir]})]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.installed&&l.jsxs(l.Fragment,{children:[h.running?l.jsx(pl,{icon:HS,label:"Stop",onClick:()=>y(o.mutateAsync(a.id),`${a.id} stopped`),disabled:o.isPending}):l.jsx(pl,{icon:ng,label:"Start",onClick:()=>y(s.mutateAsync(a.id),`${a.id} started`),disabled:s.isPending}),h.running&&l.jsx(pl,{icon:Gd,label:"Restart",onClick:()=>y(s.mutateAsync(a.id),`${a.id} restarted`),disabled:s.isPending}),l.jsx(pl,{icon:ag,label:d?"Hide logs":"Logs",onClick:()=>f(w=>!w)}),l.jsx(pl,{icon:yi,label:"Uninstall",onClick:x,disabled:i.isPending,danger:!0})]}),!h.installed&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:[l.jsx(On,{size:12})," Re-run install wizard to enable"]})]})]}),d&&h.installed&&l.jsxs("div",{className:"border-t border-[var(--color-border)] bg-[var(--color-background)] p-3",children:[l.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[l.jsx(Qx,{active:m==="stderr",onClick:()=>v("stderr"),children:"stderr"}),l.jsx(Qx,{active:m==="stdout",onClick:()=>v("stdout"),children:"stdout"}),l.jsx("code",{className:"ml-2 text-xs text-[var(--color-text-muted)] opacity-60",children:g.data?.file})]}),l.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap rounded bg-[var(--color-surface-alt)] p-2 text-xs font-mono text-[var(--color-text)]",children:g.isLoading?"Loading…":g.isError?`Failed to load logs: ${g.error instanceof Error?g.error.message:String(g.error)}`:g.data?.content||"(empty)"})]})]})}function pl({icon:a,label:s,onClick:o,disabled:i,danger:d}){return l.jsxs("button",{type:"button",onClick:o,disabled:i,className:te("flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs","transition-colors disabled:cursor-not-allowed disabled:opacity-50",d?"border-red-500/30 text-red-500 hover:bg-red-500/10":"border-[var(--color-border)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-text)]"),children:[l.jsx(a,{size:12}),s]})}function Qx({active:a,onClick:s,children:o}){return l.jsx("button",{type:"button",onClick:s,className:te("rounded px-2 py-0.5 text-xs",a?"bg-[var(--color-primary)] text-white":"border border-[var(--color-border)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:o})}function h4({message:a}){return l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-500",children:[l.jsx(Bd,{size:14}),a]})}async function p4(){const{data:a}=await be.get("/api/models/installed");return a.models}async function x4(a){const{data:s}=await be.post("/api/models/download",a);return s}async function v4(a){await be.delete(`/api/models/${encodeURIComponent(a)}`)}function Eg(){return yt({queryKey:["models","installed"],queryFn:p4,staleTime:1e4})}function Cg(){const a=pt();return bt({mutationFn:s=>x4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}function g4(){const a=pt();return bt({mutationFn:s=>v4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}const ss=[{id:"qwen3-4b",displayName:"Qwen 3 4B",hfRepoVllm:"Qwen/Qwen3-4B-AWQ",hfRepoGguf:"Qwen/Qwen3-4B-GGUF",ggufFilename:"Qwen3-4B-Q4_K_M.gguf",chatFormat:"qwen3",contextWindow:40960,sizeVllm:"2.5GB",sizeGguf:"2.5GB",vramMb:4096,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{id:"qwen3-8b",displayName:"Qwen 3 8B",hfRepoVllm:"Qwen/Qwen3-8B-AWQ",hfRepoGguf:"Qwen/Qwen3-8B-GGUF",ggufFilename:"Qwen3-8B-Q4_K_M.gguf",chatFormat:"qwen3",contextWindow:40960,sizeVllm:"5.7GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{id:"qwen3-14b",displayName:"Qwen 3 14B",hfRepoVllm:"Qwen/Qwen3-14B-AWQ",hfRepoGguf:"Qwen/Qwen3-14B-GGUF",ggufFilename:"Qwen3-14B-Q4_K_M.gguf",chatFormat:"qwen3",contextWindow:40960,sizeVllm:"9.4GB",sizeGguf:"9GB",vramMb:12288,gated:!1,quantization:"awq",promptProvider:"Qwen3LargeUntrained"},{id:"qwen25-7b",displayName:"Qwen 2.5 7B Instruct",hfRepoVllm:"Qwen/Qwen2.5-7B-Instruct-AWQ",hfRepoGguf:"Qwen/Qwen2.5-7B-Instruct-GGUF",ggufFilename:"qwen2.5-7b-instruct-q4_k_m.gguf",chatFormat:"chatml",contextWindow:32768,sizeVllm:"4.7GB",sizeGguf:"4.7GB",vramMb:6144,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{id:"llama-3.1-8b",displayName:"Llama 3.1 8B Instruct",hfRepoVllm:"hugging-quants/Meta-Llama-3.1-8B-Instruct-AWQ-INT4",hfRepoGguf:"lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF",ggufFilename:"Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf",chatFormat:"llama-3",contextWindow:131072,sizeVllm:"5.4GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Llama31MediumUntrained"},{id:"hermes-3-8b",displayName:"Hermes 3 Llama 3.1 8B",hfRepoVllm:"solidrust/Hermes-3-Llama-3.1-8B-AWQ",hfRepoGguf:"NousResearch/Hermes-3-Llama-3.1-8B-GGUF",ggufFilename:"Hermes-3-Llama-3.1-8B.Q4_K_M.gguf",chatFormat:"chatml",contextWindow:131072,sizeVllm:"5.4GB",sizeGguf:"4.9GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"HermesMediumUntrained"}];function y4(){const[a,s]=N.useState(""),[o,i]=N.useState(""),[d,f]=N.useState(""),[m,v]=N.useState(null),{data:g,isLoading:h}=Eg(),y=Cg(),x=g4();function S(E,_){const O=`${E}/${_??""}`;v(O),y.mutate({repo:E,filename:_||void 0,token:a||void 0},{onSuccess:k=>{Me.success(k.message),v(null)},onError:k=>{Me.error(k instanceof Error?k.message:"Download failed"),v(null)}})}function R(E){confirm(`Delete ${E}?`)&&x.mutate(E,{onSuccess:()=>Me.success(`Deleted ${E}`),onError:()=>Me.error("Failed to delete")})}function w(){o&&S(o,d)}return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Manage LLM models on the inference server"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(uS,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Token"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"(optional, for gated models)"})]}),l.jsx("input",{type:"password",value:a,onChange:E=>s(E.target.value),placeholder:"hf_...",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Hd,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Installed Models"})]}),h?l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading..."}):g?.length?l.jsx("div",{className:"space-y-2",children:g.map(E=>l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-3 py-2",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:E.name}),l.jsx("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:E.sizeFormatted})]}),l.jsx("button",{onClick:()=>R(E.name),disabled:x.isPending,className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",children:l.jsx(yi,{size:14})})]},E.name))}):l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No models installed yet"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(BS,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Suggested Models"})]}),l.jsx("div",{className:"space-y-3",children:ss.map(E=>{const _=g?.some(O=>O.name===E.ggufFilename||O.name.includes(E.ggufFilename));return l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-4 py-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:E.displayName}),l.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:["~",E.sizeGguf]}),_&&l.jsx("span",{className:"rounded bg-green-500/10 px-1.5 py-0.5 text-xs text-green-500",children:"installed"})]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[E.hfRepoGguf," / ",E.ggufFilename]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Prompt provider: ",l.jsx("code",{className:"text-[var(--color-primary)]",children:E.promptProvider})]})]}),l.jsxs("button",{onClick:()=>S(E.hfRepoGguf,E.ggufFilename),disabled:m!==null,className:te("ml-4 flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",_?"border border-[var(--color-border)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[l.jsx(en,{size:14}),m===`${E.hfRepoGguf}/${E.ggufFilename}`?"Downloading...":_?"Re-download":"Download"]})]},E.id)})})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(en,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Download from HuggingFace"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Repository (e.g. Qwen/Qwen3-14B-GGUF)"}),l.jsx("input",{value:o,onChange:E=>i(E.target.value),placeholder:"owner/repo-name",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Filename (optional — downloads specific file instead of full repo)"}),l.jsx("input",{value:d,onChange:E=>f(E.target.value),placeholder:"model-name.gguf",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("button",{onClick:w,disabled:!o||m!==null,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[l.jsx(en,{size:14}),m===`${o}/${d}`?"Downloading...":"Download"]})]})]})]})}async function b4(){const{data:a}=await be.get("/api/quick-sets");return a}async function N4(a){const{data:s}=await be.post("/api/quick-sets/apply",a);return s}async function j4(a){const{data:s}=await be.post("/api/quick-sets/custom",a);return s}async function S4(a){const{data:s}=await be.delete(`/api/quick-sets/custom/${a}`);return s}function w4(){return yt({queryKey:["quick-sets"],queryFn:b4,staleTime:6e4})}function E4(){const a=pt();return bt({mutationFn:s=>N4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]}),a.invalidateQueries({queryKey:["settings"]}),a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function C4(){const a=pt();return bt({mutationFn:s=>j4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}function T4(){const a=pt();return bt({mutationFn:s=>S4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}const Vx=["GGUF","MLX","VLLM","TRANSFORMERS","REST"];function _4(){const{data:a,isLoading:s,error:o}=w4(),i=E4(),d=C4(),f=T4(),{data:m}=Eg(),v=N.useMemo(()=>(m??[]).map(z=>`.models/${z.name}`),[m]),[g,h]=N.useState(null),[y,x]=N.useState(""),[S,R]=N.useState(!1),[w,E]=N.useState(""),[_,O]=N.useState(""),[k,Y]=N.useState(""),[I,ne]=N.useState(""),[ee,H]=N.useState(new Set(["live"])),[K,ie]=N.useState(!1),[re,oe]=N.useState(""),[he,Ee]=N.useState(""),[Te,ae]=N.useState(""),[C,F]=N.useState(""),[X,ve]=N.useState("GGUF"),[W,j]=N.useState(8192),D=a?.presets,G=N.useMemo(()=>{if(!D)return new Map;const z=new Map;for(const Se of D){const xe=Se.family||"Custom",Ut=z.get(xe)??[];Ut.push(Se),z.set(xe,Ut)}return z},[D]);function Z(z){if(g===z.id){h(null);return}h(z.id),x(a?.currentValues.modelName??""),R(!1),O(z.defaultBackend),Y(z.chatFormat),ne(z.promptProvider);const Se=a?.currentValues.contextWindow;E(Se&&Se>0?Se:z.defaultContextWindow)}function se(z){H(Se=>{const xe=new Set(Se);return xe.has(z)?xe.size>1&&xe.delete(z):xe.add(z),xe})}function me(){!g||!y.trim()||i.mutate({presetId:g,modelName:y.trim(),contextWindow:w?Number(w):void 0,backend:_,chatFormat:k,promptProvider:I,targets:Array.from(ee)},{onSuccess:z=>{z.success?Me.success(z.message):Me.warning(z.message),h(null)},onError:z=>{Me.error(z.message||"Failed to apply preset")}})}function ue(){!re.trim()||!Te.trim()||!C.trim()||d.mutate({name:re.trim(),family:he.trim()||"Custom",chatFormat:Te.trim(),promptProvider:C.trim(),defaultBackend:X,defaultContextWindow:W?Number(W):8192},{onSuccess:()=>{Me.success(`Created preset "${re.trim()}"`),ie(!1),oe(""),Ee(""),ae(""),F(""),ve("GGUF"),j(8192)},onError:z=>{Me.error(z.message||"Failed to create preset")}})}function je(z){f.mutate(z.id,{onSuccess:()=>{Me.success(`Deleted "${z.name}"`),g===z.id&&h(null)},onError:()=>Me.error("Failed to delete preset")})}const U=a?.presets.find(z=>z.id===g);return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Quick Sets"}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Select a model preset to auto-configure chat format, prompt provider, and backend"})]}),a?.currentValues.modelName&&l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3",children:[l.jsx(On,{size:16,className:"text-[var(--color-primary)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Current model"}),l.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:a.currentValues.modelName})]}),a.currentValues.contextWindow>0&&l.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-2 py-0.5 text-xs text-[var(--color-text-muted)]",children:[a.currentValues.contextWindow.toLocaleString()," ctx"]})]}),s&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(it,{size:20,className:"animate-spin text-[var(--color-text-muted)]"})}),o&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-4 py-3",children:[l.jsx(ra,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:"Failed to load presets"})]}),!s&&Array.from(G.entries()).map(([z,Se])=>l.jsxs("section",{children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text-muted)]",children:z}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:Se.map(xe=>l.jsxs("div",{className:te("relative rounded-lg border px-4 py-3 transition-colors",g===xe.id?"border-[var(--color-primary)] bg-[var(--color-primary)]/5":"border-[var(--color-border)] bg-[var(--color-surface)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("button",{onClick:()=>Z(xe),className:"w-full text-left",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:xe.name}),g===xe.id&&l.jsx(xi,{size:16,className:"text-[var(--color-primary)]"})]}),xe.description&&l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:xe.description}),l.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[l.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:xe.chatFormat}),l.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:xe.defaultBackend})]})]}),xe.isCustom&&l.jsx("button",{onClick:()=>je(xe),disabled:f.isPending,className:"absolute right-2 top-2 rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",title:"Delete custom preset",children:l.jsx(yi,{size:14})})]},xe.id))})]},z)),!s&&!K&&l.jsxs("button",{onClick:()=>ie(!0),className:"flex items-center gap-2 rounded-lg border border-dashed border-[var(--color-border)] px-4 py-3 text-sm text-[var(--color-text-muted)] transition-colors hover:border-[var(--color-primary)] hover:text-[var(--color-primary)]",children:[l.jsx(ti,{size:16}),"Create custom preset"]}),K&&l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ti,{size:16,className:"text-[var(--color-primary)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"New Custom Preset"})]}),l.jsx("button",{onClick:()=>ie(!1),className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:l.jsx(Vd,{size:16})})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Name *"}),l.jsx("input",{type:"text",value:re,onChange:z=>oe(z.target.value),placeholder:"My Custom Model",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Family"}),l.jsx("input",{type:"text",value:he,onChange:z=>Ee(z.target.value),placeholder:"Custom",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format *"}),l.jsx("input",{type:"text",value:Te,onChange:z=>ae(z.target.value),placeholder:"chatml",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider *"}),l.jsx("input",{type:"text",value:C,onChange:z=>F(z.target.value),placeholder:"Qwen25MediumUntrained",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default backend"}),l.jsx("select",{value:X,onChange:z=>ve(z.target.value),className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:Vx.map(z=>l.jsx("option",{value:z,children:z},z))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default context window"}),l.jsx("input",{type:"number",value:W,onChange:z=>j(z.target.value?parseInt(z.target.value,10):""),placeholder:"8192",min:1,className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[l.jsxs("button",{onClick:ue,disabled:!re.trim()||!Te.trim()||!C.trim()||d.isPending,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[d.isPending?l.jsx(it,{size:14,className:"animate-spin"}):l.jsx(ti,{size:14}),d.isPending?"Creating...":"Create Preset"]}),l.jsx("button",{onClick:()=>ie(!1),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]}),U&&l.jsxs("section",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx(oi,{size:16,className:"text-[var(--color-primary)]"}),l.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:["Apply: ",U.name]})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("span",{className:"mb-2 block text-xs font-medium text-[var(--color-text-muted)]",children:"Apply to"}),l.jsx("div",{className:"flex items-center gap-4",children:["live","background"].map(z=>l.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[l.jsx("input",{type:"checkbox",checked:ee.has(z),onChange:()=>se(z),className:"rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),l.jsx("span",{className:"capitalize",children:z})]},z))})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Model file path"}),v.length>0&&l.jsxs("select",{value:S||y!==""&&!v.includes(y)?"__other__":y,onChange:z=>{z.target.value==="__other__"?R(!0):(R(!1),x(z.target.value))},className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"",disabled:!0,children:"Select a model…"}),v.map(z=>l.jsx("option",{value:z,children:z.replace(/^\.models\//,"")},z)),l.jsx("option",{value:"__other__",children:"Other (custom path / HF ID)…"})]}),(v.length===0||S||y!==""&&!v.includes(y))&&l.jsx("input",{type:"text",value:y,onChange:z=>x(z.target.value),placeholder:".models/model-name.gguf",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format"}),l.jsx("input",{type:"text",value:k,onChange:z=>Y(z.target.value),placeholder:"chatml",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider"}),l.jsx("input",{type:"text",value:I,onChange:z=>ne(z.target.value),placeholder:"Qwen25MediumUntrained",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Context window (tokens)"}),l.jsx("input",{type:"number",value:w,onChange:z=>E(z.target.value?parseInt(z.target.value,10):""),placeholder:String(U.defaultContextWindow),min:1,className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Backend"}),l.jsx("select",{value:_,onChange:z=>O(z.target.value),className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:Vx.map(z=>l.jsx("option",{value:z,children:z},z))})]})]})]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[l.jsxs("button",{onClick:me,disabled:!y.trim()||i.isPending,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[i.isPending?l.jsx(it,{size:14,className:"animate-spin"}):l.jsx(oi,{size:14}),i.isPending?"Applying...":"Apply Settings"]}),l.jsx("button",{onClick:()=>h(null),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]})}const Zu={preflight:"Checking prerequisites",download:"Downloading update",binary:"Updating binary",restarting:"Restarting admin server",compose:"Updating configuration",pull:"Pulling images",restart:"Restarting services",verify:"Verifying health",done:"Complete"};function R4(){const a=wa(),{data:s,isLoading:o}=Sg(),[i,d]=N.useState("idle"),[f,m]=N.useState([]),[v,g]=N.useState(null),h=N.useRef(null),y=N.useCallback(R=>{m(w=>[...w,R])},[]);N.useEffect(()=>{h.current&&(h.current.scrollTop=h.current.scrollHeight)},[f]);async function x(){d("preflight"),m([]),g(null);try{const R=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),w=await fetch("/api/update/apply",{method:"POST",headers:{Authorization:`Bearer ${R}`}});if(!w.ok||!w.body){const k=await w.text();throw new Error(k||`HTTP ${w.status}`)}const E=w.body.getReader(),_=new TextDecoder;let O="";for(;;){const{done:k,value:Y}=await E.read();if(k)break;O+=_.decode(Y,{stream:!0});const I=O.split(`
|
|
17
|
-
`);O=I.pop()??"";for(const ne of I)if(ne.startsWith("data: "))try{const ee=JSON.parse(ne.slice(6));if(ee.phase&&d(ee.phase),ee.message&&y({text:ee.message,phase:ee.phase}),ee.stream&&ee.text&&y({text:ee.text.trim()}),ee.restart){d("restarting"),y({text:"Admin server restarting with new version..."}),await k4(s?.latestVersion??""),d("done"),y({text:"Upgrade complete!"});return}if(ee.done&&ee.code!==0)throw new Error(ee.error??"Upgrade failed");ee.done&&ee.code===0&&d("done")}catch(ee){if(ee instanceof SyntaxError)continue;throw ee}}}catch(R){const w=R instanceof Error?R.message:String(R);g(w),d("error"),y({text:`Error: ${w}`})}}if(o)return l.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:l.jsx(Ct,{size:24,className:"animate-spin text-[var(--color-primary)]"})});const S=Object.keys(Zu).filter(R=>{const w=Object.keys(Zu),E=w.indexOf(i);return w.indexOf(R)<E});return l.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Update Jarvis"}),s?.updateAvailable?l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["v",s.currentVersion," → v",s.latestVersion]}):l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["You're running the latest version (v",s?.currentVersion??"?",")"]})]}),i!=="idle"&&l.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries(Zu).map(([R,w])=>{const E=R===i,_=S.includes(R),O=R===i&&i==="error";return l.jsxs("div",{className:"flex items-center gap-2",children:[_?l.jsx(ht,{size:16,className:"text-green-500"}):O?l.jsx(ra,{size:16,className:"text-red-500"}):E?l.jsx(Ct,{size:16,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),l.jsx("span",{className:te("text-sm",E?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",_&&"text-green-500"),children:w})]},R)})}),f.length>0&&l.jsx("div",{ref:h,className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[#0d1117] p-3 font-mono text-xs text-gray-300",children:f.map((R,w)=>l.jsx("div",{children:R.text},w))}),v&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(ra,{size:14,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:v})]}),l.jsxs("div",{className:"flex gap-3",children:[i==="idle"&&s?.updateAvailable&&l.jsxs("button",{onClick:x,className:"flex items-center gap-2 rounded-lg bg-green-600 px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(tg,{size:16}),"Update to v",s.latestVersion]}),i==="done"&&l.jsxs("button",{onClick:()=>a("/dashboard"),className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(ht,{size:16}),"Go to Dashboard"]}),i==="error"&&l.jsxs("button",{onClick:x,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(it,{size:16}),"Retry"]})]})]})}async function k4(a,s=6e4){const o=Date.now()+s;for(;Date.now()<o;){await new Promise(i=>setTimeout(i,2e3));try{const i=await fetch("/health");if(i.ok){const d=await i.json();if(d.version&&d.version!=="0.0.0-dev")return}}catch{}}throw new Error("Admin server did not restart within 60 seconds")}const Ju={regenerate:"Regenerating compose from registry",pull:"Pulling images for new release track",apply:"Applying changes (docker compose up)",done:"Complete"};function M4(){const a=wa(),s=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),[o,i]=N.useState("loading_options"),[d,f]=N.useState([]),[m,v]=N.useState(null),g=N.useRef(null),[h,y]=N.useState([]),[x,S]=N.useState(!1),[R,w]=N.useState("https://relay.jarvisautomation.io"),[E,_]=N.useState("/whisper-models/ggml-base.en.bin"),[O,k]=N.useState("cpu"),[Y,I]=N.useState("cpu"),[ne,ee]=N.useState(!1),[H,K]=N.useState("stable"),[ie,re]=N.useState(null),[oe,he]=N.useState(!1),Ee=N.useCallback(W=>{f(j=>[...j,W])},[]);N.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[d]),N.useEffect(()=>{async function W(){try{const j=await fetch("/api/install/reconcile/options",{headers:{Authorization:`Bearer ${s}`}});if(!j.ok)throw new Error(`HTTP ${j.status}`);const D=await j.json();y(D.services),S(D.relayEnabled),w(D.relayUrl||"https://relay.jarvisautomation.io"),_(D.whisperModelPath||"/whisper-models/ggml-base.en.bin"),k(D.whisperBackend??"cpu"),I(D.ttsBackend??"cpu"),ee(D.pinImages??!1),K(D.releaseTrack??"stable"),i("options")}catch(j){v(j instanceof Error?j.message:"Failed to load options"),i("error")}}W()},[s]);function Te(W){y(j=>j.map(D=>D.id===W?{...D,enabled:!D.enabled}:D))}async function ae(){i("regenerate"),f([]),v(null);const W=h.filter(j=>j.enabled).map(j=>j.id);try{const j=await fetch("/api/install/reconcile",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({enabledModules:W,relayEnabled:x,relayUrl:R,whisperModelPath:E,whisperBackend:O,ttsBackend:Y,pinImages:ne,releaseTrack:H})});if(!j.ok||!j.body){const se=await j.text();throw new Error(se||`HTTP ${j.status}`)}const D=j.body.getReader(),G=new TextDecoder;let Z="";for(;;){const{done:se,value:me}=await D.read();if(se)break;Z+=G.decode(me,{stream:!0});const ue=Z.split(`
|
|
18
|
-
`);Z=ue.pop()??"";for(const je of ue)if(je.startsWith("data: "))try{const U=JSON.parse(je.slice(6));if(U.phase&&i(U.phase),U.message&&Ee({text:U.message,phase:U.phase}),U.stream&&U.text&&Ee({text:U.text.trim()}),U.done&&U.code!==0)throw new Error(U.message??"Reconcile failed")}catch(U){if(U instanceof SyntaxError)continue;throw U}}}catch(j){const D=j instanceof Error?j.message:String(j);v(D),i("error"),Ee({text:`Error: ${D}`})}}function C(){return{enabledModules:h.filter(W=>W.enabled).map(W=>W.id),relayEnabled:x,relayUrl:R,whisperModelPath:E,whisperBackend:O,ttsBackend:Y,pinImages:ne,releaseTrack:H}}async function F(W){he(!0),v(null),re(null);try{const{latest:j,...D}=W??{},Z=await fetch(`/api/install/regenerate-download${j?"?latest=true":""}`,{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({...C(),...D})});if(!Z.ok){const me=await Z.text();throw new Error(me||`HTTP ${Z.status}`)}const se=await Z.json();re({compose:se.compose,env:se.env,initDb:se.initDb})}catch(j){v(j instanceof Error?j.message:String(j))}finally{he(!1)}}function X(W,j){const D=new Blob([j],{type:"text/plain;charset=utf-8"}),G=URL.createObjectURL(D),Z=document.createElement("a");Z.href=G,Z.download=W,document.body.appendChild(Z),Z.click(),Z.remove(),URL.revokeObjectURL(G)}const ve=Object.keys(Ju).filter(W=>{const j=Object.keys(Ju),D=j.indexOf(o);return j.indexOf(W)<D||o==="done"&&W==="done"});return l.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Sync Compose"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Regenerate ",l.jsx("code",{className:"rounded bg-[var(--color-surface)] px-1.5 py-0.5 text-xs",children:"docker-compose.yml"})," from the latest service registry, preserving your secrets. ",l.jsx("strong",{className:"text-[var(--color-text)]",children:"Sync now"})," applies it to the running stack;",l.jsx("strong",{className:"text-[var(--color-text)]",children:" Download"})," hands you the files to review and apply by hand (",l.jsx("code",{className:"rounded bg-[var(--color-surface)] px-1 text-xs",children:"docker compose up -d"}),")."," ",l.jsx("strong",{className:"text-[var(--color-text)]",children:"Update stack to latest"})," downloads the same, pinned to the newest published images."]})]}),o==="loading_options"&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})}),o==="options"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Services"}),l.jsx("div",{className:"space-y-2",children:h.map(W=>l.jsxs("button",{onClick:()=>Te(W.id),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left hover:bg-[var(--color-bg-secondary)] transition-colors",children:[W.enabled?l.jsx(ht,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:W.name}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:W.description})]})]},W.id))})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Release Track"}),l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:H==="dev"?"Dev":"Stable"}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:H==="dev"?"Using latest main branch builds (may be unstable)":"Using tagged releases"})]}),l.jsx("button",{type:"button",role:"switch","aria-checked":H==="dev",onClick:()=>K(H==="dev"?"stable":"dev"),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${H==="dev"?"bg-amber-500":"bg-[var(--color-surface-alt)]"}`,children:l.jsx("span",{className:`absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform ${H==="dev"?"translate-x-5":"translate-x-0"}`})})]}),H==="dev"&&l.jsx("div",{className:"mx-3 mt-1 rounded-lg border border-amber-300 bg-amber-500/10 px-3 py-2 text-xs text-amber-400",children:"Switching tracks will pull all images and force-recreate containers."})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Integrations"}),l.jsxs("button",{onClick:()=>S(!x),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left hover:bg-[var(--color-bg-secondary)] transition-colors",children:[x?l.jsx(ht,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]}),x&&l.jsxs("div",{className:"mt-2 px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Relay URL"}),l.jsx("input",{type:"url",value:R,onChange:W=>w(W.target.value),placeholder:"https://relay.jarvisautomation.io",className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),h.some(W=>W.id==="jarvis-whisper-api"&&W.enabled)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Whisper"}),l.jsxs("div",{className:"px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Model path"}),l.jsx("input",{type:"text",value:E,onChange:W=>_(W.target.value),placeholder:"/whisper-models/ggml-base.en.bin",className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm font-mono text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Path inside the container. Place model files in ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"./whisper-models/"})," next to your compose file."]}),l.jsx("label",{className:"mt-3 block text-xs font-medium text-[var(--color-text-muted)]",children:"GPU backend"}),l.jsxs("select",{value:O,onChange:W=>k(W.target.value),className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"cpu",children:"CPU (default)"}),l.jsx("option",{value:"cuda",children:"NVIDIA (CUDA)"}),l.jsx("option",{value:"vulkan",children:"AMD / generic (Vulkan)"}),l.jsx("option",{value:"rocm",children:"AMD (ROCm)"})]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Where speech-to-text runs. CPU leaves the GPU for the LLM; pick a GPU backend to run Whisper on the GPU."})]})]}),h.some(W=>W.id==="jarvis-tts"&&W.enabled)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Text-to-speech"}),l.jsxs("div",{className:"px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Inference device"}),l.jsxs("select",{value:Y,onChange:W=>I(W.target.value),className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"cpu",children:"CPU (default)"}),l.jsx("option",{value:"cuda",children:"NVIDIA (CUDA)"})]}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Where Kokoro synthesis runs. CPU is fine for most installs; CUDA gives the fastest first-audio. On multi-GPU hosts set ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"TTS_GPU_DEVICE"})," in .env to pick which GPU (default 0)."]})]})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:l.jsxs("label",{className:"flex items-start gap-3 text-sm",children:[l.jsx("input",{type:"checkbox",checked:ne,onChange:W=>ee(W.target.checked),className:"mt-0.5","data-testid":"pin-images-checkbox"}),l.jsxs("span",{children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:"Pin images by digest"}),l.jsxs("span",{className:"mt-1 block text-xs text-[var(--color-text-muted)]",children:["Advanced supply-chain hardening: locks every image to an exact build. Leave OFF for normal use — with pinning on, ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"docker compose pull"})," will never update anything and services only change via this page."]})]})]})})]}),ie&&o==="options"&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-primary)]/40 bg-[var(--color-surface)] p-4",children:[l.jsxs("h2",{className:"mb-1 flex items-center gap-2 text-sm font-semibold text-[var(--color-text)]",children:[l.jsx(ht,{size:16,className:"text-green-500"}),"Updated files ready"]}),l.jsxs("p",{className:"mb-3 text-xs text-[var(--color-text-muted)]",children:["Your existing secrets and settings are carried over. Download, replace the files next to your compose, then run ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"docker compose up -d"}),". Nothing on the server was changed."]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsxs("button",{onClick:()=>X("docker-compose.yml",ie.compose),className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-3 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(en,{size:15}),"docker-compose.yml"]}),l.jsxs("button",{onClick:()=>X(".env",ie.env),className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:[l.jsx(en,{size:15}),".env"]}),l.jsxs("button",{onClick:()=>X("init-db.sh",ie.initDb),className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:[l.jsx(en,{size:15}),"init-db.sh"]})]}),l.jsxs("p",{className:"mt-3 text-xs text-[var(--color-text-muted)]",children:["The ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:".env"})," merges new keys into your existing values, and ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"init-db.sh"})," covers any new databases — replace all three to be safe. Diff them against your current files first if you want to eyeball the changes."]})]}),o!=="loading_options"&&o!=="options"&&l.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries(Ju).map(([W,j])=>{const D=W===o,G=ve.includes(W),Z=W===o&&o==="error";return l.jsxs("div",{className:"flex items-center gap-2",children:[G?l.jsx(ht,{size:16,className:"text-green-500"}):Z?l.jsx(ra,{size:16,className:"text-red-500"}):D?l.jsx(Ct,{size:16,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),l.jsx("span",{className:te("text-sm",D?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",G&&"text-green-500"),children:j})]},W)})}),d.length>0&&l.jsx("div",{ref:g,className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[#0d1117] p-3 font-mono text-xs text-gray-300",children:d.map((W,j)=>l.jsx("div",{children:W.text},j))}),m&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(ra,{size:14,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:m})]}),l.jsxs("div",{className:"flex gap-3",children:[o==="options"&&l.jsxs("button",{onClick:ae,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(xd,{size:16}),"Sync now"]}),o==="options"&&l.jsxs("button",{onClick:()=>F(),disabled:oe,title:"Regenerate the compose and download it to apply by hand — doesn't touch the running stack",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[oe?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(en,{size:16}),"Download updated compose"]}),o==="options"&&l.jsxs("button",{onClick:()=>F({latest:!0}),disabled:oe,title:"Download a compose pinned to the LATEST published images (digests refreshed from the registry). Apply it yourself on the host — docker compose pull && docker compose up -d — which also updates jarvis-admin.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[oe?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(it,{size:16}),"Update stack to latest"]}),o==="options"&&l.jsxs("button",{onClick:()=>F({mqttAllowAnon:!1}),disabled:oe,title:"Download a compose with the MQTT broker locked (allow_anonymous=false). Do this only after every node has authenticated, or un-migrated nodes will drop off.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[oe?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(vi,{size:16}),"Download + lock broker"]}),o==="options"&&l.jsxs("button",{onClick:()=>F({mqttAllowAnon:!0}),disabled:oe,title:"Download a compose that re-opens the MQTT broker to anonymous clients (allow_anonymous=true) — the transition/rollback state.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[oe?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(pS,{size:16}),"Download + unlock broker"]}),(o==="options"||o==="regenerate"||o==="apply"||o==="done")&&l.jsxs("button",{onClick:()=>a("/dashboard"),disabled:o==="regenerate"||o==="apply",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",children:[l.jsx(ht,{size:16}),"Back to dashboard"]}),o==="error"&&l.jsxs("button",{onClick:ae,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(it,{size:16}),"Retry"]})]})]})}async function A4(a={}){const{data:s}=await be.get("/api/traces",{params:a});return s}async function O4(a){const{data:s}=await be.get(`/api/traces/${a}`);return s}function Fx(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function Yx(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function z4(a){const s=new Map;for(const o of a){const i=s.get(o.conversation_id);if(!i){s.set(o.conversation_id,{conversation_id:o.conversation_id,traces:[o],newest_at:o.created_at,user_command:o.user_command,assistant_message:o.assistant_message,source:o.source,node_id:o.node_id,household_id:o.household_id,total_duration_ms:o.total_duration_ms,status:o.status});continue}i.traces.push(o),i.total_duration_ms+=o.total_duration_ms,o.created_at>i.newest_at&&(i.newest_at=o.created_at),!i.user_command&&o.user_command&&(i.user_command=o.user_command),!i.assistant_message&&o.assistant_message&&(i.assistant_message=o.assistant_message),o.status!=="ok"&&(i.status=o.status)}return Array.from(s.values()).sort((o,i)=>o.newest_at<i.newest_at?1:-1)}function D4(a){return a==="mobile"?"📱":"🔊"}function U4(){const a=wa(),[s,o]=N.useState(""),[i,d]=N.useState(""),[f,m]=N.useState(""),[v,g]=N.useState(""),[h,y]=N.useState(new Set),x=yt({queryKey:["admin","households"],queryFn:KE,staleTime:6e4}),S=yt({queryKey:["admin","nodes"],queryFn:$E,staleTime:6e4}),{data:R,isLoading:w,error:E}=yt({queryKey:["traces",s,i,f,v],queryFn:()=>A4({limit:100,...s?{status:s}:{},...i?{source:i}:{},...f?{household_id:f}:{},...v?{node_id:v}:{}}),refetchInterval:1e4}),_=N.useMemo(()=>{const H=S.data??[];return f?H.filter(K=>K.household_id===f):H},[S.data,f]),O=N.useMemo(()=>{const H=new Map;for(const K of S.data??[])H.set(K.node_id,K.name);return H},[S.data]),k=N.useMemo(()=>{const H=new Map;for(const K of x.data??[])H.set(K.id,K.name);return H},[x.data]),Y=N.useMemo(()=>R?z4(R.traces):[],[R]);function I(H){y(K=>{const ie=new Set(K);return ie.has(H)?ie.delete(H):ie.add(H),ie})}function ne(H){if(m(H),H&&v){const K=(S.data??[]).find(ie=>ie.node_id===v);K&&K.household_id!==H&&g("")}}const ee="rounded border border-[var(--color-border)] bg-[var(--color-surface)] px-2 py-1 text-sm text-[var(--color-text)]";return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Request Traces"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("select",{className:ee,value:f,onChange:H=>ne(H.target.value),disabled:x.isLoading,children:[l.jsx("option",{value:"",children:"All households"}),(x.data??[]).map(H=>l.jsx("option",{value:H.id,children:H.name},H.id))]}),l.jsxs("select",{className:ee,value:v,onChange:H=>g(H.target.value),disabled:S.isLoading,children:[l.jsx("option",{value:"",children:"All nodes"}),_.map(H=>l.jsx("option",{value:H.node_id,children:H.name},H.node_id))]}),l.jsxs("select",{className:ee,value:s,onChange:H=>o(H.target.value),children:[l.jsx("option",{value:"",children:"All statuses"}),l.jsx("option",{value:"ok",children:"OK"}),l.jsx("option",{value:"error",children:"Error"})]}),l.jsxs("select",{className:ee,value:i,onChange:H=>d(H.target.value),children:[l.jsx("option",{value:"",children:"All sources"}),l.jsx("option",{value:"node",children:"Node"}),l.jsx("option",{value:"mobile",children:"Mobile"})]})]})]}),w&&l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}),E&&l.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 p-4 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:"Failed to load traces"}),R&&l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[R.total," traces in ",Y.length," conversation",Y.length===1?"":"s"]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--color-border)]",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)]",children:[l.jsx("th",{className:"w-8 px-2 py-2"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Time"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Source"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Node"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"User said"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Jarvis said"}),l.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Duration"}),l.jsx("th",{className:"px-3 py-2 text-center font-medium text-[var(--color-text-muted)]",children:"Status"}),l.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Traces"})]})}),l.jsxs("tbody",{children:[Y.map(H=>{const K=h.has(H.conversation_id),ie=H.traces.length,re=H.node_id?O.get(H.node_id)??H.node_id.slice(0,8):"-";return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>I(H.conversation_id),children:[l.jsx("td",{className:"px-2 py-2 text-center text-[var(--color-text-muted)]",children:ie>1?K?"▼":"▶":""}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] whitespace-nowrap",children:Yx(H.newest_at)}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)]",children:l.jsxs("span",{className:"inline-flex items-center gap-1",children:[D4(H.source),H.source]})}),l.jsxs("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap",children:[re,H.household_id&&l.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["· ",k.get(H.household_id)??""]})]}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:H.user_command??"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] max-w-xs truncate",children:H.assistant_message??"-"}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:Fx(H.total_duration_ms)}),l.jsx("td",{className:"px-3 py-2 text-center",children:l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${H.status==="ok"?"bg-green-500":"bg-red-500"}`})}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text-muted)] tabular-nums",children:ie})]}),K&&H.traces.slice().sort((oe,he)=>oe.created_at<he.created_at?-1:1).map(oe=>l.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer bg-[var(--color-surface-alt)]/40 transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>a(`/traces/${oe.id}`),children:[l.jsx("td",{className:"px-2 py-2"}),l.jsxs("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap",children:[l.jsx("span",{className:"inline-block w-3"}),Yx(oe.created_at)]}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] text-xs",children:oe.request_type}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap text-xs",children:oe.node_id?O.get(oe.node_id)??oe.node_id.slice(0,8):"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:oe.user_command??"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] max-w-xs truncate",children:oe.assistant_message??"-"}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:Fx(oe.total_duration_ms)}),l.jsx("td",{className:"px-3 py-2 text-center",children:l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${oe.status==="ok"?"bg-green-500":"bg-red-500"}`})}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text-muted)] tabular-nums",children:oe.span_count})]},oe.id))]},H.conversation_id)}),Y.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:9,className:"px-3 py-8 text-center text-[var(--color-text-muted)]",children:"No traces yet"})})]})]})})]})]})}function ns(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}const Xx={cc:"#9e9e9e",llm_proxy:"#42a5f5",node:"#66bb6a",tts:"#ffa726",whisper:"#ab47bc"},Kx={cc:"Command Center",llm_proxy:"LLM Proxy",node:"Node",tts:"TTS",whisper:"Whisper"};function L4(a){const s=a.filter(d=>d.duration_ms>0),o=s.filter(d=>!s.some(f=>f!==d&&d.start_ms<=f.start_ms&&d.end_ms>=f.end_ms&&f.duration_ms>0));o.sort((d,f)=>d.start_ms-f.start_ms);const i=[];for(const d of o){const f=i[i.length-1];f&&f.service===d.service?(f.duration_ms=Math.round((f.duration_ms+d.duration_ms)*10)/10,f.steps.push(d.name),d.status==="error"&&(f.status="error")):i.push({service:d.service,duration_ms:d.duration_ms,status:d.status,steps:[d.name]})}return i}function B4(){const{id:a}=A0(),s=wa(),[o,i]=N.useState(!1),[d,f]=N.useState(null),{data:m,isLoading:v,error:g}=yt({queryKey:["trace",a],queryFn:()=>O4(a),enabled:!!a}),h=N.useMemo(()=>m?L4(m.spans):[],[m]);return v?l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}):g||!m?l.jsxs("div",{className:"space-y-4",children:[l.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>s("/traces"),children:"Back to traces"}),l.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 p-4 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:"Trace not found"})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>s("/traces"),children:"Back to traces"}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-[var(--color-text)]",children:m.user_command??"Request Trace"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[m.source==="mobile"?"📱 Mobile":"🔊 Node",m.node_id&&` (${m.node_id})`," · ",m.request_type," · ",m.created_at?new Date(m.created_at).toLocaleString():""]})]}),l.jsxs("div",{className:"text-right",children:[l.jsx("div",{className:"text-2xl font-bold tabular-nums text-[var(--color-text)]",children:ns(m.total_duration_ms)}),l.jsxs("div",{className:"flex items-center justify-end gap-1 mt-1",children:[l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${m.status==="ok"?"bg-green-500":"bg-red-500"}`}),l.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:m.status})]})]})]}),m.error_message&&l.jsx("div",{className:"mt-3 rounded border border-red-300 bg-red-50 p-2 text-sm text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:m.error_message}),l.jsx("p",{className:"mt-2 text-xs text-[var(--color-text-muted)] font-mono",children:m.conversation_id})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-muted)]",children:"Service Flow"}),l.jsx("p",{className:"mb-4 text-xs text-[var(--color-text-muted)] opacity-60",children:h.map(y=>Kx[y.service]??y.service).join(" → ")}),l.jsx("div",{className:"space-y-2",children:h.map((y,x)=>{const S=Math.min(y.duration_ms/m.total_duration_ms*100,100),R=y.status==="error"?"#ef4444":Xx[y.service]??"#9e9e9e",w=Kx[y.service]??y.service;return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:R}}),l.jsx("span",{className:"w-32 text-sm text-[var(--color-text)] shrink-0",children:w}),l.jsxs("div",{className:"flex-1 h-6 rounded bg-[var(--color-surface-alt)] relative",children:[l.jsx("div",{className:"absolute top-0 left-0 h-full rounded",style:{width:`${Math.max(S,1)}%`,backgroundColor:R,opacity:.7}}),l.jsx("span",{className:"absolute inset-0 flex items-center px-2 text-xs text-[var(--color-text)] opacity-70",children:y.steps.join(", ")})]}),l.jsx("span",{className:"w-16 text-sm text-[var(--color-text)] text-right tabular-nums shrink-0",children:ns(y.duration_ms)})]},`${y.service}-${x}`)})})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("button",{className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>{i(y=>!y),f(null)},children:[o?"Hide":"Show"," raw spans (",m.spans.length,")"]}),o&&l.jsx("div",{className:"mt-3 space-y-1",children:m.spans.map((y,x)=>{const S=Math.min(y.duration_ms/m.total_duration_ms*100,100),R=y.start_ms/m.total_duration_ms*100,w=y.status==="error"?"#ef4444":Xx[y.service]??"#9e9e9e",E=d===y;return l.jsxs("div",{className:`flex items-center gap-2 cursor-pointer rounded px-1 py-0.5 ${E?"bg-[var(--color-surface-alt)]":""}`,onClick:()=>f(E?null:y),children:[l.jsx("span",{className:"w-36 truncate text-xs text-[var(--color-text-muted)] text-right shrink-0",children:y.name}),l.jsx("div",{className:"flex-1 relative h-4 rounded bg-[var(--color-surface-alt)]",children:l.jsx("div",{className:"absolute top-0 h-full rounded",style:{left:`${R}%`,width:`${Math.max(S,.5)}%`,backgroundColor:w,minWidth:"2px"}})}),l.jsx("span",{className:"w-14 text-xs text-[var(--color-text-muted)] text-right shrink-0 tabular-nums",children:ns(y.duration_ms)}),l.jsx("span",{className:"w-16 text-xs text-[var(--color-text-muted)] opacity-60 shrink-0",children:y.service})]},`${y.name}-${x}`)})}),d&&o&&l.jsx("div",{className:"mt-3 border-t border-[var(--color-border)] pt-3",children:l.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm max-w-md",children:[l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Service"}),l.jsx("dd",{className:"text-[var(--color-text)]",children:d.service}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Duration"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.duration_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Start"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.start_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"End"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.end_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Status"}),l.jsx("dd",{className:d.status==="ok"?"text-green-600":"text-red-600",children:d.status}),Object.entries(d.metadata||{}).map(([y,x])=>l.jsxs("div",{className:"contents",children:[l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:y}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:String(x)})]},y))]})})]})]})}function q4(){return l.jsxs("div",{className:"flex min-h-[60vh] flex-col items-center justify-center",children:[l.jsx("h1",{className:"mb-2 text-4xl font-bold text-[var(--color-text)]",children:"404"}),l.jsx("p",{className:"mb-4 text-[var(--color-text-muted)]",children:"Page not found"}),l.jsx(Cd,{to:"/settings",className:"text-[var(--color-primary)] underline hover:opacity-80",children:"Go to Settings"})]})}const H4=7,G4={currentStep:0,totalSteps:H4,enabledModules:[],portOverrides:{},infraPortOverrides:{},secrets:{},dbUser:"jarvis",whisperModel:"base.en",whisperModelPath:"/whisper-models/ggml-base.en.bin",llmInterface:"Qwen25MediumUntrained",deploymentMode:"local",deploymentTarget:"standard",remoteLlmUrl:"",remoteWhisperUrl:"",platform:"linux",hardware:null,relayEnabled:!1,installRunning:!1,installComplete:!1,nativeServices:[]};function Q4(a,s,o){return Math.max(s,Math.min(o,a))}function V4(a,s){switch(s.type){case"SET_STEP":return{...a,currentStep:Q4(s.step,0,a.totalSteps-1)};case"NEXT_STEP":return{...a,currentStep:Math.min(a.currentStep+1,a.totalSteps-1)};case"PREV_STEP":return{...a,currentStep:Math.max(a.currentStep-1,0)};case"SET_ENABLED_MODULES":return{...a,enabledModules:s.modules};case"TOGGLE_MODULE":{if(s.enabled){const o=a.enabledModules.includes(s.serviceId)?a.enabledModules:[...a.enabledModules,s.serviceId];return{...a,enabledModules:o}}return{...a,enabledModules:a.enabledModules.filter(o=>o!==s.serviceId)}}case"SET_PORT_OVERRIDE":return{...a,portOverrides:{...a.portOverrides,[s.serviceId]:s.port}};case"SET_INFRA_PORT_OVERRIDE":return{...a,infraPortOverrides:{...a.infraPortOverrides,[s.infraId]:s.port}};case"SET_SECRET":return{...a,secrets:{...a.secrets,[s.name]:s.value}};case"SET_SECRETS":return{...a,secrets:s.secrets};case"SET_DB_USER":return{...a,dbUser:s.user};case"SET_WHISPER_MODEL":return{...a,whisperModel:s.model};case"SET_WHISPER_BACKEND":return{...a,whisperBackend:s.backend};case"SET_LLM_INTERFACE":return{...a,llmInterface:s.interfaceId};case"SET_DEPLOYMENT_MODE":return{...a,deploymentMode:s.mode};case"SET_DEPLOYMENT_TARGET":return{...a,deploymentTarget:s.target};case"SET_REMOTE_LLM_URL":return{...a,remoteLlmUrl:s.url};case"SET_REMOTE_WHISPER_URL":return{...a,remoteWhisperUrl:s.url};case"SET_PLATFORM":return{...a,platform:s.platform};case"SET_HARDWARE":return{...a,hardware:s.hardware,platform:s.hardware.platform};case"SET_RELAY_ENABLED":return{...a,relayEnabled:s.enabled};case"SET_INSTALL_RUNNING":return{...a,installRunning:s.running};case"SET_INSTALL_COMPLETE":return{...a,installRunning:!1,installComplete:!0};case"SET_NATIVE_SERVICES":return{...a,nativeServices:s.services};case"TOGGLE_NATIVE_SERVICE":{if(s.enabled){const o=a.nativeServices.includes(s.serviceId)?a.nativeServices:[...a.nativeServices,s.serviceId];return{...a,nativeServices:o}}return{...a,nativeServices:a.nativeServices.filter(o=>o!==s.serviceId)}}default:return a}}const Tg=N.createContext(null);function F4({children:a}){const[s,o]=N.useReducer(V4,G4);return l.jsx(Tg.Provider,{value:{state:s,dispatch:o},children:a})}function fr(){const a=N.useContext(Tg);if(!a)throw new Error("useWizard must be used within a WizardProvider");return a}function Y4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(null),[d,f]=N.useState(!0),[m,v]=N.useState(!1);function g(){f(!0),v(!1),Yd().then(y=>{i(y);const x=y.reason==="docker_not_found";v(x),s(x?{type:"SET_INSTALL_RUNNING",running:!0}:{type:"SET_INSTALL_RUNNING",running:!1})}).catch(()=>{i({configured:!1,reason:"error"}),v(!0),s({type:"SET_INSTALL_RUNNING",running:!0})}).finally(()=>f(!1))}N.useEffect(()=>{g()},[]);const h=o&&o.reason!=="docker_not_found";return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Let's get your personal voice assistant up and running. This wizard will guide you through selecting services, configuring hardware, and starting everything up."})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsxs("div",{className:"flex items-center gap-3",children:[d?l.jsx(Ct,{size:20,className:"animate-spin text-[var(--color-primary)]"}):h?l.jsx(ht,{size:20,className:"text-green-500"}):l.jsx(Bd,{size:20,className:"text-red-500"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:d?"Checking Docker...":h?"Docker is running":"Docker not found"}),!d&&!h&&l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("p",{className:"text-xs text-red-400",children:"Docker is required to run Jarvis services."}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Install"," ",l.jsx("a",{href:"https://www.docker.com/products/docker-desktop/",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-primary)] underline hover:no-underline",children:"Docker Desktop"})," ","for your platform, start it, then click Retry."]})]})]}),m&&!d&&l.jsxs("button",{type:"button",onClick:g,className:"flex items-center gap-1 rounded-md border border-[var(--color-border)] px-2 py-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[l.jsx(gi,{size:12}),"Retry"]})]})}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-2 block text-sm font-medium text-[var(--color-text)]",children:"Deployment Mode"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_DEPLOYMENT_MODE",mode:"local"}),className:te("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",a.deploymentMode==="local"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[l.jsx(NS,{size:24,className:"text-[var(--color-primary)]"}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Local"}),l.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"Everything on this machine"})]}),l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"}),className:te("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",a.deploymentMode==="remote-llm"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[l.jsx(Qd,{size:24,className:"text-[var(--color-primary)]"}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM"}),l.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"LLM on separate GPU machine"})]})]})]})]})}const $o=[{label:"None / CPU only",gpu:null,gpuType:"none",vramMb:null,backends:["gguf"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4090 (24 GB)",gpu:"NVIDIA RTX 4090",gpuType:"nvidia",vramMb:24576,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4080 (16 GB)",gpu:"NVIDIA RTX 4080",gpuType:"nvidia",vramMb:16384,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4070 Ti (12 GB)",gpu:"NVIDIA RTX 4070 Ti",gpuType:"nvidia",vramMb:12288,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3090 (24 GB)",gpu:"NVIDIA RTX 3090",gpuType:"nvidia",vramMb:24576,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3080 (10 GB)",gpu:"NVIDIA RTX 3080",gpuType:"nvidia",vramMb:10240,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3070 (8 GB)",gpu:"NVIDIA RTX 3070",gpuType:"nvidia",vramMb:8192,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA A100 (80 GB)",gpu:"NVIDIA A100",gpuType:"nvidia",vramMb:81920,backends:["gguf","vllm"],defaultBackend:"vllm"},{label:"NVIDIA A100 (40 GB)",gpu:"NVIDIA A100",gpuType:"nvidia",vramMb:40960,backends:["gguf","vllm"],defaultBackend:"vllm"},{label:"NVIDIA Tesla T4 (16 GB)",gpu:"NVIDIA Tesla T4",gpuType:"nvidia",vramMb:16384,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"AMD RX 9070 XT — Vulkan (16 GB)",gpu:"AMD RX 9070 XT",gpuType:"amd",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 — Vulkan (12 GB)",gpu:"AMD RX 9070",gpuType:"amd",vramMb:12288,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XTX — Vulkan (24 GB)",gpu:"AMD RX 7900 XTX",gpuType:"amd",vramMb:24576,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XT — Vulkan (20 GB)",gpu:"AMD RX 7900 XT",gpuType:"amd",vramMb:20480,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7800 XT — Vulkan (16 GB)",gpu:"AMD RX 7800 XT",gpuType:"amd",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7600 — Vulkan (8 GB)",gpu:"AMD RX 7600",gpuType:"amd",vramMb:8192,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 XT — ROCm (16 GB)",gpu:"AMD RX 9070 XT",gpuType:"amd-rocm",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 — ROCm (12 GB)",gpu:"AMD RX 9070",gpuType:"amd-rocm",vramMb:12288,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XTX — ROCm (24 GB)",gpu:"AMD RX 7900 XTX",gpuType:"amd-rocm",vramMb:24576,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XT — ROCm (20 GB)",gpu:"AMD RX 7900 XT",gpuType:"amd-rocm",vramMb:20480,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7800 XT — ROCm (16 GB)",gpu:"AMD RX 7800 XT",gpuType:"amd-rocm",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"Apple M4 Max (128 GB unified)",gpu:"Apple M4 Max",gpuType:"apple",vramMb:131072,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Max (64 GB unified)",gpu:"Apple M4 Max",gpuType:"apple",vramMb:65536,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Pro (48 GB unified)",gpu:"Apple M4 Pro",gpuType:"apple",vramMb:49152,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Pro (24 GB unified)",gpu:"Apple M4 Pro",gpuType:"apple",vramMb:24576,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M2 Max (32 GB unified)",gpu:"Apple M2 Max",gpuType:"apple",vramMb:32768,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M2 Pro (16 GB unified)",gpu:"Apple M2 Pro",gpuType:"apple",vramMb:16384,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M1 (16 GB unified)",gpu:"Apple M1",gpuType:"apple",vramMb:16384,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M1 (8 GB unified)",gpu:"Apple M1",gpuType:"apple",vramMb:8192,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Other (enter VRAM manually)",gpu:"Other",gpuType:"none",vramMb:null,backends:["gguf"],defaultBackend:"gguf"}];function X4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(!a.hardware),[d,f]=N.useState(!1),[m,v]=N.useState(0),[g,h]=N.useState("");N.useEffect(()=>{a.hardware||AE().then(S=>{s({type:"SET_HARDWARE",hardware:S}),S.recommendedBackend==="remote"&&a.deploymentMode==="local"&&s({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"})}).catch(()=>{}).finally(()=>i(!1))},[]);function y(S,R){const w=$o[S];if(!a.hardware)return;const E=w.gpu==="Other"?(parseInt(R??g,10)||0)*1024:w.vramMb,_={...a.hardware,gpuName:w.gpu,gpuVramMb:E||null,gpuType:w.gpuType,recommendedBackends:[...w.backends],recommendedBackend:w.defaultBackend};s({type:"SET_HARDWARE",hardware:_})}const x=a.hardware;return o?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"}),l.jsx("p",{className:"mt-3 text-sm text-[var(--color-text-muted)]",children:"Detecting hardware..."})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Hardware Detection"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"We detected the following hardware. This determines which LLM backend to use."})]}),x&&l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(On,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"Platform"})]}),l.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[x.platform==="darwin"?"macOS":"Linux"," (",x.arch,")"]})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(Hd,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"Memory"})]}),l.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[x.totalMemoryGb," GB RAM"]})]}),l.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(On,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"GPU"})]}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:x.gpuName??"No GPU detected"}),x.gpuVramMb!=null&&x.gpuVramMb>0&&l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[Math.round(x.gpuVramMb/1024)," GB VRAM"]})]}),l.jsx("button",{type:"button",onClick:()=>f(!d),className:"text-xs font-medium text-[var(--color-primary)] hover:underline",children:d?"Cancel":"Override"})]}),d&&l.jsxs("div",{className:"mt-3 space-y-3 border-t border-[var(--color-border)] pt-3",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"gpu-select",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Select GPU"}),l.jsx("select",{id:"gpu-select",value:m,onChange:S=>{const R=parseInt(S.target.value,10);v(R),$o[R].gpu!=="Other"&&(y(R),f(!1))},className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]"),children:$o.map((S,R)=>l.jsx("option",{value:R,children:S.label},`${S.label}-${R}`))})]}),$o[m].gpu==="Other"&&l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{htmlFor:"custom-vram",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"VRAM (GB)"}),l.jsx("input",{id:"custom-vram",type:"number",min:1,max:512,value:g,onChange:S=>h(S.target.value),placeholder:"e.g. 24",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsx("button",{type:"button",disabled:!g||parseInt(g,10)<=0,onClick:()=>{y(m,g),f(!1)},className:te("rounded-lg px-4 py-2 text-sm font-medium","bg-[var(--color-primary)] text-white","disabled:cursor-not-allowed disabled:opacity-50"),children:"Apply"})]})]})]}),l.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Recommended: ",l.jsx("span",{className:"text-[var(--color-primary)]",children:x.recommendedBackend.toUpperCase()})]}),x.recommendedBackends.length>1&&l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["Available backends: ",x.recommendedBackends.join(", ")]})]})]}),a.deploymentMode==="remote-llm"&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote Service URLs"}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"remote-llm",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"LLM Proxy URL"}),l.jsx("input",{id:"remote-llm",type:"url",value:a.remoteLlmUrl,onChange:S=>s({type:"SET_REMOTE_LLM_URL",url:S.target.value}),placeholder:"http://192.168.1.100:7704",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"remote-whisper",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Whisper URL (optional)"}),l.jsx("input",{id:"remote-whisper",type:"url",value:a.remoteWhisperUrl,onChange:S=>s({type:"SET_REMOTE_WHISPER_URL",url:S.target.value}),placeholder:"http://192.168.1.100:7706",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]})]})]})}function K4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(null),[d,f]=N.useState(!0);if(N.useEffect(()=>{Promise.all([jg(),OE()]).then(([h,y])=>{if(i(h),a.enabledModules.length===0&&s({type:"SET_ENABLED_MODULES",modules:y.enabledModules}),a.platform==="darwin"&&a.nativeServices.length===0){const x=h.services.filter(S=>S.nativeCapable).map(S=>S.id);x.length>0&&s({type:"SET_NATIVE_SERVICES",services:x})}}).catch(()=>{}).finally(()=>f(!1))},[]),d||!o)return l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const{core:m,recommended:v,optional:g}=$4(o.services);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Select Services"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Core services are always included. Toggle recommended and optional services.",a.platform==="darwin"&&l.jsxs(l.Fragment,{children:[" Services marked ",l.jsx("em",{children:"Native"})," can run as macOS LaunchAgents to use the Apple GPU."]})]})]}),l.jsx(Pu,{title:"Core",subtitle:"Always included",services:m,enabled:m.map(h=>h.id),nativeServices:a.nativeServices,platform:a.platform,locked:!0}),l.jsx(Pu,{title:"Recommended",subtitle:"Enabled by default",services:v,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(h,y)=>s({type:"TOGGLE_MODULE",serviceId:h,enabled:y}),onToggleNative:(h,y)=>s({type:"TOGGLE_NATIVE_SERVICE",serviceId:h,enabled:y})}),g.length>0&&l.jsx(Pu,{title:"Optional",subtitle:"Off by default",services:g,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(h,y)=>s({type:"TOGGLE_MODULE",serviceId:h,enabled:y}),onToggleNative:(h,y)=>s({type:"TOGGLE_NATIVE_SERVICE",serviceId:h,enabled:y})}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Integrations"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Cloud services"})]}),l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_RELAY_ENABLED",enabled:!a.relayEnabled}),className:te("flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors",a.relayEnabled?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)] hover:border-[var(--color-primary)]/30"),children:[a.relayEnabled?l.jsx(ht,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),l.jsx(nS,{size:12,className:"text-[var(--color-text-muted)]"})]}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]})]})]})}function $4(a){return{core:a.filter(s=>s.category==="core"),recommended:a.filter(s=>s.category==="recommended"),optional:a.filter(s=>s.category==="optional")}}function Pu({title:a,subtitle:s,services:o,enabled:i,nativeServices:d,locked:f,onToggle:m,onToggleNative:v,platform:g}){return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:a}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:s})]}),l.jsx("div",{className:"space-y-1",children:o.map(h=>{const y=i.includes(h.id),x=h.nativeCapable&&g==="darwin"&&y,S=d.includes(h.id);return l.jsxs("div",{className:te("rounded-lg border transition-colors",y?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)]",!f&&!y&&"hover:border-[var(--color-primary)]/30"),children:[l.jsxs("button",{type:"button",disabled:f,onClick:()=>m?.(h.id,!y),className:te("flex w-full items-center gap-3 px-3 py-2.5 text-left",f&&"cursor-default"),children:[f?l.jsx(vi,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}):y?l.jsx(ht,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:h.name}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",h.port]}),h.nativeCapable&&g==="darwin"&&l.jsx("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-500",children:"Native"})]}),l.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:h.description})]})]}),x&&l.jsxs("button",{type:"button",onClick:()=>v?.(h.id,!S),className:te("flex w-full items-center gap-2 border-t border-[var(--color-border)]/50 px-3 py-2 text-left text-xs","hover:bg-[var(--color-surface-alt)] transition-colors"),children:[l.jsx(On,{size:12,className:S?"text-amber-500":"text-[var(--color-text-muted)]"}),l.jsx("span",{className:S?"text-[var(--color-text)]":"text-[var(--color-text-muted)]",children:"Run natively via LaunchAgent"}),l.jsx("span",{className:"ml-auto text-[var(--color-text-muted)]",children:S?"On (uses Apple GPU)":"Off (runs in Docker)"})]})]},h.id)})})]})}function Z4(){const{state:a}=fr(),[s,o]=N.useState(null);if(N.useEffect(()=>{jg().then(o).catch(()=>{})},[]),!s)return l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const i=s.services.filter(x=>x.category==="core"),d=s.services.filter(x=>x.category!=="core"&&a.enabledModules.includes(x.id)),f=[...i,...d],m=new Map;for(const x of f){const S=a.portOverrides[x.id]??x.port,R=m.get(S)??[];m.set(S,[...R,x.name])}const v=[...m.entries()].filter(([,x])=>x.length>1),g=f.filter(x=>x.database).length,h=f.filter(x=>a.nativeServices.includes(x.id)),y=f.filter(x=>!a.nativeServices.includes(x.id));return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Review Configuration"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Review your selections before installing."})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsx(Iu,{label:"Docker Services",value:y.length}),l.jsx(Iu,{label:"Native Services",value:h.length}),l.jsx(Iu,{label:"Databases",value:g})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Deployment Mode"}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:a.deploymentMode==="local"?"Local (all services on this machine)":"Remote LLM"}),a.deploymentMode==="remote-llm"&&a.remoteLlmUrl&&l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["LLM: ",a.remoteLlmUrl]})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsxs("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:["Services (",f.length,")"]})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:f.map(x=>l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ht,{size:14,className:"text-green-500"}),l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:x.name})]}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",a.portOverrides[x.id]??x.port]})]},x.id))})]}),a.relayEnabled&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Jarvis Relay"}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:"Enabled"}),l.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:"https://relay.jarvisautomation.io"})]}),v.length>0&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ra,{size:16,className:"text-amber-500"}),l.jsx("span",{className:"text-sm font-medium text-amber-500",children:"Port Conflicts"})]}),v.map(([x,S])=>l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Port ",x,": ",S.join(", ")]},x))]})]})}function Iu({label:a,value:s}){return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-3 text-center",children:[l.jsx("p",{className:"text-2xl font-bold text-[var(--color-primary)]",children:s}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a})]})}function Wu(){const[a,s]=N.useState({lines:[],running:!1,done:!1,exitCode:null,error:null,redirect:null}),o=N.useRef(null),i=N.useCallback((f,m)=>(o.current?.close(),s({lines:[],running:!0,done:!1,exitCode:null,error:null,redirect:null}),new Promise((v,g)=>{const h=new EventSource(f);o.current=h,h.onmessage=y=>{try{const x=JSON.parse(y.data);if(m&&m(x),"done"in x){if(s(S=>({...S,running:!1,done:!0,exitCode:x.code,redirect:x.redirect??null})),h.close(),x.code===0)v(x.code);else{const S=x.error?String(x.error):`Process exited with code ${x.code}`;g(new Error(S))}return}if("stream"in x&&"text"in x){const S={stream:x.stream,text:x.text,timestamp:Date.now()};s(R=>({...R,lines:[...R.lines,S]}))}}catch{}},h.onerror=()=>{const y=o.current===null;s(x=>({...x,running:!1,error:x.done?null:"Connection lost"})),h.close(),y||g(new Error("Connection lost"))}})),[]),d=N.useCallback(()=>{o.current?.close(),o.current=null,s(f=>({...f,running:!1}))},[]);return{...a,run:i,stop:d}}function ed({lines:a,running:s,title:o,className:i}){const d=N.useRef(null),f=N.useRef(!0);N.useEffect(()=>{const v=d.current;!v||!f.current||(v.scrollTop=v.scrollHeight)},[a]);function m(){const v=d.current;if(!v)return;const g=v.scrollHeight-v.scrollTop-v.clientHeight;f.current=g<50}return l.jsxs("div",{className:te("flex flex-col rounded-lg border border-[var(--color-border)] overflow-hidden",i),children:[o&&l.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2",children:[l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:o}),s&&l.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-green-500"})]}),l.jsxs("div",{ref:d,onScroll:m,className:"h-64 overflow-y-auto bg-[#0d1117] p-3 font-mono text-xs leading-5",children:[a.length===0&&!s&&l.jsx("span",{className:"text-gray-500",children:"Waiting for output..."}),a.map((v,g)=>l.jsx("div",{className:te("whitespace-pre-wrap break-all",v.stream==="stderr"?"text-yellow-400":"text-gray-300"),children:v.text},g)),s&&l.jsx("span",{className:"inline-block h-4 w-1.5 animate-pulse bg-gray-400"})]})]})}function J4(){const{state:a,dispatch:s}=fr(),o=Wu(),i=Wu(),d=Wu(),[f,m]=N.useState("idle"),[v,g]=N.useState(null),[h,y]=N.useState(null),[x,S]=N.useState({}),[R,w]=N.useState({}),[E,_]=N.useState(null),[O,k]=N.useState(null),[Y,I]=N.useState(null),[ne,ee]=N.useState({});N.useEffect(()=>{const ae=i.redirect;if(f!=="done"||!ae||a.platform==="darwin")return;k(5);const C=setInterval(()=>{k(F=>F===null||F<=1?(clearInterval(C),window.location.href=ae,0):F-1)},1e3);return()=>clearInterval(C)},[f,i.redirect]);const H=N.useCallback(async()=>{m("preflight"),y(null),g(null);try{const ae=await ME(a.enabledModules);return y(ae),ae.canProceed?!0:(g("Pre-flight checks failed. Fix the issues above and retry."),m("error"),_("preflight"),!1)}catch(ae){return g(`Pre-flight check failed: ${ae instanceof Error?ae.message:String(ae)}`),m("error"),_("preflight"),!1}},[a.enabledModules]);async function K(){if(a.nativeServices.length!==0){m("native");for(const ae of a.nativeServices){I(ae);try{await d.run(`/api/native-services/${ae}/install`),ee(C=>({...C,[ae]:{ok:!0}}))}catch(C){const F=C instanceof Error?C.message:String(C);ee(X=>({...X,[ae]:{ok:!1,error:F}}))}}I(null)}}async function ie(){g(null),S({}),_(null),ee({}),s({type:"SET_INSTALL_RUNNING",running:!0});try{if(!await H()){s({type:"SET_INSTALL_RUNNING",running:!1});return}m("generating"),await Bx(a),m("pulling"),await o.run("/api/install/pull"),m("starting"),await i.run("/api/install/start",C=>{if(C.phase==="health"&&typeof C.service=="string"&&S(F=>({...F,[C.service]:{healthy:C.healthy,error:C.error}})),C.serviceHealth&&typeof C.serviceHealth=="object"){const F=C.serviceHealth;S(X=>({...X,...F}))}}),await K(),m("done"),s({type:"SET_INSTALL_COMPLETE"})}catch(ae){g(ae instanceof Error?ae.message:String(ae)),m("error"),_(f),s({type:"SET_INSTALL_RUNNING",running:!1})}}async function re(){if(E==="preflight"){if(g(null),s({type:"SET_INSTALL_RUNNING",running:!0}),!await H()){s({type:"SET_INSTALL_RUNNING",running:!1});return}try{m("generating"),await Bx(a),m("pulling"),await o.run("/api/install/pull"),m("starting"),await i.run("/api/install/start",C=>{if(C.phase==="health"&&typeof C.service=="string"&&S(F=>({...F,[C.service]:{healthy:C.healthy,error:C.error}})),C.serviceHealth&&typeof C.serviceHealth=="object"){const F=C.serviceHealth;S(X=>({...X,...F}))}}),await K(),m("done"),s({type:"SET_INSTALL_COMPLETE"})}catch(C){g(C instanceof Error?C.message:String(C)),m("error"),s({type:"SET_INSTALL_RUNNING",running:!1})}}else ie()}async function oe(ae){try{const C=await fetch(`/api/containers/${ae}/logs`);if(C.ok){const F=await C.text();w(X=>({...X,[ae]:F}))}else w(F=>({...F,[ae]:`Failed to fetch logs: HTTP ${C.status}`}))}catch(C){w(F=>({...F,[ae]:`Failed to fetch logs: ${C instanceof Error?C.message:String(C)}`}))}}const he=[{key:"preflight",label:"Pre-flight checks"},{key:"generating",label:"Generate configuration"},{key:"pulling",label:"Pull Docker images"},{key:"starting",label:"Start services"},...a.nativeServices.length>0?[{key:"native",label:`Install ${a.nativeServices.length} native service${a.nativeServices.length===1?"":"s"}`}]:[]],Te=he.map(ae=>ae.key).indexOf(f);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Install"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:f==="idle"?"Ready to install. This will pull Docker images and start all services.":f==="done"?i.redirect&&a.platform!=="darwin"?`Installation complete! Redirecting to your admin dashboard in ${O??"..."}s...`:"Installation complete! Click Next to create your account and choose your models.":f==="error"?"Installation encountered an error.":"Installing..."})]}),h&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Pre-flight Checks"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:h.checks.map(ae=>l.jsx("div",{className:"flex items-center justify-between px-3 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[ae.status==="pass"?l.jsx(ht,{size:14,className:"text-green-500"}):ae.status==="warn"?l.jsx(ra,{size:14,className:"text-amber-500"}):l.jsx(xl,{size:14,className:"text-red-500"}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ae.name}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:ae.message}),ae.details&&ae.status!=="pass"&&l.jsx("p",{className:"text-xs text-[var(--color-text-muted)] opacity-60",children:ae.details})]})]})},ae.name))})]}),l.jsx("div",{className:"space-y-2",children:he.map((ae,C)=>{const F=ae.key===f,X=Te>C||f==="done",ve=f==="error"&&ae.key===E;return l.jsxs("div",{className:"flex items-center gap-3",children:[X?l.jsx(ht,{size:18,className:"text-green-500"}):ve?l.jsx(xl,{size:18,className:"text-red-500"}):F?l.jsx(Ct,{size:18,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-[18px] w-[18px] rounded-full border-2 border-[var(--color-border)]"}),l.jsx("span",{className:te("text-sm",X?"text-green-500":F?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:ae.label})]},ae.key)})}),(f==="starting"||f==="done"||f==="error")&&Object.keys(x).length>0&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Service Status"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:Object.entries(x).map(([ae,C])=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ae}),l.jsxs("div",{className:"flex items-center gap-2",children:[!C.healthy&&l.jsxs("button",{type:"button",onClick:()=>oe(ae),className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[l.jsx(ag,{size:12}),"Logs"]}),C.healthy?l.jsx(ht,{size:14,className:"text-green-500"}):l.jsx(xl,{size:14,className:"text-red-500"})]})]}),C.error&&l.jsx("p",{className:"px-3 pb-2 text-xs text-red-400",children:C.error}),R[ae]&&l.jsx("div",{className:"mx-3 mb-2 max-h-32 overflow-auto rounded bg-[var(--color-background)] p-2 text-xs font-mono text-[var(--color-text-muted)]",children:l.jsx("pre",{className:"whitespace-pre-wrap",children:R[ae]})})]},ae))})]}),(o.lines.length>0||o.running)&&l.jsx(ed,{lines:o.lines,running:o.running,title:"docker compose pull"}),(i.lines.length>0||i.running)&&l.jsx(ed,{lines:i.lines,running:i.running,title:"docker compose up -d"}),(f==="native"||Object.keys(ne).length>0)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Native Services (LaunchAgents)"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:a.nativeServices.map(ae=>{const C=ne[ae],F=Y===ae&&f==="native";return l.jsxs("div",{className:"px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ae}),C?.ok?l.jsx(ht,{size:14,className:"text-green-500"}):C?l.jsx(xl,{size:14,className:"text-red-500"}):F?l.jsx(Ct,{size:14,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-3 w-3 rounded-full border border-[var(--color-border)]"})]}),C?.error&&l.jsx("p",{className:"mt-1 text-xs text-red-400",children:C.error})]},ae)})})]}),(d.lines.length>0||d.running)&&l.jsx(ed,{lines:d.lines,running:d.running,title:Y?`deploy-launchd.sh (${Y})`:"deploy-launchd.sh"}),v&&l.jsx("div",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:v}),(f==="idle"||f==="error")&&l.jsxs("button",{type:"button",onClick:f==="error"?re:ie,className:te("flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-3 font-medium text-white","hover:opacity-90 transition-opacity"),children:[f==="error"?l.jsx(gi,{size:18}):l.jsx(ng,{size:18}),f==="error"?"Retry Installation":"Start Installation"]})]})}const $x="jarvis-whisper-api",P4="jarvis-llm-proxy-api";function I4(){const{state:a,dispatch:s}=fr(),o=Ng(),i=Cg(),d=gg(),f=wg(),m=a.platform==="darwin",[v,g]=N.useState("select"),[h,y]=N.useState(null),[x,S]=N.useState("GGUF"),[R,w]=N.useState(""),[E,_]=N.useState(!0),[O,k]=N.useState(null);if(a.deploymentMode==="remote-llm")return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Your LLM is configured to use a remote server."})]}),l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(ht,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a.remoteLlmUrl})]})]})]});const Y=async()=>{await d.mutateAsync({serviceName:$x,key:"whisper.allow_model_autodownload",value:!0}),m&&await f.mutateAsync($x)},I=re=>{y(re),k(null),re.gated&&!R.trim()?g("token"):ee(re,R.trim())},ne=()=>{if(!R.trim()){k("HuggingFace token is required for gated models");return}h&&ee(h,R)},ee=async(re,oe)=>{if(k(null),E){g("whisper");try{await Y()}catch(Te){k(`Whisper model setup failed: ${Te.message}`),g("select");return}}g("downloading");const he=x==="GGUF"?re.hfRepoGguf:re.hfRepoVllm,Ee=x==="GGUF"?re.ggufFilename:void 0;try{await i.mutateAsync({repo:he,filename:Ee,token:oe||void 0}),await H(re)}catch(Te){k(`Download failed: ${Te.message}`),g("select")}},H=async re=>{g("configuring");const he={"model.main.name":x==="GGUF"?`.models/${re.ggufFilename}`:`.models/${re.hfRepoVllm.split("/").pop()}`,"model.main.backend":x,"model.main.chat_format":re.chatFormat,"model.main.context_window":re.contextWindow,"llm.interface":re.promptProvider};x==="GGUF"&&(he["inference.gguf.n_gpu_layers"]=-1),x==="VLLM"&&re.quantization&&(he["inference.vllm.quantization"]=re.quantization);try{await o.mutateAsync(he),m&&await f.mutateAsync(P4),s({type:"SET_LLM_INTERFACE",interfaceId:re.promptProvider}),g("done")}catch(Ee){k(`Configuration failed: ${Ee.message}`),g("select")}},K=a.hardware?.gpuVramMb,ie=K?ss.filter(re=>re.vramMb<=K):ss;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:v==="done"?"Models configured. Services are restarting to load them.":"Choose a language model, and optionally fetch the speech-to-text model."})]}),O&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-500",children:[l.jsx(ra,{size:16,className:"mt-0.5 shrink-0"}),O]}),h&&l.jsxs("button",{type:"button",onClick:()=>ee(h,R),className:te("flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors"),children:[l.jsx(gi,{size:14}),"Retry"]})]}),v==="select"&&l.jsxs(l.Fragment,{children:[!m&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Backend"}),l.jsx("div",{className:"flex gap-2",children:["GGUF","VLLM"].map(re=>l.jsx("button",{type:"button",onClick:()=>S(re),className:te("rounded-md px-3 py-1 text-xs font-medium transition-colors",x===re?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:re==="VLLM"?"vLLM":re},re))})]}),l.jsxs("label",{className:te("flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors",E?"border-[var(--color-primary)] bg-[var(--color-primary)]/5":"border-[var(--color-border)]"),children:[l.jsx("input",{type:"checkbox",checked:E,onChange:re=>_(re.target.checked),className:"mt-0.5"}),l.jsxs("span",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[l.jsx(kx,{size:15,className:"shrink-0 text-[var(--color-primary)]"}),l.jsxs("span",{children:["Auto-download the speech-to-text model",l.jsxs("span",{className:"block text-xs text-[var(--color-text-muted)]",children:["Whisper ",l.jsx("code",{children:"base.en"})," (~150 MB, no token needed). Required for voice."]})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"hf-token",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"HuggingFace Token (optional — speeds up downloads, required for gated models)"}),l.jsx("input",{id:"hf-token",type:"password",value:R,onChange:re=>w(re.target.value),placeholder:"hf_...",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Language model"}),ie.map(re=>l.jsxs("button",{type:"button",onClick:()=>I(re),className:te("flex w-full items-center justify-between rounded-lg border border-[var(--color-border)] p-3 text-left transition-colors","hover:border-[var(--color-primary)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:re.displayName}),re.gated&&l.jsxs("span",{className:"flex items-center gap-0.5 rounded bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(vi,{size:10}),"Gated"]})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[re.promptProvider," · ",re.contextWindow.toLocaleString()," ctx"]})]}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["~",x==="GGUF"?re.sizeGguf:re.sizeVllm]})]},re.id)),ie.length===0&&l.jsxs("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:["No models fit your available memory (",K?Math.round(K/1024)+" GB":"unknown",")."]}),K&&ie.length<ss.length&&l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Showing ",ie.length," of ",ss.length," models that fit your ",Math.round(K/1024)," GB."]})]})]}),v==="token"&&h&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[l.jsx("strong",{children:h.displayName})," is a gated model. Accept the license on HuggingFace and paste your access token below."]}),l.jsx("input",{type:"password",value:R,onChange:re=>w(re.target.value),placeholder:"hf_...",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")}),l.jsxs("div",{className:"flex justify-between",children:[l.jsx("button",{type:"button",onClick:()=>{g("select"),k(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),l.jsx("button",{type:"button",onClick:ne,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Download"})]})]}),v==="whisper"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(kx,{className:"mb-4 animate-pulse text-[var(--color-primary)]",size:32}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Enabling speech-to-text model download..."}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Whisper will fetch ggml-base.en on restart"})]}),v==="downloading"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(en,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Downloading ",h?.displayName,"..."]}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["~",x==="GGUF"?h?.sizeGguf:h?.sizeVllm," · This may take several minutes"]})]}),v==="configuring"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(Ct,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Configuring model and prompt provider..."})]}),v==="done"&&h&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(ht,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:[h.displayName," configured"]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Backend: ",x," · Prompt provider: ",h.promptProvider,E&&" · Whisper auto-download enabled"]})]})]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["The LLM proxy is restarting with the new model",E&&", and whisper is fetching its model",". This may take a few minutes to finish loading. Command Center will use the"," ",l.jsx("strong",{children:h.promptProvider})," prompt provider."]})]})]})}function W4(){const[a,s]=N.useState(""),[o,i]=N.useState(""),[d,f]=N.useState(""),[m,v]=N.useState(""),[g,h]=N.useState(!1),[y,x]=N.useState(!1),[S,R]=N.useState(null),w=o===d,E=a&&o&&d&&m&&w&&!g;async function _(){if(E){h(!0),R(null);try{const k=await Pv(a,o,m);rs(k.access_token),localStorage.setItem("access_token",k.access_token),localStorage.setItem("refresh_token",k.refresh_token),x(!0)}catch(k){const Y=k?.response?.data?.error??(k instanceof Error?k.message:"Failed to create account");R(Y)}finally{h(!1)}}}if(y)return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Account Created"})}),l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(ht,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Superuser account created"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a})]})]}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:`You're logged in. Click "Next" to configure your LLM model.`})]});const O=te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Create Account"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Create your superuser account. This will be the admin for your Jarvis instance."})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"display-name",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Display Name"}),l.jsx("input",{id:"display-name",type:"text",value:m,onChange:k=>v(k.target.value),className:O,placeholder:"Alex"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",value:a,onChange:k=>s(k.target.value),className:O,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",value:o,onChange:k=>i(k.target.value),className:O,placeholder:"Choose a strong password"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),l.jsx("input",{id:"confirm-password",type:"password",value:d,onChange:k=>f(k.target.value),className:te(O,d&&!w&&"ring-2 ring-red-500"),placeholder:"Confirm password"}),d&&!w&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Passwords don't match"})]})]}),S&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(Bd,{size:14,className:"text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm text-red-500",children:S})]}),l.jsxs("button",{type:"button",onClick:_,disabled:!E,className:te("flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors","disabled:opacity-50"),children:[l.jsx(gi,{size:14}),"Retry"]})]}),!S&&l.jsx("button",{type:"button",onClick:_,disabled:!E,className:te("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50 transition-opacity"),children:g?"Creating...":"Create Superuser Account"})]})}const Zo=[{label:"Welcome",component:Y4},{label:"Hardware",component:X4},{label:"Services",component:K4},{label:"Review",component:Z4},{label:"Install",component:J4},{label:"Account",component:W4},{label:"Models",component:I4}],e3=5;function t3({skipToAccount:a}){const{state:s,dispatch:o}=fr();N.useEffect(()=>{a&&o({type:"SET_STEP",step:e3})},[a,o]);const i=wa(),d=Zo[s.currentStep].component,f=s.currentStep===0,m=s.currentStep===Zo.length-1,h=s.currentStep===4&&!s.installComplete,y=s.installRunning||h;function x(){m?i("/login"):o({type:"NEXT_STEP"})}function S(){o({type:"PREV_STEP"})}return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)] p-4",children:l.jsxs("div",{className:"w-full max-w-2xl",children:[l.jsx("div",{className:"mb-6 flex items-center justify-center gap-1",children:Zo.map((R,w)=>l.jsxs("button",{type:"button",onClick:()=>!y&&o({type:"SET_STEP",step:w}),disabled:y,className:te("flex items-center gap-1",y&&"cursor-not-allowed"),children:[l.jsx("div",{className:te("flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium transition-colors",w===s.currentStep?"bg-[var(--color-primary)] text-white":w<s.currentStep?"bg-[var(--color-primary)]/20 text-[var(--color-primary)]":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:w+1}),l.jsx("span",{className:te("hidden text-xs sm:inline",w===s.currentStep?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:R.label}),w<Zo.length-1&&l.jsx("div",{className:te("mx-1 h-px w-4 sm:w-6",w<s.currentStep?"bg-[var(--color-primary)]/30":"bg-[var(--color-border)]")})]},R.label))}),l.jsx("div",{className:"rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-6 shadow-lg",children:l.jsx(d,{})}),l.jsxs("div",{className:"mt-4 flex justify-between",children:[l.jsx("button",{type:"button",onClick:S,disabled:f||y,className:te("rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors","disabled:invisible"),children:"Back"}),l.jsx("button",{type:"button",onClick:x,disabled:y,className:te("rounded-lg bg-[var(--color-primary)] px-6 py-2 text-sm font-medium text-white","hover:opacity-90 transition-opacity","disabled:opacity-50 disabled:cursor-not-allowed"),children:m?"Finish":"Next"})]})]})})}function a3({skipToAccount:a}){return l.jsx(F4,{children:l.jsx(t3,{skipToAccount:a})})}function n3(){const a=wa(),s=Ng(),o=kE(),[i,d]=N.useState("select"),[f,m]=N.useState(null),[v,g]=N.useState("GGUF"),[h,y]=N.useState(""),[x,S]=N.useState(null),R=k=>{m(k),k.gated?d("token"):E(k,"")},w=()=>{if(!h.trim()){S("HuggingFace token is required for gated models");return}S(null),f&&E(f,h)},E=async(k,Y)=>{d("download"),S(null);const I=v==="GGUF"?k.hfRepoGguf:k.hfRepoVllm,ne=v==="GGUF"?k.ggufFilename:void 0;try{await o.mutateAsync({repo:I,filename:ne,token:Y||void 0}),_(k)}catch(ee){S(`Download failed: ${ee.message}`),d("select")}},_=async k=>{d("configure"),S(null);const I={"model.main.name":v==="GGUF"?`.models/${k.ggufFilename}`:`.models/${k.hfRepoVllm.split("/").pop()}`,"model.main.backend":v,"model.main.chat_format":k.chatFormat,"model.main.context_window":k.contextWindow};v==="GGUF"&&(I["inference.gguf.n_gpu_layers"]=-1),v==="VLLM"&&k.quantization&&(I["inference.vllm.quantization"]=k.quantization);try{await s.mutateAsync(I),d("done"),Me.success("LLM configured successfully")}catch(ne){S(`Configuration failed: ${ne.message}`),d("select")}},O=()=>{a("/dashboard")};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-bg)] p-4",children:l.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:[l.jsxs("div",{className:"mb-8 text-center",children:[l.jsx(pd,{className:"mx-auto mb-3 text-[var(--color-primary)]",size:40}),l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"LLM Setup"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Configure a local language model for Jarvis"})]}),l.jsx("div",{className:"mb-8 flex items-center justify-center gap-2",children:["select","download","configure","done"].map((k,Y)=>{const I=i==="token"?"select":i,ne=["select","download","configure","done"];return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:te("h-2 w-2 rounded-full",I===k?"bg-[var(--color-primary)]":ne.indexOf(I)>Y?"bg-green-500":"bg-[var(--color-border)]")}),Y<3&&l.jsx("div",{className:"h-px w-8 bg-[var(--color-border)]"})]},k)})}),x&&l.jsxs("div",{className:"mb-6 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-500",children:[l.jsx(ra,{size:16,className:"mt-0.5 shrink-0"}),x]}),i==="select"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Select a model"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>g("GGUF"),className:te("rounded-md px-3 py-1 text-xs font-medium transition-colors",v==="GGUF"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"GGUF"}),l.jsx("button",{onClick:()=>g("VLLM"),className:te("rounded-md px-3 py-1 text-xs font-medium transition-colors",v==="VLLM"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"vLLM"})]})]}),l.jsx("div",{className:"grid gap-3",children:ss.map(k=>l.jsxs("button",{onClick:()=>R(k),className:te("flex items-center justify-between rounded-lg border border-[var(--color-border)] p-4 text-left transition-colors","hover:border-[var(--color-primary)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:k.displayName}),k.gated&&l.jsxs("span",{className:"flex items-center gap-1 rounded bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(vi,{size:10}),"Gated"]})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[k.quantization?`${k.quantization.toUpperCase()} 4-bit`:k.chatFormat," · ",k.contextWindow.toLocaleString()," ctx"]})]}),l.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["~",v==="GGUF"?k.sizeGguf:k.sizeVllm]})]},k.id))}),l.jsx("div",{className:"flex justify-end pt-2",children:l.jsx("button",{onClick:O,className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Skip for now"})})]}),i==="token"&&f&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Access Required"}),l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[l.jsx("strong",{children:f.displayName})," is a gated model. You need to:"]}),l.jsxs("ol",{className:"list-inside list-decimal space-y-1 text-sm text-[var(--color-text-muted)]",children:[l.jsx("li",{children:"Visit the model page on huggingface.co and accept the license agreement"}),l.jsx("li",{children:"Create an access token at huggingface.co/settings/tokens"}),l.jsx("li",{children:"Paste your token below"})]}),l.jsx("input",{type:"password",value:h,onChange:k=>y(k.target.value),placeholder:"hf_...",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")}),l.jsxs("div",{className:"flex justify-between",children:[l.jsx("button",{onClick:()=>{d("select"),S(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),l.jsx("button",{onClick:w,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Continue"})]})]}),i==="download"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(en,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Downloading model..."}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," ","(~",v==="GGUF"?f?.sizeGguf:f?.sizeVllm,")"]}),l.jsx("p",{className:"mt-4 text-xs text-[var(--color-text-muted)]",children:"This may take several minutes depending on your connection"})]}),i==="configure"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(rg,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Configuring..."}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Writing settings and restarting LLM proxy"})]}),i==="done"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(Gj,{className:"mb-4 text-green-500",size:40}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"LLM Ready"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," configured on ",v]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"The model service is restarting. It may take a minute to load the model."}),l.jsx("button",{onClick:()=>a("/dashboard"),className:"mt-6 rounded-lg bg-[var(--color-primary)] px-6 py-2 text-sm text-white hover:opacity-90",children:"Go to Dashboard"})]}),(o.isPending||s.isPending)&&i!=="download"&&i!=="configure"&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:l.jsx(Ct,{className:"animate-spin text-white",size:32})})]})})}const r3=new I1;function s3(){const[a,s]=N.useState(!0),[o,i]=N.useState(!1),[d,f]=N.useState(!1);return N.useEffect(()=>{Yd().then(m=>{m.state==="deployed-needs-account"?(f(!0),i(!0)):i(!m.configured)}).catch(()=>{i(!1)}).finally(()=>s(!1))},[]),a?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-primary)] border-t-transparent"})}):l.jsxs($0,{children:[l.jsx(ft,{path:"/setup",element:l.jsx(a3,{skipToAccount:d})}),l.jsx(ft,{path:"/login",element:l.jsx(Jw,{})}),l.jsx(ft,{path:"/llm-setup",element:l.jsx(n3,{})}),l.jsxs(ft,{element:l.jsx(Zw,{}),children:[l.jsx(ft,{path:"/dashboard",element:l.jsx(LE,{})}),l.jsx(ft,{path:"/settings",element:l.jsx(iE,{})}),l.jsx(ft,{path:"/services",element:l.jsx(wE,{})}),l.jsx(ft,{path:"/models",element:l.jsx(y4,{})}),l.jsx(ft,{path:"/quick-sets",element:l.jsx(_4,{})}),l.jsx(ft,{path:"/traces",element:l.jsx(U4,{})}),l.jsx(ft,{path:"/traces/:id",element:l.jsx(B4,{})}),l.jsx(ft,{path:"/update",element:l.jsx(R4,{})}),l.jsx(ft,{path:"/reconcile",element:l.jsx(M4,{})}),l.jsx(ft,{path:"/nodes",element:l.jsx(XE,{})}),l.jsx(ft,{path:"/users",element:l.jsx(a4,{})}),l.jsx(ft,{path:"/native-services",element:l.jsx(f4,{})}),l.jsx(ft,{path:"/",element:o?l.jsx(ni,{to:"/setup",replace:!0}):l.jsx(ni,{to:"/dashboard",replace:!0})}),l.jsx(ft,{path:"*",element:l.jsx(q4,{})})]})]})}function l3(){return l.jsx(q2,{children:l.jsx(W1,{client:r3,children:l.jsxs(jj,{children:[l.jsx(g1,{children:l.jsx(s3,{})}),l.jsx(L2,{position:"bottom-right",richColors:!0})]})})})}Kb.createRoot(document.getElementById("root")).render(l.jsx(N.StrictMode,{children:l.jsx(l3,{})}));
|