@alexberardi/jarvis-admin 0.1.54 → 0.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/package.json +1 -1
  2. package/public/assets/index-DLDBFUBG.js +18 -0
  3. package/public/assets/index-j8zHkAqX.css +1 -0
  4. package/public/index.html +2 -2
  5. package/server/dist/app.d.ts +3 -0
  6. package/server/dist/app.d.ts.map +1 -1
  7. package/server/dist/app.js +7 -1
  8. package/server/dist/app.js.map +1 -1
  9. package/server/dist/routes/admin.d.ts +8 -0
  10. package/server/dist/routes/admin.d.ts.map +1 -0
  11. package/server/dist/routes/admin.js +29 -0
  12. package/server/dist/routes/admin.js.map +1 -0
  13. package/server/dist/routes/traces.d.ts.map +1 -1
  14. package/server/dist/routes/traces.js +18 -2
  15. package/server/dist/routes/traces.js.map +1 -1
  16. package/server/dist/services/configService.d.ts +6 -1
  17. package/server/dist/services/configService.d.ts.map +1 -1
  18. package/server/dist/services/configService.js +8 -2
  19. package/server/dist/services/configService.js.map +1 -1
  20. package/server/dist/services/generators/compose-generator.js +8 -0
  21. package/server/dist/services/generators/compose-generator.js.map +1 -1
  22. package/server/dist/services/generators/env-generator.d.ts.map +1 -1
  23. package/server/dist/services/generators/env-generator.js +4 -0
  24. package/server/dist/services/generators/env-generator.js.map +1 -1
  25. package/server/dist/services/serviceRegistry.d.ts +31 -0
  26. package/server/dist/services/serviceRegistry.d.ts.map +1 -0
  27. package/server/dist/services/serviceRegistry.js +56 -0
  28. package/server/dist/services/serviceRegistry.js.map +1 -0
  29. package/server/dist/services/upgrade/state-reconstructor.d.ts.map +1 -1
  30. package/server/dist/services/upgrade/state-reconstructor.js +2 -0
  31. package/server/dist/services/upgrade/state-reconstructor.js.map +1 -1
  32. package/server/dist/types/wizard.d.ts +8 -1
  33. package/server/dist/types/wizard.d.ts.map +1 -1
  34. package/public/assets/index-BSTio8c-.css +0 -1
  35. package/public/assets/index-DWQc4gfz.js +0 -18
@@ -0,0 +1,18 @@
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 Fx(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ku={exports:{}},il={};var Dp;function Ob(){if(Dp)return il;Dp=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 il.Fragment=s,il.jsx=o,il.jsxs=o,il}var Lp;function zb(){return Lp||(Lp=1,ku.exports=Ob()),ku.exports}var l=zb(),Ou={exports:{}},we={};var Up;function Db(){if(Up)return we;Up=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"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),N=Symbol.iterator;function M(R){return R===null||typeof R!="object"?null:(R=N&&R[N]||R["@@iterator"],typeof R=="function"?R:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,T={};function k(R,X,K){this.props=R,this.context=X,this.refs=T,this.updater=K||j}k.prototype.isReactComponent={},k.prototype.setState=function(R,X){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,X,"setState")},k.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function A(){}A.prototype=k.prototype;function V(R,X,K){this.props=R,this.context=X,this.refs=T,this.updater=K||j}var q=V.prototype=new A;q.constructor=V,E(q,k.prototype),q.isPureReactComponent=!0;var te=Array.isArray;function W(){}var z={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function re(R,X,K){var I=K.ref;return{$$typeof:a,type:R,key:X,ref:I!==void 0?I:null,props:K}}function Ne(R,X){return re(R.type,X,R.props)}function oe(R){return typeof R=="object"&&R!==null&&R.$$typeof===a}function he(R){var X={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(K){return X[K]})}var Ce=/\/+/g;function Re(R,X){return typeof R=="object"&&R!==null&&R.key!=null?he(""+R.key):X.toString(36)}function ee(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(W,W):(R.status="pending",R.then(function(X){R.status==="pending"&&(R.status="fulfilled",R.value=X)},function(X){R.status==="pending"&&(R.status="rejected",R.reason=X)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function w(R,X,K,I,le){var $=typeof R;($==="undefined"||$==="boolean")&&(R=null);var ie=!1;if(R===null)ie=!0;else switch($){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(R.$$typeof){case a:case s:ie=!0;break;case y:return ie=R._init,w(ie(R._payload),X,K,I,le)}}if(ie)return le=le(R),ie=I===""?"."+Re(R,0):I,te(le)?(K="",ie!=null&&(K=ie.replace(Ce,"$&/")+"/"),w(le,X,K,"",function(ne){return ne})):le!=null&&(oe(le)&&(le=Ne(le,K+(le.key==null||R&&R.key===le.key?"":(""+le.key).replace(Ce,"$&/")+"/")+ie)),X.push(le)),1;ie=0;var ce=I===""?".":I+":";if(te(R))for(var H=0;H<R.length;H++)I=R[H],$=ce+Re(I,H),ie+=w(I,X,K,$,le);else if(H=M(R),typeof H=="function")for(R=H.call(R),H=0;!(I=R.next()).done;)I=I.value,$=ce+Re(I,H++),ie+=w(I,X,K,$,le);else if($==="object"){if(typeof R.then=="function")return w(ee(R),X,K,I,le);throw X=String(R),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ie}function F(R,X,K){if(R==null)return R;var I=[],le=0;return w(R,I,"","",function($){return X.call(K,$,le++)}),I}function Y(R){if(R._status===-1){var X=R._result;X=X(),X.then(function(K){(R._status===0||R._status===-1)&&(R._status=1,R._result=K)},function(K){(R._status===0||R._status===-1)&&(R._status=2,R._result=K)}),R._status===-1&&(R._status=0,R._result=X)}if(R._status===1)return R._result.default;throw R._result}var xe=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},ve={map:F,forEach:function(R,X,K){F(R,function(){X.apply(this,arguments)},K)},count:function(R){var X=0;return F(R,function(){X++}),X},toArray:function(R){return F(R,function(X){return X})||[]},only:function(R){if(!oe(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return we.Activity=x,we.Children=ve,we.Component=k,we.Fragment=o,we.Profiler=d,we.PureComponent=V,we.StrictMode=i,we.Suspense=g,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,we.__COMPILER_RUNTIME={__proto__:null,c:function(R){return z.H.useMemoCache(R)}},we.cache=function(R){return function(){return R.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(R,X,K){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var I=E({},R.props),le=R.key;if(X!=null)for($ in X.key!==void 0&&(le=""+X.key),X)!B.call(X,$)||$==="key"||$==="__self"||$==="__source"||$==="ref"&&X.ref===void 0||(I[$]=X[$]);var $=arguments.length-2;if($===1)I.children=K;else if(1<$){for(var ie=Array($),ce=0;ce<$;ce++)ie[ce]=arguments[ce+2];I.children=ie}return re(R.type,le,I)},we.createContext=function(R){return R={$$typeof:m,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:f,_context:R},R},we.createElement=function(R,X,K){var I,le={},$=null;if(X!=null)for(I in X.key!==void 0&&($=""+X.key),X)B.call(X,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(le[I]=X[I]);var ie=arguments.length-2;if(ie===1)le.children=K;else if(1<ie){for(var ce=Array(ie),H=0;H<ie;H++)ce[H]=arguments[H+2];le.children=ce}if(R&&R.defaultProps)for(I in ie=R.defaultProps,ie)le[I]===void 0&&(le[I]=ie[I]);return re(R,$,le)},we.createRef=function(){return{current:null}},we.forwardRef=function(R){return{$$typeof:v,render:R}},we.isValidElement=oe,we.lazy=function(R){return{$$typeof:y,_payload:{_status:-1,_result:R},_init:Y}},we.memo=function(R,X){return{$$typeof:p,type:R,compare:X===void 0?null:X}},we.startTransition=function(R){var X=z.T,K={};z.T=K;try{var I=R(),le=z.S;le!==null&&le(K,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(W,xe)}catch($){xe($)}finally{X!==null&&K.types!==null&&(X.types=K.types),z.T=X}},we.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},we.use=function(R){return z.H.use(R)},we.useActionState=function(R,X,K){return z.H.useActionState(R,X,K)},we.useCallback=function(R,X){return z.H.useCallback(R,X)},we.useContext=function(R){return z.H.useContext(R)},we.useDebugValue=function(){},we.useDeferredValue=function(R,X){return z.H.useDeferredValue(R,X)},we.useEffect=function(R,X){return z.H.useEffect(R,X)},we.useEffectEvent=function(R){return z.H.useEffectEvent(R)},we.useId=function(){return z.H.useId()},we.useImperativeHandle=function(R,X,K){return z.H.useImperativeHandle(R,X,K)},we.useInsertionEffect=function(R,X){return z.H.useInsertionEffect(R,X)},we.useLayoutEffect=function(R,X){return z.H.useLayoutEffect(R,X)},we.useMemo=function(R,X){return z.H.useMemo(R,X)},we.useOptimistic=function(R,X){return z.H.useOptimistic(R,X)},we.useReducer=function(R,X,K){return z.H.useReducer(R,X,K)},we.useRef=function(R){return z.H.useRef(R)},we.useState=function(R){return z.H.useState(R)},we.useSyncExternalStore=function(R,X,K){return z.H.useSyncExternalStore(R,X,K)},we.useTransition=function(){return z.H.useTransition()},we.version="19.2.4",we}var Bp;function pd(){return Bp||(Bp=1,Ou.exports=Db()),Ou.exports}var S=pd();const se=Fx(S);var zu={exports:{}},cl={},Du={exports:{}},Lu={};var qp;function Lb(){return qp||(qp=1,(function(a){function s(w,F){var Y=w.length;w.push(F);e:for(;0<Y;){var xe=Y-1>>>1,ve=w[xe];if(0<d(ve,F))w[xe]=F,w[Y]=ve,Y=xe;else break e}}function o(w){return w.length===0?null:w[0]}function i(w){if(w.length===0)return null;var F=w[0],Y=w.pop();if(Y!==F){w[0]=Y;e:for(var xe=0,ve=w.length,R=ve>>>1;xe<R;){var X=2*(xe+1)-1,K=w[X],I=X+1,le=w[I];if(0>d(K,Y))I<ve&&0>d(le,K)?(w[xe]=le,w[I]=Y,xe=I):(w[xe]=K,w[X]=Y,xe=X);else if(I<ve&&0>d(le,Y))w[xe]=le,w[I]=Y,xe=I;else break e}}return F}function d(w,F){var Y=w.sortIndex-F.sortIndex;return Y!==0?Y:w.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=[],p=[],y=1,x=null,N=3,M=!1,j=!1,E=!1,T=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function q(w){for(var F=o(p);F!==null;){if(F.callback===null)i(p);else if(F.startTime<=w)i(p),F.sortIndex=F.expirationTime,s(g,F);else break;F=o(p)}}function te(w){if(E=!1,q(w),!j)if(o(g)!==null)j=!0,W||(W=!0,he());else{var F=o(p);F!==null&&ee(te,F.startTime-w)}}var W=!1,z=-1,B=5,re=-1;function Ne(){return T?!0:!(a.unstable_now()-re<B)}function oe(){if(T=!1,W){var w=a.unstable_now();re=w;var F=!0;try{e:{j=!1,E&&(E=!1,A(z),z=-1),M=!0;var Y=N;try{t:{for(q(w),x=o(g);x!==null&&!(x.expirationTime>w&&Ne());){var xe=x.callback;if(typeof xe=="function"){x.callback=null,N=x.priorityLevel;var ve=xe(x.expirationTime<=w);if(w=a.unstable_now(),typeof ve=="function"){x.callback=ve,q(w),F=!0;break t}x===o(g)&&i(g),q(w)}else i(g);x=o(g)}if(x!==null)F=!0;else{var R=o(p);R!==null&&ee(te,R.startTime-w),F=!1}}break e}finally{x=null,N=Y,M=!1}F=void 0}}finally{F?he():W=!1}}}var he;if(typeof V=="function")he=function(){V(oe)};else if(typeof MessageChannel<"u"){var Ce=new MessageChannel,Re=Ce.port2;Ce.port1.onmessage=oe,he=function(){Re.postMessage(null)}}else he=function(){k(oe,0)};function ee(w,F){z=k(function(){w(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(w){w.callback=null},a.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<w?Math.floor(1e3/w):5},a.unstable_getCurrentPriorityLevel=function(){return N},a.unstable_next=function(w){switch(N){case 1:case 2:case 3:var F=3;break;default:F=N}var Y=N;N=F;try{return w()}finally{N=Y}},a.unstable_requestPaint=function(){T=!0},a.unstable_runWithPriority=function(w,F){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var Y=N;N=w;try{return F()}finally{N=Y}},a.unstable_scheduleCallback=function(w,F,Y){var xe=a.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?xe+Y:xe):Y=xe,w){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=Y+ve,w={id:y++,callback:F,priorityLevel:w,startTime:Y,expirationTime:ve,sortIndex:-1},Y>xe?(w.sortIndex=Y,s(p,w),o(g)===null&&w===o(p)&&(E?(A(z),z=-1):E=!0,ee(te,Y-xe))):(w.sortIndex=ve,s(g,w),j||M||(j=!0,W||(W=!0,he()))),w},a.unstable_shouldYield=Ne,a.unstable_wrapCallback=function(w){var F=N;return function(){var Y=N;N=F;try{return w.apply(this,arguments)}finally{N=Y}}}})(Lu)),Lu}var Hp;function Ub(){return Hp||(Hp=1,Du.exports=Lb()),Du.exports}var Uu={exports:{}},Ct={};var Gp;function Bb(){if(Gp)return Ct;Gp=1;var a=pd();function s(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+p+" 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,p,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:x==null?null:""+x,children:g,containerInfo:p,implementation:y}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ct.createPortal=function(g,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(s(299));return f(g,p,null,y)},Ct.flushSync=function(g){var p=m.T,y=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=p,i.p=y,i.d.f()}},Ct.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(g,p))},Ct.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Ct.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var y=p.as,x=v(y,p.crossOrigin),N=typeof p.integrity=="string"?p.integrity:void 0,M=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?i.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:N,fetchPriority:M}):y==="script"&&i.d.X(g,{crossOrigin:x,integrity:N,fetchPriority:M,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ct.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=v(p.as,p.crossOrigin);i.d.M(g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(g)},Ct.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,x=v(y,p.crossOrigin);i.d.L(g,y,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ct.preloadModule=function(g,p){if(typeof g=="string")if(p){var y=v(p.as,p.crossOrigin);i.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(g)},Ct.requestFormReset=function(g){i.d.r(g)},Ct.unstable_batchedUpdates=function(g,p){return g(p)},Ct.useFormState=function(g,p,y){return m.H.useFormState(g,p,y)},Ct.useFormStatus=function(){return m.H.useHostTransitionStatus()},Ct.version="19.2.4",Ct}var Qp;function Yx(){if(Qp)return Uu.exports;Qp=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(),Uu.exports=Bb(),Uu.exports}var Vp;function qb(){if(Vp)return cl;Vp=1;var a=Ub(),s=pd(),o=Yx();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 p(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 h=!1,b=c.child;b;){if(b===n){h=!0,n=c,r=u;break}if(b===r){h=!0,r=c,n=u;break}b=b.sibling}if(!h){for(b=u.child;b;){if(b===n){h=!0,n=u,r=c;break}if(b===r){h=!0,r=u,n=c;break}b=b.sibling}if(!h)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,N=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),V=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),Ne=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 Ce=Symbol.for("react.client.reference");function Re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case k:return"Profiler";case T:return"StrictMode";case te:return"Suspense";case W:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case V:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:Re(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return Re(e(t))}catch{}}return null}var ee=Array.isArray,w=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,Y={pending:!1,data:null,method:null,action:null},xe=[],ve=-1;function R(e){return{current:e}}function X(e){0>ve||(e.current=xe[ve],xe[ve]=null,ve--)}function K(e,t){ve++,xe[ve]=e.current,e.current=t}var I=R(null),le=R(null),$=R(null),ie=R(null);function ce(e,t){switch(K($,t),K(le,e),K(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?rp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rp(t),e=sp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}X(I),K(I,e)}function H(){X(I),X(le),X($)}function ne(e){e.memoizedState!==null&&K(ie,e);var t=I.current,n=sp(t,e.type);t!==n&&(K(le,e),K(I,n))}function _e(e){le.current===e&&(X(I),X(le)),ie.current===e&&(X(ie),rl._currentValue=Y)}var Ae,va;function it(e){if(Ae===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||"",va=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Ae+e+va}var zn=!1;function fr(e,t){if(!e||zn)return"";zn=!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(G){var U=G}Reflect.construct(e,[],P)}else{try{P.call()}catch(G){U=G}e.call(P.prototype)}}else{try{throw Error()}catch(G){U=G}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(G){if(G&&U&&typeof G.stack=="string")return[G.stack,U.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(),h=u[0],b=u[1];if(h&&b){var C=h.split(`
4
+ `),L=b.split(`
5
+ `);for(c=r=0;r<C.length&&!C[r].includes("DetermineComponentFrameRoot");)r++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(r===C.length||c===L.length)for(r=C.length-1,c=L.length-1;1<=r&&0<=c&&C[r]!==L[c];)c--;for(;1<=r&&0<=c;r--,c--)if(C[r]!==L[c]){if(r!==1||c!==1)do if(r--,c--,0>c||C[r]!==L[c]){var Z=`
6
+ `+C[r].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=r&&0<=c);break}}}finally{zn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?it(n):""}function Dn(e,t){switch(e.tag){case 26:case 27:case 5:return it(e.type);case 16:return it("Lazy");case 13:return e.child!==t&&t!==null?it("Suspense Fallback"):it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return fr(e.type,!1);case 11:return fr(e.type.render,!1);case 1:return fr(e.type,!0);case 31:return it("Activity");default:return""}}function hs(e){try{var t="",n=null;do t+=Dn(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var Zt=Object.prototype.hasOwnProperty,ps=a.unstable_scheduleCallback,xs=a.unstable_cancelCallback,Mt=a.unstable_shouldYield,an=a.unstable_requestPaint,At=a.unstable_now,bi=a.unstable_getCurrentPriorityLevel,Ln=a.unstable_ImmediatePriority,Tl=a.unstable_UserBlockingPriority,Un=a.unstable_NormalPriority,vs=a.unstable_LowPriority,za=a.unstable_IdlePriority,Cl=a.log,nn=a.unstable_setDisableYieldValue,Bn=null,kt=null;function ga(e){if(typeof Cl=="function"&&nn(e),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(Bn,e)}catch{}}var Et=Math.clz32?Math.clz32:Ta,Si=Math.log,gs=Math.LN2;function Ta(e){return e>>>=0,e===0?32:31-(Si(e)/gs|0)|0}var mr=256,hr=262144,qn=4194304;function Ca(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 je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var c=0,u=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var b=r&134217727;return b!==0?(r=b&~u,r!==0?c=Ca(r):(h&=b,h!==0?c=Ca(h):n||(n=b&~e,n!==0&&(c=Ca(n))))):(b=r&~u,b!==0?c=Ca(b):h!==0?c=Ca(h):n||(n=r&~e,n!==0&&(c=Ca(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(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 Tt(){var e=qn;return qn<<=1,(qn&62914560)===0&&(qn=4194304),e}function rn(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 Dt(e,t,n,r,c,u){var h=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,C=e.expirationTimes,L=e.hiddenUpdates;for(n=h&~n;0<n;){var Z=31-Et(n),P=1<<Z;b[Z]=0,C[Z]=-1;var U=L[Z];if(U!==null)for(L[Z]=null,Z=0;Z<U.length;Z++){var G=U[Z];G!==null&&(G.lane&=-536870913)}n&=~P}r!==0&&Hn(e,r,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(h&~t))}function Hn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Et(n),c=1<<r;c&t|e[r]&t&&(e[r]|=t),n&=~c}}function Ut(e,t){var n=t&-t;return n=(n&42)!==0?1:pr(n),(n&(e.suspendedLanes|t))!==0?0:n}function pr(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 Ni(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:Rp(e.type))}function Vd(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var sn=Math.random().toString(36).slice(2),gt="__reactFiber$"+sn,Bt="__reactProps$"+sn,xr="__reactContainer$"+sn,ji="__reactEvents$"+sn,Ng="__reactListeners$"+sn,jg="__reactHandles$"+sn,Fd="__reactResources$"+sn,ys="__reactMarker$"+sn;function wi(e){delete e[gt],delete e[Bt],delete e[ji],delete e[Ng],delete e[jg]}function vr(e){var t=e[gt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[xr]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fp(e);e!==null;){if(n=e[gt])return n;e=fp(e)}return t}e=n,n=e.parentNode}return null}function gr(e){if(e=e[gt]||e[xr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yr(e){var t=e[Fd];return t||(t=e[Fd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[ys]=!0}var Yd=new Set,Xd={};function Gn(e,t){br(e,t),br(e+"Capture",t)}function br(e,t){for(Xd[e]=t,e=0;e<t.length;e++)Yd.add(t[e])}var wg=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]*$"),Kd={},Zd={};function Eg(e){return Zt.call(Zd,e)?!0:Zt.call(Kd,e)?!1:wg.test(e)?Zd[e]=!0:(Kd[e]=!0,!1)}function Rl(e,t,n){if(Eg(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 _l(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 sa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $d(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Tg(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(h){n=""+h,u.call(this,h)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ei(e){if(!e._valueTracker){var t=$d(e)?"checked":"value";e._valueTracker=Tg(e,t,""+e[t])}}function Jd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$d(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ml(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 Cg=/[\n"\\]/g;function la(e){return e.replace(Cg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ti(e,t,n,r,c,u,h,b){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+sa(t)):e.value!==""+sa(t)&&(e.value=""+sa(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Ci(e,h,sa(t)):n!=null?Ci(e,h,sa(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=""+sa(b):e.removeAttribute("name")}function Pd(e,t,n,r,c,u,h,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)){Ei(e);return}n=n!=null?""+sa(n):"",t=t!=null?""+sa(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,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Ei(e)}function Ci(e,t,n){t==="number"&&Ml(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Sr(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=""+sa(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 Id(e,t,n){if(t!=null&&(t=""+sa(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+sa(n):""}function Wd(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ee(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=sa(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Ei(e)}function Nr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rg=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 ef(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||Rg.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function tf(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&&ef(e,c,r)}else for(var u in t)t.hasOwnProperty(u)&&ef(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 _g=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"]]),Mg=/^[\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 Al(e){return Mg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function La(){}var _i=null;function Mi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jr=null,wr=null;function af(e){var t=gr(e);if(t&&(e=t.stateNode)){var n=e[Bt]||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="'+la(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var c=r[Bt]||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&&Jd(r)}break e;case"textarea":Id(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Sr(e,!!n.multiple,t,!1)}}}var Ai=!1;function nf(e,t,n){if(Ai)return e(t,n);Ai=!0;try{var r=e(t);return r}finally{if(Ai=!1,(jr!==null||wr!==null)&&(yo(),jr&&(t=jr,e=wr,wr=jr=null,af(t),e)))for(t=0;t<e.length;t++)af(e[t])}}function Ss(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Bt]||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 Ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ki=!1;if(Ua)try{var Ns={};Object.defineProperty(Ns,"passive",{get:function(){ki=!0}}),window.addEventListener("test",Ns,Ns),window.removeEventListener("test",Ns,Ns)}catch{ki=!1}var ln=null,Oi=null,kl=null;function rf(){if(kl)return kl;var e,t=Oi,n=t.length,r,c="value"in ln?ln.value:ln.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var h=n-e;for(r=1;r<=h&&t[n-r]===c[u-r];r++);return kl=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 sf(){return!1}function qt(e){function t(n,r,c,u,h){this._reactName=n,this._targetInst=c,this.type=r,this.nativeEvent=u,this.target=h,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:sf,this.isPropagationStopped=sf,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 Qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=qt(Qn),js=x({},Qn,{view:0,detail:0}),Ag=qt(js),zi,Di,ws,Ll=x({},js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ui,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!==ws&&(ws&&e.type==="mousemove"?(zi=e.screenX-ws.screenX,Di=e.screenY-ws.screenY):Di=zi=0,ws=e),zi)},movementY:function(e){return"movementY"in e?e.movementY:Di}}),lf=qt(Ll),kg=x({},Ll,{dataTransfer:0}),Og=qt(kg),zg=x({},js,{relatedTarget:0}),Li=qt(zg),Dg=x({},Qn,{animationName:0,elapsedTime:0,pseudoElement:0}),Lg=qt(Dg),Ug=x({},Qn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bg=qt(Ug),qg=x({},Qn,{data:0}),of=qt(qg),Hg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gg={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"},Qg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qg[e])?!!t[e]:!1}function Ui(){return Vg}var Fg=x({},js,{key:function(e){if(e.key){var t=Hg[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"?Gg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ui,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}}),Yg=qt(Fg),Xg=x({},Ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cf=qt(Xg),Kg=x({},js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ui}),Zg=qt(Kg),$g=x({},Qn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jg=qt($g),Pg=x({},Ll,{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}),Ig=qt(Pg),Wg=x({},Qn,{newState:0,oldState:0}),ey=qt(Wg),ty=[9,13,27,32],Bi=Ua&&"CompositionEvent"in window,Es=null;Ua&&"documentMode"in document&&(Es=document.documentMode);var ay=Ua&&"TextEvent"in window&&!Es,uf=Ua&&(!Bi||Es&&8<Es&&11>=Es),df=" ",ff=!1;function mf(e,t){switch(e){case"keyup":return ty.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function ny(e,t){switch(e){case"compositionend":return hf(t);case"keypress":return t.which!==32?null:(ff=!0,df);case"textInput":return e=t.data,e===df&&ff?null:e;default:return null}}function ry(e,t){if(Er)return e==="compositionend"||!Bi&&mf(e,t)?(e=rf(),kl=Oi=ln=null,Er=!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 uf&&t.locale!=="ko"?null:t.data;default:return null}}var sy={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 pf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!sy[e.type]:t==="textarea"}function xf(e,t,n,r){jr?wr?wr.push(r):wr=[r]:jr=r,t=To(t,"onChange"),0<t.length&&(n=new Dl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ts=null,Cs=null;function ly(e){Ih(e,0)}function Ul(e){var t=bs(e);if(Jd(t))return e}function vf(e,t){if(e==="change")return t}var gf=!1;if(Ua){var qi;if(Ua){var Hi="oninput"in document;if(!Hi){var yf=document.createElement("div");yf.setAttribute("oninput","return;"),Hi=typeof yf.oninput=="function"}qi=Hi}else qi=!1;gf=qi&&(!document.documentMode||9<document.documentMode)}function bf(){Ts&&(Ts.detachEvent("onpropertychange",Sf),Cs=Ts=null)}function Sf(e){if(e.propertyName==="value"&&Ul(Cs)){var t=[];xf(t,Cs,e,Mi(e)),nf(ly,t)}}function oy(e,t,n){e==="focusin"?(bf(),Ts=t,Cs=n,Ts.attachEvent("onpropertychange",Sf)):e==="focusout"&&bf()}function iy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ul(Cs)}function cy(e,t){if(e==="click")return Ul(t)}function uy(e,t){if(e==="input"||e==="change")return Ul(t)}function dy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:dy;function Rs(e,t){if($t(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(!Zt.call(t,c)||!$t(e[c],t[c]))return!1}return!0}function Nf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jf(e,t){var n=Nf(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=Nf(n)}}function wf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ef(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ml(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=Ml(e.document)}return t}function Gi(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 fy=Ua&&"documentMode"in document&&11>=document.documentMode,Tr=null,Qi=null,_s=null,Vi=!1;function Tf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vi||Tr==null||Tr!==Ml(r)||(r=Tr,"selectionStart"in r&&Gi(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}),_s&&Rs(_s,r)||(_s=r,r=To(Qi,"onSelect"),0<r.length&&(t=new Dl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Vn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Cr={animationend:Vn("Animation","AnimationEnd"),animationiteration:Vn("Animation","AnimationIteration"),animationstart:Vn("Animation","AnimationStart"),transitionrun:Vn("Transition","TransitionRun"),transitionstart:Vn("Transition","TransitionStart"),transitioncancel:Vn("Transition","TransitionCancel"),transitionend:Vn("Transition","TransitionEnd")},Fi={},Cf={};Ua&&(Cf=document.createElement("div").style,"AnimationEvent"in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),"TransitionEvent"in window||delete Cr.transitionend.transition);function Fn(e){if(Fi[e])return Fi[e];if(!Cr[e])return e;var t=Cr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Cf)return Fi[e]=t[n];return e}var Rf=Fn("animationend"),_f=Fn("animationiteration"),Mf=Fn("animationstart"),my=Fn("transitionrun"),hy=Fn("transitionstart"),py=Fn("transitioncancel"),Af=Fn("transitionend"),kf=new Map,Yi="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(" ");Yi.push("scrollEnd");function ba(e,t){kf.set(e,t),Gn(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)},oa=[],Rr=0,Xi=0;function ql(){for(var e=Rr,t=Xi=Rr=0;t<e;){var n=oa[t];oa[t++]=null;var r=oa[t];oa[t++]=null;var c=oa[t];oa[t++]=null;var u=oa[t];if(oa[t++]=null,r!==null&&c!==null){var h=r.pending;h===null?c.next=c:(c.next=h.next,h.next=c),r.pending=c}u!==0&&Of(n,c,u)}}function Hl(e,t,n,r){oa[Rr++]=e,oa[Rr++]=t,oa[Rr++]=n,oa[Rr++]=r,Xi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ki(e,t,n,r){return Hl(e,t,n,r),Gl(e)}function Yn(e,t){return Hl(e,null,null,t),Gl(e)}function Of(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-Et(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<Ps)throw Ps=0,au=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _r={};function xy(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 Jt(e,t,n,r){return new xy(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=Jt(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 zf(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 h=0;if(r=e,typeof e=="function")Zi(e)&&(h=1);else if(typeof e=="string")h=Sb(e,n,I.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case re:return e=Jt(31,n,t,c),e.elementType=re,e.lanes=u,e;case E:return Xn(n.children,c,u,t);case T:h=8,c|=24;break;case k:return e=Jt(12,n,t,c|2),e.elementType=k,e.lanes=u,e;case te:return e=Jt(13,n,t,c),e.elementType=te,e.lanes=u,e;case W:return e=Jt(19,n,t,c),e.elementType=W,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:h=10;break e;case A:h=9;break e;case q:h=11;break e;case z:h=14;break e;case B:h=16,r=null;break e}h=29,n=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=Jt(h,n,t,c),t.elementType=e,t.type=r,t.lanes=u,t}function Xn(e,t,n,r){return e=Jt(7,e,r,t),e.lanes=n,e}function $i(e,t,n){return e=Jt(6,e,null,t),e.lanes=n,e}function Df(e){var t=Jt(18,null,null,0);return t.stateNode=e,t}function Ji(e,t,n){return t=Jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Lf=new WeakMap;function ia(e,t){if(typeof e=="object"&&e!==null){var n=Lf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:hs(t)},Lf.set(e,t),t)}return{value:e,source:t,stack:hs(t)}}var Mr=[],Ar=0,Vl=null,Ms=0,ca=[],ua=0,on=null,Ra=1,_a="";function qa(e,t){Mr[Ar++]=Ms,Mr[Ar++]=Vl,Vl=e,Ms=t}function Uf(e,t,n){ca[ua++]=Ra,ca[ua++]=_a,ca[ua++]=on,on=e;var r=Ra;e=_a;var c=32-Et(r)-1;r&=~(1<<c),n+=1;var u=32-Et(t)+c;if(30<u){var h=c-c%5;u=(r&(1<<h)-1).toString(32),r>>=h,c-=h,Ra=1<<32-Et(t)+c|n<<c|r,_a=u+e}else Ra=1<<u|n<<c|r,_a=e}function Pi(e){e.return!==null&&(qa(e,1),Uf(e,1,0))}function Ii(e){for(;e===Vl;)Vl=Mr[--Ar],Mr[Ar]=null,Ms=Mr[--Ar],Mr[Ar]=null;for(;e===on;)on=ca[--ua],ca[ua]=null,_a=ca[--ua],ca[ua]=null,Ra=ca[--ua],ca[ua]=null}function Bf(e,t){ca[ua++]=Ra,ca[ua++]=_a,ca[ua++]=on,Ra=t.id,_a=t.overflow,on=e}var yt=null,Ke=null,Ue=!1,cn=null,da=!1,Wi=Error(i(519));function un(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw As(ia(t,e)),Wi}function qf(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[Bt]=r,n){case"dialog":Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":case"embed":Oe("load",t);break;case"video":case"audio":for(n=0;n<Ws.length;n++)Oe(Ws[n],t);break;case"source":Oe("error",t);break;case"img":case"image":case"link":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"input":Oe("invalid",t),Pd(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Oe("invalid",t);break;case"textarea":Oe("invalid",t),Wd(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||ap(t.textContent,n)?(r.popover!=null&&(Oe("beforetoggle",t),Oe("toggle",t)),r.onScroll!=null&&Oe("scroll",t),r.onScrollEnd!=null&&Oe("scrollend",t),r.onClick!=null&&(t.onclick=La),t=!0):t=!1,t||un(e,!0)}function Hf(e){for(yt=e.return;yt;)switch(yt.tag){case 5:case 31:case 13:da=!1;return;case 27:case 3:da=!0;return;default:yt=yt.return}}function kr(e){if(e!==yt)return!1;if(!Ue)return Hf(e),Ue=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||vu(e.type,e.memoizedProps)),n=!n),n&&Ke&&un(e),Hf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=dp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=dp(e)}else t===27?(t=Ke,wn(e.type)?(e=Nu,Nu=null,Ke=e):Ke=t):Ke=yt?ma(e.stateNode.nextSibling):null;return!0}function Kn(){Ke=yt=null,Ue=!1}function ec(){var e=cn;return e!==null&&(Vt===null?Vt=e:Vt.push.apply(Vt,e),cn=null),e}function As(e){cn===null?cn=[e]:cn.push(e)}var tc=R(null),Zn=null,Ha=null;function dn(e,t,n){K(tc,t._currentValue),t._currentValue=n}function Ga(e){e._currentValue=tc.current,X(tc)}function ac(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 nc(e,t,n,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var h=c.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=c;for(var C=0;C<t.length;C++)if(b.context===t[C]){u.lanes|=n,b=u.alternate,b!==null&&(b.lanes|=n),ac(u.return,n,e),r||(h=null);break e}u=b.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(i(341));h.lanes|=n,u=h.alternate,u!==null&&(u.lanes|=n),ac(h,n,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function Or(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 h=c.alternate;if(h===null)throw Error(i(387));if(h=h.memoizedProps,h!==null){var b=c.type;$t(c.pendingProps.value,h.value)||(e!==null?e.push(b):e=[b])}}else if(c===ie.current){if(h=c.alternate,h===null)throw Error(i(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(rl):e=[rl])}c=c.return}e!==null&&nc(t,e,n,r),t.flags|=262144}function Fl(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $n(e){Zn=e,Ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function bt(e){return Gf(Zn,e)}function Yl(e,t){return Zn===null&&$n(e),Gf(e,t)}function Gf(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 vy=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()})}},gy=a.unstable_scheduleCallback,yy=a.unstable_NormalPriority,rt={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rc(){return{controller:new vy,data:new Map,refCount:0}}function ks(e){e.refCount--,e.refCount===0&&gy(yy,function(){e.controller.abort()})}var Os=null,sc=0,zr=0,Dr=null;function by(e,t){if(Os===null){var n=Os=[];sc=0,zr=iu(),Dr={status:"pending",value:void 0,then:function(r){n.push(r)}}}return sc++,t.then(Qf,Qf),t}function Qf(){if(--sc===0&&Os!==null){Dr!==null&&(Dr.status="fulfilled");var e=Os;Os=null,zr=0,Dr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Sy(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 Vf=w.S;w.S=function(e,t){Th=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&by(e,t),Vf!==null&&Vf(e,t)};var Jn=R(null);function lc(){var e=Jn.current;return e!==null?e:Xe.pooledCache}function Xl(e,t){t===null?K(Jn,Jn.current):K(Jn,t.pool)}function Ff(){var e=lc();return e===null?null:{parent:rt._currentValue,pool:e}}var Lr=Error(i(460)),oc=Error(i(474)),Kl=Error(i(542)),Zl={then:function(){}};function Yf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(La,La),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zf(e),e;default:if(typeof t.status=="string")t.then(La,La);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,Zf(e),e}throw In=t,Lr}}function Pn(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(In=n,Lr):n}}var In=null;function Kf(){if(In===null)throw Error(i(459));var e=In;return In=null,e}function Zf(e){if(e===Lr||e===Kl)throw Error(i(483))}var Ur=null,zs=0;function $l(e){var t=zs;return zs+=1,Ur===null&&(Ur=[]),Xf(Ur,e,t)}function Ds(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Jl(e,t){throw t.$$typeof===N?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function $f(e){function t(O,_){if(e){var D=O.deletions;D===null?(O.deletions=[_],O.flags|=16):D.push(_)}}function n(O,_){if(!e)return null;for(;_!==null;)t(O,_),_=_.sibling;return null}function r(O){for(var _=new Map;O!==null;)O.key!==null?_.set(O.key,O):_.set(O.index,O),O=O.sibling;return _}function c(O,_){return O=Ba(O,_),O.index=0,O.sibling=null,O}function u(O,_,D){return O.index=D,e?(D=O.alternate,D!==null?(D=D.index,D<_?(O.flags|=67108866,_):D):(O.flags|=67108866,_)):(O.flags|=1048576,_)}function h(O){return e&&O.alternate===null&&(O.flags|=67108866),O}function b(O,_,D,J){return _===null||_.tag!==6?(_=$i(D,O.mode,J),_.return=O,_):(_=c(_,D),_.return=O,_)}function C(O,_,D,J){var pe=D.type;return pe===E?Z(O,_,D.props.children,J,D.key):_!==null&&(_.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===B&&Pn(pe)===_.type)?(_=c(_,D.props),Ds(_,D),_.return=O,_):(_=Ql(D.type,D.key,D.props,null,O.mode,J),Ds(_,D),_.return=O,_)}function L(O,_,D,J){return _===null||_.tag!==4||_.stateNode.containerInfo!==D.containerInfo||_.stateNode.implementation!==D.implementation?(_=Ji(D,O.mode,J),_.return=O,_):(_=c(_,D.children||[]),_.return=O,_)}function Z(O,_,D,J,pe){return _===null||_.tag!==7?(_=Xn(D,O.mode,J,pe),_.return=O,_):(_=c(_,D),_.return=O,_)}function P(O,_,D){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=$i(""+_,O.mode,D),_.return=O,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case M:return D=Ql(_.type,_.key,_.props,null,O.mode,D),Ds(D,_),D.return=O,D;case j:return _=Ji(_,O.mode,D),_.return=O,_;case B:return _=Pn(_),P(O,_,D)}if(ee(_)||he(_))return _=Xn(_,O.mode,D,null),_.return=O,_;if(typeof _.then=="function")return P(O,$l(_),D);if(_.$$typeof===V)return P(O,Yl(O,_),D);Jl(O,_)}return null}function U(O,_,D,J){var pe=_!==null?_.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return pe!==null?null:b(O,_,""+D,J);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case M:return D.key===pe?C(O,_,D,J):null;case j:return D.key===pe?L(O,_,D,J):null;case B:return D=Pn(D),U(O,_,D,J)}if(ee(D)||he(D))return pe!==null?null:Z(O,_,D,J,null);if(typeof D.then=="function")return U(O,_,$l(D),J);if(D.$$typeof===V)return U(O,_,Yl(O,D),J);Jl(O,D)}return null}function G(O,_,D,J,pe){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return O=O.get(D)||null,b(_,O,""+J,pe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case M:return O=O.get(J.key===null?D:J.key)||null,C(_,O,J,pe);case j:return O=O.get(J.key===null?D:J.key)||null,L(_,O,J,pe);case B:return J=Pn(J),G(O,_,D,J,pe)}if(ee(J)||he(J))return O=O.get(D)||null,Z(_,O,J,pe,null);if(typeof J.then=="function")return G(O,_,D,$l(J),pe);if(J.$$typeof===V)return G(O,_,D,Yl(_,J),pe);Jl(_,J)}return null}function ue(O,_,D,J){for(var pe=null,Be=null,me=_,Te=_=0,Le=null;me!==null&&Te<D.length;Te++){me.index>Te?(Le=me,me=null):Le=me.sibling;var qe=U(O,me,D[Te],J);if(qe===null){me===null&&(me=Le);break}e&&me&&qe.alternate===null&&t(O,me),_=u(qe,_,Te),Be===null?pe=qe:Be.sibling=qe,Be=qe,me=Le}if(Te===D.length)return n(O,me),Ue&&qa(O,Te),pe;if(me===null){for(;Te<D.length;Te++)me=P(O,D[Te],J),me!==null&&(_=u(me,_,Te),Be===null?pe=me:Be.sibling=me,Be=me);return Ue&&qa(O,Te),pe}for(me=r(me);Te<D.length;Te++)Le=G(me,O,Te,D[Te],J),Le!==null&&(e&&Le.alternate!==null&&me.delete(Le.key===null?Te:Le.key),_=u(Le,_,Te),Be===null?pe=Le:Be.sibling=Le,Be=Le);return e&&me.forEach(function(_n){return t(O,_n)}),Ue&&qa(O,Te),pe}function ge(O,_,D,J){if(D==null)throw Error(i(151));for(var pe=null,Be=null,me=_,Te=_=0,Le=null,qe=D.next();me!==null&&!qe.done;Te++,qe=D.next()){me.index>Te?(Le=me,me=null):Le=me.sibling;var _n=U(O,me,qe.value,J);if(_n===null){me===null&&(me=Le);break}e&&me&&_n.alternate===null&&t(O,me),_=u(_n,_,Te),Be===null?pe=_n:Be.sibling=_n,Be=_n,me=Le}if(qe.done)return n(O,me),Ue&&qa(O,Te),pe;if(me===null){for(;!qe.done;Te++,qe=D.next())qe=P(O,qe.value,J),qe!==null&&(_=u(qe,_,Te),Be===null?pe=qe:Be.sibling=qe,Be=qe);return Ue&&qa(O,Te),pe}for(me=r(me);!qe.done;Te++,qe=D.next())qe=G(me,O,Te,qe.value,J),qe!==null&&(e&&qe.alternate!==null&&me.delete(qe.key===null?Te:qe.key),_=u(qe,_,Te),Be===null?pe=qe:Be.sibling=qe,Be=qe);return e&&me.forEach(function(kb){return t(O,kb)}),Ue&&qa(O,Te),pe}function Ye(O,_,D,J){if(typeof D=="object"&&D!==null&&D.type===E&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case M:e:{for(var pe=D.key;_!==null;){if(_.key===pe){if(pe=D.type,pe===E){if(_.tag===7){n(O,_.sibling),J=c(_,D.props.children),J.return=O,O=J;break e}}else if(_.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===B&&Pn(pe)===_.type){n(O,_.sibling),J=c(_,D.props),Ds(J,D),J.return=O,O=J;break e}n(O,_);break}else t(O,_);_=_.sibling}D.type===E?(J=Xn(D.props.children,O.mode,J,D.key),J.return=O,O=J):(J=Ql(D.type,D.key,D.props,null,O.mode,J),Ds(J,D),J.return=O,O=J)}return h(O);case j:e:{for(pe=D.key;_!==null;){if(_.key===pe)if(_.tag===4&&_.stateNode.containerInfo===D.containerInfo&&_.stateNode.implementation===D.implementation){n(O,_.sibling),J=c(_,D.children||[]),J.return=O,O=J;break e}else{n(O,_);break}else t(O,_);_=_.sibling}J=Ji(D,O.mode,J),J.return=O,O=J}return h(O);case B:return D=Pn(D),Ye(O,_,D,J)}if(ee(D))return ue(O,_,D,J);if(he(D)){if(pe=he(D),typeof pe!="function")throw Error(i(150));return D=pe.call(D),ge(O,_,D,J)}if(typeof D.then=="function")return Ye(O,_,$l(D),J);if(D.$$typeof===V)return Ye(O,_,Yl(O,D),J);Jl(O,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,_!==null&&_.tag===6?(n(O,_.sibling),J=c(_,D),J.return=O,O=J):(n(O,_),J=$i(D,O.mode,J),J.return=O,O=J),h(O)):n(O,_)}return function(O,_,D,J){try{zs=0;var pe=Ye(O,_,D,J);return Ur=null,pe}catch(me){if(me===Lr||me===Kl)throw me;var Be=Jt(29,me,null,O.mode);return Be.lanes=J,Be.return=O,Be}}}var Wn=$f(!0),Jf=$f(!1),fn=!1;function ic(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cc(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 mn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hn(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),Of(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,Lt(e,n)}}function uc(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 h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=h:u=u.next=h,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 dc=!1;function Us(){if(dc){var e=Dr;if(e!==null)throw e}}function Bs(e,t,n,r){dc=!1;var c=e.updateQueue;fn=!1;var u=c.firstBaseUpdate,h=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var C=b,L=C.next;C.next=null,h===null?u=L:h.next=L,h=C;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,b=Z.lastBaseUpdate,b!==h&&(b===null?Z.firstBaseUpdate=L:b.next=L,Z.lastBaseUpdate=C))}if(u!==null){var P=c.baseState;h=0,Z=L=C=null,b=u;do{var U=b.lane&-536870913,G=U!==b.lane;if(G?(De&U)===U:(r&U)===U){U!==0&&U===zr&&(dc=!0),Z!==null&&(Z=Z.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ue=e,ge=b;U=t;var Ye=n;switch(ge.tag){case 1:if(ue=ge.payload,typeof ue=="function"){P=ue.call(Ye,P,U);break e}P=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ge.payload,U=typeof ue=="function"?ue.call(Ye,P,U):ue,U==null)break e;P=x({},P,U);break e;case 2:fn=!0}}U=b.callback,U!==null&&(e.flags|=64,G&&(e.flags|=8192),G=c.callbacks,G===null?c.callbacks=[U]:G.push(U))}else G={lane:U,tag:b.tag,payload:b.payload,callback:b.callback,next:null},Z===null?(L=Z=G,C=P):Z=Z.next=G,h|=U;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;G=b,b=G.next,G.next=null,c.lastBaseUpdate=G,c.shared.pending=null}}while(!0);Z===null&&(C=P),c.baseState=C,c.firstBaseUpdate=L,c.lastBaseUpdate=Z,u===null&&(c.shared.lanes=0),yn|=h,e.lanes=h,e.memoizedState=P}}function Pf(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function If(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Pf(n[e],t)}var Br=R(null),Pl=R(0);function Wf(e,t){e=Ja,K(Pl,e),K(Br,t),Ja=e|t.baseLanes}function fc(){K(Pl,Ja),K(Br,Br.current)}function mc(){Ja=Pl.current,X(Br),X(Pl)}var Pt=R(null),fa=null;function pn(e){var t=e.alternate;K(tt,tt.current&1),K(Pt,e),fa===null&&(t===null||Br.current!==null||t.memoizedState!==null)&&(fa=e)}function hc(e){K(tt,tt.current),K(Pt,e),fa===null&&(fa=e)}function em(e){e.tag===22?(K(tt,tt.current),K(Pt,e),fa===null&&(fa=e)):xn()}function xn(){K(tt,tt.current),K(Pt,Pt.current)}function It(e){X(Pt),fa===e&&(fa=null),X(tt)}var tt=R(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||bu(n)||Su(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,Ee=null,Ve=null,st=null,Wl=!1,qr=!1,er=!1,eo=0,qs=0,Hr=null,Ny=0;function We(){throw Error(i(321))}function pc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$t(e[n],t[n]))return!1;return!0}function xc(e,t,n,r,c,u){return Qa=u,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?Um:Ac,er=!1,u=n(r,c),er=!1,qr&&(u=am(t,n,r,c)),tm(e),u}function tm(e){w.H=Qs;var t=Ve!==null&&Ve.next!==null;if(Qa=0,st=Ve=Ee=null,Wl=!1,qs=0,Hr=null,t)throw Error(i(300));e===null||lt||(e=e.dependencies,e!==null&&Fl(e)&&(lt=!0))}function am(e,t,n,r){Ee=e;var c=0;do{if(qr&&(Hr=null),qs=0,qr=!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)}w.H=Bm,u=t(n,r)}while(qr);return u}function jy(){var e=w.H,t=e.useState()[0];return t=typeof t.then=="function"?Hs(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Ee.flags|=1024),t}function vc(){var e=eo!==0;return eo=0,e}function gc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function yc(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=Ee=null,qr=!1,qs=eo=0,Hr=null}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?Ee.memoizedState=st=e:st=st.next=e,st}function at(){if(Ve===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=st===null?Ee.memoizedState:st.next;if(t!==null)st=t,Ve=e;else{if(e===null)throw Ee.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?Ee.memoizedState=st=e:st=st.next=e}return st}function to(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hs(e){var t=qs;return qs+=1,Hr===null&&(Hr=[]),e=Xf(Hr,e,t),t=Ee,(st===null?t.memoizedState:st.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?Um:Ac),e}function ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Hs(e);if(e.$$typeof===V)return bt(e)}throw Error(i(438,String(e)))}function bc(e){var t=null,n=Ee.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ee.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(),Ee.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]=Ne;return t.index++,n}function Va(e,t){return typeof t=="function"?t(e):t}function no(e){var t=at();return Sc(t,Ve,e)}function Sc(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 h=c.next;c.next=u.next,u.next=h}t.baseQueue=c=u,r.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var b=h=null,C=null,L=t,Z=!1;do{var P=L.lane&-536870913;if(P!==L.lane?(De&P)===P:(Qa&P)===P){var U=L.revertLane;if(U===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),P===zr&&(Z=!0);else if((Qa&U)===U){L=L.next,U===zr&&(Z=!0);continue}else P={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(b=C=P,h=u):C=C.next=P,Ee.lanes|=U,yn|=U;P=L.action,er&&n(u,P),u=L.hasEagerState?L.eagerState:n(u,P)}else U={lane:P,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(b=C=U,h=u):C=C.next=U,Ee.lanes|=P,yn|=P;L=L.next}while(L!==null&&L!==t);if(C===null?h=u:C.next=b,!$t(u,e.memoizedState)&&(lt=!0,Z&&(n=Dr,n!==null)))throw n;e.memoizedState=u,e.baseState=h,e.baseQueue=C,r.lastRenderedState=u}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Nc(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 h=c=c.next;do u=e(u,h.action),h=h.next;while(h!==c);$t(u,t.memoizedState)||(lt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,r]}function nm(e,t,n){var r=Ee,c=at(),u=Ue;if(u){if(n===void 0)throw Error(i(407));n=n()}else n=t();var h=!$t((Ve||c).memoizedState,n);if(h&&(c.memoizedState=n,lt=!0),c=c.queue,Ec(lm.bind(null,r,c,e),[e]),c.getSnapshot!==t||h||st!==null&&st.memoizedState.tag&1){if(r.flags|=2048,Gr(9,{destroy:void 0},sm.bind(null,r,c,n,t),null),Xe===null)throw Error(i(349));u||(Qa&127)!==0||rm(r,t,n)}return n}function rm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ee.updateQueue,t===null?(t=to(),Ee.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function sm(e,t,n,r){t.value=n,t.getSnapshot=r,om(t)&&im(e)}function lm(e,t,n){return n(function(){om(t)&&im(e)})}function om(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$t(e,n)}catch{return!0}}function im(e){var t=Yn(e,2);t!==null&&Ft(t,e,2)}function jc(e){var t=Ot();if(typeof e=="function"){var n=e;if(e=n(),er){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 cm(e,t,n,r){return e.baseState=n,Sc(e,Ve,typeof r=="function"?r:Va)}function wy(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(h){u.listeners.push(h)}};w.T!==null?n(!0):u.isTransition=!1,r(u),n=t.pending,n===null?(u.next=t.pending=u,um(t,u)):(u.next=n.next,t.pending=n.next=u)}}function um(e,t){var n=t.action,r=t.payload,c=e.state;if(t.isTransition){var u=w.T,h={};w.T=h;try{var b=n(c,r),C=w.S;C!==null&&C(h,b),dm(e,t,b)}catch(L){wc(e,t,L)}finally{u!==null&&h.types!==null&&(u.types=h.types),w.T=u}}else try{u=n(c,r),dm(e,t,u)}catch(L){wc(e,t,L)}}function dm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){fm(e,t,r)},function(r){return wc(e,t,r)}):fm(e,t,n)}function fm(e,t,n){t.status="fulfilled",t.value=n,mm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,um(e,n)))}function wc(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,mm(t),t=t.next;while(t!==r)}e.action=null}function mm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function hm(e,t){return t}function pm(e,t){if(Ue){var n=Xe.formState;if(n!==null){e:{var r=Ee;if(Ue){if(Ke){t:{for(var c=Ke,u=da;c.nodeType!==8;){if(!u){c=null;break t}if(c=ma(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ke=ma(c.nextSibling),r=c.data==="F!";break e}}un(r)}r=!1}r&&(t=n[0])}}return n=Ot(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hm,lastRenderedState:t},n.queue=r,n=zm.bind(null,Ee,r),r.dispatch=n,r=jc(!1),u=Mc.bind(null,Ee,!1,r.queue),r=Ot(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,n=wy.bind(null,Ee,c,u,n),c.dispatch=n,r.memoizedState=e,[t,n,!1]}function xm(e){var t=at();return vm(t,Ve,e)}function vm(e,t,n){if(t=Sc(e,t,hm)[0],e=no(Va)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Hs(t)}catch(h){throw h===Lr?Kl:h}else r=t;t=at();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(Ee.flags|=2048,Gr(9,{destroy:void 0},Ey.bind(null,c,n),null)),[r,u,e]}function Ey(e,t){e.action=t}function gm(e){var t=at(),n=Ve;if(n!==null)return vm(t,n,e);at(),t=t.memoizedState,n=at();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Gr(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=to(),Ee.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 ym(){return at().memoizedState}function ro(e,t,n,r){var c=Ot();Ee.flags|=e,c.memoizedState=Gr(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&&pc(r,Ve.memoizedState.deps)?c.memoizedState=Gr(t,u,n,r):(Ee.flags|=e,c.memoizedState=Gr(1|t,u,n,r))}function bm(e,t){ro(8390656,8,e,t)}function Ec(e,t){so(2048,8,e,t)}function Ty(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=to(),Ee.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Sm(e){var t=at().memoizedState;return Ty({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Nm(e,t){return so(4,2,e,t)}function jm(e,t){return so(4,4,e,t)}function wm(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 Em(e,t,n){n=n!=null?n.concat([e]):null,so(4,4,wm.bind(null,t,e),n)}function Tc(){}function Tm(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&pc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Cm(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&pc(t,r[1]))return r[0];if(r=e(),er){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r}function Cc(e,t,n){return n===void 0||(Qa&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Rh(),Ee.lanes|=e,yn|=e,n)}function Rm(e,t,n,r){return $t(n,t)?n:Br.current!==null?(e=Cc(e,n,r),$t(e,t)||(lt=!0),e):(Qa&42)===0||(Qa&1073741824)!==0&&(De&261930)===0?(lt=!0,e.memoizedState=n):(e=Rh(),Ee.lanes|=e,yn|=e,t)}function _m(e,t,n,r,c){var u=F.p;F.p=u!==0&&8>u?u:8;var h=w.T,b={};w.T=b,Mc(e,!1,t,n);try{var C=c(),L=w.S;if(L!==null&&L(b,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var Z=Sy(C,r);Gs(e,t,Z,ta(e))}else Gs(e,t,r,ta(e))}catch(P){Gs(e,t,{then:function(){},status:"rejected",reason:P},ta())}finally{F.p=u,h!==null&&b.types!==null&&(h.types=b.types),w.T=h}}function Cy(){}function Rc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var c=Mm(e).queue;_m(e,c,t,Y,n===null?Cy:function(){return Am(e),n(r)})}function Mm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:Y},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 Am(e){var t=Mm(e);t.next===null&&(t=e.alternate.memoizedState),Gs(e,t.next.queue,{},ta())}function _c(){return bt(rl)}function km(){return at().memoizedState}function Om(){return at().memoizedState}function Ry(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ta();e=mn(n);var r=hn(t,e,n);r!==null&&(Ft(r,t,n),Ls(r,t,n)),t={cache:rc()},e.payload=t;return}t=t.return}}function _y(e,t,n){var r=ta();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lo(e)?Dm(t,n):(n=Ki(e,t,n,r),n!==null&&(Ft(n,e,r),Lm(n,t,r)))}function zm(e,t,n){var r=ta();Gs(e,t,n,r)}function Gs(e,t,n,r){var c={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lo(e))Dm(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var h=t.lastRenderedState,b=u(h,n);if(c.hasEagerState=!0,c.eagerState=b,$t(b,h))return Hl(e,t,c,0),Xe===null&&ql(),!1}catch{}if(n=Ki(e,t,c,r),n!==null)return Ft(n,e,r),Lm(n,t,r),!0}return!1}function Mc(e,t,n,r){if(r={lane:2,revertLane:iu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lo(e)){if(t)throw Error(i(479))}else t=Ki(e,n,r,2),t!==null&&Ft(t,e,2)}function lo(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Dm(e,t){qr=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lm(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Lt(e,n)}}var Qs={readContext:bt,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};Qs.useEffectEvent=We;var Um={readContext:bt,use:ao,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:bm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ro(4194308,4,wm.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=Ot();t=t===void 0?null:t;var r=e();if(er){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ot();if(n!==void 0){var c=n(t);if(er){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=_y.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:function(e){e=jc(e);var t=e.queue,n=zm.bind(null,Ee,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Tc,useDeferredValue:function(e,t){var n=Ot();return Cc(n,e,t)},useTransition:function(){var e=jc(!1);return e=_m.bind(null,Ee,e.queue,!0,!1),Ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ee,c=Ot();if(Ue){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xe===null)throw Error(i(349));(De&127)!==0||rm(r,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,bm(lm.bind(null,r,u,e),[e]),r.flags|=2048,Gr(9,{destroy:void 0},sm.bind(null,r,u,n,t),null),n},useId:function(){var e=Ot(),t=Xe.identifierPrefix;if(Ue){var n=_a,r=Ra;n=(r&~(1<<32-Et(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=eo++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Ny++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:_c,useFormState:pm,useActionState:pm,useOptimistic:function(e){var t=Ot();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,Ee,!0,n),n.dispatch=t,[e,t]},useMemoCache:bc,useCacheRefresh:function(){return Ot().memoizedState=Ry.bind(null,Ee)},useEffectEvent:function(e){var t=Ot(),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:bt,use:ao,useCallback:Tm,useContext:bt,useEffect:Ec,useImperativeHandle:Em,useInsertionEffect:Nm,useLayoutEffect:jm,useMemo:Cm,useReducer:no,useRef:ym,useState:function(){return no(Va)},useDebugValue:Tc,useDeferredValue:function(e,t){var n=at();return Rm(n,Ve.memoizedState,e,t)},useTransition:function(){var e=no(Va)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Hs(e),t]},useSyncExternalStore:nm,useId:km,useHostTransitionStatus:_c,useFormState:xm,useActionState:xm,useOptimistic:function(e,t){var n=at();return cm(n,Ve,e,t)},useMemoCache:bc,useCacheRefresh:Om};Ac.useEffectEvent=Sm;var Bm={readContext:bt,use:ao,useCallback:Tm,useContext:bt,useEffect:Ec,useImperativeHandle:Em,useInsertionEffect:Nm,useLayoutEffect:jm,useMemo:Cm,useReducer:Nc,useRef:ym,useState:function(){return Nc(Va)},useDebugValue:Tc,useDeferredValue:function(e,t){var n=at();return Ve===null?Cc(n,e,t):Rm(n,Ve.memoizedState,e,t)},useTransition:function(){var e=Nc(Va)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Hs(e),t]},useSyncExternalStore:nm,useId:km,useHostTransitionStatus:_c,useFormState:gm,useActionState:gm,useOptimistic:function(e,t){var n=at();return Ve!==null?cm(n,Ve,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:bc,useCacheRefresh:Om};Bm.useEffectEvent=Sm;function kc(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 Oc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ta(),c=mn(r);c.payload=t,n!=null&&(c.callback=n),t=hn(e,c,r),t!==null&&(Ft(t,e,r),Ls(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ta(),c=mn(r);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=hn(e,c,r),t!==null&&(Ft(t,e,r),Ls(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ta(),r=mn(n);r.tag=2,t!=null&&(r.callback=t),t=hn(e,r,n),t!==null&&(Ft(t,e,n),Ls(t,e,n))}};function qm(e,t,n,r,c,u,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,h):t.prototype&&t.prototype.isPureReactComponent?!Rs(n,r)||!Rs(c,u):!0}function Hm(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&&Oc.enqueueReplaceState(t,t.state,null)}function tr(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 Gm(e){Bl(e)}function Qm(e){console.error(e)}function Vm(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 Fm(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 zc(e,t,n){return n=mn(n),n.tag=3,n.payload={element:null},n.callback=function(){oo(e,t)},n}function Ym(e){return e=mn(e),e.tag=3,e}function Xm(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(){Fm(t,n,r)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){Fm(t,n,r),typeof c!="function"&&(bn===null?bn=new Set([this]):bn.add(this));var b=r.stack;this.componentDidCatch(r.value,{componentStack:b!==null?b:""})})}function My(e,t,n,r,c){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Or(t,n,c,!0),n=Pt.current,n!==null){switch(n.tag){case 31:case 13:return fa===null?bo():n.alternate===null&&et===0&&(et=3),n.flags&=-257,n.flags|=65536,n.lanes=c,r===Zl?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),su(e,r,c)),!1;case 22:return n.flags|=65536,r===Zl?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)),su(e,r,c)),!1}throw Error(i(435,n.tag))}return su(e,r,c),bo(),!1}if(Ue)return t=Pt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==Wi&&(e=Error(i(422),{cause:r}),As(ia(e,n)))):(r!==Wi&&(t=Error(i(423),{cause:r}),As(ia(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=ia(r,n),c=zc(e.stateNode,r,c),uc(e,c),et!==4&&(et=2)),!1;var u=Error(i(520),{cause:r});if(u=ia(u,n),Js===null?Js=[u]:Js.push(u),et!==4&&(et=2),t===null)return!0;r=ia(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=zc(n.stateNode,r,e),uc(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"&&(bn===null||!bn.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Ym(c),Xm(c,e,n,r),uc(n,c),!1}n=n.return}while(n!==null);return!1}var Dc=Error(i(461)),lt=!1;function St(e,t,n,r){t.child=e===null?Jf(t,null,n,r):Wn(t,e.child,n,r)}function Km(e,t,n,r,c){n=n.render;var u=t.ref;if("ref"in r){var h={};for(var b in r)b!=="ref"&&(h[b]=r[b])}else h=r;return $n(t),r=xc(e,t,n,h,u,c),b=vc(),e!==null&&!lt?(gc(e,t,c),Fa(e,t,c)):(Ue&&b&&Pi(t),t.flags|=1,St(e,t,r,c),t.child)}function Zm(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,$m(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,!Vc(e,c)){var h=u.memoizedProps;if(n=n.compare,n=n!==null?n:Rs,n(h,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 $m(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,Vc(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 Jm(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 Pm(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?Wf(t,u):fc(),em(t);else return r=t.lanes=536870912,Pm(e,t,u!==null?u.baseLanes|n:n,n,r)}else u!==null?(Xl(t,u.cachePool),Wf(t,u),xn(),t.memoizedState=null):(e!==null&&Xl(t,null),fc(),xn());return St(e,t,c,n),t.child}function Vs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pm(e,t,n,r,c){var u=lc();return u=u===null?null:{parent:rt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Xl(t,null),fc(),em(t),e!==null&&Or(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 Im(e,t,n){return Wn(t,e.child,null,n),e=io(t,t.pendingProps),e.flags|=2,It(t),t.memoizedState=null,e}function Ay(e,t,n){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(r.mode==="hidden")return e=io(t,r),t.lanes=536870912,Vs(null,e);if(hc(t),(e=Ke)?(e=up(e,da),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:on!==null?{id:Ra,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},n=Df(e),n.return=t,t.child=n,yt=t,Ke=null)):e=null,e===null)throw un(t);return t.lanes=536870912,null}return io(t,r)}var u=e.memoizedState;if(u!==null){var h=u.dehydrated;if(hc(t),c)if(t.flags&256)t.flags&=-257,t=Im(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||Or(e,t,n,!1),c=(n&e.childLanes)!==0,lt||c){if(r=Xe,r!==null&&(h=Ut(r,n),h!==0&&h!==u.retryLane))throw u.retryLane=h,Yn(e,h),Ft(r,e,h),Dc;bo(),t=Im(e,t,n)}else e=u.treeContext,Ke=ma(h.nextSibling),yt=t,Ue=!0,cn=null,da=!1,e!==null&&Bf(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 $n(t),n=xc(e,t,n,r,void 0,c),r=vc(),e!==null&&!lt?(gc(e,t,c),Fa(e,t,c)):(Ue&&r&&Pi(t),t.flags|=1,St(e,t,n,c),t.child)}function Wm(e,t,n,r,c,u){return $n(t),t.updateQueue=null,n=am(t,r,n,c),tm(e),r=vc(),e!==null&&!lt?(gc(e,t,u),Fa(e,t,u)):(Ue&&r&&Pi(t),t.flags|=1,St(e,t,n,u),t.child)}function eh(e,t,n,r,c){if($n(t),t.stateNode===null){var u=_r,h=n.contextType;typeof h=="object"&&h!==null&&(u=bt(h)),u=new n(r,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Oc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=r,u.state=t.memoizedState,u.refs={},ic(t),h=n.contextType,u.context=typeof h=="object"&&h!==null?bt(h):_r,u.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(kc(t,n,h,r),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(h=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),h!==u.state&&Oc.enqueueReplaceState(u,u.state,null),Bs(t,r,u,c),Us(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,C=tr(n,b);u.props=C;var L=u.context,Z=n.contextType;h=_r,typeof Z=="object"&&Z!==null&&(h=bt(Z));var P=n.getDerivedStateFromProps;Z=typeof P=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,Z||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||L!==h)&&Hm(t,u,r,h),fn=!1;var U=t.memoizedState;u.state=U,Bs(t,r,u,c),Us(),L=t.memoizedState,b||U!==L||fn?(typeof P=="function"&&(kc(t,n,P,r),L=t.memoizedState),(C=fn||qm(t,n,C,r,U,L,h))?(Z||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=L),u.props=r,u.state=L,u.context=h,r=C):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,cc(e,t),h=t.memoizedProps,Z=tr(n,h),u.props=Z,P=t.pendingProps,U=u.context,L=n.contextType,C=_r,typeof L=="object"&&L!==null&&(C=bt(L)),b=n.getDerivedStateFromProps,(L=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(h!==P||U!==C)&&Hm(t,u,r,C),fn=!1,U=t.memoizedState,u.state=U,Bs(t,r,u,c),Us();var G=t.memoizedState;h!==P||U!==G||fn||e!==null&&e.dependencies!==null&&Fl(e.dependencies)?(typeof b=="function"&&(kc(t,n,b,r),G=t.memoizedState),(Z=fn||qm(t,n,Z,r,U,G,C)||e!==null&&e.dependencies!==null&&Fl(e.dependencies))?(L||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,G,C),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,G,C)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=G),u.props=r,u.state=G,u.context=C,r=Z):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&U===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=Wn(t,e.child,null,c),t.child=Wn(t,null,n,c)):St(e,t,n,c),t.memoizedState=u.state,e=t.child):e=Fa(e,t,c),e}function th(e,t,n,r){return Kn(),t.flags|=256,St(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bc(e){return{baseLanes:e,cachePool:Ff()}}function qc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ea),e}function ah(e,t,n){var r=t.pendingProps,c=!1,u=(t.flags&128)!==0,h;if((h=u)||(h=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(c?pn(t):xn(),(e=Ke)?(e=up(e,da),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:on!==null?{id:Ra,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},n=Df(e),n.return=t,t.child=n,yt=t,Ke=null)):e=null,e===null)throw un(t);return Su(e)?t.lanes=32:t.lanes=536870912,null}var b=r.children;return r=r.fallback,c?(xn(),c=t.mode,b=uo({mode:"hidden",children:b},c),r=Xn(r,c,n,null),b.return=t,r.return=t,b.sibling=r,t.child=b,r=t.child,r.memoizedState=Bc(n),r.childLanes=qc(e,h,n),t.memoizedState=Uc,Vs(null,r)):(pn(t),Hc(t,b))}var C=e.memoizedState;if(C!==null&&(b=C.dehydrated,b!==null)){if(u)t.flags&256?(pn(t),t.flags&=-257,t=Gc(e,t,n)):t.memoizedState!==null?(xn(),t.child=e.child,t.flags|=128,t=null):(xn(),b=r.fallback,c=t.mode,r=uo({mode:"visible",children:r.children},c),b=Xn(b,c,n,null),b.flags|=2,r.return=t,b.return=t,r.sibling=b,t.child=r,Wn(t,e.child,null,n),r=t.child,r.memoizedState=Bc(n),r.childLanes=qc(e,h,n),t.memoizedState=Uc,t=Vs(null,r));else if(pn(t),Su(b)){if(h=b.nextSibling&&b.nextSibling.dataset,h)var L=h.dgst;h=L,r=Error(i(419)),r.stack="",r.digest=h,As({value:r,source:null,stack:null}),t=Gc(e,t,n)}else if(lt||Or(e,t,n,!1),h=(n&e.childLanes)!==0,lt||h){if(h=Xe,h!==null&&(r=Ut(h,n),r!==0&&r!==C.retryLane))throw C.retryLane=r,Yn(e,r),Ft(h,e,r),Dc;bu(b)||bo(),t=Gc(e,t,n)}else bu(b)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,Ke=ma(b.nextSibling),yt=t,Ue=!0,cn=null,da=!1,e!==null&&Bf(t,e),t=Hc(t,r.children),t.flags|=4096);return t}return c?(xn(),b=r.fallback,c=t.mode,C=e.child,L=C.sibling,r=Ba(C,{mode:"hidden",children:r.children}),r.subtreeFlags=C.subtreeFlags&65011712,L!==null?b=Ba(L,b):(b=Xn(b,c,n,null),b.flags|=2),b.return=t,r.return=t,r.sibling=b,t.child=r,Vs(null,r),r=t.child,b=e.child.memoizedState,b===null?b=Bc(n):(c=b.cachePool,c!==null?(C=rt._currentValue,c=c.parent!==C?{parent:C,pool:C}:c):c=Ff(),b={baseLanes:b.baseLanes|n,cachePool:c}),r.memoizedState=b,r.childLanes=qc(e,h,n),t.memoizedState=Uc,Vs(e.child,r)):(pn(t),n=e.child,e=n.sibling,n=Ba(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function Hc(e,t){return t=uo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function uo(e,t){return e=Jt(22,e,null,t),e.lanes=0,e}function Gc(e,t,n){return Wn(t,e.child,null,n),e=Hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ac(e.return,t,n)}function Qc(e,t,n,r,c,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:c,treeForkCount:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=r,h.tail=n,h.tailMode=c,h.treeForkCount=u)}function rh(e,t,n){var r=t.pendingProps,c=r.revealOrder,u=r.tail;r=r.children;var h=tt.current,b=(h&2)!==0;if(b?(h=h&1|2,t.flags|=128):h&=1,K(tt,h),St(e,t,r,n),r=Ue?Ms:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nh(e,n,t);else if(e.tag===19)nh(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),Qc(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}Qc(t,!0,n,null,u,r);break;case"together":Qc(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),yn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Or(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 Vc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fl(e)))}function ky(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),dn(t,rt,e.memoizedState.cache),Kn();break;case 27:case 5:ne(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:dn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(pn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?ah(e,t,n):(pn(t),e=Fa(e,t,n),e!==null?e.sibling:null);pn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Or(e,t,n,!1),r=(n&t.childLanes)!==0),c){if(r)return rh(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),K(tt,tt.current),r)break;return null;case 22:return t.lanes=0,Jm(e,t,n,t.pendingProps);case 24:dn(t,rt,e.memoizedState.cache)}return Fa(e,t,n)}function sh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)lt=!0;else{if(!Vc(e,n)&&(t.flags&128)===0)return lt=!1,ky(e,t,n);lt=(e.flags&131072)!==0}else lt=!1,Ue&&(t.flags&1048576)!==0&&Uf(t,Ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Pn(t.elementType),t.type=e,typeof e=="function")Zi(e)?(r=tr(e,r),t.tag=1,t=eh(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===q){t.tag=11,t=Km(null,t,e,r,n);break e}else if(c===z){t.tag=14,t=Zm(null,t,e,r,n);break e}}throw t=Re(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=tr(r,t.pendingProps),eh(e,t,r,c,n);case 3:e:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var u=t.memoizedState;c=u.element,cc(e,t),Bs(t,r,null,n);var h=t.memoizedState;if(r=h.cache,dn(t,rt,r),r!==u.cache&&nc(t,[rt],n,!0),Us(),r=h.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=th(e,t,r,n);break e}else if(r!==c){c=ia(Error(i(424)),t),As(c),t=th(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=ma(e.firstChild),yt=t,Ue=!0,cn=null,da=!0,n=Jf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Kn(),r===c){t=Fa(e,t,n);break e}St(e,t,r,n)}t=t.child}return t;case 26:return co(e,t),e===null?(n=xp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ue||(n=t.type,e=t.pendingProps,r=Co($.current).createElement(n),r[gt]=t,r[Bt]=e,Nt(r,n,e),mt(r),t.stateNode=r):t.memoizedState=xp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ne(t),e===null&&Ue&&(r=t.stateNode=mp(t.type,t.pendingProps,$.current),yt=t,da=!0,c=Ke,wn(t.type)?(Nu=c,Ke=ma(r.firstChild)):Ke=c),St(e,t,t.pendingProps.children,n),co(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((c=r=Ke)&&(r=ib(r,t.type,t.pendingProps,da),r!==null?(t.stateNode=r,yt=t,Ke=ma(r.firstChild),da=!1,c=!0):c=!1),c||un(t)),ne(t),c=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,r=u.children,vu(c,u)?r=null:h!==null&&vu(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=xc(e,t,jy,null,null,n),rl._currentValue=c),co(e,t),St(e,t,r,n),t.child;case 6:return e===null&&Ue&&((e=n=Ke)&&(n=cb(n,t.pendingProps,da),n!==null?(t.stateNode=n,yt=t,Ke=null,e=!0):e=!1),e||un(t)),null;case 13:return ah(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Wn(t,null,r,n):St(e,t,r,n),t.child;case 11:return Km(e,t,t.type,t.pendingProps,n);case 7:return St(e,t,t.pendingProps,n),t.child;case 8:return St(e,t,t.pendingProps.children,n),t.child;case 12:return St(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,dn(t,t.type,r.value),St(e,t,r.children,n),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,$n(t),c=bt(c),r=r(c),t.flags|=1,St(e,t,r,n),t.child;case 14:return Zm(e,t,t.type,t.pendingProps,n);case 15:return $m(e,t,t.type,t.pendingProps,n);case 19:return rh(e,t,n);case 31:return Ay(e,t,n);case 22:return Jm(e,t,n,t.pendingProps);case 24:return $n(t),r=bt(rt),e===null?(c=lc(),c===null&&(c=Xe,u=rc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:r,cache:c},ic(t),dn(t,rt,c)):((e.lanes&n)!==0&&(cc(e,t),Bs(t,null,null,n),Us()),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),dn(t,rt,r)):(r=u.cache,dn(t,rt,r),r!==c.cache&&nc(t,[rt],n,!0))),St(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 Fc(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(kh())e.flags|=8192;else throw In=Zl,oc}else e.flags&=-16777217}function lh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sp(t))if(kh())e.flags|=8192;else throw In=Zl,oc}function fo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Tt():536870912,e.lanes|=t,Yr|=t)}function Fs(e,t){if(!Ue)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 Ze(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 Oy(e,t,n){var r=t.pendingProps;switch(Ii(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(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),H(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(kr(t)?Ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ec())),Ze(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Ya(t),u!==null?(Ze(t),lh(t,u)):(Ze(t),Fc(t,c,null,r,n))):u?u!==e.memoizedState?(Ya(t),Ze(t),lh(t,u)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ya(t),Ze(t),Fc(t,c,e,r,n)),null;case 27:if(_e(t),n=$.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 Ze(t),null}e=I.current,kr(t)?qf(t):(e=mp(c,r,n),t.stateNode=e,Ya(t))}return Ze(t),null;case 5:if(_e(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 Ze(t),null}if(u=I.current,kr(t))qf(t);else{var h=Co($.current);switch(u){case 1:u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=h.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?h.createElement("select",{is:r.is}):h.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?h.createElement(c,{is:r.is}):h.createElement(c)}}u[gt]=t,u[Bt]=r;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)u.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=u;e:switch(Nt(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 Ze(t),Fc(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=$.current,kr(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,c=yt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||ap(e.nodeValue,n)),e||un(t,!0)}else e=Co(e).createTextNode(r),e[gt]=t,t.stateNode=e}return Ze(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=kr(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[gt]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else n=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(i(558))}return Ze(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=kr(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[gt]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),c=!1}else c=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(It(t),t):(It(t),null)}return It(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),Ze(t),null);case 4:return H(),e===null&&fu(t.stateNode.containerInfo),Ze(t),null;case 10:return Ga(t.type),Ze(t),null;case 19:if(X(tt),r=t.memoizedState,r===null)return Ze(t),null;if(c=(t.flags&128)!==0,u=r.rendering,u===null)if(c)Fs(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,Fs(r,!1),e=u.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zf(n,e),n=n.sibling;return K(tt,tt.current&1|2),Ue&&qa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&At()>vo&&(t.flags|=128,c=!0,Fs(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),Fs(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!Ue)return Ze(t),null}else 2*At()-r.renderingStartTime>vo&&n!==536870912&&(t.flags|=128,c=!0,Fs(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,K(tt,c?n&1|2:n&1),Ue&&qa(t,r.treeForkCount),e):(Ze(t),null);case 22:case 23:return It(t),mc(),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&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(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&&X(Jn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ga(rt),Ze(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zy(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ga(rt),H(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(i(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(tt),null;case 4:return H(),null;case 10:return Ga(t.type),null;case 22:case 23:return It(t),mc(),e!==null&&X(Jn),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 oh(e,t){switch(Ii(t),t.tag){case 3:Ga(rt),H();break;case 26:case 27:case 5:_e(t);break;case 4:H();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:X(tt);break;case 10:Ga(t.type);break;case 22:case 23:It(t),mc(),e!==null&&X(Jn);break;case 24:Ga(rt)}}function Ys(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,h=n.inst;r=u(),h.destroy=r}n=n.next}while(n!==c)}}catch(b){Qe(t,t.return,b)}}function vn(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 h=r.inst,b=h.destroy;if(b!==void 0){h.destroy=void 0,c=t;var C=n,L=b;try{L()}catch(Z){Qe(c,C,Z)}}}r=r.next}while(r!==u)}}catch(Z){Qe(t,t.return,Z)}}function ih(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{If(t,n)}catch(r){Qe(e,e.return,r)}}}function ch(e,t,n){n.props=tr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Qe(e,t,r)}}function Xs(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 Ma(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 uh(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 Yc(e,t,n){try{var r=e.stateNode;ab(r,e.type,n,t),r[Bt]=t}catch(c){Qe(e,e.return,c)}}function dh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wn(e.type)||e.tag===4}function Xc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dh(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&&wn(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 Kc(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=La));else if(r!==4&&(r===27&&wn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(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&&wn(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 fh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Nt(t,r,n),t[gt]=e,t[Bt]=n}catch(u){Qe(e,e.return,u)}}var Xa=!1,ot=!1,Zc=!1,mh=typeof WeakSet=="function"?WeakSet:Set,ht=null;function Dy(e,t){if(e=e.containerInfo,pu=zo,e=Ef(e),Gi(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 h=0,b=-1,C=-1,L=0,Z=0,P=e,U=null;t:for(;;){for(var G;P!==n||c!==0&&P.nodeType!==3||(b=h+c),P!==u||r!==0&&P.nodeType!==3||(C=h+r),P.nodeType===3&&(h+=P.nodeValue.length),(G=P.firstChild)!==null;)U=P,P=G;for(;;){if(P===e)break t;if(U===n&&++L===c&&(b=h),U===u&&++Z===r&&(C=h),(G=P.nextSibling)!==null)break;P=U,U=P.parentNode}P=G}n=b===-1||C===-1?null:{start:b,end:C}}else n=null}n=n||{start:0,end:0}}else n=null;for(xu={focusedElem:e,selectionRange:n},zo=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){switch(t=ht,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 ue=tr(n.type,c);e=r.getSnapshotBeforeUpdate(ue,u),r.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Qe(n,n.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)yu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yu(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,ht=e;break}ht=t.return}}function hh(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Za(e,n),r&4&&Ys(5,n);break;case 1:if(Za(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Qe(n,n.return,h)}else{var c=tr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Qe(n,n.return,h)}}r&64&&ih(n),r&512&&Xs(n,n.return);break;case 3:if(Za(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{If(e,t)}catch(h){Qe(n,n.return,h)}}break;case 27:t===null&&r&4&&fh(n);case 26:case 5:Za(e,n),t===null&&r&4&&uh(n),r&512&&Xs(n,n.return);break;case 12:Za(e,n);break;case 31:Za(e,n),r&4&&vh(e,n);break;case 13:Za(e,n),r&4&&gh(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Fy.bind(null,n),ub(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?$a(e,n,(n.subtreeFlags&8772)!==0):Za(e,n),Xa=c,ot=u}break;case 30:break;default:Za(e,n)}}function ph(e){var t=e.alternate;t!==null&&(e.alternate=null,ph(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wi(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,Ht=!1;function Ka(e,t,n){for(n=n.child;n!==null;)xh(e,t,n),n=n.sibling}function xh(e,t,n){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Bn,n)}catch{}switch(n.tag){case 26:ot||Ma(n,t),Ka(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ot||Ma(n,t);var r=Je,c=Ht;wn(n.type)&&(Je=n.stateNode,Ht=!1),Ka(e,t,n),tl(n.stateNode),Je=r,Ht=c;break;case 5:ot||Ma(n,t);case 6:if(r=Je,c=Ht,Je=null,Ka(e,t,n),Je=r,Ht=c,Je!==null)if(Ht)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&&(Ht?(e=Je,ip(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wr(e)):ip(Je,n.stateNode));break;case 4:r=Je,c=Ht,Je=n.stateNode.containerInfo,Ht=!0,Ka(e,t,n),Je=r,Ht=c;break;case 0:case 11:case 14:case 15:vn(2,n,t),ot||vn(4,n,t),Ka(e,t,n);break;case 1:ot||(Ma(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&ch(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 vh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wr(e)}catch(n){Qe(t,t.return,n)}}}function gh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wr(e)}catch(n){Qe(t,t.return,n)}}function Ly(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mh),t;default:throw Error(i(435,e.tag))}}function ho(e,t){var n=Ly(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var c=Yy.bind(null,e,r);r.then(c,c)}})}function Gt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var c=n[r],u=e,h=t,b=h;e:for(;b!==null;){switch(b.tag){case 27:if(wn(b.type)){Je=b.stateNode,Ht=!1;break e}break;case 5:Je=b.stateNode,Ht=!1;break e;case 3:case 4:Je=b.stateNode.containerInfo,Ht=!0;break e}b=b.return}if(Je===null)throw Error(i(160));xh(u,h,c),Je=null,Ht=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yh(t,e),t=t.sibling}var Sa=null;function yh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Qt(e),r&4&&(vn(3,e,e.return),Ys(3,e),vn(5,e,e.return));break;case 1:Gt(t,e),Qt(e),r&512&&(ot||n===null||Ma(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=Sa;if(Gt(t,e),Qt(e),r&512&&(ot||n===null||Ma(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[ys]||u[gt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(r),c.head.insertBefore(u,c.querySelector("head > title"))),Nt(u,r,n),u[gt]=e,mt(u),r=u;break e;case"link":var h=yp("link","href",c).get(r+(n.href||""));if(h){for(var b=0;b<h.length;b++)if(u=h[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)){h.splice(b,1);break t}}u=c.createElement(r),Nt(u,r,n),c.head.appendChild(u);break;case"meta":if(h=yp("meta","content",c).get(r+(n.content||""))){for(b=0;b<h.length;b++)if(u=h[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)){h.splice(b,1);break t}}u=c.createElement(r),Nt(u,r,n),c.head.appendChild(u);break;default:throw Error(i(468,r))}u[gt]=e,mt(u),r=u}e.stateNode=r}else bp(c,e.type,e.stateNode);else e.stateNode=gp(c,r,e.memoizedProps);else u!==r?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,r===null?bp(c,e.type,e.stateNode):gp(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Yc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Gt(t,e),Qt(e),r&512&&(ot||n===null||Ma(n,n.return)),n!==null&&r&4&&Yc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Gt(t,e),Qt(e),r&512&&(ot||n===null||Ma(n,n.return)),e.flags&32){c=e.stateNode;try{Nr(c,"")}catch(ue){Qe(e,e.return,ue)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Yc(e,c,n!==null?n.memoizedProps:c)),r&1024&&(Zc=!0);break;case 6:if(Gt(t,e),Qt(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ue){Qe(e,e.return,ue)}}break;case 3:if(Mo=null,c=Sa,Sa=Ro(t.containerInfo),Gt(t,e),Sa=c,Qt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wr(t.containerInfo)}catch(ue){Qe(e,e.return,ue)}Zc&&(Zc=!1,bh(e));break;case 4:r=Sa,Sa=Ro(e.stateNode.containerInfo),Gt(t,e),Qt(e),Sa=r;break;case 12:Gt(t,e),Qt(e);break;case 31:Gt(t,e),Qt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 13:Gt(t,e),Qt(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 C=n!==null&&n.memoizedState!==null,L=Xa,Z=ot;if(Xa=L||c,ot=Z||C,Gt(t,e),ot=Z,Xa=L,Qt(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||C||Xa||ot||ar(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){C=n=t;try{if(u=C.stateNode,c)h=u.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{b=C.stateNode;var P=C.memoizedProps.style,U=P!=null&&P.hasOwnProperty("display")?P.display:null;b.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(ue){Qe(C,C.return,ue)}}}else if(t.tag===6){if(n===null){C=t;try{C.stateNode.nodeValue=c?"":C.memoizedProps}catch(ue){Qe(C,C.return,ue)}}}else if(t.tag===18){if(n===null){C=t;try{var G=C.stateNode;c?cp(G,!0):cp(C.stateNode,!1)}catch(ue){Qe(C,C.return,ue)}}}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:Gt(t,e),Qt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 30:break;case 21:break;default:Gt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(dh(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode,u=Xc(e);mo(e,u,c);break;case 5:var h=n.stateNode;n.flags&32&&(Nr(h,""),n.flags&=-33);var b=Xc(e);mo(e,b,h);break;case 3:case 4:var C=n.stateNode.containerInfo,L=Xc(e);Kc(e,L,C);break;default:throw Error(i(161))}}catch(Z){Qe(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Za(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hh(e,t.alternate,t),t=t.sibling}function ar(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:vn(4,t,t.return),ar(t);break;case 1:Ma(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&ch(t,t.return,n),ar(t);break;case 27:tl(t.stateNode);case 26:case 5:Ma(t,t.return),ar(t);break;case 22:t.memoizedState===null&&ar(t);break;case 30:ar(t);break;default:ar(t)}e=e.sibling}}function $a(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,u=t,h=u.flags;switch(u.tag){case 0:case 11:case 15:$a(c,u,n),Ys(4,u);break;case 1:if($a(c,u,n),r=u,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){Qe(r,r.return,L)}if(r=u,c=r.updateQueue,c!==null){var b=r.stateNode;try{var C=c.shared.hiddenCallbacks;if(C!==null)for(c.shared.hiddenCallbacks=null,c=0;c<C.length;c++)Pf(C[c],b)}catch(L){Qe(r,r.return,L)}}n&&h&64&&ih(u),Xs(u,u.return);break;case 27:fh(u);case 26:case 5:$a(c,u,n),n&&r===null&&h&4&&uh(u),Xs(u,u.return);break;case 12:$a(c,u,n);break;case 31:$a(c,u,n),n&&h&4&&vh(c,u);break;case 13:$a(c,u,n),n&&h&4&&gh(c,u);break;case 22:u.memoizedState===null&&$a(c,u,n),Xs(u,u.return);break;case 30:break;default:$a(c,u,n)}t=t.sibling}}function $c(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&&ks(n))}function Jc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ks(e))}function Na(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sh(e,t,n,r),t=t.sibling}function Sh(e,t,n,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Na(e,t,n,r),c&2048&&Ys(9,t);break;case 1:Na(e,t,n,r);break;case 3:Na(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&&ks(e)));break;case 12:if(c&2048){Na(e,t,n,r),e=t.stateNode;try{var u=t.memoizedProps,h=u.id,b=u.onPostCommit;typeof b=="function"&&b(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){Qe(t,t.return,C)}}else Na(e,t,n,r);break;case 31:Na(e,t,n,r);break;case 13:Na(e,t,n,r);break;case 23:break;case 22:u=t.stateNode,h=t.alternate,t.memoizedState!==null?u._visibility&2?Na(e,t,n,r):Ks(e,t):u._visibility&2?Na(e,t,n,r):(u._visibility|=2,Qr(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&$c(h,t);break;case 24:Na(e,t,n,r),c&2048&&Jc(t.alternate,t);break;default:Na(e,t,n,r)}}function Qr(e,t,n,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,h=t,b=n,C=r,L=h.flags;switch(h.tag){case 0:case 11:case 15:Qr(u,h,b,C,c),Ys(8,h);break;case 23:break;case 22:var Z=h.stateNode;h.memoizedState!==null?Z._visibility&2?Qr(u,h,b,C,c):Ks(u,h):(Z._visibility|=2,Qr(u,h,b,C,c)),c&&L&2048&&$c(h.alternate,h);break;case 24:Qr(u,h,b,C,c),c&&L&2048&&Jc(h.alternate,h);break;default:Qr(u,h,b,C,c)}t=t.sibling}}function Ks(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:Ks(n,r),c&2048&&$c(r.alternate,r);break;case 24:Ks(n,r),c&2048&&Jc(r.alternate,r);break;default:Ks(n,r)}t=t.sibling}}var Zs=8192;function Vr(e,t,n){if(e.subtreeFlags&Zs)for(e=e.child;e!==null;)Nh(e,t,n),e=e.sibling}function Nh(e,t,n){switch(e.tag){case 26:Vr(e,t,n),e.flags&Zs&&e.memoizedState!==null&&Nb(n,Sa,e.memoizedState,e.memoizedProps);break;case 5:Vr(e,t,n);break;case 3:case 4:var r=Sa;Sa=Ro(e.stateNode.containerInfo),Vr(e,t,n),Sa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zs,Zs=16777216,Vr(e,t,n),Zs=r):Vr(e,t,n));break;default:Vr(e,t,n)}}function jh(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 $s(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];ht=r,Eh(r,e)}jh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wh(e),e=e.sibling}function wh(e){switch(e.tag){case 0:case 11:case 15:$s(e),e.flags&2048&&vn(9,e,e.return);break;case 3:$s(e);break;case 12:$s(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)):$s(e);break;default:$s(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];ht=r,Eh(r,e)}jh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vn(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 Eh(e,t){for(;ht!==null;){var n=ht;switch(n.tag){case 0:case 11:case 15:vn(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:ks(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ht=r;else e:for(n=e;ht!==null;){r=ht;var c=r.sibling,u=r.return;if(ph(r),r===n){ht=null;break e}if(c!==null){c.return=u,ht=c;break e}ht=u}}}var Uy={getCacheForType:function(e){var t=bt(rt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return bt(rt).controller.signal}},By=typeof WeakMap=="function"?WeakMap:Map,He=0,Xe=null,ke=null,De=0,Ge=0,Wt=null,gn=!1,Fr=!1,Pc=!1,Ja=0,et=0,yn=0,nr=0,Ic=0,ea=0,Yr=0,Js=null,Vt=null,Wc=!1,xo=0,Th=0,vo=1/0,go=null,bn=null,ct=0,Sn=null,Xr=null,Pa=0,eu=0,tu=null,Ch=null,Ps=0,au=null;function ta(){return(He&2)!==0&&De!==0?De&-De:w.T!==null?iu():Ni()}function Rh(){if(ea===0)if((De&536870912)===0||Ue){var e=hr;hr<<=1,(hr&3932160)===0&&(hr=262144),ea=e}else ea=536870912;return e=Pt.current,e!==null&&(e.flags|=32),ea}function Ft(e,t,n){(e===Xe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(Kr(e,0),Nn(e,De,ea,!1)),Ie(e,n),((He&2)===0||e!==Xe)&&(e===Xe&&((He&2)===0&&(nr|=n),et===4&&Nn(e,De,ea,!1)),Aa(e))}function _h(e,t,n){if((He&6)!==0)throw Error(i(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||$e(e,t),c=r?Gy(e,t):ru(e,t,!0),u=r;do{if(c===0){Fr&&!r&&Nn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!qy(n)){c=ru(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var b=e;c=Js;var C=b.current.memoizedState.isDehydrated;if(C&&(Kr(b,h).flags|=256),h=ru(b,h,!1),h!==2){if(Pc&&!C){b.errorRecoveryDisabledLanes|=u,nr|=u,c=4;break e}u=Vt,Vt=c,u!==null&&(Vt===null?Vt=u:Vt.push.apply(Vt,u))}c=h}if(u=!1,c!==2)continue}}if(c===1){Kr(e,0),Nn(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:Nn(r,t,ea,!gn);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=xo+300-At(),10<c)){if(Nn(r,t,ea,!gn),je(r,0,!0)!==0)break e;Pa=t,r.timeoutHandle=lp(Mh.bind(null,r,n,Vt,go,Wc,t,ea,nr,Yr,gn,u,"Throttled",-0,0),c);break e}Mh(r,n,Vt,go,Wc,t,ea,nr,Yr,gn,u,null,-0,0)}}break}while(!0);Aa(e)}function Mh(e,t,n,r,c,u,h,b,C,L,Z,P,U,G){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:La},Nh(t,u,P);var ue=(u&62914560)===u?xo-At():(u&4194048)===u?Th-At():0;if(ue=jb(P,ue),ue!==null){Pa=u,e.cancelPendingCommit=ue(Bh.bind(null,e,t,u,n,r,c,h,b,C,Z,P,null,U,G)),Nn(e,u,h,!L);return}}Bh(e,t,u,n,r,c,h,b,C)}function qy(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(!$t(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 Nn(e,t,n,r){t&=~Ic,t&=~nr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var u=31-Et(c),h=1<<u;r[u]=-1,c&=~h}n!==0&&Hn(e,n,t)}function yo(){return(He&6)===0?(Is(0),!1):!0}function nu(){if(ke!==null){if(Ge===0)var e=ke.return;else e=ke,Ha=Zn=null,yc(e),Ur=null,zs=0,e=ke;for(;e!==null;)oh(e.alternate,e),e=e.return;ke=null}}function Kr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,sb(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Pa=0,nu(),Xe=e,ke=n=Ba(e.current,null),De=t,Ge=0,Wt=null,gn=!1,Fr=$e(e,t),Pc=!1,Yr=ea=Ic=nr=yn=et=0,Vt=Js=null,Wc=!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-Et(r),u=1<<c;t|=e[c],r&=~u}return Ja=t,ql(),n}function Ah(e,t){Ee=null,w.H=Qs,t===Lr||t===Kl?(t=Kf(),Ge=3):t===oc?(t=Kf(),Ge=4):Ge=t===Dc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,ke===null&&(et=1,oo(e,ia(t,e.current)))}function kh(){var e=Pt.current;return e===null?!0:(De&4194048)===De?fa===null:(De&62914560)===De||(De&536870912)!==0?e===fa:!1}function Oh(){var e=w.H;return w.H=Qs,e===null?Qs:e}function zh(){var e=w.A;return w.A=Uy,e}function bo(){et=4,gn||(De&4194048)!==De&&Pt.current!==null||(Fr=!0),(yn&134217727)===0&&(nr&134217727)===0||Xe===null||Nn(Xe,De,ea,!1)}function ru(e,t,n){var r=He;He|=2;var c=Oh(),u=zh();(Xe!==e||De!==t)&&(go=null,Kr(e,t)),t=!1;var h=et;e:do try{if(Ge!==0&&ke!==null){var b=ke,C=Wt;switch(Ge){case 8:nu(),h=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(t=!0);var L=Ge;if(Ge=0,Wt=null,Zr(e,b,C,L),n&&Fr){h=0;break e}break;default:L=Ge,Ge=0,Wt=null,Zr(e,b,C,L)}}Hy(),h=et;break}catch(Z){Ah(e,Z)}while(!0);return t&&e.shellSuspendCounter++,Ha=Zn=null,He=r,w.H=c,w.A=u,ke===null&&(Xe=null,De=0,ql()),h}function Hy(){for(;ke!==null;)Dh(ke)}function Gy(e,t){var n=He;He|=2;var r=Oh(),c=zh();Xe!==e||De!==t?(go=null,vo=At()+500,Kr(e,t)):Fr=$e(e,t);e:do try{if(Ge!==0&&ke!==null){t=ke;var u=Wt;t:switch(Ge){case 1:Ge=0,Wt=null,Zr(e,t,u,1);break;case 2:case 9:if(Yf(u)){Ge=0,Wt=null,Lh(t);break}t=function(){Ge!==2&&Ge!==9||Xe!==e||(Ge=7),Aa(e)},u.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Yf(u)?(Ge=0,Wt=null,Lh(t)):(Ge=0,Wt=null,Zr(e,t,u,7));break;case 5:var h=null;switch(ke.tag){case 26:h=ke.memoizedState;case 5:case 27:var b=ke;if(h?Sp(h):b.stateNode.complete){Ge=0,Wt=null;var C=b.sibling;if(C!==null)ke=C;else{var L=b.return;L!==null?(ke=L,So(L)):ke=null}break t}}Ge=0,Wt=null,Zr(e,t,u,5);break;case 6:Ge=0,Wt=null,Zr(e,t,u,6);break;case 8:nu(),et=6;break e;default:throw Error(i(462))}}Qy();break}catch(Z){Ah(e,Z)}while(!0);return Ha=Zn=null,w.H=r,w.A=c,He=n,ke!==null?0:(Xe=null,De=0,ql(),et)}function Qy(){for(;ke!==null&&!Mt();)Dh(ke)}function Dh(e){var t=sh(e.alternate,e,Ja);e.memoizedProps=e.pendingProps,t===null?So(e):ke=t}function Lh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wm(n,t,t.pendingProps,t.type,void 0,De);break;case 11:t=Wm(n,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:yc(t);default:oh(n,t),t=ke=zf(t,Ja),t=sh(n,t,Ja)}e.memoizedProps=e.pendingProps,t===null?So(e):ke=t}function Zr(e,t,n,r){Ha=Zn=null,yc(t),Ur=null,zs=0;var c=t.return;try{if(My(e,c,t,n,De)){et=1,oo(e,ia(n,e.current)),ke=null;return}}catch(u){if(c!==null)throw ke=c,u;et=1,oo(e,ia(n,e.current)),ke=null;return}t.flags&32768?(Ue||r===1?e=!0:Fr||(De&536870912)!==0?e=!1:(gn=e=!0,(r===2||r===9||r===3||r===6)&&(r=Pt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Uh(t,e)):So(t)}function So(e){var t=e;do{if((t.flags&32768)!==0){Uh(t,gn);return}e=t.return;var n=Oy(t.alternate,t,Ja);if(n!==null){ke=n;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);et===0&&(et=5)}function Uh(e,t){do{var n=zy(e.alternate,e);if(n!==null){n.flags&=32767,ke=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=n}while(e!==null);et=6,ke=null}function Bh(e,t,n,r,c,u,h,b,C){e.cancelPendingCommit=null;do No();while(ct!==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|=Xi,Dt(e,n,u,h,b,C),e===Xe&&(ke=Xe=null,De=0),Xr=t,Sn=e,Pa=n,eu=u,tu=c,Ch=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Xy(Un,function(){return Vh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=w.T,w.T=null,c=F.p,F.p=2,h=He,He|=4;try{Dy(e,t,n)}finally{He=h,F.p=c,w.T=r}}ct=1,qh(),Hh(),Gh()}}function qh(){if(ct===1){ct=0;var e=Sn,t=Xr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=w.T,w.T=null;var r=F.p;F.p=2;var c=He;He|=4;try{yh(t,e);var u=xu,h=Ef(e.containerInfo),b=u.focusedElem,C=u.selectionRange;if(h!==b&&b&&b.ownerDocument&&wf(b.ownerDocument.documentElement,b)){if(C!==null&&Gi(b)){var L=C.start,Z=C.end;if(Z===void 0&&(Z=L),"selectionStart"in b)b.selectionStart=L,b.selectionEnd=Math.min(Z,b.value.length);else{var P=b.ownerDocument||document,U=P&&P.defaultView||window;if(U.getSelection){var G=U.getSelection(),ue=b.textContent.length,ge=Math.min(C.start,ue),Ye=C.end===void 0?ge:Math.min(C.end,ue);!G.extend&&ge>Ye&&(h=Ye,Ye=ge,ge=h);var O=jf(b,ge),_=jf(b,Ye);if(O&&_&&(G.rangeCount!==1||G.anchorNode!==O.node||G.anchorOffset!==O.offset||G.focusNode!==_.node||G.focusOffset!==_.offset)){var D=P.createRange();D.setStart(O.node,O.offset),G.removeAllRanges(),ge>Ye?(G.addRange(D),G.extend(_.node,_.offset)):(D.setEnd(_.node,_.offset),G.addRange(D))}}}}for(P=[],G=b;G=G.parentNode;)G.nodeType===1&&P.push({element:G,left:G.scrollLeft,top:G.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=!!pu,xu=pu=null}finally{He=c,F.p=r,w.T=n}}e.current=t,ct=2}}function Hh(){if(ct===2){ct=0;var e=Sn,t=Xr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=w.T,w.T=null;var r=F.p;F.p=2;var c=He;He|=4;try{hh(e,t.alternate,t)}finally{He=c,F.p=r,w.T=n}}ct=3}}function Gh(){if(ct===4||ct===3){ct=0,an();var e=Sn,t=Xr,n=Pa,r=Ch;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ct=5:(ct=0,Xr=Sn=null,Qh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(bn=null),ya(n),t=t.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(Bn,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=w.T,c=F.p,F.p=2,w.T=null;try{for(var u=e.onRecoverableError,h=0;h<r.length;h++){var b=r[h];u(b.value,{componentStack:b.stack})}}finally{w.T=t,F.p=c}}(Pa&3)!==0&&No(),Aa(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===au?Ps++:(Ps=0,au=e):Ps=0,Is(0)}}function Qh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ks(t)))}function No(){return qh(),Hh(),Gh(),Vh()}function Vh(){if(ct!==5)return!1;var e=Sn,t=eu;eu=0;var n=ya(Pa),r=w.T,c=F.p;try{F.p=32>n?32:n,w.T=null,n=tu,tu=null;var u=Sn,h=Pa;if(ct=0,Xr=Sn=null,Pa=0,(He&6)!==0)throw Error(i(331));var b=He;if(He|=4,wh(u.current),Sh(u,u.current,h,n),He=b,Is(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(Bn,u)}catch{}return!0}finally{F.p=c,w.T=r,Qh(e,t)}}function Fh(e,t,n){t=ia(n,t),t=zc(e.stateNode,t,2),e=hn(e,t,2),e!==null&&(Ie(e,2),Aa(e))}function Qe(e,t,n){if(e.tag===3)Fh(e,e,n);else for(;t!==null;){if(t.tag===3){Fh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(bn===null||!bn.has(r))){e=ia(n,e),n=Ym(2),r=hn(t,n,2),r!==null&&(Xm(n,r,t,e),Ie(r,2),Aa(r));break}}t=t.return}}function su(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new By;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)||(Pc=!0,c.add(n),e=Vy.bind(null,e,t,n),t.then(e,e))}function Vy(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&&Kr(e,0):Ic|=n,Yr===De&&(Yr=0)),Aa(e)}function Yh(e,t){t===0&&(t=Tt()),e=Yn(e,t),e!==null&&(Ie(e,t),Aa(e))}function Fy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yh(e,n)}function Yy(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),Yh(e,n)}function Xy(e,t){return ps(e,t)}var jo=null,$r=null,lu=!1,wo=!1,ou=!1,jn=0;function Aa(e){e!==$r&&e.next===null&&($r===null?jo=$r=e:$r=$r.next=e),wo=!0,lu||(lu=!0,Zy())}function Is(e,t){if(!ou&&wo){ou=!0;do for(var n=!1,r=jo;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var u=0;else{var h=r.suspendedLanes,b=r.pingedLanes;u=(1<<31-Et(42|e)+1)-1,u&=c&~(h&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,$h(r,u))}else u=De,u=je(r,r===Xe?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||$e(r,u)||(n=!0,$h(r,u));r=r.next}while(n);ou=!1}}function Ky(){Xh()}function Xh(){wo=lu=!1;var e=0;jn!==0&&rb()&&(e=jn);for(var t=At(),n=null,r=jo;r!==null;){var c=r.next,u=Kh(r,t);u===0?(r.next=null,n===null?jo=c:n.next=c,c===null&&($r=n)):(n=r,(e!==0||(u&3)!==0)&&(wo=!0)),r=c}ct!==0&&ct!==5||Is(e),jn!==0&&(jn=0)}function Kh(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var h=31-Et(u),b=1<<h,C=c[h];C===-1?((b&n)===0||(b&r)!==0)&&(c[h]=ft(b,t)):C<=t&&(e.expiredLanes|=b),u&=~b}if(t=Xe,n=De,n=je(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&&xs(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xs(r),ya(n)){case 2:case 8:n=Tl;break;case 32:n=Un;break;case 268435456:n=za;break;default:n=Un}return r=Zh.bind(null,e),n=ps(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xs(r),e.callbackPriority=2,e.callbackNode=null,2}function Zh(e,t){if(ct!==0&&ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(No()&&e.callbackNode!==n)return null;var r=De;return r=je(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_h(e,r,t),Kh(e,At()),e.callbackNode!=null&&e.callbackNode===n?Zh.bind(null,e):null)}function $h(e,t){if(No())return null;_h(e,t,!0)}function Zy(){lb(function(){(He&6)!==0?ps(Ln,Ky):Xh()})}function iu(){if(jn===0){var e=zr;e===0&&(e=mr,mr<<=1,(mr&261888)===0&&(mr=256)),jn=e}return jn}function Jh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Al(""+e)}function Ph(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 $y(e,t,n,r,c){if(t==="submit"&&n&&n.stateNode===c){var u=Jh((c[Bt]||null).action),h=r.submitter;h&&(t=(t=h[Bt]||null)?Jh(t.formAction):h.getAttribute("formAction"),t!==null&&(u=t,h=null));var b=new Dl("action","action",null,r,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jn!==0){var C=h?Ph(c,h):new FormData(c);Rc(n,{pending:!0,data:C,method:c.method,action:u},null,C)}}else typeof u=="function"&&(b.preventDefault(),C=h?Ph(c,h):new FormData(c),Rc(n,{pending:!0,data:C,method:c.method,action:u},u,C))},currentTarget:c}]})}}for(var cu=0;cu<Yi.length;cu++){var uu=Yi[cu],Jy=uu.toLowerCase(),Py=uu[0].toUpperCase()+uu.slice(1);ba(Jy,"on"+Py)}ba(Rf,"onAnimationEnd"),ba(_f,"onAnimationIteration"),ba(Mf,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(my,"onTransitionRun"),ba(hy,"onTransitionStart"),ba(py,"onTransitionCancel"),ba(Af,"onTransitionEnd"),br("onMouseEnter",["mouseout","mouseover"]),br("onMouseLeave",["mouseout","mouseover"]),br("onPointerEnter",["pointerout","pointerover"]),br("onPointerLeave",["pointerout","pointerover"]),Gn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ws="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(" "),Iy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ws));function Ih(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 h=r.length-1;0<=h;h--){var b=r[h],C=b.instance,L=b.currentTarget;if(b=b.listener,C!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=L;try{u(c)}catch(Z){Bl(Z)}c.currentTarget=null,u=C}else for(h=0;h<r.length;h++){if(b=r[h],C=b.instance,L=b.currentTarget,b=b.listener,C!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=L;try{u(c)}catch(Z){Bl(Z)}c.currentTarget=null,u=C}}}}function Oe(e,t){var n=t[ji];n===void 0&&(n=t[ji]=new Set);var r=e+"__bubble";n.has(r)||(Wh(t,e,2,!1),n.add(r))}function du(e,t,n){var r=0;t&&(r|=4),Wh(n,e,r,t)}var Eo="_reactListening"+Math.random().toString(36).slice(2);function fu(e){if(!e[Eo]){e[Eo]=!0,Yd.forEach(function(n){n!=="selectionchange"&&(Iy.has(n)||du(n,!1,e),du(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Eo]||(t[Eo]=!0,du("selectionchange",!1,t))}}function Wh(e,t,n,r){switch(Rp(t)){case 2:var c=Tb;break;case 8:c=Cb;break;default:c=Cu}n=c.bind(null,t,n,e),c=void 0,!ki||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 mu(e,t,n,r,c){var u=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var h=r.tag;if(h===3||h===4){var b=r.stateNode.containerInfo;if(b===c)break;if(h===4)for(h=r.return;h!==null;){var C=h.tag;if((C===3||C===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;b!==null;){if(h=vr(b),h===null)return;if(C=h.tag,C===5||C===6||C===26||C===27){r=u=h;continue e}b=b.parentNode}}r=r.return}nf(function(){var L=u,Z=Mi(n),P=[];e:{var U=kf.get(e);if(U!==void 0){var G=Dl,ue=e;switch(e){case"keypress":if(Ol(n)===0)break e;case"keydown":case"keyup":G=Yg;break;case"focusin":ue="focus",G=Li;break;case"focusout":ue="blur",G=Li;break;case"beforeblur":case"afterblur":G=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":G=lf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=Og;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=Zg;break;case Rf:case _f:case Mf:G=Lg;break;case Af:G=Jg;break;case"scroll":case"scrollend":G=Ag;break;case"wheel":G=Ig;break;case"copy":case"cut":case"paste":G=Bg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=cf;break;case"toggle":case"beforetoggle":G=ey}var ge=(t&4)!==0,Ye=!ge&&(e==="scroll"||e==="scrollend"),O=ge?U!==null?U+"Capture":null:U;ge=[];for(var _=L,D;_!==null;){var J=_;if(D=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||D===null||O===null||(J=Ss(_,O),J!=null&&ge.push(el(_,J,D))),Ye)break;_=_.return}0<ge.length&&(U=new G(U,ue,null,n,Z),P.push({event:U,listeners:ge}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",G=e==="mouseout"||e==="pointerout",U&&n!==_i&&(ue=n.relatedTarget||n.fromElement)&&(vr(ue)||ue[xr]))break e;if((G||U)&&(U=Z.window===Z?Z:(U=Z.ownerDocument)?U.defaultView||U.parentWindow:window,G?(ue=n.relatedTarget||n.toElement,G=L,ue=ue?vr(ue):null,ue!==null&&(Ye=f(ue),ge=ue.tag,ue!==Ye||ge!==5&&ge!==27&&ge!==6)&&(ue=null)):(G=null,ue=L),G!==ue)){if(ge=lf,J="onMouseLeave",O="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(ge=cf,J="onPointerLeave",O="onPointerEnter",_="pointer"),Ye=G==null?U:bs(G),D=ue==null?U:bs(ue),U=new ge(J,_+"leave",G,n,Z),U.target=Ye,U.relatedTarget=D,J=null,vr(Z)===L&&(ge=new ge(O,_+"enter",ue,n,Z),ge.target=D,ge.relatedTarget=Ye,J=ge),Ye=J,G&&ue)t:{for(ge=Wy,O=G,_=ue,D=0,J=O;J;J=ge(J))D++;J=0;for(var pe=_;pe;pe=ge(pe))J++;for(;0<D-J;)O=ge(O),D--;for(;0<J-D;)_=ge(_),J--;for(;D--;){if(O===_||_!==null&&O===_.alternate){ge=O;break t}O=ge(O),_=ge(_)}ge=null}else ge=null;G!==null&&ep(P,U,G,ge,!1),ue!==null&&Ye!==null&&ep(P,Ye,ue,ge,!0)}}e:{if(U=L?bs(L):window,G=U.nodeName&&U.nodeName.toLowerCase(),G==="select"||G==="input"&&U.type==="file")var Be=vf;else if(pf(U))if(gf)Be=uy;else{Be=iy;var me=oy}else G=U.nodeName,!G||G.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&Ri(L.elementType)&&(Be=vf):Be=cy;if(Be&&(Be=Be(e,L))){xf(P,Be,n,Z);break e}me&&me(e,U,L),e==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&Ci(U,"number",U.value)}switch(me=L?bs(L):window,e){case"focusin":(pf(me)||me.contentEditable==="true")&&(Tr=me,Qi=L,_s=null);break;case"focusout":_s=Qi=Tr=null;break;case"mousedown":Vi=!0;break;case"contextmenu":case"mouseup":case"dragend":Vi=!1,Tf(P,n,Z);break;case"selectionchange":if(fy)break;case"keydown":case"keyup":Tf(P,n,Z)}var Te;if(Bi)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Er?mf(e,n)&&(Le="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Le="onCompositionStart");Le&&(uf&&n.locale!=="ko"&&(Er||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Er&&(Te=rf()):(ln=Z,Oi="value"in ln?ln.value:ln.textContent,Er=!0)),me=To(L,Le),0<me.length&&(Le=new of(Le,e,null,n,Z),P.push({event:Le,listeners:me}),Te?Le.data=Te:(Te=hf(n),Te!==null&&(Le.data=Te)))),(Te=ay?ny(e,n):ry(e,n))&&(Le=To(L,"onBeforeInput"),0<Le.length&&(me=new of("onBeforeInput","beforeinput",null,n,Z),P.push({event:me,listeners:Le}),me.data=Te)),$y(P,e,L,n,Z)}Ih(P,t)})}function el(e,t,n){return{instance:e,listener:t,currentTarget:n}}function To(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=Ss(e,n),c!=null&&r.unshift(el(e,c,u)),c=Ss(e,t),c!=null&&r.push(el(e,c,u))),e.tag===3)return r;e=e.return}return[]}function Wy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ep(e,t,n,r,c){for(var u=t._reactName,h=[];n!==null&&n!==r;){var b=n,C=b.alternate,L=b.stateNode;if(b=b.tag,C!==null&&C===r)break;b!==5&&b!==26&&b!==27||L===null||(C=L,c?(L=Ss(n,u),L!=null&&h.unshift(el(n,L,C))):c||(L=Ss(n,u),L!=null&&h.push(el(n,L,C)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var eb=/\r\n?/g,tb=/\u0000|\uFFFD/g;function tp(e){return(typeof e=="string"?e:""+e).replace(eb,`
9
+ `).replace(tb,"")}function ap(e,t){return t=tp(t),tp(e)===t}function Fe(e,t,n,r,c,u){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Nr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Nr(e,""+r);break;case"className":_l(e,"class",r);break;case"tabIndex":_l(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(e,n,r);break;case"style":tf(e,r,u);break;case"data":if(t!=="object"){_l(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=Al(""+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=Al(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=La);break;case"onScroll":r!=null&&Oe("scroll",e);break;case"onScrollEnd":r!=null&&Oe("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=Al(""+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":Oe("beforetoggle",e),Oe("toggle",e),Rl(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":Rl(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=_g.get(n)||n,Rl(e,n,r))}}function hu(e,t,n,r,c,u){switch(n){case"style":tf(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"?Nr(e,r):(typeof r=="number"||typeof r=="bigint")&&Nr(e,""+r);break;case"onScroll":r!=null&&Oe("scroll",e);break;case"onScrollEnd":r!=null&&Oe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=La);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xd.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[Bt]||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,""):Rl(e,n,r)}}}function Nt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",e),Oe("load",e);var r=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var h=n[u];if(h!=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,h,n,null)}}c&&Fe(e,t,"srcSet",n.srcSet,n,null),r&&Fe(e,t,"src",n.src,n,null);return;case"input":Oe("invalid",e);var b=u=h=c=null,C=null,L=null;for(r in n)if(n.hasOwnProperty(r)){var Z=n[r];if(Z!=null)switch(r){case"name":c=Z;break;case"type":h=Z;break;case"checked":C=Z;break;case"defaultChecked":L=Z;break;case"value":u=Z;break;case"defaultValue":b=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(137,t));break;default:Fe(e,t,r,Z,n,null)}}Pd(e,u,b,C,L,h,c,!1);return;case"select":Oe("invalid",e),r=h=u=null;for(c in n)if(n.hasOwnProperty(c)&&(b=n[c],b!=null))switch(c){case"value":u=b;break;case"defaultValue":h=b;break;case"multiple":r=b;default:Fe(e,t,c,b,n,null)}t=u,n=h,e.multiple=!!r,t!=null?Sr(e,!!r,t,!1):n!=null&&Sr(e,!!r,n,!0);return;case"textarea":Oe("invalid",e),u=c=r=null;for(h in n)if(n.hasOwnProperty(h)&&(b=n[h],b!=null))switch(h){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,h,b,n,null)}Wd(e,r,c,u);return;case"option":for(C in n)n.hasOwnProperty(C)&&(r=n[C],r!=null)&&(C==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Fe(e,t,C,r,n,null));return;case"dialog":Oe("beforetoggle",e),Oe("toggle",e),Oe("cancel",e),Oe("close",e);break;case"iframe":case"object":Oe("load",e);break;case"video":case"audio":for(r=0;r<Ws.length;r++)Oe(Ws[r],e);break;case"image":Oe("error",e),Oe("load",e);break;case"details":Oe("toggle",e);break;case"embed":case"source":case"link":Oe("error",e),Oe("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(L in n)if(n.hasOwnProperty(L)&&(r=n[L],r!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Fe(e,t,L,r,n,null)}return;default:if(Ri(t)){for(Z in n)n.hasOwnProperty(Z)&&(r=n[Z],r!==void 0&&hu(e,t,Z,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 ab(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,h=null,b=null,C=null,L=null,Z=null;for(G in n){var P=n[G];if(n.hasOwnProperty(G)&&P!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":C=P;default:r.hasOwnProperty(G)||Fe(e,t,G,null,r,P)}}for(var U in r){var G=r[U];if(P=n[U],r.hasOwnProperty(U)&&(G!=null||P!=null))switch(U){case"type":u=G;break;case"name":c=G;break;case"checked":L=G;break;case"defaultChecked":Z=G;break;case"value":h=G;break;case"defaultValue":b=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,t));break;default:G!==P&&Fe(e,t,U,G,r,P)}}Ti(e,h,b,C,L,Z,u,c);return;case"select":G=h=b=U=null;for(u in n)if(C=n[u],n.hasOwnProperty(u)&&C!=null)switch(u){case"value":break;case"multiple":G=C;default:r.hasOwnProperty(u)||Fe(e,t,u,null,r,C)}for(c in r)if(u=r[c],C=n[c],r.hasOwnProperty(c)&&(u!=null||C!=null))switch(c){case"value":U=u;break;case"defaultValue":b=u;break;case"multiple":h=u;default:u!==C&&Fe(e,t,c,u,r,C)}t=b,n=h,r=G,U!=null?Sr(e,!!n,U,!1):!!r!=!!n&&(t!=null?Sr(e,!!n,t,!0):Sr(e,!!n,n?[]:"",!1));return;case"textarea":G=U=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(h in r)if(c=r[h],u=n[h],r.hasOwnProperty(h)&&(c!=null||u!=null))switch(h){case"value":U=c;break;case"defaultValue":G=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==u&&Fe(e,t,h,c,r,u)}Id(e,U,G);return;case"option":for(var ue in n)U=n[ue],n.hasOwnProperty(ue)&&U!=null&&!r.hasOwnProperty(ue)&&(ue==="selected"?e.selected=!1:Fe(e,t,ue,null,r,U));for(C in r)U=r[C],G=n[C],r.hasOwnProperty(C)&&U!==G&&(U!=null||G!=null)&&(C==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":Fe(e,t,C,U,r,G));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 ge in n)U=n[ge],n.hasOwnProperty(ge)&&U!=null&&!r.hasOwnProperty(ge)&&Fe(e,t,ge,null,r,U);for(L in r)if(U=r[L],G=n[L],r.hasOwnProperty(L)&&U!==G&&(U!=null||G!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,t));break;default:Fe(e,t,L,U,r,G)}return;default:if(Ri(t)){for(var Ye in n)U=n[Ye],n.hasOwnProperty(Ye)&&U!==void 0&&!r.hasOwnProperty(Ye)&&hu(e,t,Ye,void 0,r,U);for(Z in r)U=r[Z],G=n[Z],!r.hasOwnProperty(Z)||U===G||U===void 0&&G===void 0||hu(e,t,Z,U,r,G);return}}for(var O in n)U=n[O],n.hasOwnProperty(O)&&U!=null&&!r.hasOwnProperty(O)&&Fe(e,t,O,null,r,U);for(P in r)U=r[P],G=n[P],!r.hasOwnProperty(P)||U===G||U==null&&G==null||Fe(e,t,P,U,r,G)}function np(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nb(){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,h=c.initiatorType,b=c.duration;if(u&&b&&np(h)){for(h=0,b=c.responseEnd,r+=1;r<n.length;r++){var C=n[r],L=C.startTime;if(L>b)break;var Z=C.transferSize,P=C.initiatorType;Z&&np(P)&&(C=C.responseEnd,h+=Z*(C<b?1:(b-L)/(C-L)))}if(--r,t+=8*(u+h)/(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 pu=null,xu=null;function Co(e){return e.nodeType===9?e:e.ownerDocument}function rp(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 sp(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 vu(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 gu=null;function rb(){var e=window.event;return e&&e.type==="popstate"?e===gu?!1:(gu=e,!0):(gu=null,!1)}var lp=typeof setTimeout=="function"?setTimeout:void 0,sb=typeof clearTimeout=="function"?clearTimeout:void 0,op=typeof Promise=="function"?Promise:void 0,lb=typeof queueMicrotask=="function"?queueMicrotask:typeof op<"u"?function(e){return op.resolve(null).then(e).catch(ob)}:lp;function ob(e){setTimeout(function(){throw e})}function wn(e){return e==="head"}function ip(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),Wr(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")tl(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,tl(n);for(var u=n.firstChild;u;){var h=u.nextSibling,b=u.nodeName;u[ys]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=h}}else n==="body"&&tl(e.ownerDocument.body);n=c}while(n);Wr(t)}function cp(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 yu(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":yu(n),wi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function ib(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[ys])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=ma(e.nextSibling),e===null)break}return null}function cb(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ma(e.nextSibling),e===null))return null;return e}function up(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ma(e.nextSibling),e===null))return null;return e}function bu(e){return e.data==="$?"||e.data==="$~"}function Su(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ub(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 ma(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 Nu=null;function dp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ma(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function fp(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 mp(e,t,n){switch(t=Co(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 tl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wi(e)}var ha=new Map,hp=new Set;function Ro(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ia=F.d;F.d={f:db,r:fb,D:mb,C:hb,L:pb,m:xb,X:gb,S:vb,M:yb};function db(){var e=Ia.f(),t=yo();return e||t}function fb(e){var t=gr(e);t!==null&&t.tag===5&&t.type==="form"?Am(t):Ia.r(e)}var Jr=typeof document>"u"?null:document;function pp(e,t,n){var r=Jr;if(r&&typeof t=="string"&&t){var c=la(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),hp.has(c)||(hp.add(c),e={rel:e,crossOrigin:n,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Nt(t,"link",e),mt(t),r.head.appendChild(t)))}}function mb(e){Ia.D(e),pp("dns-prefetch",e,null)}function hb(e,t){Ia.C(e,t),pp("preconnect",e,t)}function pb(e,t,n){Ia.L(e,t,n);var r=Jr;if(r&&e&&t){var c='link[rel="preload"][as="'+la(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+la(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+la(n.imageSizes)+'"]')):c+='[href="'+la(e)+'"]';var u=c;switch(t){case"style":u=Pr(e);break;case"script":u=Ir(e)}ha.has(u)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ha.set(u,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(al(u))||t==="script"&&r.querySelector(nl(u))||(t=r.createElement("link"),Nt(t,"link",e),mt(t),r.head.appendChild(t)))}}function xb(e,t){Ia.m(e,t);var n=Jr;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+la(r)+'"][href="'+la(e)+'"]',u=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ir(e)}if(!ha.has(u)&&(e=x({rel:"modulepreload",href:e},t),ha.set(u,e),n.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(nl(u)))return}r=n.createElement("link"),Nt(r,"link",e),mt(r),n.head.appendChild(r)}}}function vb(e,t,n){Ia.S(e,t,n);var r=Jr;if(r&&e){var c=yr(r).hoistableStyles,u=Pr(e);t=t||"default";var h=c.get(u);if(!h){var b={loading:0,preload:null};if(h=r.querySelector(al(u)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ha.get(u))&&ju(e,n);var C=h=r.createElement("link");mt(C),Nt(C,"link",e),C._p=new Promise(function(L,Z){C.onload=L,C.onerror=Z}),C.addEventListener("load",function(){b.loading|=1}),C.addEventListener("error",function(){b.loading|=2}),b.loading|=4,_o(h,t,r)}h={type:"stylesheet",instance:h,count:1,state:b},c.set(u,h)}}}function gb(e,t){Ia.X(e,t);var n=Jr;if(n&&e){var r=yr(n).hoistableScripts,c=Ir(e),u=r.get(c);u||(u=n.querySelector(nl(c)),u||(e=x({src:e,async:!0},t),(t=ha.get(c))&&wu(e,t),u=n.createElement("script"),mt(u),Nt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function yb(e,t){Ia.M(e,t);var n=Jr;if(n&&e){var r=yr(n).hoistableScripts,c=Ir(e),u=r.get(c);u||(u=n.querySelector(nl(c)),u||(e=x({src:e,async:!0,type:"module"},t),(t=ha.get(c))&&wu(e,t),u=n.createElement("script"),mt(u),Nt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function xp(e,t,n,r){var c=(c=$.current)?Ro(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=Pr(n.href),n=yr(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=Pr(n.href);var u=yr(c).hoistableStyles,h=u.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,h),(u=c.querySelector(al(e)))&&!u._p&&(h.instance=u,h.state.loading=5),ha.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},ha.set(e,n),u||bb(c,e,n,h.state))),t&&r===null)throw Error(i(528,""));return h}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=Ir(n),n=yr(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 Pr(e){return'href="'+la(e)+'"'}function al(e){return'link[rel="stylesheet"]['+e+"]"}function vp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function bb(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}),Nt(t,"link",n),mt(t),e.head.appendChild(t))}function Ir(e){return'[src="'+la(e)+'"]'}function nl(e){return"script[async]"+e}function gp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+la(n.href)+'"]');if(r)return t.instance=r,mt(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"),mt(r),Nt(r,"style",c),_o(r,n.precedence,e),t.instance=r;case"stylesheet":c=Pr(n.href);var u=e.querySelector(al(c));if(u)return t.state.loading|=4,t.instance=u,mt(u),u;r=vp(n),(c=ha.get(c))&&ju(r,c),u=(e.ownerDocument||e).createElement("link"),mt(u);var h=u;return h._p=new Promise(function(b,C){h.onload=b,h.onerror=C}),Nt(u,"link",r),t.state.loading|=4,_o(u,n.precedence,e),t.instance=u;case"script":return u=Ir(n.src),(c=e.querySelector(nl(u)))?(t.instance=c,mt(c),c):(r=n,(c=ha.get(u))&&(r=x({},n),wu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),mt(c),Nt(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,_o(r,n.precedence,e));return t.instance}function _o(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,h=0;h<r.length;h++){var b=r[h];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 ju(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Mo=null;function yp(e,t,n){if(Mo===null){var r=new Map,c=Mo=new Map;c.set(n,r)}else c=Mo,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[ys]||u[gt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var h=u.getAttribute(t)||"";h=e+h;var b=r.get(h);b?b.push(u):r.set(h,[u])}}return r}function bp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Sb(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 Sp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Nb(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=Pr(r.href),u=t.querySelector(al(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ao.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,mt(u);return}u=t.ownerDocument||t,r=vp(r),(c=ha.get(c))&&ju(r,c),u=u.createElement("link"),mt(u);var h=u;h._p=new Promise(function(b,C){h.onload=b,h.onerror=C}),Nt(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=Ao.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Eu=0;function jb(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&&Eu===0&&(Eu=62500*nb());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>Eu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Ao(){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 ko=null;function Oo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ko=new Map,t.forEach(wb,e),ko=null,Ao.call(e))}function wb(e,t){if(!(t.state.loading&4)){var n=ko.get(e);if(n)var r=n.get(null);else{n=new Map,ko.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var h=c[u];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),r=h)}r&&n.set(null,r)}c=t.instance,h=c.getAttribute("data-precedence"),u=n.get(h)||r,u===r&&n.set(null,c),n.set(h,c),this.count++,r=Ao.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 rl={$$typeof:V,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function Eb(e,t,n,r,c,u,h,b,C){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=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Np(e,t,n,r,c,u,h,b,C,L,Z,P){return e=new Eb(e,t,n,h,C,L,Z,P,b),t=1,u===!0&&(t|=24),u=Jt(3,null,null,t),e.current=u,u.stateNode=e,t=rc(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:r,isDehydrated:n,cache:t},ic(u),e}function jp(e){return e?(e=_r,e):_r}function wp(e,t,n,r,c,u){c=jp(c),r.context===null?r.context=c:r.pendingContext=c,r=mn(t),r.payload={element:n},u=u===void 0?null:u,u!==null&&(r.callback=u),n=hn(e,r,t),n!==null&&(Ft(n,e,t),Ls(n,e,t))}function Ep(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){Ep(e,t),(e=e.alternate)&&Ep(e,t)}function Tp(e){if(e.tag===13||e.tag===31){var t=Yn(e,67108864);t!==null&&Ft(t,e,67108864),Tu(e,67108864)}}function Cp(e){if(e.tag===13||e.tag===31){var t=ta();t=pr(t);var n=Yn(e,t);n!==null&&Ft(n,e,t),Tu(e,t)}}var zo=!0;function Tb(e,t,n,r){var c=w.T;w.T=null;var u=F.p;try{F.p=2,Cu(e,t,n,r)}finally{F.p=u,w.T=c}}function Cb(e,t,n,r){var c=w.T;w.T=null;var u=F.p;try{F.p=8,Cu(e,t,n,r)}finally{F.p=u,w.T=c}}function Cu(e,t,n,r){if(zo){var c=Ru(r);if(c===null)mu(e,t,r,Do,n),_p(e,r);else if(_b(c,e,t,n,r))r.stopPropagation();else if(_p(e,r),t&4&&-1<Rb.indexOf(e)){for(;c!==null;){var u=gr(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var h=Ca(u.pendingLanes);if(h!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;h;){var C=1<<31-Et(h);b.entanglements[1]|=C,h&=~C}Aa(u),(He&6)===0&&(vo=At()+500,Is(0))}}break;case 31:case 13:b=Yn(u,2),b!==null&&Ft(b,u,2),yo(),Tu(u,2)}if(u=Ru(r),u===null&&mu(e,t,r,Do,n),u===c)break;c=u}c!==null&&r.stopPropagation()}else mu(e,t,r,null,n)}}function Ru(e){return e=Mi(e),_u(e)}var Do=null;function _u(e){if(Do=null,e=vr(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 Rp(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(bi()){case Ln:return 2;case Tl:return 8;case Un:case vs:return 32;case za:return 268435456;default:return 32}default:return 32}}var Mu=!1,En=null,Tn=null,Cn=null,sl=new Map,ll=new Map,Rn=[],Rb="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 _p(e,t){switch(e){case"focusin":case"focusout":En=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":Cn=null;break;case"pointerover":case"pointerout":sl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ll.delete(t.pointerId)}}function ol(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=gr(t),t!==null&&Tp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function _b(e,t,n,r,c){switch(t){case"focusin":return En=ol(En,e,t,n,r,c),!0;case"dragenter":return Tn=ol(Tn,e,t,n,r,c),!0;case"mouseover":return Cn=ol(Cn,e,t,n,r,c),!0;case"pointerover":var u=c.pointerId;return sl.set(u,ol(sl.get(u)||null,e,t,n,r,c)),!0;case"gotpointercapture":return u=c.pointerId,ll.set(u,ol(ll.get(u)||null,e,t,n,r,c)),!0}return!1}function Mp(e){var t=vr(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,Vd(e.priority,function(){Cp(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,Vd(e.priority,function(){Cp(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 Lo(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);_i=r,n.target.dispatchEvent(r),_i=null}else return t=gr(n),t!==null&&Tp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){Lo(e)&&n.delete(t)}function Mb(){Mu=!1,En!==null&&Lo(En)&&(En=null),Tn!==null&&Lo(Tn)&&(Tn=null),Cn!==null&&Lo(Cn)&&(Cn=null),sl.forEach(Ap),ll.forEach(Ap)}function Uo(e,t){e.blockedOn===t&&(e.blockedOn=null,Mu||(Mu=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Mb)))}var Bo=null;function kp(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(_u(r||n)===null)continue;break}var u=gr(n);u!==null&&(e.splice(t,3),t-=3,Rc(u,{pending:!0,data:c,method:n.method,action:r},r,c))}}))}function Wr(e){function t(C){return Uo(C,e)}En!==null&&Uo(En,e),Tn!==null&&Uo(Tn,e),Cn!==null&&Uo(Cn,e),sl.forEach(t),ll.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);)Mp(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],h=c[Bt]||null;if(typeof u=="function")h||kp(n);else if(h){var b=null;if(u&&u.hasAttribute("formAction")){if(c=u,h=u[Bt]||null)b=h.formAction;else if(_u(c)!==null)continue}else b=h.action;typeof b=="function"?n[r+1]=b:(n.splice(r,3),r-=3),kp(n)}}}function Op(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(h){return c=h})},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=ta();wp(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;wp(e.current,2,null,e,null,null),yo(),t[xr]=null}};function qo(e){this._internalRoot=e}qo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ni();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&&Mp(e)}};var zp=s.version;if(zp!=="19.2.4")throw Error(i(527,zp,"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=p(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Ab={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ho=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ho.isDisabled&&Ho.supportsFiber)try{Bn=Ho.inject(Ab),kt=Ho}catch{}}return cl.createRoot=function(e,t){if(!d(e))throw Error(i(299));var n=!1,r="",c=Gm,u=Qm,h=Vm;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&&(h=t.onRecoverableError)),t=Np(e,1,!1,null,null,n,r,null,c,u,h,Op),e[xr]=t.current,fu(e),new Au(t)},cl.hydrateRoot=function(e,t,n){if(!d(e))throw Error(i(299));var r=!1,c="",u=Gm,h=Qm,b=Vm,C=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&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(C=n.formState)),t=Np(e,1,!0,t,n??null,r,c,C,u,h,b,Op),t.context=jp(null),n=t.current,r=ta(),r=pr(r),c=mn(r),c.callback=null,hn(n,c,r),n=r,t.current.lanes=n,Ie(t,n),Aa(t),e[xr]=t.current,fu(e),new qo(t)},cl.version="19.2.4",cl}var Fp;function Hb(){if(Fp)return zu.exports;Fp=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(),zu.exports=qb(),zu.exports}var Gb=Hb();var Yp="popstate";function Qb(a={}){function s(i,d){let{pathname:f,search:m,hash:v}=i.location;return Wu("",{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 Fb(s,o,null,a)}function Pe(a,s){if(a===!1||a===null||typeof a>"u")throw new Error(s)}function ja(a,s){if(!a){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function Vb(){return Math.random().toString(36).substring(2,10)}function Xp(a,s){return{usr:a.state,key:a.key,idx:s}}function Wu(a,s,o=null,i){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof s=="string"?os(s):s,state:o,key:s&&s.key||i||Vb()}}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 os(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 Fb(a,s,o,i={}){let{window:d=document.defaultView,v5Compat:f=!1}=i,m=d.history,v="POP",g=null,p=y();p==null&&(p=0,m.replaceState({...m.state,idx:p},""));function y(){return(m.state||{idx:null}).idx}function x(){v="POP";let T=y(),k=T==null?null:T-p;p=T,g&&g({action:v,location:E.location,delta:k})}function N(T,k){v="PUSH";let A=Wu(E.location,T,k);p=y()+1;let V=Xp(A,p),q=E.createHref(A);try{m.pushState(V,"",q)}catch(te){if(te instanceof DOMException&&te.name==="DataCloneError")throw te;d.location.assign(q)}f&&g&&g({action:v,location:E.location,delta:1})}function M(T,k){v="REPLACE";let A=Wu(E.location,T,k);p=y();let V=Xp(A,p),q=E.createHref(A);m.replaceState(V,"",q),f&&g&&g({action:v,location:E.location,delta:0})}function j(T){return Yb(T)}let E={get action(){return v},get location(){return a(d,m)},listen(T){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Yp,x),g=T,()=>{d.removeEventListener(Yp,x),g=null}},createHref(T){return s(d,T)},createURL:j,encodeLocation(T){let k=j(T);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:N,replace:M,go(T){return m.go(T)}};return E}function Yb(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 Xx(a,s,o="/"){return Xb(a,s,o,!1)}function Xb(a,s,o,i){let d=typeof s=="string"?os(s):s,f=tn(d.pathname||"/",o);if(f==null)return null;let m=Kx(a);Kb(m);let v=null;for(let g=0;v==null&&g<m.length;++g){let p=r0(f);v=a0(m[g],p,i)}return v}function Kx(a,s=[],o=[],i="",d=!1){let f=(m,v,g=d,p)=>{let y={relativePath:p===void 0?m.path||"":p,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=en([i,y.relativePath]),N=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}".`),Kx(m.children,s,N,x,g)),!(m.path==null&&!m.index)&&s.push({path:x,score:e0(x,m.index),routesMeta:N})};return a.forEach((m,v)=>{if(m.path===""||!m.path?.includes("?"))f(m,v);else for(let g of Zx(m.path))f(m,v,!0,g)}),s}function Zx(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=Zx(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 Kb(a){a.sort((s,o)=>s.score!==o.score?o.score-s.score:t0(s.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var Zb=/^:[\w-]+$/,$b=3,Jb=2,Pb=1,Ib=10,Wb=-2,Kp=a=>a==="*";function e0(a,s){let o=a.split("/"),i=o.length;return o.some(Kp)&&(i+=Wb),s&&(i+=Jb),o.filter(d=>!Kp(d)).reduce((d,f)=>d+(Zb.test(f)?$b:f===""?Pb:Ib),i)}function t0(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 a0(a,s,o=!1){let{routesMeta:i}=a,d={},f="/",m=[];for(let v=0;v<i.length;++v){let g=i[v],p=v===i.length-1,y=f==="/"?s:s.slice(f.length)||"/",x=ai({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},y),N=g.route;if(!x&&p&&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:en([f,x.pathname]),pathnameBase:i0(en([f,x.pathnameBase])),route:N}),x.pathnameBase!=="/"&&(f=en([f,x.pathnameBase]))}return m}function ai(a,s){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=n0(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((p,{paramName:y,isOptional:x},N)=>{if(y==="*"){let j=v[N]||"";m=f.slice(0,f.length-j.length).replace(/(.)\/+$/,"$1")}const M=v[N];return x&&!M?p[y]=void 0:p[y]=(M||"").replace(/%2F/g,"/"),p},{}),pathname:f,pathnameBase:m,pattern:a}}function n0(a,s=!1,o=!0){ja(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 r0(a){try{return a.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return ja(!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 tn(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 s0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function l0(a,s="/"){let{pathname:o,search:i="",hash:d=""}=typeof a=="string"?os(a):a,f;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?f=Zp(o.substring(1),"/"):f=Zp(o,s)):f=s,{pathname:f,search:c0(i),hash:u0(d)}}function Zp(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 Bu(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 o0(a){return a.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function xd(a){let s=o0(a);return s.map((o,i)=>i===s.length-1?o.pathname:o.pathnameBase)}function vd(a,s,o,i=!1){let d;typeof a=="string"?d=os(a):(d={...a},Pe(!d.pathname||!d.pathname.includes("?"),Bu("?","pathname","search",d)),Pe(!d.pathname||!d.pathname.includes("#"),Bu("#","pathname","hash",d)),Pe(!d.search||!d.search.includes("#"),Bu("#","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 N=m.split("/");for(;N[0]==="..";)N.shift(),x-=1;d.pathname=N.join("/")}v=x>=0?s[x]:"/"}let g=l0(d,v),p=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(p||y)&&(g.pathname+="/"),g}var en=a=>a.join("/").replace(/\/\/+/g,"/"),i0=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),c0=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,u0=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,d0=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 f0(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function m0(a){return a.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var $x=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Jx(a,s){let o=a;if(typeof o!="string"||!s0.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,d=!1;if($x)try{let f=new URL(window.location.href),m=o.startsWith("//")?new URL(f.protocol+o):new URL(o),v=tn(m.pathname,s);m.origin===f.origin&&v!=null?o=v+m.search+m.hash:d=!0}catch{ja(!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 Px=["POST","PUT","PATCH","DELETE"];new Set(Px);var h0=["GET",...Px];new Set(h0);var is=S.createContext(null);is.displayName="DataRouter";var ci=S.createContext(null);ci.displayName="DataRouterState";var p0=S.createContext(!1),Ix=S.createContext({isTransitioning:!1});Ix.displayName="ViewTransition";var x0=S.createContext(new Map);x0.displayName="Fetchers";var v0=S.createContext(null);v0.displayName="Await";var ra=S.createContext(null);ra.displayName="Navigation";var yl=S.createContext(null);yl.displayName="Location";var xa=S.createContext({outlet:null,matches:[],isDataRoute:!1});xa.displayName="Route";var gd=S.createContext(null);gd.displayName="RouteError";var Wx="REACT_ROUTER_ERROR",g0="REDIRECT",y0="ROUTE_ERROR_RESPONSE";function b0(a){if(a.startsWith(`${Wx}:${g0}:{`))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 S0(a){if(a.startsWith(`${Wx}:${y0}:{`))try{let s=JSON.parse(a.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new d0(s.status,s.statusText,s.data)}catch{}}function N0(a,{relative:s}={}){Pe(cs(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=S.useContext(ra),{hash:d,pathname:f,search:m}=bl(a,{relative:s}),v=f;return o!=="/"&&(v=f==="/"?o:en([o,f])),i.createHref({pathname:v,search:m,hash:d})}function cs(){return S.useContext(yl)!=null}function On(){return Pe(cs(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(yl).location}var ev="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tv(a){S.useContext(ra).static||S.useLayoutEffect(a)}function wa(){let{isDataRoute:a}=S.useContext(xa);return a?B0():j0()}function j0(){Pe(cs(),"useNavigate() may be used only in the context of a <Router> component.");let a=S.useContext(is),{basename:s,navigator:o}=S.useContext(ra),{matches:i}=S.useContext(xa),{pathname:d}=On(),f=JSON.stringify(xd(i)),m=S.useRef(!1);return tv(()=>{m.current=!0}),S.useCallback((g,p={})=>{if(ja(m.current,ev),!m.current)return;if(typeof g=="number"){o.go(g);return}let y=vd(g,JSON.parse(f),d,p.relative==="path");a==null&&s!=="/"&&(y.pathname=y.pathname==="/"?s:en([s,y.pathname])),(p.replace?o.replace:o.push)(y,p.state,p)},[s,o,f,d,a])}var w0=S.createContext(null);function E0(a){let s=S.useContext(xa).outlet;return S.useMemo(()=>s&&S.createElement(w0.Provider,{value:a},s),[s,a])}function T0(){let{matches:a}=S.useContext(xa),s=a[a.length-1];return s?s.params:{}}function bl(a,{relative:s}={}){let{matches:o}=S.useContext(xa),{pathname:i}=On(),d=JSON.stringify(xd(o));return S.useMemo(()=>vd(a,JSON.parse(d),i,s==="path"),[a,d,i,s])}function C0(a,s){return av(a,s)}function av(a,s,o,i,d){Pe(cs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=S.useContext(ra),{matches:m}=S.useContext(xa),v=m[m.length-1],g=v?v.params:{},p=v?v.pathname:"/",y=v?v.pathnameBase:"/",x=v&&v.route;{let A=x&&x.path||"";rv(p,!x||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${A}">) 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="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let N=On(),M;if(s){let A=typeof s=="string"?os(s):s;Pe(y==="/"||A.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 "${A.pathname}" was given in the \`location\` prop.`),M=A}else M=N;let j=M.pathname||"/",E=j;if(y!=="/"){let A=y.replace(/^\//,"").split("/");E="/"+j.replace(/^\//,"").split("/").slice(A.length).join("/")}let T=Xx(a,{pathname:E});ja(x||T!=null,`No routes matched location "${M.pathname}${M.search}${M.hash}" `),ja(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${M.pathname}${M.search}${M.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 k=k0(T&&T.map(A=>Object.assign({},A,{params:Object.assign({},g,A.params),pathname:en([y,f.encodeLocation?f.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?y:en([y,f.encodeLocation?f.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),m,o,i,d);return s&&k?S.createElement(yl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...M},navigationType:"POP"}},k):k}function R0(){let a=U0(),s=f0(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=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:f},"ErrorBoundary")," or"," ",S.createElement("code",{style:f},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},s),o?S.createElement("pre",{style:d},o):null,m)}var _0=S.createElement(R0,null),nv=class extends S.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=S0(a.digest);o&&(a=o)}let s=a!==void 0?S.createElement(xa.Provider,{value:this.props.routeContext},S.createElement(gd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?S.createElement(M0,{error:a},s):s}};nv.contextType=p0;var qu=new WeakMap;function M0({children:a,error:s}){let{basename:o}=S.useContext(ra);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let i=b0(s.digest);if(i){let d=qu.get(s);if(d)throw d;let f=Jx(i.location,o);if($x&&!qu.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 qu.set(s,m),m}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function A0({routeContext:a,match:s,children:o}){let i=S.useContext(is);return i&&i.static&&i.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=s.route.id),S.createElement(xa.Provider,{value:a},o)}function k0(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:N,errors:M}=o,j=x.route.loader&&!N.hasOwnProperty(x.route.id)&&(!M||M[x.route.id]===void 0);if(x.route.lazy||j){v=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let p=o&&i?(y,x)=>{i(y,{location:o.location,params:o.matches?.[0]?.params??{},unstable_pattern:m0(o.matches),errorInfo:x})}:void 0;return f.reduceRight((y,x,N)=>{let M,j=!1,E=null,T=null;o&&(M=m&&x.route.id?m[x.route.id]:void 0,E=x.route.errorElement||_0,v&&(g<0&&N===0?(rv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,T=null):g===N&&(j=!0,T=x.route.hydrateFallbackElement||null)));let k=s.concat(f.slice(0,N+1)),A=()=>{let V;return M?V=E:j?V=T:x.route.Component?V=S.createElement(x.route.Component,null):x.route.element?V=x.route.element:V=y,S.createElement(A0,{match:x,routeContext:{outlet:y,matches:k,isDataRoute:o!=null},children:V})};return o&&(x.route.ErrorBoundary||x.route.errorElement||N===0)?S.createElement(nv,{location:o.location,revalidation:o.revalidation,component:E,error:M,children:A(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:p}):A()},null)}function yd(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function O0(a){let s=S.useContext(is);return Pe(s,yd(a)),s}function z0(a){let s=S.useContext(ci);return Pe(s,yd(a)),s}function D0(a){let s=S.useContext(xa);return Pe(s,yd(a)),s}function bd(a){let s=D0(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 L0(){return bd("useRouteId")}function U0(){let a=S.useContext(gd),s=z0("useRouteError"),o=bd("useRouteError");return a!==void 0?a:s.errors?.[o]}function B0(){let{router:a}=O0("useNavigate"),s=bd("useNavigate"),o=S.useRef(!1);return tv(()=>{o.current=!0}),S.useCallback(async(d,f={})=>{ja(o.current,ev),o.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:s,...f}))},[a,s])}var $p={};function rv(a,s,o){!s&&!$p[a]&&($p[a]=!0,ja(!1,o))}S.memo(q0);function q0({routes:a,future:s,state:o,onError:i}){return av(a,void 0,o,i,s)}function ni({to:a,replace:s,state:o,relative:i}){Pe(cs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=S.useContext(ra);ja(!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}=S.useContext(xa),{pathname:m}=On(),v=wa(),g=vd(a,xd(f),m,i==="path"),p=JSON.stringify(g);return S.useEffect(()=>{v(JSON.parse(p),{replace:s,state:o,relative:i})},[v,p,i,s,o]),null}function H0(a){return E0(a.context)}function pt(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 G0({basename:a="/",children:s=null,location:o,navigationType:i="POP",navigator:d,static:f=!1,unstable_useTransitions:m}){Pe(!cs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let v=a.replace(/^\/*/,"/"),g=S.useMemo(()=>({basename:v,navigator:d,static:f,unstable_useTransitions:m,future:{}}),[v,d,f,m]);typeof o=="string"&&(o=os(o));let{pathname:p="/",search:y="",hash:x="",state:N=null,key:M="default"}=o,j=S.useMemo(()=>{let E=tn(p,v);return E==null?null:{location:{pathname:E,search:y,hash:x,state:N,key:M},navigationType:i}},[v,p,y,x,N,M,i]);return ja(j!=null,`<Router basename="${v}"> is not able to match the URL "${p}${y}${x}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:S.createElement(ra.Provider,{value:g},S.createElement(yl.Provider,{children:s,value:j}))}function Q0({children:a,location:s}){return C0(ed(a),s)}function ed(a,s=[]){let o=[];return S.Children.forEach(a,(i,d)=>{if(!S.isValidElement(i))return;let f=[...s,d];if(i.type===S.Fragment){o.push.apply(o,ed(i.props.children,f));return}Pe(i.type===pt,`[${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=ed(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 V0(a){return ui(a)&&a.tagName.toLowerCase()==="button"}function F0(a){return ui(a)&&a.tagName.toLowerCase()==="form"}function Y0(a){return ui(a)&&a.tagName.toLowerCase()==="input"}function X0(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function K0(a,s){return a.button===0&&(!s||s==="_self")&&!X0(a)}var Go=null;function Z0(){if(Go===null)try{new FormData(document.createElement("form"),0),Go=!1}catch{Go=!0}return Go}var $0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Hu(a){return a!=null&&!$0.has(a)?(ja(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Po}"`),null):a}function J0(a,s){let o,i,d,f,m;if(F0(a)){let v=a.getAttribute("action");i=v?tn(v,s):null,o=a.getAttribute("method")||Jo,d=Hu(a.getAttribute("enctype"))||Po,f=new FormData(a)}else if(V0(a)||Y0(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?tn(g,s):null,o=a.getAttribute("formmethod")||v.getAttribute("method")||Jo,d=Hu(a.getAttribute("formenctype"))||Hu(v.getAttribute("enctype"))||Po,f=new FormData(v,a),!Z0()){let{name:p,type:y,value:x}=a;if(y==="image"){let N=p?`${p}.`:"";f.append(`${N}x`,"0"),f.append(`${N}y`,"0")}else p&&f.append(p,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 Sd(a,s){if(a===!1||a===null||typeof a>"u")throw new Error(s)}function P0(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&&tn(d.pathname,s)==="/"?d.pathname=`${s.replace(/\/$/,"")}/_root.${i}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${i}`,d}async function I0(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 W0(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 e1(a,s,o){let i=await Promise.all(a.map(async d=>{let f=s.routes[d.route.id];if(f){let m=await I0(f,o);return m.links?m.links():[]}return[]}));return r1(i.flat(1).filter(W0).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Jp(a,s,o,i,d,f){let m=(g,p)=>o[p]?g.route.id!==o[p].route.id:!0,v=(g,p)=>o[p].pathname!==g.pathname||o[p].route.path?.endsWith("*")&&o[p].params["*"]!==g.params["*"];return f==="assets"?s.filter((g,p)=>m(g,p)||v(g,p)):f==="data"?s.filter((g,p)=>{let y=i.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,p)||v(g,p))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 t1(a,s,{includeHydrateFallback:o}={}){return a1(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 a1(a){return[...new Set(a)]}function n1(a){let s={},o=Object.keys(a).sort();for(let i of o)s[i]=a[i];return s}function r1(a,s){let o=new Set;return new Set(s),a.reduce((i,d)=>{let f=JSON.stringify(n1(d));return o.has(f)||(o.add(f),i.push({key:f,link:d})),i},[])}function sv(){let a=S.useContext(is);return Sd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function s1(){let a=S.useContext(ci);return Sd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Nd=S.createContext(void 0);Nd.displayName="FrameworkContext";function lv(){let a=S.useContext(Nd);return Sd(a,"You must render this element inside a <HydratedRouter> element"),a}function l1(a,s){let o=S.useContext(Nd),[i,d]=S.useState(!1),[f,m]=S.useState(!1),{onFocus:v,onBlur:g,onMouseEnter:p,onMouseLeave:y,onTouchStart:x}=s,N=S.useRef(null);S.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let E=k=>{k.forEach(A=>{m(A.isIntersecting)})},T=new IntersectionObserver(E,{threshold:.5});return N.current&&T.observe(N.current),()=>{T.disconnect()}}},[a]),S.useEffect(()=>{if(i){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[i]);let M=()=>{d(!0)},j=()=>{d(!1),m(!1)};return o?a!=="intent"?[f,N,{}]:[f,N,{onFocus:ul(v,M),onBlur:ul(g,j),onMouseEnter:ul(p,M),onMouseLeave:ul(y,j),onTouchStart:ul(x,M)}]:[!1,N,{}]}function ul(a,s){return o=>{a&&a(o),o.defaultPrevented||s(o)}}function o1({page:a,...s}){let{router:o}=sv(),i=S.useMemo(()=>Xx(o.routes,a,o.basename),[o.routes,a,o.basename]);return i?S.createElement(c1,{page:a,matches:i,...s}):null}function i1(a){let{manifest:s,routeModules:o}=lv(),[i,d]=S.useState([]);return S.useEffect(()=>{let f=!1;return e1(a,s,o).then(m=>{f||d(m)}),()=>{f=!0}},[a,s,o]),i}function c1({page:a,matches:s,...o}){let i=On(),{future:d,manifest:f,routeModules:m}=lv(),{basename:v}=sv(),{loaderData:g,matches:p}=s1(),y=S.useMemo(()=>Jp(a,s,p,f,i,"data"),[a,s,p,f,i]),x=S.useMemo(()=>Jp(a,s,p,f,i,"assets"),[a,s,p,f,i]),N=S.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,T=!1;if(s.forEach(A=>{let V=f.routes[A.route.id];!V||!V.hasLoader||(!y.some(q=>q.route.id===A.route.id)&&A.route.id in g&&m[A.route.id]?.shouldRevalidate||V.hasClientLoader?T=!0:E.add(A.route.id))}),E.size===0)return[];let k=P0(a,v,d.unstable_trailingSlashAwareDataRequests,"data");return T&&E.size>0&&k.searchParams.set("_routes",s.filter(A=>E.has(A.route.id)).map(A=>A.route.id).join(",")),[k.pathname+k.search]},[v,d.unstable_trailingSlashAwareDataRequests,g,i,f,y,s,a,m]),M=S.useMemo(()=>t1(x,f),[x,f]),j=i1(x);return S.createElement(S.Fragment,null,N.map(E=>S.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),M.map(E=>S.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),j.map(({key:E,link:T})=>S.createElement("link",{key:E,nonce:o.nonce,...T,crossOrigin:T.crossOrigin??o.crossOrigin})))}function u1(...a){return s=>{a.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var d1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{d1&&(window.__reactRouterVersion="7.13.0")}catch{}function f1({basename:a,children:s,unstable_useTransitions:o,window:i}){let d=S.useRef();d.current==null&&(d.current=Qb({window:i,v5Compat:!0}));let f=d.current,[m,v]=S.useState({action:f.action,location:f.location}),g=S.useCallback(p=>{o===!1?v(p):S.startTransition(()=>v(p))},[o]);return S.useLayoutEffect(()=>f.listen(g),[f,g]),S.createElement(G0,{basename:a,children:s,location:m.location,navigationType:m.action,navigator:f,unstable_useTransitions:o})}var ov=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jd=S.forwardRef(function({onClick:s,discover:o="render",prefetch:i="none",relative:d,reloadDocument:f,replace:m,state:v,target:g,to:p,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:N,...M},j){let{basename:E,unstable_useTransitions:T}=S.useContext(ra),k=typeof p=="string"&&ov.test(p),A=Jx(p,E);p=A.to;let V=N0(p,{relative:d}),[q,te,W]=l1(i,M),z=p1(p,{replace:m,state:v,target:g,preventScrollReset:y,relative:d,viewTransition:x,unstable_defaultShouldRevalidate:N,unstable_useTransitions:T});function B(Ne){s&&s(Ne),Ne.defaultPrevented||z(Ne)}let re=S.createElement("a",{...M,...W,href:A.absoluteURL||V,onClick:A.isExternal||f?s:B,ref:u1(j,te),target:g,"data-discover":!k&&o==="render"?"true":void 0});return q&&!k?S.createElement(S.Fragment,null,re,S.createElement(o1,{page:V})):re});jd.displayName="Link";var iv=S.forwardRef(function({"aria-current":s="page",caseSensitive:o=!1,className:i="",end:d=!1,style:f,to:m,viewTransition:v,children:g,...p},y){let x=bl(m,{relative:p.relative}),N=On(),M=S.useContext(ci),{navigator:j,basename:E}=S.useContext(ra),T=M!=null&&b1(x)&&v===!0,k=j.encodeLocation?j.encodeLocation(x).pathname:x.pathname,A=N.pathname,V=M&&M.navigation&&M.navigation.location?M.navigation.location.pathname:null;o||(A=A.toLowerCase(),V=V?V.toLowerCase():null,k=k.toLowerCase()),V&&E&&(V=tn(V,E)||V);const q=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let te=A===k||!d&&A.startsWith(k)&&A.charAt(q)==="/",W=V!=null&&(V===k||!d&&V.startsWith(k)&&V.charAt(k.length)==="/"),z={isActive:te,isPending:W,isTransitioning:T},B=te?s:void 0,re;typeof i=="function"?re=i(z):re=[i,te?"active":null,W?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let Ne=typeof f=="function"?f(z):f;return S.createElement(jd,{...p,"aria-current":B,className:re,ref:y,style:Ne,to:m,viewTransition:v},typeof g=="function"?g(z):g)});iv.displayName="NavLink";var m1=S.forwardRef(({discover:a="render",fetcherKey:s,navigate:o,reloadDocument:i,replace:d,state:f,method:m=Jo,action:v,onSubmit:g,relative:p,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:N,...M},j)=>{let{unstable_useTransitions:E}=S.useContext(ra),T=g1(),k=y1(v,{relative:p}),A=m.toLowerCase()==="get"?"get":"post",V=typeof v=="string"&&ov.test(v),q=te=>{if(g&&g(te),te.defaultPrevented)return;te.preventDefault();let W=te.nativeEvent.submitter,z=W?.getAttribute("formmethod")||m,B=()=>T(W||te.currentTarget,{fetcherKey:s,method:z,navigate:o,replace:d,state:f,relative:p,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:N});E&&o!==!1?S.startTransition(()=>B()):B()};return S.createElement("form",{ref:j,method:A,action:k,onSubmit:i?g:q,...M,"data-discover":!V&&a==="render"?"true":void 0})});m1.displayName="Form";function h1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cv(a){let s=S.useContext(is);return Pe(s,h1(a)),s}function p1(a,{target:s,replace:o,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v,unstable_useTransitions:g}={}){let p=wa(),y=On(),x=bl(a,{relative:f});return S.useCallback(N=>{if(K0(N,s)){N.preventDefault();let M=o!==void 0?o:vl(y)===vl(x),j=()=>p(a,{replace:M,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v});g?S.startTransition(()=>j()):j()}},[y,p,x,o,i,s,a,d,f,m,v,g])}var x1=0,v1=()=>`__${String(++x1)}__`;function g1(){let{router:a}=cv("useSubmit"),{basename:s}=S.useContext(ra),o=L0(),i=a.fetch,d=a.navigate;return S.useCallback(async(f,m={})=>{let{action:v,method:g,encType:p,formData:y,body:x}=J0(f,s);if(m.navigate===!1){let N=m.fetcherKey||v1();await i(N,o,m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||p,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||p,replace:m.replace,state:m.state,fromRouteId:o,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,d,s,o])}function y1(a,{relative:s}={}){let{basename:o}=S.useContext(ra),i=S.useContext(xa);Pe(i,"useFormAction must be used inside a RouteContext");let[d]=i.matches.slice(-1),f={...bl(a||".",{relative:s})},m=On();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:en([o,f.pathname])),vl(f)}function b1(a,{relative:s}={}){let o=S.useContext(Ix);Pe(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=cv("useViewTransitionState"),d=bl(a,{relative:s});if(!o.isTransitioning)return!1;let f=tn(o.currentLocation.pathname,i)||o.currentLocation.pathname,m=tn(o.nextLocation.pathname,i)||o.nextLocation.pathname;return ai(d.pathname,m)!=null||ai(d.pathname,f)!=null}var S1=Yx();const N1=Fx(S1);var us=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(){}},j1={setTimeout:(a,s)=>setTimeout(a,s),clearTimeout:a=>clearTimeout(a),setInterval:(a,s)=>setInterval(a,s),clearInterval:a=>clearInterval(a)},w1=class{#e=j1;#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)}},sr=new w1;function E1(a){setTimeout(a,0)}var ir=typeof window>"u"||"Deno"in globalThis;function zt(){}function T1(a,s){return typeof a=="function"?a(s):a}function td(a){return typeof a=="number"&&a>=0&&a!==1/0}function uv(a,s){return Math.max(a+(s||0)-Date.now(),0)}function An(a,s){return typeof a=="function"?a(s):a}function pa(a,s){return typeof a=="function"?a(s):a}function Pp(a,s){const{type:o="all",exact:i,fetchStatus:d,predicate:f,queryKey:m,stale:v}=a;if(m){if(i){if(s.queryHash!==wd(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 Ip(a,s){const{exact:o,status:i,predicate:d,mutationKey:f}=a;if(f){if(!s.options.mutationKey)return!1;if(o){if(cr(s.options.mutationKey)!==cr(f))return!1}else if(!gl(s.options.mutationKey,f))return!1}return!(i&&s.state.status!==i||d&&!d(s))}function wd(a,s){return(s?.queryKeyHashFn||cr)(a)}function cr(a){return JSON.stringify(a,(s,o)=>ad(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 C1=Object.prototype.hasOwnProperty;function dv(a,s,o=0){if(a===s)return a;if(o>500)return s;const i=Wp(a)&&Wp(s);if(!i&&!(ad(a)&&ad(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 p=0;for(let y=0;y<v;y++){const x=i?y:m[y],N=a[x],M=s[x];if(N===M){g[x]=N,(i?y<f:C1.call(a,x))&&p++;continue}if(N===null||M===null||typeof N!="object"||typeof M!="object"){g[x]=M;continue}const j=dv(N,M,o+1);g[x]=j,j===N&&p++}return f===v&&p===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 Wp(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function ad(a){if(!ex(a))return!1;const s=a.constructor;if(s===void 0)return!0;const o=s.prototype;return!(!ex(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function ex(a){return Object.prototype.toString.call(a)==="[object Object]"}function R1(a){return new Promise(s=>{sr.setTimeout(s,a)})}function nd(a,s,o){return typeof o.structuralSharing=="function"?o.structuralSharing(a,s):o.structuralSharing!==!1?dv(a,s):s}function _1(a,s,o=0){const i=[...a,s];return o&&i.length>o?i.slice(1):i}function M1(a,s,o=0){const i=[s,...a];return o&&i.length>o?i.slice(0,-1):i}var Ed=Symbol();function fv(a,s){return!a.queryFn&&s?.initialPromise?()=>s.initialPromise:!a.queryFn||a.queryFn===Ed?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function Td(a,s){return typeof a=="function"?a(...s):!!a}function A1(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 k1=class extends us{#e;#t;#a;constructor(){super(),this.#a=a=>{if(!ir&&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"}},Cd=new k1;function rd(){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 O1=E1;function z1(){let a=[],s=0,o=v=>{v()},i=v=>{v()},d=O1;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 dt=z1(),D1=class extends us{#e=!0;#t;#a;constructor(){super(),this.#a=a=>{if(!ir&&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 D1;function L1(a){return Math.min(1e3*2**a,3e4)}function mv(a){return(a??"online")==="online"?si.isOnline():!0}var sd=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function hv(a){let s=!1,o=0,i;const d=rd(),f=()=>d.status!=="pending",m=E=>{if(!f()){const T=new sd(E);N(T),a.onCancel?.(T)}},v=()=>{s=!0},g=()=>{s=!1},p=()=>Cd.isFocused()&&(a.networkMode==="always"||si.isOnline())&&a.canRun(),y=()=>mv(a.networkMode)&&a.canRun(),x=E=>{f()||(i?.(),d.resolve(E))},N=E=>{f()||(i?.(),d.reject(E))},M=()=>new Promise(E=>{i=T=>{(f()||p())&&E(T)},a.onPause?.()}).then(()=>{i=void 0,f()||a.onContinue?.()}),j=()=>{if(f())return;let E;const T=o===0?a.initialPromise:void 0;try{E=T??a.fn()}catch(k){E=Promise.reject(k)}Promise.resolve(E).then(x).catch(k=>{if(f())return;const A=a.retry??(ir?0:3),V=a.retryDelay??L1,q=typeof V=="function"?V(o,k):V,te=A===!0||typeof A=="number"&&o<A||typeof A=="function"&&A(o,k);if(s||!te){N(k);return}o++,a.onFail?.(o,k),R1(q).then(()=>p()?void 0:M()).then(()=>{s?N(k):j()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(i?.(),d),cancelRetry:v,continueRetry:g,canStart:y,start:()=>(y()?j():M().then(j),d)}}var pv=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),td(this.gcTime)&&(this.#e=sr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(ir?1/0:300*1e3))}clearGcTimeout(){this.#e&&(sr.clearTimeout(this.#e),this.#e=void 0)}},U1=class extends pv{#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=ax(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=ax(this.options);s.data!==void 0&&(this.setState(tx(s.data,s.dataUpdatedAt)),this.#e=s)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(a,s){const o=nd(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(zt).catch(zt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(a=>pa(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ed||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:!uv(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=fv(this.options,s),p=(()=>{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,p,this):v(p)},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=hv({initialPromise:s?.initialPromise,fn:m.fetchFn,onCancel:v=>{v instanceof sd&&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 sd){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,...xv(o.data,this.options),fetchMeta:a.meta??null};case"success":const i={...o,...tx(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),dt.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:a})})}};function xv(a,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mv(s.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function tx(a,s){return{data:a,dataUpdatedAt:s??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ax(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 B1=class extends us{constructor(a,s){super(),this.options=s,this.#e=a,this.#s=null,this.#o=rd(),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),nx(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ld(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ld(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),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 pa(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#N(),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&&rx(this.#t,o,this.options,s)&&this.#d(),this.updateResult(),i&&(this.#t!==o||pa(this.options.enabled,this.#t)!==pa(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||pa(this.options.enabled,this.#t)!==pa(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 H1(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.#N();let s=this.#t.fetch(this.options,a);return a?.throwOnError||(s=s.catch(zt)),s}#x(){this.#b();const a=An(this.options.staleTime,this.#t);if(ir||this.#r.isStale||!td(a))return;const o=uv(this.#r.dataUpdatedAt,a)+1;this.#c=sr.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.#S(),this.#i=a,!(ir||pa(this.options.enabled,this.#t)===!1||!td(this.#i)||this.#i===0)&&(this.#u=sr.setInterval(()=>{(this.options.refetchIntervalInBackground||Cd.isFocused())&&this.#d()},this.#i))}#y(){this.#x(),this.#g(this.#v())}#b(){this.#c&&(sr.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(sr.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:p}=a;let y={...p},x=!1,N;if(s._optimisticResults){const B=this.hasListeners(),re=!B&&nx(a,s),Ne=B&&rx(a,o,s,i);(re||Ne)&&(y={...y,...xv(p.data,a.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:M,errorUpdatedAt:j,status:E}=y;N=y.data;let T=!1;if(s.placeholderData!==void 0&&N===void 0&&E==="pending"){let B;d?.isPlaceholderData&&s.placeholderData===m?.placeholderData?(B=d.data,T=!0):B=typeof s.placeholderData=="function"?s.placeholderData(this.#m?.state.data,this.#m):s.placeholderData,B!==void 0&&(E="success",N=nd(d?.data,B,s),x=!0)}if(s.select&&N!==void 0&&!T)if(d&&N===f?.data&&s.select===this.#p)N=this.#f;else try{this.#p=s.select,N=s.select(N),N=nd(d?.data,N,s),this.#f=N,this.#s=null}catch(B){this.#s=B}this.#s&&(M=this.#s,N=this.#f,j=Date.now(),E="error");const k=y.fetchStatus==="fetching",A=E==="pending",V=E==="error",q=A&&k,te=N!==void 0,z={status:E,fetchStatus:y.fetchStatus,isPending:A,isSuccess:E==="success",isError:V,isInitialLoading:q,isLoading:q,data:N,dataUpdatedAt:y.dataUpdatedAt,error:M,errorUpdatedAt:j,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:k,isRefetching:k&&!A,isLoadingError:V&&!te,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:V&&te,isStale:Rd(a,s),refetch:this.refetch,promise:this.#o,isEnabled:pa(s.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const B=z.data!==void 0,re=z.status==="error"&&!B,Ne=Ce=>{re?Ce.reject(z.error):B&&Ce.resolve(z.data)},oe=()=>{const Ce=this.#o=z.promise=rd();Ne(Ce)},he=this.#o;switch(he.status){case"pending":a.queryHash===o.queryHash&&Ne(he);break;case"fulfilled":(re||z.data!==he.value)&&oe();break;case"rejected":(!re||z.error!==he.reason)&&oe();break}}return z}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.#j({listeners:o()})}#N(){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()}#j(a){dt.batch(()=>{a.listeners&&this.listeners.forEach(s=>{s(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function q1(a,s){return pa(s.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&s.retryOnMount===!1)}function nx(a,s){return q1(a,s)||a.state.data!==void 0&&ld(a,s,s.refetchOnMount)}function ld(a,s,o){if(pa(s.enabled,a)!==!1&&An(s.staleTime,a)!=="static"){const i=typeof o=="function"?o(a):o;return i==="always"||i!==!1&&Rd(a,s)}return!1}function rx(a,s,o,i){return(a!==s||pa(i.enabled,a)===!1)&&(!o.suspense||a.state.status!=="error")&&Rd(a,o)}function Rd(a,s){return pa(s.enabled,a)!==!1&&a.isStaleByTime(An(s.staleTime,a))}function H1(a,s){return!ri(a.getCurrentResult(),s)}function sx(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 p=async()=>{let y=!1;const x=j=>{A1(j,()=>s.signal,()=>y=!0)},N=fv(s.options,s.fetchOptions),M=async(j,E,T)=>{if(y)return Promise.reject();if(E==null&&j.pages.length)return Promise.resolve(j);const A=(()=>{const W={client:s.client,queryKey:s.queryKey,pageParam:E,direction:T?"backward":"forward",meta:s.options.meta};return x(W),W})(),V=await N(A),{maxPages:q}=s.options,te=T?M1:_1;return{pages:te(j.pages,V,q),pageParams:te(j.pageParams,E,q)}};if(d&&f.length){const j=d==="backward",E=j?G1:lx,T={pages:f,pageParams:m},k=E(i,T);v=await M(T,k,j)}else{const j=a??f.length;do{const E=g===0?m[0]??i.initialPageParam:lx(i,v);if(g>0&&E==null)break;v=await M(v,E),g++}while(g<j)}return v};s.options.persister?s.fetchFn=()=>s.options.persister?.(p,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},o):s.fetchFn=p}}}function lx(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 G1(a,{pages:s,pageParams:o}){return s.length>0?a.getPreviousPageParam?.(s[0],s,o[0],o):void 0}var Q1=class extends pv{#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||vv(),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=hv({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),dt.batch(()=>{this.#t.forEach(o=>{o.onMutationUpdate(a)}),this.#a.notify({mutation:this,type:"updated",action:a})})}};function vv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var V1=class extends us{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 Q1({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(){dt.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=>Ip(s,o))}findAll(a={}){return this.getAll().filter(s=>Ip(a,s))}notify(a){dt.batch(()=>{this.listeners.forEach(s=>{s(a)})})}resumePausedMutations(){const a=this.getAll().filter(s=>s.state.isPaused);return dt.batch(()=>Promise.all(a.map(s=>s.continue().catch(zt))))}};function Qo(a){return a.options.scope?.id}var F1=class extends us{#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&&cr(o.mutationKey)!==cr(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??vv();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){dt.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)})})}},Y1=class extends us{constructor(a={}){super(),this.config=a,this.#e=new Map}#e;build(a,s,o){const i=s.queryKey,d=s.queryHash??wd(i,s);let f=this.get(d);return f||(f=new U1({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(){dt.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=>Pp(s,o))}findAll(a={}){const s=this.getAll();return Object.keys(a).length>0?s.filter(o=>Pp(a,o)):s}notify(a){dt.batch(()=>{this.listeners.forEach(s=>{s(a)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},X1=class{#e;#t;#a;#r;#n;#l;#o;#s;constructor(a={}){this.#e=a.queryCache||new Y1,this.#t=a.mutationCache||new V1,this.#a=a.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#o=Cd.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=T1(s,f);if(m!==void 0)return this.#e.build(this,i).setData(m,{...o,manual:!0})}setQueriesData(a,s,o){return dt.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;dt.batch(()=>{s.findAll(a).forEach(o=>{s.remove(o)})})}resetQueries(a,s){const o=this.#e;return dt.batch(()=>(o.findAll(a).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...a},s)))}cancelQueries(a,s={}){const o={revert:!0,...s},i=dt.batch(()=>this.#e.findAll(a).map(d=>d.cancel(o)));return Promise.all(i).then(zt).catch(zt)}invalidateQueries(a,s={}){return dt.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=dt.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(zt)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(i).then(zt)}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(zt).catch(zt)}fetchInfiniteQuery(a){return a.behavior=sx(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(zt).catch(zt)}ensureInfiniteQueryData(a){return a.behavior=sx(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(cr(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(cr(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=wd(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===Ed&&(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()}},gv=S.createContext(void 0),vt=a=>{const s=S.useContext(gv);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},K1=({client:a,children:s})=>(S.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),l.jsx(gv.Provider,{value:a,children:s})),yv=S.createContext(!1),Z1=()=>S.useContext(yv);yv.Provider;function $1(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var J1=S.createContext($1()),P1=()=>S.useContext(J1),I1=(a,s,o)=>{const i=o?.state.error&&typeof a.throwOnError=="function"?Td(a.throwOnError,[o.state.error,o]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||i)&&(s.isReset()||(a.retryOnMount=!1))},W1=a=>{S.useEffect(()=>{a.clearReset()},[a])},e2=({result:a,errorResetBoundary:s,throwOnError:o,query:i,suspense:d})=>a.isError&&!s.isReset()&&!a.isFetching&&i&&(d&&a.data===void 0||Td(o,[a.error,i])),t2=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))}},a2=(a,s)=>a.isLoading&&a.isFetching&&!s,n2=(a,s)=>a?.suspense&&s.isPending,ox=(a,s,o)=>s.fetchOptimistic(a).catch(()=>{o.clearReset()});function r2(a,s,o){const i=Z1(),d=P1(),f=vt(),m=f.defaultQueryOptions(a);f.getDefaultOptions().queries?._experimental_beforeQuery?.(m);const v=f.getQueryCache().get(m.queryHash);m._optimisticResults=i?"isRestoring":"optimistic",t2(m),I1(m,d,v),W1(d);const g=!f.getQueryCache().get(m.queryHash),[p]=S.useState(()=>new s(f,m)),y=p.getOptimisticResult(m),x=!i&&a.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(N=>{const M=x?p.subscribe(dt.batchCalls(N)):zt;return p.updateResult(),M},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),S.useEffect(()=>{p.setOptions(m)},[m,p]),n2(m,y))throw ox(m,p,d);if(e2({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&&!ir&&a2(y,i)&&(g?ox(m,p,d):v?.promise)?.catch(zt).finally(()=>{p.updateResult()}),m.notifyOnChangeProps?y:p.trackResult(y)}function jt(a,s){return r2(a,B1)}function wt(a,s){const o=vt(),[i]=S.useState(()=>new F1(o,a));S.useEffect(()=>{i.setOptions(a)},[i,a]);const d=S.useSyncExternalStore(S.useCallback(m=>i.subscribe(dt.batchCalls(m)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),f=S.useCallback((m,v)=>{i.mutate(m,v).catch(zt)},[i]);if(d.error&&Td(i.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}function s2(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 l2=a=>{switch(a){case"success":return c2;case"info":return d2;case"warning":return u2;case"error":return f2;default:return null}},o2=Array(12).fill(0),i2=({visible:a,className:s})=>se.createElement("div",{className:["sonner-loading-wrapper",s].filter(Boolean).join(" "),"data-visible":a},se.createElement("div",{className:"sonner-spinner"},o2.map((o,i)=>se.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),c2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.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"})),u2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},se.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"})),d2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.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"})),f2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.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"})),m2=se.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"},se.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),se.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),h2=()=>{const[a,s]=se.useState(document.hidden);return se.useEffect(()=>{const o=()=>{s(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a};let od=1;class p2{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:od++,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 p=>{if(m=["resolve",p],se.isValidElement(p))f=!1,this.create({id:i,type:"default",message:p});else if(v2(p)&&!p.ok){f=!1;const x=typeof o.error=="function"?await o.error(`HTTP error! status: ${p.status}`):o.error,N=typeof o.description=="function"?await o.description(`HTTP error! status: ${p.status}`):o.description,j=typeof x=="object"&&!se.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:N,...j})}else if(p instanceof Error){f=!1;const x=typeof o.error=="function"?await o.error(p):o.error,N=typeof o.description=="function"?await o.description(p):o.description,j=typeof x=="object"&&!se.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:N,...j})}else if(o.success!==void 0){f=!1;const x=typeof o.success=="function"?await o.success(p):o.success,N=typeof o.description=="function"?await o.description(p):o.description,j=typeof x=="object"&&!se.isValidElement(x)?x:{message:x};this.create({id:i,type:"success",description:N,...j})}}).catch(async p=>{if(m=["reject",p],o.error!==void 0){f=!1;const y=typeof o.error=="function"?await o.error(p):o.error,x=typeof o.description=="function"?await o.description(p):o.description,M=typeof y=="object"&&!se.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:x,...M})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),o.finally==null||o.finally.call(o)}),g=()=>new Promise((p,y)=>v.then(()=>m[0]==="reject"?y(m[1]):p(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||od++;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 Yt=new p2,x2=(a,s)=>{const o=s?.id||od++;return Yt.addToast({title:a,...s,id:o}),o},v2=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",g2=x2,y2=()=>Yt.toasts,b2=()=>Yt.getActiveToasts(),ze=Object.assign(g2,{success:Yt.success,info:Yt.info,warning:Yt.warning,error:Yt.error,custom:Yt.custom,message:Yt.message,promise:Yt.promise,dismiss:Yt.dismiss,loading:Yt.loading},{getHistory:y2,getToasts:b2});s2("[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 S2=3,N2="24px",j2="16px",ix=4e3,w2=356,E2=14,T2=45,C2=200;function ka(...a){return a.filter(Boolean).join(" ")}function R2(a){const[s,o]=a.split("-"),i=[];return s&&i.push(s),o&&i.push(o),i}const _2=a=>{var s,o,i,d,f,m,v,g,p;const{invert:y,toast:x,unstyled:N,interacting:M,setHeights:j,visibleToasts:E,heights:T,index:k,toasts:A,expanded:V,removeToast:q,defaultRichColors:te,closeButton:W,style:z,cancelButtonStyle:B,actionButtonStyle:re,className:Ne="",descriptionClassName:oe="",duration:he,position:Ce,gap:Re,expandByDefault:ee,classNames:w,icons:F,closeButtonAriaLabel:Y="Close toast"}=a,[xe,ve]=se.useState(null),[R,X]=se.useState(null),[K,I]=se.useState(!1),[le,$]=se.useState(!1),[ie,ce]=se.useState(!1),[H,ne]=se.useState(!1),[_e,Ae]=se.useState(!1),[va,it]=se.useState(0),[zn,fr]=se.useState(0),Dn=se.useRef(x.duration||he||ix),hs=se.useRef(null),Zt=se.useRef(null),ps=k===0,xs=k+1<=E,Mt=x.type,an=x.dismissible!==!1,At=x.className||"",bi=x.descriptionClassName||"",Ln=se.useMemo(()=>T.findIndex(je=>je.toastId===x.id)||0,[T,x.id]),Tl=se.useMemo(()=>{var je;return(je=x.closeButton)!=null?je:W},[x.closeButton,W]),Un=se.useMemo(()=>x.duration||he||ix,[x.duration,he]),vs=se.useRef(0),za=se.useRef(0),Cl=se.useRef(0),nn=se.useRef(null),[Bn,kt]=Ce.split("-"),ga=se.useMemo(()=>T.reduce((je,$e,ft)=>ft>=Ln?je:je+$e.height,0),[T,Ln]),Et=h2(),Si=x.invert||y,gs=Mt==="loading";za.current=se.useMemo(()=>Ln*Re+ga,[Ln,ga]),se.useEffect(()=>{Dn.current=Un},[Un]),se.useEffect(()=>{I(!0)},[]),se.useEffect(()=>{const je=Zt.current;if(je){const $e=je.getBoundingClientRect().height;return fr($e),j(ft=>[{toastId:x.id,height:$e,position:x.position},...ft]),()=>j(ft=>ft.filter(Tt=>Tt.toastId!==x.id))}},[j,x.id]),se.useLayoutEffect(()=>{if(!K)return;const je=Zt.current,$e=je.style.height;je.style.height="auto";const ft=je.getBoundingClientRect().height;je.style.height=$e,fr(ft),j(Tt=>Tt.find(Ie=>Ie.toastId===x.id)?Tt.map(Ie=>Ie.toastId===x.id?{...Ie,height:ft}:Ie):[{toastId:x.id,height:ft,position:x.position},...Tt])},[K,x.title,x.description,j,x.id,x.jsx,x.action,x.cancel]);const Ta=se.useCallback(()=>{$(!0),it(za.current),j(je=>je.filter($e=>$e.toastId!==x.id)),setTimeout(()=>{q(x)},C2)},[x,q,j,za]);se.useEffect(()=>{if(x.promise&&Mt==="loading"||x.duration===1/0||x.type==="loading")return;let je;return V||M||Et?(()=>{if(Cl.current<vs.current){const Tt=new Date().getTime()-vs.current;Dn.current=Dn.current-Tt}Cl.current=new Date().getTime()})():Dn.current!==1/0&&(vs.current=new Date().getTime(),je=setTimeout(()=>{x.onAutoClose==null||x.onAutoClose.call(x,x),Ta()},Dn.current)),()=>clearTimeout(je)},[V,M,x,Mt,Et,Ta]),se.useEffect(()=>{x.delete&&(Ta(),x.onDismiss==null||x.onDismiss.call(x,x))},[Ta,x.delete]);function mr(){var je;if(F?.loading){var $e;return se.createElement("div",{className:ka(w?.loader,x==null||($e=x.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":Mt==="loading"},F.loading)}return se.createElement(i2,{className:ka(w?.loader,x==null||(je=x.classNames)==null?void 0:je.loader),visible:Mt==="loading"})}const hr=x.icon||F?.[Mt]||l2(Mt);var qn,Ca;return se.createElement("li",{tabIndex:0,ref:Zt,className:ka(Ne,At,w?.toast,x==null||(s=x.classNames)==null?void 0:s.toast,w?.default,w?.[Mt],x==null||(o=x.classNames)==null?void 0:o[Mt]),"data-sonner-toast":"","data-rich-colors":(qn=x.richColors)!=null?qn:te,"data-styled":!(x.jsx||x.unstyled||N),"data-mounted":K,"data-promise":!!x.promise,"data-swiped":_e,"data-removed":le,"data-visible":xs,"data-y-position":Bn,"data-x-position":kt,"data-index":k,"data-front":ps,"data-swiping":ie,"data-dismissible":an,"data-type":Mt,"data-invert":Si,"data-swipe-out":H,"data-swipe-direction":R,"data-expanded":!!(V||ee&&K),"data-testid":x.testId,style:{"--index":k,"--toasts-before":k,"--z-index":A.length-k,"--offset":`${le?va:za.current}px`,"--initial-height":ee?"auto":`${zn}px`,...z,...x.style},onDragEnd:()=>{ce(!1),ve(null),nn.current=null},onPointerDown:je=>{je.button!==2&&(gs||!an||(hs.current=new Date,it(za.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(ce(!0),nn.current={x:je.clientX,y:je.clientY})))},onPointerUp:()=>{var je,$e,ft;if(H||!an)return;nn.current=null;const Tt=Number(((je=Zt.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),rn=Number((($e=Zt.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ie=new Date().getTime()-((ft=hs.current)==null?void 0:ft.getTime()),Dt=xe==="x"?Tt:rn,Hn=Math.abs(Dt)/Ie;if(Math.abs(Dt)>=T2||Hn>.11){it(za.current),x.onDismiss==null||x.onDismiss.call(x,x),X(xe==="x"?Tt>0?"right":"left":rn>0?"down":"up"),Ta(),ne(!0);return}else{var Lt,Ut;(Lt=Zt.current)==null||Lt.style.setProperty("--swipe-amount-x","0px"),(Ut=Zt.current)==null||Ut.style.setProperty("--swipe-amount-y","0px")}Ae(!1),ce(!1),ve(null)},onPointerMove:je=>{var $e,ft,Tt;if(!nn.current||!an||(($e=window.getSelection())==null?void 0:$e.toString().length)>0)return;const Ie=je.clientY-nn.current.y,Dt=je.clientX-nn.current.x;var Hn;const Lt=(Hn=a.swipeDirections)!=null?Hn:R2(Ce);!xe&&(Math.abs(Dt)>1||Math.abs(Ie)>1)&&ve(Math.abs(Dt)>Math.abs(Ie)?"x":"y");let Ut={x:0,y:0};const pr=ya=>1/(1.5+Math.abs(ya)/20);if(xe==="y"){if(Lt.includes("top")||Lt.includes("bottom"))if(Lt.includes("top")&&Ie<0||Lt.includes("bottom")&&Ie>0)Ut.y=Ie;else{const ya=Ie*pr(Ie);Ut.y=Math.abs(ya)<Math.abs(Ie)?ya:Ie}}else if(xe==="x"&&(Lt.includes("left")||Lt.includes("right")))if(Lt.includes("left")&&Dt<0||Lt.includes("right")&&Dt>0)Ut.x=Dt;else{const ya=Dt*pr(Dt);Ut.x=Math.abs(ya)<Math.abs(Dt)?ya:Dt}(Math.abs(Ut.x)>0||Math.abs(Ut.y)>0)&&Ae(!0),(ft=Zt.current)==null||ft.style.setProperty("--swipe-amount-x",`${Ut.x}px`),(Tt=Zt.current)==null||Tt.style.setProperty("--swipe-amount-y",`${Ut.y}px`)}},Tl&&!x.jsx&&Mt!=="loading"?se.createElement("button",{"aria-label":Y,"data-disabled":gs,"data-close-button":!0,onClick:gs||!an?()=>{}:()=>{Ta(),x.onDismiss==null||x.onDismiss.call(x,x)},className:ka(w?.closeButton,x==null||(i=x.classNames)==null?void 0:i.closeButton)},(Ca=F?.close)!=null?Ca:m2):null,(Mt||x.icon||x.promise)&&x.icon!==null&&(F?.[Mt]!==null||x.icon)?se.createElement("div",{"data-icon":"",className:ka(w?.icon,x==null||(d=x.classNames)==null?void 0:d.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||mr():null,x.type!=="loading"?hr:null):null,se.createElement("div",{"data-content":"",className:ka(w?.content,x==null||(f=x.classNames)==null?void 0:f.content)},se.createElement("div",{"data-title":"",className:ka(w?.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?se.createElement("div",{"data-description":"",className:ka(oe,bi,w?.description,x==null||(v=x.classNames)==null?void 0:v.description)},typeof x.description=="function"?x.description():x.description):null),se.isValidElement(x.cancel)?x.cancel:x.cancel&&Vo(x.cancel)?se.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||B,onClick:je=>{Vo(x.cancel)&&an&&(x.cancel.onClick==null||x.cancel.onClick.call(x.cancel,je),Ta())},className:ka(w?.cancelButton,x==null||(g=x.classNames)==null?void 0:g.cancelButton)},x.cancel.label):null,se.isValidElement(x.action)?x.action:x.action&&Vo(x.action)?se.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||re,onClick:je=>{Vo(x.action)&&(x.action.onClick==null||x.action.onClick.call(x.action,je),!je.defaultPrevented&&Ta())},className:ka(w?.actionButton,x==null||(p=x.classNames)==null?void 0:p.actionButton)},x.action.label):null)};function cx(){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 M2(a,s){const o={};return[a,s].forEach((i,d)=>{const f=d===1,m=f?"--mobile-offset":"--offset",v=f?j2:N2;function g(p){["top","right","bottom","left"].forEach(y=>{o[`${m}-${y}`]=typeof p=="number"?`${p}px`:p})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(p=>{i[p]===void 0?o[`${m}-${p}`]=v:o[`${m}-${p}`]=typeof i[p]=="number"?`${i[p]}px`:i[p]}):g(v)}),o}const A2=se.forwardRef(function(s,o){const{id:i,invert:d,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:v,closeButton:g,className:p,offset:y,mobileOffset:x,theme:N="light",richColors:M,duration:j,style:E,visibleToasts:T=S2,toastOptions:k,dir:A=cx(),gap:V=E2,icons:q,containerAriaLabel:te="Notifications"}=s,[W,z]=se.useState([]),B=se.useMemo(()=>i?W.filter(K=>K.toasterId===i):W.filter(K=>!K.toasterId),[W,i]),re=se.useMemo(()=>Array.from(new Set([f].concat(B.filter(K=>K.position).map(K=>K.position)))),[B,f]),[Ne,oe]=se.useState([]),[he,Ce]=se.useState(!1),[Re,ee]=se.useState(!1),[w,F]=se.useState(N!=="system"?N:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=se.useRef(null),xe=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),ve=se.useRef(null),R=se.useRef(!1),X=se.useCallback(K=>{z(I=>{var le;return(le=I.find($=>$.id===K.id))!=null&&le.delete||Yt.dismiss(K.id),I.filter(({id:$})=>$!==K.id)})},[]);return se.useEffect(()=>Yt.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{z(I=>I.map(le=>le.id===K.id?{...le,delete:!0}:le))});return}setTimeout(()=>{N1.flushSync(()=>{z(I=>{const le=I.findIndex($=>$.id===K.id);return le!==-1?[...I.slice(0,le),{...I[le],...K},...I.slice(le+1)]:[K,...I]})})})}),[W]),se.useEffect(()=>{if(N!=="system"){F(N);return}if(N==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:I})=>{F(I?"dark":"light")})}catch{K.addListener(({matches:le})=>{try{F(le?"dark":"light")}catch($){console.error($)}})}},[N]),se.useEffect(()=>{W.length<=1&&Ce(!1)},[W]),se.useEffect(()=>{const K=I=>{var le;if(m.every(ce=>I[ce]||I.code===ce)){var ie;Ce(!0),(ie=Y.current)==null||ie.focus()}I.code==="Escape"&&(document.activeElement===Y.current||(le=Y.current)!=null&&le.contains(document.activeElement))&&Ce(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[m]),se.useEffect(()=>{if(Y.current)return()=>{ve.current&&(ve.current.focus({preventScroll:!0}),ve.current=null,R.current=!1)}},[Y.current]),se.createElement("section",{ref:o,"aria-label":`${te} ${xe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},re.map((K,I)=>{var le;const[$,ie]=K.split("-");return B.length?se.createElement("ol",{key:K,dir:A==="auto"?cx():A,tabIndex:-1,ref:Y,className:p,"data-sonner-toaster":!0,"data-sonner-theme":w,"data-y-position":$,"data-x-position":ie,style:{"--front-toast-height":`${((le=Ne[0])==null?void 0:le.height)||0}px`,"--width":`${w2}px`,"--gap":`${V}px`,...E,...M2(y,x)},onBlur:ce=>{R.current&&!ce.currentTarget.contains(ce.relatedTarget)&&(R.current=!1,ve.current&&(ve.current.focus({preventScroll:!0}),ve.current=null))},onFocus:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||R.current||(R.current=!0,ve.current=ce.relatedTarget)},onMouseEnter:()=>Ce(!0),onMouseMove:()=>Ce(!0),onMouseLeave:()=>{Re||Ce(!1)},onDragEnd:()=>Ce(!1),onPointerDown:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||ee(!0)},onPointerUp:()=>ee(!1)},B.filter(ce=>!ce.position&&I===0||ce.position===K).map((ce,H)=>{var ne,_e;return se.createElement(_2,{key:ce.id,icons:q,index:H,toast:ce,defaultRichColors:M,duration:(ne=k?.duration)!=null?ne:j,className:k?.className,descriptionClassName:k?.descriptionClassName,invert:d,visibleToasts:T,closeButton:(_e=k?.closeButton)!=null?_e:g,interacting:Re,position:K,style:k?.style,unstyled:k?.unstyled,classNames:k?.classNames,cancelButtonStyle:k?.cancelButtonStyle,actionButtonStyle:k?.actionButtonStyle,closeButtonAriaLabel:k?.closeButtonAriaLabel,removeToast:X,toasts:B.filter(Ae=>Ae.position==ce.position),heights:Ne.filter(Ae=>Ae.position==ce.position),setHeights:oe,expandByDefault:v,gap:V,expanded:he,swipeDirections:s.swipeDirections})})):null}))}),bv=S.createContext(void 0),Sv="jarvis-admin-theme";function k2(){const a=localStorage.getItem(Sv);return a==="light"||a==="dark"?a:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function O2({children:a}){const[s,o]=S.useState(k2);S.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark"),localStorage.setItem(Sv,s)},[s]);const i=S.useCallback(()=>{o(d=>d==="dark"?"light":"dark")},[]);return l.jsx(bv.Provider,{value:{theme:s,toggleTheme:i},children:a})}function z2(){const a=S.useContext(bv);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}function Nv(a,s){return function(){return a.apply(s,arguments)}}const{toString:D2}=Object.prototype,{getPrototypeOf:_d}=Object,{iterator:di,toStringTag:jv}=Symbol,fi=(a=>s=>{const o=D2.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:ds}=Array,ss=mi("undefined");function Sl(a){return a!==null&&!ss(a)&&a.constructor!==null&&!ss(a.constructor)&&Xt(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const wv=Ea("ArrayBuffer");function L2(a){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(a):s=a&&a.buffer&&wv(a.buffer),s}const U2=mi("string"),Xt=mi("function"),Ev=mi("number"),Nl=a=>a!==null&&typeof a=="object",B2=a=>a===!0||a===!1,Io=a=>{if(fi(a)!=="object")return!1;const s=_d(a);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(jv in a)&&!(di in a)},q2=a=>{if(!Nl(a)||Sl(a))return!1;try{return Object.keys(a).length===0&&Object.getPrototypeOf(a)===Object.prototype}catch{return!1}},H2=Ea("Date"),G2=Ea("File"),Q2=Ea("Blob"),V2=Ea("FileList"),F2=a=>Nl(a)&&Xt(a.pipe),Y2=a=>{let s;return a&&(typeof FormData=="function"&&a instanceof FormData||Xt(a.append)&&((s=fi(a))==="formdata"||s==="object"&&Xt(a.toString)&&a.toString()==="[object FormData]"))},X2=Ea("URLSearchParams"),[K2,Z2,$2,J2]=["ReadableStream","Request","Response","Headers"].map(Ea),P2=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function jl(a,s,{allOwnKeys:o=!1}={}){if(a===null||typeof a>"u")return;let i,d;if(typeof a!="object"&&(a=[a]),ds(a))for(i=0,d=a.length;i<d;i++)s.call(null,a[i],i,a);else{if(Sl(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 Tv(a,s){if(Sl(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 lr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Cv=a=>!ss(a)&&a!==lr;function id(){const{caseless:a,skipUndefined:s}=Cv(this)&&this||{},o={},i=(d,f)=>{const m=a&&Tv(o,f)||f;Io(o[m])&&Io(d)?o[m]=id(o[m],d):Io(d)?o[m]=id({},d):ds(d)?o[m]=d.slice():(!s||!ss(d))&&(o[m]=d)};for(let d=0,f=arguments.length;d<f;d++)arguments[d]&&jl(arguments[d],i);return o}const I2=(a,s,o,{allOwnKeys:i}={})=>(jl(s,(d,f)=>{o&&Xt(d)?Object.defineProperty(a,f,{value:Nv(d,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(a,f,{value:d,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),a),W2=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),eS=(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)},tS=(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&&_d(a)}while(a&&(!o||o(a,s))&&a!==Object.prototype);return s},aS=(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},nS=a=>{if(!a)return null;if(ds(a))return a;let s=a.length;if(!Ev(s))return null;const o=new Array(s);for(;s-- >0;)o[s]=a[s];return o},rS=(a=>s=>a&&s instanceof a)(typeof Uint8Array<"u"&&_d(Uint8Array)),sS=(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])}},lS=(a,s)=>{let o;const i=[];for(;(o=a.exec(s))!==null;)i.push(o);return i},oS=Ea("HTMLFormElement"),iS=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,i,d){return i.toUpperCase()+d}),ux=(({hasOwnProperty:a})=>(s,o)=>a.call(s,o))(Object.prototype),cS=Ea("RegExp"),Rv=(a,s)=>{const o=Object.getOwnPropertyDescriptors(a),i={};jl(o,(d,f)=>{let m;(m=s(d,f,a))!==!1&&(i[f]=m||d)}),Object.defineProperties(a,i)},uS=a=>{Rv(a,(s,o)=>{if(Xt(a)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const i=a[o];if(Xt(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+"'")})}})},dS=(a,s)=>{const o={},i=d=>{d.forEach(f=>{o[f]=!0})};return ds(a)?i(a):i(String(a).split(s)),o},fS=()=>{},mS=(a,s)=>a!=null&&Number.isFinite(a=+a)?a:s;function hS(a){return!!(a&&Xt(a.append)&&a[jv]==="FormData"&&a[di])}const pS=a=>{const s=new Array(10),o=(i,d)=>{if(Nl(i)){if(s.indexOf(i)>=0)return;if(Sl(i))return i;if(!("toJSON"in i)){s[d]=i;const f=ds(i)?[]:{};return jl(i,(m,v)=>{const g=o(m,d+1);!ss(g)&&(f[v]=g)}),s[d]=void 0,f}}return i};return o(a,0)},xS=Ea("AsyncFunction"),vS=a=>a&&(Nl(a)||Xt(a))&&Xt(a.then)&&Xt(a.catch),_v=((a,s)=>a?setImmediate:s?((o,i)=>(lr.addEventListener("message",({source:d,data:f})=>{d===lr&&f===o&&i.length&&i.shift()()},!1),d=>{i.push(d),lr.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",Xt(lr.postMessage)),gS=typeof queueMicrotask<"u"?queueMicrotask.bind(lr):typeof process<"u"&&process.nextTick||_v,yS=a=>a!=null&&Xt(a[di]),Q={isArray:ds,isArrayBuffer:wv,isBuffer:Sl,isFormData:Y2,isArrayBufferView:L2,isString:U2,isNumber:Ev,isBoolean:B2,isObject:Nl,isPlainObject:Io,isEmptyObject:q2,isReadableStream:K2,isRequest:Z2,isResponse:$2,isHeaders:J2,isUndefined:ss,isDate:H2,isFile:G2,isBlob:Q2,isRegExp:cS,isFunction:Xt,isStream:F2,isURLSearchParams:X2,isTypedArray:rS,isFileList:V2,forEach:jl,merge:id,extend:I2,trim:P2,stripBOM:W2,inherits:eS,toFlatObject:tS,kindOf:fi,kindOfTest:Ea,endsWith:aS,toArray:nS,forEachEntry:sS,matchAll:lS,isHTMLForm:oS,hasOwnProperty:ux,hasOwnProp:ux,reduceDescriptors:Rv,freezeMethods:uS,toObjectSet:dS,toCamelCase:iS,noop:fS,toFiniteNumber:mS,findKey:Tv,global:lr,isContextDefined:Cv,isSpecCompliantForm:hS,toJSONObject:pS,isAsyncFn:xS,isThenable:vS,setImmediate:_v,asap:gS,isIterable:yS};let be=class Mv extends Error{static from(s,o,i,d,f,m){const v=new Mv(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:Q.toJSONObject(this.config),code:this.code,status:this.status}}};be.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";be.ERR_BAD_OPTION="ERR_BAD_OPTION";be.ECONNABORTED="ECONNABORTED";be.ETIMEDOUT="ETIMEDOUT";be.ERR_NETWORK="ERR_NETWORK";be.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";be.ERR_DEPRECATED="ERR_DEPRECATED";be.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";be.ERR_BAD_REQUEST="ERR_BAD_REQUEST";be.ERR_CANCELED="ERR_CANCELED";be.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";be.ERR_INVALID_URL="ERR_INVALID_URL";const bS=null;function cd(a){return Q.isPlainObject(a)||Q.isArray(a)}function Av(a){return Q.endsWith(a,"[]")?a.slice(0,-2):a}function dx(a,s,o){return a?a.concat(s).map(function(d,f){return d=Av(d),!o&&f?"["+d+"]":d}).join(o?".":""):s}function SS(a){return Q.isArray(a)&&!a.some(cd)}const NS=Q.toFlatObject(Q,{},null,function(s){return/^is[A-Z]/.test(s)});function hi(a,s,o){if(!Q.isObject(a))throw new TypeError("target must be an object");s=s||new FormData,o=Q.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,T){return!Q.isUndefined(T[E])});const i=o.metaTokens,d=o.visitor||y,f=o.dots,m=o.indexes,g=(o.Blob||typeof Blob<"u"&&Blob)&&Q.isSpecCompliantForm(s);if(!Q.isFunction(d))throw new TypeError("visitor must be a function");function p(j){if(j===null)return"";if(Q.isDate(j))return j.toISOString();if(Q.isBoolean(j))return j.toString();if(!g&&Q.isBlob(j))throw new be("Blob is not supported. Use a Buffer instead.");return Q.isArrayBuffer(j)||Q.isTypedArray(j)?g&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function y(j,E,T){let k=j;if(j&&!T&&typeof j=="object"){if(Q.endsWith(E,"{}"))E=i?E:E.slice(0,-2),j=JSON.stringify(j);else if(Q.isArray(j)&&SS(j)||(Q.isFileList(j)||Q.endsWith(E,"[]"))&&(k=Q.toArray(j)))return E=Av(E),k.forEach(function(V,q){!(Q.isUndefined(V)||V===null)&&s.append(m===!0?dx([E],q,f):m===null?E:E+"[]",p(V))}),!1}return cd(j)?!0:(s.append(dx(T,E,f),p(j)),!1)}const x=[],N=Object.assign(NS,{defaultVisitor:y,convertValue:p,isVisitable:cd});function M(j,E){if(!Q.isUndefined(j)){if(x.indexOf(j)!==-1)throw Error("Circular reference detected in "+E.join("."));x.push(j),Q.forEach(j,function(k,A){(!(Q.isUndefined(k)||k===null)&&d.call(s,k,Q.isString(A)?A.trim():A,E,N))===!0&&M(k,E?E.concat(A):[A])}),x.pop()}}if(!Q.isObject(a))throw new TypeError("data must be an object");return M(a),s}function fx(a){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Md(a,s){this._pairs=[],a&&hi(a,this,s)}const kv=Md.prototype;kv.append=function(s,o){this._pairs.push([s,o])};kv.toString=function(s){const o=s?function(i){return s.call(this,i,fx)}:fx;return this._pairs.map(function(d){return o(d[0])+"="+o(d[1])},"").join("&")};function jS(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ov(a,s,o){if(!s)return a;const i=o&&o.encode||jS,d=Q.isFunction(o)?{serialize:o}:o,f=d&&d.serialize;let m;if(f?m=f(s,d):m=Q.isURLSearchParams(s)?s.toString():new Md(s,d).toString(i),m){const v=a.indexOf("#");v!==-1&&(a=a.slice(0,v)),a+=(a.indexOf("?")===-1?"?":"&")+m}return a}class mx{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){Q.forEach(this.handlers,function(i){i!==null&&s(i)})}}const zv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wS=typeof URLSearchParams<"u"?URLSearchParams:Md,ES=typeof FormData<"u"?FormData:null,TS=typeof Blob<"u"?Blob:null,CS={isBrowser:!0,classes:{URLSearchParams:wS,FormData:ES,Blob:TS},protocols:["http","https","file","blob","url","data"]},Ad=typeof window<"u"&&typeof document<"u",ud=typeof navigator=="object"&&navigator||void 0,RS=Ad&&(!ud||["ReactNative","NativeScript","NS"].indexOf(ud.product)<0),_S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",MS=Ad&&window.location.href||"http://localhost",AS=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ad,hasStandardBrowserEnv:RS,hasStandardBrowserWebWorkerEnv:_S,navigator:ud,origin:MS},Symbol.toStringTag,{value:"Module"})),Rt={...AS,...CS};function kS(a,s){return hi(a,new Rt.classes.URLSearchParams,{visitor:function(o,i,d,f){return Rt.isNode&&Q.isBuffer(o)?(this.append(i,o.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...s})}function OS(a){return Q.matchAll(/\w+|\[(\w*)]/g,a).map(s=>s[0]==="[]"?"":s[1]||s[0])}function zS(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 Dv(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&&Q.isArray(d)?d.length:m,g?(Q.hasOwnProp(d,m)?d[m]=[d[m],i]:d[m]=i,!v):((!d[m]||!Q.isObject(d[m]))&&(d[m]=[]),s(o,i,d[m],f)&&Q.isArray(d[m])&&(d[m]=zS(d[m])),!v)}if(Q.isFormData(a)&&Q.isFunction(a.entries)){const o={};return Q.forEachEntry(a,(i,d)=>{s(OS(i),d,o,0)}),o}return null}function DS(a,s,o){if(Q.isString(a))try{return(s||JSON.parse)(a),Q.trim(a)}catch(i){if(i.name!=="SyntaxError")throw i}return(o||JSON.stringify)(a)}const wl={transitional:zv,adapter:["xhr","http","fetch"],transformRequest:[function(s,o){const i=o.getContentType()||"",d=i.indexOf("application/json")>-1,f=Q.isObject(s);if(f&&Q.isHTMLForm(s)&&(s=new FormData(s)),Q.isFormData(s))return d?JSON.stringify(Dv(s)):s;if(Q.isArrayBuffer(s)||Q.isBuffer(s)||Q.isStream(s)||Q.isFile(s)||Q.isBlob(s)||Q.isReadableStream(s))return s;if(Q.isArrayBufferView(s))return s.buffer;if(Q.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 kS(s,this.formSerializer).toString();if((v=Q.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),DS(s)):s}],transformResponse:[function(s){const o=this.transitional||wl.transitional,i=o&&o.forcedJSONParsing,d=this.responseType==="json";if(Q.isResponse(s)||Q.isReadableStream(s))return s;if(s&&Q.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"?be.from(v,be.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:Rt.classes.FormData,Blob:Rt.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Q.forEach(["delete","get","head","post","put","patch"],a=>{wl.headers[a]={}});const LS=Q.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"]),US=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]&&LS[o])&&(o==="set-cookie"?s[o]?s[o].push(i):s[o]=[i]:s[o]=s[o]?s[o]+", "+i:i)}),s},hx=Symbol("internals");function dl(a){return a&&String(a).trim().toLowerCase()}function Wo(a){return a===!1||a==null?a:Q.isArray(a)?a.map(Wo):String(a)}function BS(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 qS=a=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(a.trim());function Gu(a,s,o,i,d){if(Q.isFunction(i))return i.call(this,s,o);if(d&&(s=o),!!Q.isString(s)){if(Q.isString(i))return s.indexOf(i)!==-1;if(Q.isRegExp(i))return i.test(s)}}function HS(a){return a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,o,i)=>o.toUpperCase()+i)}function GS(a,s){const o=Q.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 Kt=class{constructor(s){s&&this.set(s)}set(s,o,i){const d=this;function f(v,g,p){const y=dl(g);if(!y)throw new Error("header name must be a non-empty string");const x=Q.findKey(d,y);(!x||d[x]===void 0||p===!0||p===void 0&&d[x]!==!1)&&(d[x||g]=Wo(v))}const m=(v,g)=>Q.forEach(v,(p,y)=>f(p,y,g));if(Q.isPlainObject(s)||s instanceof this.constructor)m(s,o);else if(Q.isString(s)&&(s=s.trim())&&!qS(s))m(US(s),o);else if(Q.isObject(s)&&Q.isIterable(s)){let v={},g,p;for(const y of s){if(!Q.isArray(y))throw TypeError("Object iterator must return a key-value pair");v[p=y[0]]=(g=v[p])?Q.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=dl(s),s){const i=Q.findKey(this,s);if(i){const d=this[i];if(!o)return d;if(o===!0)return BS(d);if(Q.isFunction(o))return o.call(this,d,i);if(Q.isRegExp(o))return o.exec(d);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,o){if(s=dl(s),s){const i=Q.findKey(this,s);return!!(i&&this[i]!==void 0&&(!o||Gu(this,this[i],i,o)))}return!1}delete(s,o){const i=this;let d=!1;function f(m){if(m=dl(m),m){const v=Q.findKey(i,m);v&&(!o||Gu(i,i[v],v,o))&&(delete i[v],d=!0)}}return Q.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||Gu(this,this[f],f,s,!0))&&(delete this[f],d=!0)}return d}normalize(s){const o=this,i={};return Q.forEach(this,(d,f)=>{const m=Q.findKey(i,f);if(m){o[m]=Wo(d),delete o[f];return}const v=s?HS(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 Q.forEach(this,(i,d)=>{i!=null&&i!==!1&&(o[d]=s&&Q.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[hx]=this[hx]={accessors:{}}).accessors,d=this.prototype;function f(m){const v=dl(m);i[v]||(GS(d,m),i[v]=!0)}return Q.isArray(s)?s.forEach(f):f(s),this}};Kt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Q.reduceDescriptors(Kt.prototype,({value:a},s)=>{let o=s[0].toUpperCase()+s.slice(1);return{get:()=>a,set(i){this[o]=i}}});Q.freezeMethods(Kt);function Qu(a,s){const o=this||wl,i=s||o,d=Kt.from(i.headers);let f=i.data;return Q.forEach(a,function(v){f=v.call(o,f,d.normalize(),s?s.status:void 0)}),d.normalize(),f}function Lv(a){return!!(a&&a.__CANCEL__)}let El=class extends be{constructor(s,o,i){super(s??"canceled",be.ERR_CANCELED,o,i),this.name="CanceledError",this.__CANCEL__=!0}};function Uv(a,s,o){const i=o.config.validateStatus;!o.status||!i||i(o.status)?a(o):s(new be("Request failed with status code "+o.status,[be.ERR_BAD_REQUEST,be.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function QS(a){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return s&&s[1]||""}function VS(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 p=Date.now(),y=i[f];m||(m=p),o[d]=g,i[d]=p;let x=f,N=0;for(;x!==d;)N+=o[x++],x=x%a;if(d=(d+1)%a,d===f&&(f=(f+1)%a),p-m<s)return;const M=y&&p-y;return M?Math.round(N*1e3/M):void 0}}function FS(a,s){let o=0,i=1e3/s,d,f;const m=(p,y=Date.now())=>{o=y,d=null,f&&(clearTimeout(f),f=null),a(...p)};return[(...p)=>{const y=Date.now(),x=y-o;x>=i?m(p,y):(d=p,f||(f=setTimeout(()=>{f=null,m(d)},i-x)))},()=>d&&m(d)]}const li=(a,s,o=3)=>{let i=0;const d=VS(50,250);return FS(f=>{const m=f.loaded,v=f.lengthComputable?f.total:void 0,g=m-i,p=d(g),y=m<=v;i=m;const x={loaded:m,total:v,progress:v?m/v:void 0,bytes:g,rate:p||void 0,estimated:p&&v&&y?(v-m)/p:void 0,event:f,lengthComputable:v!=null,[s?"download":"upload"]:!0};a(x)},o)},px=(a,s)=>{const o=a!=null;return[i=>s[0]({lengthComputable:o,total:a,loaded:i}),s[1]]},xx=a=>(...s)=>Q.asap(()=>a(...s)),YS=Rt.hasStandardBrowserEnv?((a,s)=>o=>(o=new URL(o,Rt.origin),a.protocol===o.protocol&&a.host===o.host&&(s||a.port===o.port)))(new URL(Rt.origin),Rt.navigator&&/(msie|trident)/i.test(Rt.navigator.userAgent)):()=>!0,XS=Rt.hasStandardBrowserEnv?{write(a,s,o,i,d,f,m){if(typeof document>"u")return;const v=[`${a}=${encodeURIComponent(s)}`];Q.isNumber(o)&&v.push(`expires=${new Date(o).toUTCString()}`),Q.isString(i)&&v.push(`path=${i}`),Q.isString(d)&&v.push(`domain=${d}`),f===!0&&v.push("secure"),Q.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 KS(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function ZS(a,s){return s?a.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):a}function Bv(a,s,o){let i=!KS(s);return a&&(i||o==!1)?ZS(a,s):s}const vx=a=>a instanceof Kt?{...a}:a;function ur(a,s){s=s||{};const o={};function i(p,y,x,N){return Q.isPlainObject(p)&&Q.isPlainObject(y)?Q.merge.call({caseless:N},p,y):Q.isPlainObject(y)?Q.merge({},y):Q.isArray(y)?y.slice():y}function d(p,y,x,N){if(Q.isUndefined(y)){if(!Q.isUndefined(p))return i(void 0,p,x,N)}else return i(p,y,x,N)}function f(p,y){if(!Q.isUndefined(y))return i(void 0,y)}function m(p,y){if(Q.isUndefined(y)){if(!Q.isUndefined(p))return i(void 0,p)}else return i(void 0,y)}function v(p,y,x){if(x in s)return i(p,y);if(x in a)return i(void 0,p)}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:(p,y,x)=>d(vx(p),vx(y),x,!0)};return Q.forEach(Object.keys({...a,...s}),function(y){const x=g[y]||d,N=x(a[y],s[y],y);Q.isUndefined(N)&&x!==v||(o[y]=N)}),o}const qv=a=>{const s=ur({},a);let{data:o,withXSRFToken:i,xsrfHeaderName:d,xsrfCookieName:f,headers:m,auth:v}=s;if(s.headers=m=Kt.from(m),s.url=Ov(Bv(s.baseURL,s.url,s.allowAbsoluteUrls),a.params,a.paramsSerializer),v&&m.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):""))),Q.isFormData(o)){if(Rt.hasStandardBrowserEnv||Rt.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(Q.isFunction(o.getHeaders)){const g=o.getHeaders(),p=["content-type","content-length"];Object.entries(g).forEach(([y,x])=>{p.includes(y.toLowerCase())&&m.set(y,x)})}}if(Rt.hasStandardBrowserEnv&&(i&&Q.isFunction(i)&&(i=i(s)),i||i!==!1&&YS(s.url))){const g=d&&f&&XS.read(f);g&&m.set(d,g)}return s},$S=typeof XMLHttpRequest<"u",JS=$S&&function(a){return new Promise(function(o,i){const d=qv(a);let f=d.data;const m=Kt.from(d.headers).normalize();let{responseType:v,onUploadProgress:g,onDownloadProgress:p}=d,y,x,N,M,j;function E(){M&&M(),j&&j(),d.cancelToken&&d.cancelToken.unsubscribe(y),d.signal&&d.signal.removeEventListener("abort",y)}let T=new XMLHttpRequest;T.open(d.method.toUpperCase(),d.url,!0),T.timeout=d.timeout;function k(){if(!T)return;const V=Kt.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),te={data:!v||v==="text"||v==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:V,config:a,request:T};Uv(function(z){o(z),E()},function(z){i(z),E()},te),T=null}"onloadend"in T?T.onloadend=k:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(k)},T.onabort=function(){T&&(i(new be("Request aborted",be.ECONNABORTED,a,T)),T=null)},T.onerror=function(q){const te=q&&q.message?q.message:"Network Error",W=new be(te,be.ERR_NETWORK,a,T);W.event=q||null,i(W),T=null},T.ontimeout=function(){let q=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded";const te=d.transitional||zv;d.timeoutErrorMessage&&(q=d.timeoutErrorMessage),i(new be(q,te.clarifyTimeoutError?be.ETIMEDOUT:be.ECONNABORTED,a,T)),T=null},f===void 0&&m.setContentType(null),"setRequestHeader"in T&&Q.forEach(m.toJSON(),function(q,te){T.setRequestHeader(te,q)}),Q.isUndefined(d.withCredentials)||(T.withCredentials=!!d.withCredentials),v&&v!=="json"&&(T.responseType=d.responseType),p&&([N,j]=li(p,!0),T.addEventListener("progress",N)),g&&T.upload&&([x,M]=li(g),T.upload.addEventListener("progress",x),T.upload.addEventListener("loadend",M)),(d.cancelToken||d.signal)&&(y=V=>{T&&(i(!V||V.type?new El(null,a,T):V),T.abort(),T=null)},d.cancelToken&&d.cancelToken.subscribe(y),d.signal&&(d.signal.aborted?y():d.signal.addEventListener("abort",y)));const A=QS(d.url);if(A&&Rt.protocols.indexOf(A)===-1){i(new be("Unsupported protocol "+A+":",be.ERR_BAD_REQUEST,a));return}T.send(f||null)})},PS=(a,s)=>{const{length:o}=a=a?a.filter(Boolean):[];if(s||o){let i=new AbortController,d;const f=function(p){if(!d){d=!0,v();const y=p instanceof Error?p:this.reason;i.abort(y instanceof be?y:new El(y instanceof Error?y.message:y))}};let m=s&&setTimeout(()=>{m=null,f(new be(`timeout of ${s}ms exceeded`,be.ETIMEDOUT))},s);const v=()=>{a&&(m&&clearTimeout(m),m=null,a.forEach(p=>{p.unsubscribe?p.unsubscribe(f):p.removeEventListener("abort",f)}),a=null)};a.forEach(p=>p.addEventListener("abort",f));const{signal:g}=i;return g.unsubscribe=()=>Q.asap(v),g}},IS=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},WS=async function*(a,s){for await(const o of eN(a))yield*IS(o,s)},eN=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()}},gx=(a,s,o,i)=>{const d=WS(a,s);let f=0,m,v=g=>{m||(m=!0,i&&i(g))};return new ReadableStream({async pull(g){try{const{done:p,value:y}=await d.next();if(p){v(),g.close();return}let x=y.byteLength;if(o){let N=f+=x;o(N)}g.enqueue(new Uint8Array(y))}catch(p){throw v(p),p}},cancel(g){return v(g),d.return()}},{highWaterMark:2})},yx=64*1024,{isFunction:Fo}=Q,tN=(({Request:a,Response:s})=>({Request:a,Response:s}))(Q.global),{ReadableStream:bx,TextEncoder:Sx}=Q.global,Nx=(a,...s)=>{try{return!!a(...s)}catch{return!1}},aN=a=>{a=Q.merge.call({skipUndefined:!0},tN,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(bx),g=d&&(typeof Sx=="function"?(j=>E=>j.encode(E))(new Sx):async j=>new Uint8Array(await new o(j).arrayBuffer())),p=f&&v&&Nx(()=>{let j=!1;const E=new o(Rt.origin,{body:new bx,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!E}),y=m&&v&&Nx(()=>Q.isReadableStream(new i("").body)),x={stream:y&&(j=>j.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!x[j]&&(x[j]=(E,T)=>{let k=E&&E[j];if(k)return k.call(E);throw new be(`Response type '${j}' is not supported`,be.ERR_NOT_SUPPORT,T)})});const N=async j=>{if(j==null)return 0;if(Q.isBlob(j))return j.size;if(Q.isSpecCompliantForm(j))return(await new o(Rt.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(Q.isArrayBufferView(j)||Q.isArrayBuffer(j))return j.byteLength;if(Q.isURLSearchParams(j)&&(j=j+""),Q.isString(j))return(await g(j)).byteLength},M=async(j,E)=>{const T=Q.toFiniteNumber(j.getContentLength());return T??N(E)};return async j=>{let{url:E,method:T,data:k,signal:A,cancelToken:V,timeout:q,onDownloadProgress:te,onUploadProgress:W,responseType:z,headers:B,withCredentials:re="same-origin",fetchOptions:Ne}=qv(j),oe=s||fetch;z=z?(z+"").toLowerCase():"text";let he=PS([A,V&&V.toAbortSignal()],q),Ce=null;const Re=he&&he.unsubscribe&&(()=>{he.unsubscribe()});let ee;try{if(W&&p&&T!=="get"&&T!=="head"&&(ee=await M(B,k))!==0){let R=new o(E,{method:"POST",body:k,duplex:"half"}),X;if(Q.isFormData(k)&&(X=R.headers.get("content-type"))&&B.setContentType(X),R.body){const[K,I]=px(ee,li(xx(W)));k=gx(R.body,yx,K,I)}}Q.isString(re)||(re=re?"include":"omit");const w=f&&"credentials"in o.prototype,F={...Ne,signal:he,method:T.toUpperCase(),headers:B.normalize().toJSON(),body:k,duplex:"half",credentials:w?re:void 0};Ce=f&&new o(E,F);let Y=await(f?oe(Ce,Ne):oe(E,F));const xe=y&&(z==="stream"||z==="response");if(y&&(te||xe&&Re)){const R={};["status","statusText","headers"].forEach(le=>{R[le]=Y[le]});const X=Q.toFiniteNumber(Y.headers.get("content-length")),[K,I]=te&&px(X,li(xx(te),!0))||[];Y=new i(gx(Y.body,yx,K,()=>{I&&I(),Re&&Re()}),R)}z=z||"text";let ve=await x[Q.findKey(x,z)||"text"](Y,j);return!xe&&Re&&Re(),await new Promise((R,X)=>{Uv(R,X,{data:ve,headers:Kt.from(Y.headers),status:Y.status,statusText:Y.statusText,config:j,request:Ce})})}catch(w){throw Re&&Re(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new be("Network Error",be.ERR_NETWORK,j,Ce),{cause:w.cause||w}):be.from(w,w&&w.code,j,Ce)}}},nN=new Map,Hv=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,p,y=nN;for(;v--;)g=f[v],p=y.get(g),p===void 0&&y.set(g,p=v?new Map:aN(s)),y=p;return p};Hv();const kd={http:bS,xhr:JS,fetch:{get:Hv}};Q.forEach(kd,(a,s)=>{if(a){try{Object.defineProperty(a,"name",{value:s})}catch{}Object.defineProperty(a,"adapterName",{value:s})}});const jx=a=>`- ${a}`,rN=a=>Q.isFunction(a)||a===null||a===!1;function sN(a,s){a=Q.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,!rN(i)&&(d=kd[(v=String(i)).toLowerCase()],d===void 0))throw new be(`Unknown adapter '${v}'`);if(d&&(Q.isFunction(d)||(d=d.get(s))))break;f[v||"#"+m]=d}if(!d){const m=Object.entries(f).map(([g,p])=>`adapter ${g} `+(p===!1?"is not supported by the environment":"is not available in the build"));let v=o?m.length>1?`since :
14
+ `+m.map(jx).join(`
15
+ `):" "+jx(m[0]):"as no adapter specified";throw new be("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return d}const Gv={getAdapter:sN,adapters:kd};function Vu(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new El(null,a)}function wx(a){return Vu(a),a.headers=Kt.from(a.headers),a.data=Qu.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),Gv.getAdapter(a.adapter||wl.adapter,a)(a).then(function(i){return Vu(a),i.data=Qu.call(a,a.transformResponse,i),i.headers=Kt.from(i.headers),i},function(i){return Lv(i)||(Vu(a),i&&i.response&&(i.response.data=Qu.call(a,a.transformResponse,i.response),i.response.headers=Kt.from(i.response.headers))),Promise.reject(i)})}const Qv="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 Ex={};pi.transitional=function(s,o,i){function d(f,m){return"[Axios v"+Qv+"] Transitional option '"+f+"'"+m+(i?". "+i:"")}return(f,m,v)=>{if(s===!1)throw new be(d(m," has been removed"+(o?" in "+o:"")),be.ERR_DEPRECATED);return o&&!Ex[m]&&(Ex[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 lN(a,s,o){if(typeof a!="object")throw new be("options must be an object",be.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 be("option "+f+" must be "+g,be.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new be("Unknown option "+f,be.ERR_BAD_OPTION)}}const ei={assertOptions:lN,validators:pi},Oa=ei.validators;let or=class{constructor(s){this.defaults=s||{},this.interceptors={request:new mx,response:new mx}}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=ur(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&&(Q.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&&Q.merge(f.common,f[o.method]);f&&Q.forEach(["delete","get","head","post","put","patch","common"],j=>{delete f[j]}),o.headers=Kt.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 p=[];this.interceptors.response.forEach(function(E){p.push(E.fulfilled,E.rejected)});let y,x=0,N;if(!g){const j=[wx.bind(this),void 0];for(j.unshift(...v),j.push(...p),N=j.length,y=Promise.resolve(o);x<N;)y=y.then(j[x++],j[x++]);return y}N=v.length;let M=o;for(;x<N;){const j=v[x++],E=v[x++];try{M=j(M)}catch(T){E.call(this,T);break}}try{y=wx.call(this,M)}catch(j){return Promise.reject(j)}for(x=0,N=p.length;x<N;)y=y.then(p[x++],p[x++]);return y}getUri(s){s=ur(this.defaults,s);const o=Bv(s.baseURL,s.url,s.allowAbsoluteUrls);return Ov(o,s.params,s.paramsSerializer)}};Q.forEach(["delete","get","head","options"],function(s){or.prototype[s]=function(o,i){return this.request(ur(i||{},{method:s,url:o,data:(i||{}).data}))}});Q.forEach(["post","put","patch"],function(s){function o(i){return function(f,m,v){return this.request(ur(v||{},{method:s,headers:i?{"Content-Type":"multipart/form-data"}:{},url:f,data:m}))}}or.prototype[s]=o(),or.prototype[s+"Form"]=o(!0)});let oN=class Vv{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 Vv(function(d){s=d}),cancel:s}}};function iN(a){return function(o){return a.apply(null,o)}}function cN(a){return Q.isObject(a)&&a.isAxiosError===!0}const dd={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(dd).forEach(([a,s])=>{dd[s]=a});function Fv(a){const s=new or(a),o=Nv(or.prototype.request,s);return Q.extend(o,or.prototype,s,{allOwnKeys:!0}),Q.extend(o,s,null,{allOwnKeys:!0}),o.create=function(d){return Fv(ur(a,d))},o}const nt=Fv(wl);nt.Axios=or;nt.CanceledError=El;nt.CancelToken=oN;nt.isCancel=Lv;nt.VERSION=Qv;nt.toFormData=hi;nt.AxiosError=be;nt.Cancel=nt.CanceledError;nt.all=function(s){return Promise.all(s)};nt.spread=iN;nt.isAxiosError=cN;nt.mergeConfig=ur;nt.AxiosHeaders=Kt;nt.formToJSON=a=>Dv(Q.isHTMLForm(a)?new FormData(a):a);nt.getAdapter=Gv.getAdapter;nt.HttpStatusCode=dd;nt.default=nt;const{Axios:H3,AxiosError:G3,CanceledError:Q3,isCancel:V3,CancelToken:F3,VERSION:Y3,all:X3,Cancel:K3,isAxiosError:Z3,spread:$3,toFormData:J3,AxiosHeaders:P3,HttpStatusCode:I3,formToJSON:W3,getAdapter:e4,mergeConfig:t4}=nt,ye=nt.create({baseURL:""});function ns(a){a?ye.defaults.headers.common.Authorization=`Bearer ${a}`:delete ye.defaults.headers.common.Authorization}let fd=null;function uN(a){fd=a}let Yv=null;function dN(a){Yv=a}ye.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});ye.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&&fd){s._retry=!0;const o=await fd();if(o)return s.headers.Authorization=`Bearer ${o}`,ye(s);Yv?.()}return Promise.reject(a)});async function fN(){const{data:a}=await ye.get("/api/auth/setup-status");return a}async function Xv(a,s,o){const{data:i}=await ye.post("/api/auth/setup",{email:a,password:s,username:o});return i}async function mN(a,s){const{data:o}=await ye.post("/api/auth/login",{email:a,password:s});return o}async function hN(a){const{data:s}=await ye.post("/api/auth/refresh",{refresh_token:a});return s}const Kv=S.createContext(void 0),fl="jarvis-admin:access_token",es="jarvis-admin:refresh_token",Yo="jarvis-admin:user",pN=600*1e3;function xN({children:a}){const[s,o]=S.useState(()=>{const g=localStorage.getItem(fl),p=localStorage.getItem(es),y=localStorage.getItem(Yo);if(g&&p&&y)try{const x=JSON.parse(y);return ns(g),{user:x,accessToken:g,refreshToken:p,isAuthenticated:!0,isLoading:!1,error:null}}catch{}return{user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null}}),i=S.useCallback(()=>{localStorage.removeItem(fl),localStorage.removeItem(es),localStorage.removeItem(Yo),ns(null),o({user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null})},[]),d=S.useCallback(async()=>{const g=localStorage.getItem(es);if(!g)return null;try{const p=await hN(g),y=p.access_token,x=p.refresh_token??g;return localStorage.setItem(fl,y),localStorage.setItem(es,x),ns(y),o(N=>({...N,accessToken:y,refreshToken:x})),y}catch{return i(),null}},[i]);S.useEffect(()=>{uN(d),dN(i)},[d,i]),S.useEffect(()=>{if(!s.isAuthenticated)return;const g=setInterval(()=>{d()},pN);return()=>clearInterval(g)},[s.isAuthenticated,d]);const f=S.useCallback(async(g,p)=>{o(y=>({...y,error:null,isLoading:!0}));try{const y=await mN(g,p);if(!y.user.is_superuser){o(x=>({...x,isLoading:!1,error:"Admin access required. This account is not a superuser."}));return}localStorage.setItem(fl,y.access_token),localStorage.setItem(es,y.refresh_token),localStorage.setItem(Yo,JSON.stringify(y.user)),ns(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(N=>({...N,isLoading:!1,error:x}))}},[]),m=S.useCallback(async(g,p,y)=>{o(x=>({...x,error:null,isLoading:!0}));try{const x=await Xv(g,p,y);localStorage.setItem(fl,x.access_token),localStorage.setItem(es,x.refresh_token),localStorage.setItem(Yo,JSON.stringify(x.user)),ns(x.access_token),o({user:x.user,accessToken:x.access_token,refreshToken:x.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(x){const N=x?.response?.data?.detail??"Setup failed";o(M=>({...M,isLoading:!1,error:N}))}},[]),v=S.useMemo(()=>({state:s,login:f,setup:m,logout:i}),[s,f,m,i]);return l.jsx(Kv.Provider,{value:v,children:a})}function Od(){const a=S.useContext(Kv);if(!a)throw new Error("useAuth must be used within AuthProvider");return a}const Zv=(...a)=>a.filter((s,o,i)=>!!s&&s.trim()!==""&&i.indexOf(s)===o).join(" ").trim();const vN=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const gN=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,o,i)=>i?i.toUpperCase():o.toLowerCase());const Tx=a=>{const s=gN(a);return s.charAt(0).toUpperCase()+s.slice(1)};var yN={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 bN=a=>{for(const s in a)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1};const SN=S.forwardRef(({color:a="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:d="",children:f,iconNode:m,...v},g)=>S.createElement("svg",{ref:g,...yN,width:s,height:s,stroke:a,strokeWidth:i?Number(o)*24/Number(s):o,className:Zv("lucide",d),...!f&&!bN(v)&&{"aria-hidden":"true"},...v},[...m.map(([p,y])=>S.createElement(p,y)),...Array.isArray(f)?f:[f]]));const Se=(a,s)=>{const o=S.forwardRef(({className:i,...d},f)=>S.createElement(SN,{ref:f,iconNode:s,className:Zv(`lucide-${vN(Tx(a))}`,`lucide-${a}`,i),...d}));return o.displayName=Tx(a),o};const NN=[["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"}]],jN=Se("activity",NN);const wN=[["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"}]],EN=Se("box",wN);const TN=[["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"}]],CN=Se("boxes",TN);const RN=[["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"}]],md=Se("brain",RN);const _N=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xi=Se("check",_N);const MN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zd=Se("chevron-down",MN);const AN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$v=Se("chevron-right",AN);const kN=[["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"}]],Dd=Se("circle-alert",kN);const ON=[["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"}]],Jv=Se("circle-arrow-up",ON);const zN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],DN=Se("circle-check-big",zN);const LN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xt=Se("circle-check",LN);const UN=[["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"}]],pl=Se("circle-x",UN);const BN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ls=Se("circle",BN);const qN=[["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"}]],Pv=Se("copy",qN);const HN=[["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"}]],kn=Se("cpu",HN);const GN=[["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"}]],QN=Se("database",GN);const VN=[["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"}]],xl=Se("download",VN);const FN=[["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"}]],YN=Se("external-link",FN);const XN=[["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"}]],Iv=Se("file-text",XN);const KN=[["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"}]],Wv=Se("git-merge",KN);const ZN=[["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"}]],$N=Se("globe",ZN);const JN=[["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"}]],Ld=Se("hard-drive",JN);const PN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],IN=Se("info",PN);const WN=[["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"}]],ej=Se("key",WN);const tj=[["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"}]],aj=Se("layout-dashboard",tj);const nj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aa=Se("loader-circle",nj);const rj=[["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"}]],Ud=Se("lock",rj);const sj=[["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"}]],lj=Se("log-out",sj);const oj=[["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"}]],ij=Se("monitor",oj);const cj=[["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"}]],uj=Se("moon",cj);const dj=[["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"}]],fj=Se("pencil",dj);const mj=[["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"}]],eg=Se("play",mj);const hj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ti=Se("plus",hj);const pj=[["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"}]],_t=Se("refresh-cw",pj);const xj=[["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"}]],vi=Se("rotate-ccw",xj);const vj=[["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"}]],Bd=Se("rotate-cw",vj);const gj=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yj=Se("search",gj);const bj=[["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=Se("server",bj);const Sj=[["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"}]],tg=Se("settings",Sj);const Nj=[["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"}]],jj=Se("sparkles",Nj);const wj=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ej=Se("square",wj);const Tj=[["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"}]],Cj=Se("sun",Tj);const Rj=[["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"}]],gi=Se("trash-2",Rj);const _j=[["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"}]],na=Se("triangle-alert",_j);const Mj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hd=Se("x",Mj);const Aj=[["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"}]],kj=Se("zap-off",Aj);const Oj=[["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=Se("zap",Oj);function ag(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=ag(a[s]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function zj(){for(var a,s,o=0,i="",d=arguments.length;o<d;o++)(a=arguments[o])&&(s=ag(a))&&(i&&(i+=" "),i+=s);return i}const Dj=(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},Lj=(a,s)=>({classGroupId:a,validator:s}),ng=(a=new Map,s=null,o)=>({nextPart:a,validators:s,classGroupId:o}),ii="-",Cx=[],Uj="arbitrary..",Bj=a=>{const s=Hj(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return qj(m);const v=m.split(ii),g=v[0]===""&&v.length>1?1:0;return rg(v,g,s)},getConflictingClassGroupIds:(m,v)=>{if(v){const g=i[m],p=o[m];return g?p?Dj(p,g):g:p||Cx}return o[m]||Cx}}},rg=(a,s,o)=>{if(a.length-s===0)return o.classGroupId;const d=a[s],f=o.nextPart.get(d);if(f){const p=rg(a,s+1,f);if(p)return p}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 p=0;p<g;p++){const y=m[p];if(y.validator(v))return y.classGroupId}},qj=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?Uj+i:void 0})(),Hj=a=>{const{theme:s,classGroups:o}=a;return Gj(o,s)},Gj=(a,s)=>{const o=ng();for(const i in a){const d=a[i];Gd(d,o,i,s)}return o},Gd=(a,s,o,i)=>{const d=a.length;for(let f=0;f<d;f++){const m=a[f];Qj(m,s,o,i)}},Qj=(a,s,o,i)=>{if(typeof a=="string"){Vj(a,s,o);return}if(typeof a=="function"){Fj(a,s,o,i);return}Yj(a,s,o,i)},Vj=(a,s,o)=>{const i=a===""?s:sg(s,a);i.classGroupId=o},Fj=(a,s,o,i)=>{if(Xj(a)){Gd(a(i),s,o,i);return}s.validators===null&&(s.validators=[]),s.validators.push(Lj(o,a))},Yj=(a,s,o,i)=>{const d=Object.entries(a),f=d.length;for(let m=0;m<f;m++){const[v,g]=d[m];Gd(g,sg(s,v),o,i)}},sg=(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=ng(),o.nextPart.set(m,v)),o=v}return o},Xj=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,Kj=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)}}},hd="!",Rx=":",Zj=[],_x=(a,s,o,i,d)=>({modifiers:a,hasImportantModifier:s,baseClassName:o,maybePostfixModifierPosition:i,isExternal:d}),$j=a=>{const{prefix:s,experimentalParseClassName:o}=a;let i=d=>{const f=[];let m=0,v=0,g=0,p;const y=d.length;for(let E=0;E<y;E++){const T=d[E];if(m===0&&v===0){if(T===Rx){f.push(d.slice(g,E)),g=E+1;continue}if(T==="/"){p=E;continue}}T==="["?m++:T==="]"?m--:T==="("?v++:T===")"&&v--}const x=f.length===0?d:d.slice(g);let N=x,M=!1;x.endsWith(hd)?(N=x.slice(0,-1),M=!0):x.startsWith(hd)&&(N=x.slice(1),M=!0);const j=p&&p>g?p-g:void 0;return _x(f,M,N,j)};if(s){const d=s+Rx,f=i;i=m=>m.startsWith(d)?f(m.slice(d.length)):_x(Zj,!1,m,void 0,!0)}if(o){const d=i;i=f=>o({className:f,parseClassName:d})}return i},Jj=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}},Pj=a=>({cache:Kj(a.cacheSize),parseClassName:$j(a),sortModifiers:Jj(a),...Bj(a)}),Ij=/\s+/,Wj=(a,s)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:d,sortModifiers:f}=s,m=[],v=a.trim().split(Ij);let g="";for(let p=v.length-1;p>=0;p-=1){const y=v[p],{isExternal:x,modifiers:N,hasImportantModifier:M,baseClassName:j,maybePostfixModifierPosition:E}=o(y);if(x){g=y+(g.length>0?" "+g:g);continue}let T=!!E,k=i(T?j.substring(0,E):j);if(!k){if(!T){g=y+(g.length>0?" "+g:g);continue}if(k=i(j),!k){g=y+(g.length>0?" "+g:g);continue}T=!1}const A=N.length===0?"":N.length===1?N[0]:f(N).join(":"),V=M?A+hd:A,q=V+k;if(m.indexOf(q)>-1)continue;m.push(q);const te=d(k,T);for(let W=0;W<te.length;++W){const z=te[W];m.push(V+z)}g=y+(g.length>0?" "+g:g)}return g},ew=(...a)=>{let s=0,o,i,d="";for(;s<a.length;)(o=a[s++])&&(i=lg(o))&&(d&&(d+=" "),d+=i);return d},lg=a=>{if(typeof a=="string")return a;let s,o="";for(let i=0;i<a.length;i++)a[i]&&(s=lg(a[i]))&&(o&&(o+=" "),o+=s);return o},tw=(a,...s)=>{let o,i,d,f;const m=g=>{const p=s.reduce((y,x)=>x(y),a());return o=Pj(p),i=o.cache.get,d=o.cache.set,f=v,v(g)},v=g=>{const p=i(g);if(p)return p;const y=Wj(g,o);return d(g,y),y};return f=m,(...g)=>f(ew(...g))},aw=[],ut=a=>{const s=o=>o[a]||aw;return s.isThemeGetter=!0,s},og=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ig=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nw=/^\d+\/\d+$/,rw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sw=/\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$/,lw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ow=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ts=a=>nw.test(a),Me=a=>!!a&&!Number.isNaN(Number(a)),Mn=a=>!!a&&Number.isInteger(Number(a)),Fu=a=>a.endsWith("%")&&Me(a.slice(0,-1)),Wa=a=>rw.test(a),cw=()=>!0,uw=a=>sw.test(a)&&!lw.test(a),cg=()=>!1,dw=a=>ow.test(a),fw=a=>iw.test(a),mw=a=>!de(a)&&!fe(a),hw=a=>fs(a,fg,cg),de=a=>og.test(a),rr=a=>fs(a,mg,uw),Yu=a=>fs(a,yw,Me),Mx=a=>fs(a,ug,cg),pw=a=>fs(a,dg,fw),Xo=a=>fs(a,hg,dw),fe=a=>ig.test(a),ml=a=>ms(a,mg),xw=a=>ms(a,bw),Ax=a=>ms(a,ug),vw=a=>ms(a,fg),gw=a=>ms(a,dg),Ko=a=>ms(a,hg,!0),fs=(a,s,o)=>{const i=og.exec(a);return i?i[1]?s(i[1]):o(i[2]):!1},ms=(a,s,o=!1)=>{const i=ig.exec(a);return i?i[1]?s(i[1]):o:!1},ug=a=>a==="position"||a==="percentage",dg=a=>a==="image"||a==="url",fg=a=>a==="length"||a==="size"||a==="bg-size",mg=a=>a==="length",yw=a=>a==="number",bw=a=>a==="family-name",hg=a=>a==="shadow",Sw=()=>{const a=ut("color"),s=ut("font"),o=ut("text"),i=ut("font-weight"),d=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),v=ut("container"),g=ut("spacing"),p=ut("radius"),y=ut("shadow"),x=ut("inset-shadow"),N=ut("text-shadow"),M=ut("drop-shadow"),j=ut("blur"),E=ut("perspective"),T=ut("aspect"),k=ut("ease"),A=ut("animate"),V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],te=()=>[...q(),fe,de],W=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],B=()=>[fe,de,g],re=()=>[ts,"full","auto",...B()],Ne=()=>[Mn,"none","subgrid",fe,de],oe=()=>["auto",{span:["full",Mn,fe,de]},Mn,fe,de],he=()=>[Mn,"auto",fe,de],Ce=()=>["auto","min","max","fr",fe,de],Re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...B()],F=()=>[ts,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],Y=()=>[a,fe,de],xe=()=>[...q(),Ax,Mx,{position:[fe,de]}],ve=()=>["no-repeat",{repeat:["","x","y","space","round"]}],R=()=>["auto","cover","contain",vw,hw,{size:[fe,de]}],X=()=>[Fu,ml,rr],K=()=>["","none","full",p,fe,de],I=()=>["",Me,ml,rr],le=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Me,Fu,Ax,Mx],ce=()=>["","none",j,fe,de],H=()=>["none",Me,fe,de],ne=()=>["none",Me,fe,de],_e=()=>[Me,fe,de],Ae=()=>[ts,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wa],breakpoint:[Wa],color:[cw],container:[Wa],"drop-shadow":[Wa],ease:["in","out","in-out"],font:[mw],"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",Me],text:[Wa],"text-shadow":[Wa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ts,de,fe,T]}],container:["container"],columns:[{columns:[Me,de,fe,v]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:te()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{start:re()}],end:[{end:re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[Mn,"auto",fe,de]}],basis:[{basis:[ts,"full","auto",v,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,ts,"auto","initial","none",de]}],grow:[{grow:["",Me,fe,de]}],shrink:[{shrink:["",Me,fe,de]}],order:[{order:[Mn,"first","last","none",fe,de]}],"grid-cols":[{"grid-cols":Ne()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":Ne()}],"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":Ce()}],"auto-rows":[{"auto-rows":Ce()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...Re(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Re()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Re()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"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,ml,rr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,fe,Yu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fu,de]}],"font-family":[{font:[xw,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":[Me,"none",fe,Yu]}],leading:[{leading:[f,...B()]}],"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:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",fe,rr]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Me,"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:B()}],"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:xe()}],"bg-repeat":[{bg:ve()}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mn,fe,de],radial:["",fe,de],conic:[Mn,fe,de]},gw,pw]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,fe,de]}],"outline-w":[{outline:["",Me,ml,rr]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",y,Ko,Xo]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",x,Ko,Xo]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Me,rr]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",N,Ko,Xo]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Me,fe,de]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[fe,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"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":q()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:xe()}],"mask-repeat":[{mask:ve()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,de]}],filter:[{filter:["","none",fe,de]}],blur:[{blur:ce()}],brightness:[{brightness:[Me,fe,de]}],contrast:[{contrast:[Me,fe,de]}],"drop-shadow":[{"drop-shadow":["","none",M,Ko,Xo]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Me,fe,de]}],"hue-rotate":[{"hue-rotate":[Me,fe,de]}],invert:[{invert:["",Me,fe,de]}],saturate:[{saturate:[Me,fe,de]}],sepia:[{sepia:["",Me,fe,de]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,de]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Me,fe,de]}],"backdrop-contrast":[{"backdrop-contrast":[Me,fe,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,fe,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,fe,de]}],"backdrop-invert":[{"backdrop-invert":["",Me,fe,de]}],"backdrop-opacity":[{"backdrop-opacity":[Me,fe,de]}],"backdrop-saturate":[{"backdrop-saturate":[Me,fe,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,fe,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"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:[Me,"initial",fe,de]}],ease:[{ease:["linear","initial",k,fe,de]}],delay:[{delay:[Me,fe,de]}],animate:[{animate:["none",A,fe,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,fe,de]}],"perspective-origin":[{"perspective-origin":te()}],rotate:[{rotate:H()}],"rotate-x":[{"rotate-x":H()}],"rotate-y":[{"rotate-y":H()}],"rotate-z":[{"rotate-z":H()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[fe,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:te()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",...Y()]}],"stroke-w":[{stroke:[Me,ml,rr,Yu]}],stroke:[{stroke:["none",...Y()]}],"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"]}},Nw=tw(Sw);function ae(...a){return Nw(zj(a))}async function jw(){const{data:a}=await ye.get("/api/system/info");return a}function ww(){return jt({queryKey:["system-info"],queryFn:jw,staleTime:6e4})}function Ew(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 Tw(){const{data:a}=ww();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(kn,{size:10}),l.jsxs("span",{children:[a.cpuCount," cores"]}),l.jsx("span",{className:"mx-0.5",children:"|"}),l.jsx(Ld,{size:10}),l.jsxs("span",{children:[Math.round(a.totalMemoryMb/1024),"GB"]})]}),l.jsxs("div",{className:"mt-0.5",children:[a.hostname," · up ",Ew(a.uptime)," · v",a.version]})]}):null}const Cw=[{label:"Dashboard",icon:aj,path:"/dashboard"},{label:"Settings",icon:tg,path:"/settings"},{label:"Services",icon:qd,path:"/services"},{label:"Models",icon:EN,path:"/models"},{label:"Quick Sets",icon:oi,path:"/quick-sets"},{label:"Traces",icon:jN,path:"/traces"},{label:"Nodes",icon:kn,path:"/nodes"},{label:"Native",icon:CN,path:"/native-services"}];function Rw(){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:Cw.map(a=>l.jsxs(iv,{to:a.path,className:({isActive:s})=>ae("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(Tw,{})]})}function _w(){const{state:a,logout:s}=Od(),{theme:o,toggleTheme:i}=z2();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(Cj,{size:18}):l.jsx(uj,{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(lj,{size:18})})]})]})}function Mw(){const{state:a}=Od();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(Rw,{}),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(H0,{})})]})]}):l.jsx(ni,{to:"/login",replace:!0})}function Aw(){const{state:a,login:s,setup:o}=Od(),i=wa(),[d,f]=S.useState("loading"),[m,v]=S.useState(""),[g,p]=S.useState(""),[y,x]=S.useState(""),[N,M]=S.useState(""),[j,E]=S.useState(null);if(S.useEffect(()=>{let q=!1;async function te(){try{const{data:W}=await ye.get("/api/setup/status");if(!q&&!W.configured){i("/setup",{replace:!0});return}}catch{if(!q){i("/setup",{replace:!0});return}}try{const W=await fN();q||f(W.needs_setup?"setup":"login")}catch{q||f("login")}}return te(),()=>{q=!0}},[i]),a.isAuthenticated)return l.jsx(ni,{to:"/settings",replace:!0});const T=q=>{q.preventDefault(),s(m,y)},k=q=>{if(q.preventDefault(),E(null),y!==N){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)},A=ae("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)]"),V=j??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:k,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:q=>v(q.target.value),className:A,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:q=>p(q.target.value),className:A,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:q=>x(q.target.value),className:A})]}),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:N,onChange:q=>M(q.target.value),className:A})]}),V&&l.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:V}),l.jsx("button",{type:"submit",disabled:a.isLoading,className:ae("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:T,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:q=>v(q.target.value),className:A,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:q=>x(q.target.value),className:A})]}),V&&l.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:V}),l.jsx("button",{type:"submit",disabled:a.isLoading,className:ae("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 kw(){const{data:a}=await ye.get("/api/settings/");return a}async function Ow(a,s,o){const{data:i}=await ye.put(`/api/settings/${encodeURIComponent(a)}/${s}`,{value:o});return i}function zw(){return jt({queryKey:["settings"],queryFn:kw,staleTime:3e4})}function Dw(){const a=vt();return wt({mutationFn:({serviceName:s,key:o,value:i})=>Ow(s,o,i),onSuccess:()=>{a.invalidateQueries({queryKey:["settings"]})}})}function Lw({setting:a,onSave:s,onCancel:o,isSaving:i}){const[d,f]=S.useState(()=>a.value_type==="json"?JSON.stringify(a.value,null,2):a.value_type==="bool"?"":String(a.value??"")),[m,v]=S.useState(()=>!!a.value),[g,p]=S.useState(null),y=!!a.options?.length,x=y&&!a.options.includes(d),[N,M]=S.useState(x),j=T=>{T.preventDefault();let k;switch(a.value_type){case"bool":k=m;break;case"int":if(k=parseInt(d,10),isNaN(k)){p("Must be a whole number");return}p(null);break;case"float":if(k=parseFloat(d),isNaN(k)){p("Must be a number");return}p(null);break;case"json":try{k=JSON.parse(d),p(null)}catch{p("Invalid JSON");return}break;default:k=d}s(k)},E=ae("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:j,className:"flex items-center gap-2",children:[y?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{value:N?"__other__":d,onChange:T=>{T.target.value==="__other__"?(M(!0),f("")):(M(!1),f(T.target.value))},className:ae(E,"max-w-xs"),children:[a.options.map(T=>l.jsx("option",{value:String(T),children:String(T)},String(T))),l.jsx("option",{value:"__other__",children:"Other..."})]}),N&&l.jsx("input",{type:"text",value:d,onChange:T=>f(T.target.value),placeholder:"Custom value",className:ae(E,"max-w-xs"),autoFocus:!0})]}):a.value_type==="bool"?l.jsx("button",{type:"button",onClick:()=>v(T=>!T),className:ae("relative h-6 w-11 rounded-full transition-colors",m?"bg-[var(--color-primary)]":"bg-[var(--color-border)]"),children:l.jsx("span",{className:ae("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:T=>{f(T.target.value),p(null)},rows:4,className:ae(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:T=>{f(T.target.value),p(null)},className:ae(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 Uw(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 Bw={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 qw({setting:a,serviceName:s,onRestartService:o}){const[i,d]=S.useState(!1),f=Dw(),m=v=>{f.mutate({serviceName:s,key:a.key,value:v},{onSuccess:g=>{d(!1),g.requires_reload?ze.warning(`Setting updated. ${s} requires a restart to apply.`,o?{action:{label:"Restart",onClick:o}}:void 0):ze.success("Setting updated")},onError:g=>{ze.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:ae("rounded px-1.5 py-0.5 text-[10px] font-medium",Bw[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(QN,{size:12,className:"text-[var(--color-tertiary)]"})}),a.requires_reload&&l.jsx("span",{title:"Requires service restart",children:l.jsx(na,{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(Lw,{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:Uw(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(fj,{size:14})})]})}function Hw({category:a,settings:s,serviceName:o,onRestartService:i}){const[d,f]=S.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(zd,{size:14}):l.jsx($v,{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(qw,{setting:m,serviceName:o,onRestartService:i},m.key))})]})}async function Gw(){const{data:a}=await ye.get("/api/containers");return a}async function Qw(a){const{data:s}=await ye.post(`/api/containers/${a}/restart`);return s}function pg(){return jt({queryKey:["containers"],queryFn:Gw,staleTime:1e4,refetchInterval:1e4})}function xg(){const a=vt();return wt({mutationFn:s=>Qw(s),onSuccess:()=>{a.invalidateQueries({queryKey:["containers"]})}})}function Vw({result:a,defaultExpanded:s=!1}){const[o,i]=S.useState(s),{data:d}=pg(),f=xg(),m=S.useCallback(()=>{const g=d?.containers.find(p=>p.name.includes(a.service_name)||p.name.includes(a.service_name.replace("jarvis-","")));g?f.mutate(g.id,{onSuccess:()=>ze.success(`${a.service_name} is restarting...`),onError:p=>ze.error(`Restart failed: ${p.message}`)}):ze.error(`Could not find container for ${a.service_name}`)},[d,a.service_name,f]),v=S.useMemo(()=>{const g=new Map;for(const p of a.settings){const y=g.get(p.category)??[];g.set(p.category,[...y,p])}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(zd,{size:18,className:"text-[var(--color-text-muted)]"}):l.jsx($v,{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(xt,{size:16,className:"text-[var(--color-secondary)]"}):l.jsx(pl,{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:ae("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,p])=>l.jsx(Hw,{category:g,settings:p,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 Fw(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=zw(),[m,v]=S.useState(""),g=S.useMemo(()=>{if(!a)return[];if(!m.trim())return a.services;const p=m.toLowerCase();return a.services.map(y=>({...y,settings:y.settings.filter(x=>x.key.toLowerCase().includes(p)||x.category.toLowerCase().includes(p)||(x.description?.toLowerCase().includes(p)??!1))})).filter(y=>y.settings.length>0||y.service_name.toLowerCase().includes(p))},[a,m]);return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(_t,{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:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(_t,{size:14})})]})]}),l.jsxs("div",{className:"relative",children:[l.jsx(yj,{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:p=>v(p.target.value),placeholder:"Search settings...",className:ae("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((p,y)=>l.jsx(Vw,{result:p,defaultExpanded:y===0},p.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 Yw(){const{data:a}=await ye.get("/api/services/registry");return a}async function Xw(a){const{data:s}=await ye.post("/api/services/register",a);return s}async function Kw(a){const{data:s}=await ye.post("/api/services/rotate-key",a);return s}async function Zw(a){const{data:s}=await ye.post("/api/services/probe",a);return s}async function $w(a){const{data:s}=await ye.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 Jw(a){await ye.delete(`/api/services/${encodeURIComponent(a)}`)}async function Pw(){const{data:a}=await ye.get("/api/services/suggestions");return a}function Iw(){return jt({queryKey:["service-registry"],queryFn:Yw,staleTime:3e4})}function Ww(){const a=vt();return wt({mutationFn:Xw,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function eE(){const a=vt();return wt({mutationFn:Kw,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function tE(){const a=vt();return wt({mutationFn:$w,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function aE(){const a=vt();return wt({mutationFn:Jw,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function nE(){return jt({queryKey:["service-suggestions"],queryFn:Pw,staleTime:6e4})}function kx({ok:a,label:s}){return l.jsxs("span",{className:ae("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(Hd,{size:12}),s]})}function rE({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(aa,{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(ls,{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(ls,{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:p,onPortBlur:y,onRotateKey:x,onDelete:N,disabled:M,rotating:j,deleting:E,healthStatus:T,healthError:k,healthLatency:A}){return l.jsxs("div",{className:ae("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:M,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(kx,{ok:a.config_registered,label:"Config"}),l.jsx(kx,{ok:a.auth_registered,label:"Auth"}),a.custom&&N&&l.jsxs("button",{onClick:N,disabled:M||E,className:ae("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(gi,{size:12,className:E?"animate-spin":""}),"Remove"]}),a.auth_registered&&l.jsxs("button",{onClick:x,disabled:M||j,className:ae("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(Bd,{size:12,className:j?"animate-spin":""}),"Rotate Key"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{value:d,onChange:V=>g(V.target.value),disabled:M,className:ae("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:V=>m(V.target.value),onBlur:p,disabled:M,placeholder:"host",className:ae("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:V=>v(Number(V.target.value)),onBlur:y,disabled:M,className:ae("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(rE,{status:T,error:k,latency:A})]})]})}const Ox={name:"",host:"localhost",port:"",scheme:"http",health_path:"/health",description:""};function lE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=Iw(),m=Ww(),v=eE(),g=tE(),p=aE(),{data:y}=nE(),[x,N]=S.useState({}),[M,j]=S.useState(null),[E,T]=S.useState(null),[k,A]=S.useState(null),[V,q]=S.useState(null),[te,W]=S.useState(null),[z,B]=S.useState({}),[re,Ne]=S.useState(!1),[oe,he]=S.useState(Ox),[Ce,Re]=S.useState(!1),ee=S.useRef(null),w=S.useMemo(()=>new Set(a?.services.map(H=>H.name)??[]),[a]),F=S.useMemo(()=>{const ne=(y?.suggestions??[]).filter(Ae=>!w.has(Ae.id));if(!oe.name.trim())return ne;const _e=oe.name.toLowerCase();return ne.filter(Ae=>Ae.id.toLowerCase().includes(_e)||Ae.name.toLowerCase().includes(_e)||Ae.description.toLowerCase().includes(_e))},[y,w,oe.name]),Y=S.useCallback(H=>{he({name:H.id,description:H.description,host:"localhost",port:String(H.port),scheme:"http",health_path:H.healthCheck}),Re(!1)},[]);S.useEffect(()=>{const H=ne=>{ee.current&&!ee.current.contains(ne.target)&&Re(!1)};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const xe=S.useCallback(H=>{if(x[H])return x[H];const ne=a?.services.find(_e=>_e.name===H);return ne?{checked:ne.config_registered,host:ne.current_host??"localhost",port:ne.current_port??ne.default_port,scheme:ne.current_scheme??"http"}:{checked:!1,host:"localhost",port:0,scheme:"http"}},[x,a]),ve=S.useCallback((H,ne)=>{N(_e=>{const Ae=_e[H]??{checked:!1,host:"localhost",port:0};return{..._e,[H]:{...Ae,...ne}}})},[]),R=S.useCallback(async(H,ne,_e,Ae,va="http")=>{if(!(!ne||!_e)){B(it=>({...it,[H]:{status:"probing"}}));try{const it=await Zw({host:ne,port:_e,health_path:Ae,scheme:va});B(zn=>({...zn,[H]:{status:it.healthy?"healthy":"unhealthy",error:it.error??void 0,latency:it.latency_ms??void 0}}))}catch{B(it=>({...it,[H]:{status:"unhealthy",error:"Request failed"}}))}}},[]),X=S.useCallback(()=>{if(!a)return;const H=a.services.filter(ne=>xe(ne.name).checked).map(ne=>{const _e=xe(ne.name);return{name:ne.name,host:_e.host,port:_e.port,scheme:_e.scheme}});if(H.length===0){ze.error("No services selected");return}j(null),T(null),m.mutate({services:H},{onSuccess:ne=>{j(ne.results);const _e=ne.results.filter(va=>va.config_ok&&va.auth_ok).length,Ae=ne.results.length;_e===Ae?ze.success(`All ${Ae} services registered`):ze.warning(`${_e}/${Ae} services registered successfully`)},onError:ne=>{ze.error(`Registration failed: ${ne.message}`)}})},[a,xe,m]),K=S.useCallback(H=>{A(H),T(null),v.mutate({service_name:H},{onSuccess:ne=>{T(ne),A(null),ze.success(`Key rotated for ${H}`)},onError:ne=>{A(null),ze.error(`Key rotation failed: ${ne.message}`)}})},[v]),I=S.useCallback(H=>{q(H),p.mutate(H,{onSuccess:()=>{q(null),ze.success(`Removed ${H}`)},onError:ne=>{q(null),ze.error(`Failed to remove: ${ne.message}`)}})},[p]),le=S.useCallback(()=>{const H=parseInt(oe.port,10);if(!oe.name.trim()){ze.error("Service name is required");return}if(!H||H<1||H>65535){ze.error("Port must be between 1 and 65535");return}g.mutate({name:oe.name.trim(),host:oe.host.trim()||"localhost",port:H,scheme:oe.scheme,health_path:oe.health_path.trim()||"/health",description:oe.description.trim()},{onSuccess:ne=>{const _e=ne.results[0];_e?.config_ok?(ze.success(`Added ${oe.name.trim()}`),he(Ox),Ne(!1)):ze.error(`Failed to add: ${_e?.error??"Unknown error"}`)},onError:ne=>{ze.error(`Failed to add service: ${ne.message}`)}})},[oe,g]),$=S.useCallback(H=>{navigator.clipboard.writeText(H).then(()=>{W(H),setTimeout(()=>W(null),2e3)})},[]),ie=a?.services.filter(H=>xe(H.name).checked).length??0,ce=M?.some(H=>H.env_written)||E?.env_written===!0;return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(_t,{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:()=>Ne(H=>!H),className:ae("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium",re?"bg-[var(--color-surface-alt)] text-[var(--color-text)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[re?l.jsx(Hd,{size:14}):l.jsx(ti,{size:14}),re?"Cancel":"Add Service"]}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(_t,{size:14})})]})]}),re&&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:ee,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:H=>{he(ne=>({...ne,name:H.target.value})),Re(!0)},onFocus:()=>Re(!0),placeholder:"Select or type a service name...",className:ae("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:()=>Re(H=>!H),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(zd,{size:14})})]}),Ce&&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(H=>l.jsxs("button",{type:"button",onClick:()=>Y(H),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:[H.name,l.jsxs("span",{className:"ml-2 font-normal text-[var(--color-text-muted)]",children:[":",H.port]})]}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:H.description})]},H.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:H=>he(ne=>({...ne,description:H.target.value})),placeholder:"e.g. Camera streaming via WebRTC",className:ae("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:H=>he(ne=>({...ne,host:H.target.value})),placeholder:"localhost",className:ae("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:H=>he(ne=>({...ne,port:H.target.value})),placeholder:"e.g. 1984",className:ae("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:H=>he(ne=>({...ne,scheme:H.target.value})),className:ae("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:H=>he(ne=>({...ne,health_path:H.target.value})),placeholder:"/health",className:ae("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:le,disabled:g.isPending||!oe.name.trim()||!oe.port,className:ae("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(H=>{const ne=xe(H.name),_e=z[H.name]??{status:"idle"};return l.jsx(sE,{entry:H,checked:ne.checked,host:ne.host,port:ne.port,scheme:ne.scheme,onToggle:()=>{const Ae=!ne.checked;ve(H.name,{...ne,checked:Ae}),Ae?R(H.name,ne.host,ne.port,H.health_path,ne.scheme):B(va=>({...va,[H.name]:{status:"idle"}}))},onHostChange:Ae=>ve(H.name,{...ne,host:Ae}),onPortChange:Ae=>ve(H.name,{...ne,port:Ae}),onSchemeChange:Ae=>ve(H.name,{...ne,scheme:Ae}),onHostBlur:()=>{ne.checked&&R(H.name,ne.host,ne.port,H.health_path,ne.scheme)},onPortBlur:()=>{ne.checked&&R(H.name,ne.host,ne.port,H.health_path,ne.scheme)},onRotateKey:()=>K(H.name),onDelete:()=>I(H.name),disabled:m.isPending,rotating:k===H.name,deleting:V===H.name,healthStatus:_e.status,healthError:_e.error,healthLatency:_e.latency},H.name)})}),l.jsx("button",{onClick:X,disabled:m.isPending||ie===0,className:ae("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 (${ie})`}),E&&l.jsx(oE,{serviceName:E.service_name,appKey:E.app_key,envWritten:E.env_written,copiedKey:te,onCopy:$,label:"Rotated Key"}),M&&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"}),M.map(H=>l.jsxs("div",{className:ae("flex flex-wrap items-center gap-3 rounded-lg border p-3 text-sm",H.config_ok&&H.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:H.name}),l.jsxs("span",{className:ae("text-xs",H.config_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Config: ",H.config_ok?"OK":"Failed"]}),l.jsxs("span",{className:ae("text-xs",H.auth_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Auth: ",H.auth_ok?H.auth_created?"Created":"Exists":"Failed"]}),H.env_written!==null&&l.jsxs("span",{className:ae("text-xs",H.env_written?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",H.env_written?"Written":"Failed"]}),H.error&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-600 dark:text-yellow-400",children:[l.jsx(na,{size:12}),H.error]}),H.auth_created&&H.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(na,{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:H.app_key}),l.jsx("button",{onClick:()=>$(H.app_key),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:te===H.app_key?l.jsx(xi,{size:14,className:"text-green-500"}):l.jsx(Pv,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]},H.name))]}),ce&&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(IN,{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 oE({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:ae("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(na,{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(Pv,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]})]})}async function iE(){const{data:a}=await ye.get("/api/llm-setup/status");return a}async function cE(a){const{data:s}=await ye.post("/api/llm-setup/configure",{settings:a});return s}async function uE(a,s,o){const{data:i}=await ye.post("/api/llm-setup/download",{repo:a,filename:s,token:o});return i}function dE(){return jt({queryKey:["llm-status"],queryFn:iE,staleTime:3e4,retry:1})}function vg(){const a=vt();return wt({mutationFn:s=>cE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function fE(){return wt({mutationFn:({repo:a,filename:s,token:o})=>uE(a,s,o)})}async function Qd(){const{data:a}=await ye.get("/api/install/status");return a}async function mE(a){const s=a?.length?{services:a.join(",")}:{},{data:o}=await ye.get("/api/install/preflight",{params:s});return o}async function hE(){const{data:a}=await ye.get("/api/install/hardware");return a}async function zx(a){const{data:s}=await ye.post("/api/install/generate",a);return s}async function gg(){const{data:a}=await ye.get("/api/install/registry");return a}async function pE(){const{data:a}=await ye.get("/api/install/defaults");return a}const xE={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 vE(a){return a.match(/^Up (.+)$/)?.[1]??null}function Dx({container:a,onRestart:s,isRestarting:o}){const i=vE(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:ae("h-2.5 w-2.5 rounded-full",xE[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:ae("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(YN,{size:13})}),l.jsx("button",{onClick:()=>s(a.id),disabled:o,className:ae("rounded p-1 hover:bg-[var(--color-surface-alt)]",o&&"animate-spin"),title:"Restart",children:l.jsx(Bd,{size:13})})]})]})})]})}async function gE(){const{data:a}=await ye.get("/api/update/check");return a}function yg(){return jt({queryKey:["update-check"],queryFn:gE,staleTime:300*1e3,retry:1,refetchOnWindowFocus:!1})}const Lx="jarvis-update-dismissed-version";function Ux(){const a=wa(),{data:s}=yg(),[o,i]=S.useState(()=>s?.latestVersion?localStorage.getItem(Lx)===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(Jv,{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(Lx,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 Xu="jarvis-admin:llm-setup-dismissed";function yE(){const a=wa(),[s,o]=S.useState(!1),{data:i,isLoading:d,isError:f,error:m,refetch:v,isFetching:g}=pg(),p=xg(),y=dE(),[x,N]=S.useState(()=>!!localStorage.getItem(Xu));S.useEffect(()=>{Qd().then(A=>{A.deployMode==="compose-export"&&o(!0)}).catch(()=>{})},[]);const M=!!y.data&&!y.data.configured&&!x,j=A=>{p.mutate(A,{onSuccess:()=>ze.success("Container restart initiated"),onError:V=>ze.error(`Restart failed: ${V.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(Ux,{}),M&&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(md,{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(Xu,"true"),N(!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:"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(_t,{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??[],T=E.filter(A=>A.state==="running"),k=E.filter(A=>A.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:[T.length,"/",E.length," running"]}),l.jsx("button",{onClick:()=>v(),disabled:g,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",g&&"animate-spin"),title:"Refresh",children:l.jsx(_t,{size:14})})]})]}),l.jsx(Ux,{}),M&&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(md,{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(Xu,"true"),N(!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(Wv,{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?"})}),T.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:T.map(A=>l.jsx(Dx,{container:A,onRestart:j,isRestarting:p.isPending&&p.variables===A.id},A.id))})]}),k.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:k.map(A=>l.jsx(Dx,{container:A,onRestart:j,isRestarting:p.isPending&&p.variables===A.id},A.id))})]})]})}async function bE(){const{data:a}=await ye.get("/api/nodes");return a}async function SE(a){const{data:s}=await ye.get(`/api/nodes/${a}/nodes`);return s}async function NE(a){const{data:s}=await ye.post(`/api/nodes/${a}/train-adapter`);return s}function jE(){return jt({queryKey:["households"],queryFn:bE,staleTime:3e4})}function wE(a){return jt({queryKey:["household-nodes",a],queryFn:()=>SE(a),enabled:!!a,staleTime:3e4})}function EE(){const a=vt();return wt({mutationFn:NE,onSuccess:()=>{a.invalidateQueries({queryKey:["household-nodes"]})}})}function TE({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(kn,{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:ae("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(kj,{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:ae("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(_t,{size:12,className:"animate-spin"}),"Training..."]}):"Train Adapter"})})]})}function CE({householdId:a,householdName:s}){const{data:o,isLoading:i,isError:d}=wE(a),f=EE(),m=v=>{f.mutate(v,{onSuccess:g=>ze.success(`Training triggered for ${v} (request: ${g.request_id.slice(0,8)}...)`),onError:g=>ze.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(_t,{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(TE,{node:v,onTrain:m,isTraining:f.isPending&&f.variables===v.node_id},v.node_id))})]})}function RE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=jE();return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(_t,{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:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(_t,{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(CE,{householdId:m.id,householdName:m.name},m.id))]})}async function _E(){const{data:a}=await ye.get("/api/native-services");return a}async function ME(a){const{data:s}=await ye.post(`/api/native-services/${a}/restart`);return s}async function AE(a){const{data:s}=await ye.post(`/api/native-services/${a}/stop`);return s}async function kE(a){const{data:s}=await ye.post(`/api/native-services/${a}/uninstall`);return s}async function OE(a,s="stderr",o=200){const{data:i}=await ye.get(`/api/native-services/${a}/logs`,{params:{stream:s,lines:o}});return i}const yi=["native-services"];function zE(){return jt({queryKey:yi,queryFn:_E,staleTime:5e3,refetchInterval:5e3})}function DE(){const a=vt();return wt({mutationFn:s=>ME(s),onSuccess:()=>a.invalidateQueries({queryKey:yi})})}function LE(){const a=vt();return wt({mutationFn:s=>AE(s),onSuccess:()=>a.invalidateQueries({queryKey:yi})})}function UE(){const a=vt();return wt({mutationFn:s=>kE(s),onSuccess:()=>a.invalidateQueries({queryKey:yi})})}function BE(a,s,o){return jt({queryKey:["native-services-logs",a,s],queryFn:()=>OE(a,s,200),enabled:o,staleTime:3e3,refetchInterval:o?3e3:!1})}function qE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=zE();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(GE,{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:ae("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(_t,{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(HE,{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 HE({service:a}){const s=DE(),o=LE(),i=UE(),[d,f]=S.useState(!1),[m,v]=S.useState("stderr"),g=BE(a.id,m,d),{status:p}=a;async function y(j,E){try{await j,ze.success(E)}catch(T){ze.error(T instanceof Error?T.message:String(T))}}async function x(){confirm(`Uninstall ${a.id}? The LaunchAgent will be removed; source files at ${p.sourceDir??"~/.jarvis/native"} stay on disk.`)&&await y(i.mutateAsync(a.id),`${a.id} uninstalled`)}const N=p.installed?p.running?`Running (pid ${p.pid??"?"})`:"Installed, stopped":"Not installed",M=p.installed?p.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:ae("h-2.5 w-2.5 shrink-0 rounded-full",M)}),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:[":",p.port??a.port]}),l.jsx("code",{className:"text-xs text-[var(--color-text-muted)]",children:p.label})]}),l.jsxs("p",{className:"ml-5 mt-0.5 text-xs text-[var(--color-text-muted)]",children:[N,p.sourceDir&&l.jsxs("span",{className:"ml-2 opacity-60",children:["· ",p.sourceDir]})]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[p.installed&&l.jsxs(l.Fragment,{children:[p.running?l.jsx(hl,{icon:Ej,label:"Stop",onClick:()=>y(o.mutateAsync(a.id),`${a.id} stopped`),disabled:o.isPending}):l.jsx(hl,{icon:eg,label:"Start",onClick:()=>y(s.mutateAsync(a.id),`${a.id} started`),disabled:s.isPending}),p.running&&l.jsx(hl,{icon:Bd,label:"Restart",onClick:()=>y(s.mutateAsync(a.id),`${a.id} restarted`),disabled:s.isPending}),l.jsx(hl,{icon:Iv,label:d?"Hide logs":"Logs",onClick:()=>f(j=>!j)}),l.jsx(hl,{icon:gi,label:"Uninstall",onClick:x,disabled:i.isPending,danger:!0})]}),!p.installed&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:[l.jsx(kn,{size:12})," Re-run install wizard to enable"]})]})]}),d&&p.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(Bx,{active:m==="stderr",onClick:()=>v("stderr"),children:"stderr"}),l.jsx(Bx,{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 hl({icon:a,label:s,onClick:o,disabled:i,danger:d}){return l.jsxs("button",{type:"button",onClick:o,disabled:i,className:ae("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 Bx({active:a,onClick:s,children:o}){return l.jsx("button",{type:"button",onClick:s,className:ae("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 GE({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(Dd,{size:14}),a]})}async function QE(){const{data:a}=await ye.get("/api/models/installed");return a.models}async function VE(a){const{data:s}=await ye.post("/api/models/download",a);return s}async function FE(a){await ye.delete(`/api/models/${encodeURIComponent(a)}`)}function YE(){return jt({queryKey:["models","installed"],queryFn:QE,staleTime:1e4})}function bg(){const a=vt();return wt({mutationFn:s=>VE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}function XE(){const a=vt();return wt({mutationFn:s=>FE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}const rs=[{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 KE(){const[a,s]=S.useState(""),[o,i]=S.useState(""),[d,f]=S.useState(""),[m,v]=S.useState(null),{data:g,isLoading:p}=YE(),y=bg(),x=XE();function N(E,T){const k=`${E}/${T??""}`;v(k),y.mutate({repo:E,filename:T||void 0,token:a||void 0},{onSuccess:A=>{ze.success(A.message),v(null)},onError:A=>{ze.error(A instanceof Error?A.message:"Download failed"),v(null)}})}function M(E){confirm(`Delete ${E}?`)&&x.mutate(E,{onSuccess:()=>ze.success(`Deleted ${E}`),onError:()=>ze.error("Failed to delete")})}function j(){o&&N(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(ej,{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(Ld,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Installed Models"})]}),p?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:()=>M(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(gi,{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(jj,{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:rs.map(E=>{const T=g?.some(k=>k.name===E.ggufFilename||k.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]}),T&&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:()=>N(E.hfRepoGguf,E.ggufFilename),disabled:m!==null,className:ae("ml-4 flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",T?"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(xl,{size:14}),m===`${E.hfRepoGguf}/${E.ggufFilename}`?"Downloading...":T?"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(xl,{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:j,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(xl,{size:14}),m===`${o}/${d}`?"Downloading...":"Download"]})]})]})]})}async function ZE(){const{data:a}=await ye.get("/api/quick-sets");return a}async function $E(a){const{data:s}=await ye.post("/api/quick-sets/apply",a);return s}async function JE(a){const{data:s}=await ye.post("/api/quick-sets/custom",a);return s}async function PE(a){const{data:s}=await ye.delete(`/api/quick-sets/custom/${a}`);return s}function IE(){return jt({queryKey:["quick-sets"],queryFn:ZE,staleTime:6e4})}function WE(){const a=vt();return wt({mutationFn:s=>$E(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]}),a.invalidateQueries({queryKey:["settings"]}),a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function e3(){const a=vt();return wt({mutationFn:s=>JE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}function t3(){const a=vt();return wt({mutationFn:s=>PE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}const qx=["GGUF","MLX","VLLM","TRANSFORMERS","REST"];function a3(){const{data:a,isLoading:s,error:o}=IE(),i=WE(),d=e3(),f=t3(),[m,v]=S.useState(null),[g,p]=S.useState(""),[y,x]=S.useState(""),[N,M]=S.useState(""),[j,E]=S.useState(""),[T,k]=S.useState(""),[A,V]=S.useState(new Set(["live"])),[q,te]=S.useState(!1),[W,z]=S.useState(""),[B,re]=S.useState(""),[Ne,oe]=S.useState(""),[he,Ce]=S.useState(""),[Re,ee]=S.useState("GGUF"),[w,F]=S.useState(8192),Y=a?.presets,xe=S.useMemo(()=>{if(!Y)return new Map;const $=new Map;for(const ie of Y){const ce=ie.family||"Custom",H=$.get(ce)??[];H.push(ie),$.set(ce,H)}return $},[Y]);function ve($){if(m===$.id){v(null);return}v($.id),p(a?.currentValues.modelName??""),M($.defaultBackend),E($.chatFormat),k($.promptProvider);const ie=a?.currentValues.contextWindow;x(ie&&ie>0?ie:$.defaultContextWindow)}function R($){V(ie=>{const ce=new Set(ie);return ce.has($)?ce.size>1&&ce.delete($):ce.add($),ce})}function X(){!m||!g.trim()||i.mutate({presetId:m,modelName:g.trim(),contextWindow:y?Number(y):void 0,backend:N,chatFormat:j,promptProvider:T,targets:Array.from(A)},{onSuccess:$=>{$.success?ze.success($.message):ze.warning($.message),v(null)},onError:$=>{ze.error($.message||"Failed to apply preset")}})}function K(){!W.trim()||!Ne.trim()||!he.trim()||d.mutate({name:W.trim(),family:B.trim()||"Custom",chatFormat:Ne.trim(),promptProvider:he.trim(),defaultBackend:Re,defaultContextWindow:w?Number(w):8192},{onSuccess:()=>{ze.success(`Created preset "${W.trim()}"`),te(!1),z(""),re(""),oe(""),Ce(""),ee("GGUF"),F(8192)},onError:$=>{ze.error($.message||"Failed to create preset")}})}function I($){f.mutate($.id,{onSuccess:()=>{ze.success(`Deleted "${$.name}"`),m===$.id&&v(null)},onError:()=>ze.error("Failed to delete preset")})}const le=a?.presets.find($=>$.id===m);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(kn,{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(_t,{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(na,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:"Failed to load presets"})]}),!s&&Array.from(xe.entries()).map(([$,ie])=>l.jsxs("section",{children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text-muted)]",children:$}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:ie.map(ce=>l.jsxs("div",{className:ae("relative rounded-lg border px-4 py-3 transition-colors",m===ce.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:()=>ve(ce),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:ce.name}),m===ce.id&&l.jsx(xi,{size:16,className:"text-[var(--color-primary)]"})]}),ce.description&&l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:ce.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:ce.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:ce.defaultBackend})]})]}),ce.isCustom&&l.jsx("button",{onClick:()=>I(ce),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(gi,{size:14})})]},ce.id))})]},$)),!s&&!q&&l.jsxs("button",{onClick:()=>te(!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"]}),q&&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:()=>te(!1),className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:l.jsx(Hd,{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:W,onChange:$=>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:B,onChange:$=>re($.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:Ne,onChange:$=>oe($.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:he,onChange:$=>Ce($.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:Re,onChange:$=>ee($.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:qx.map($=>l.jsx("option",{value:$,children:$},$))})]}),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:$=>F($.target.value?parseInt($.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:K,disabled:!W.trim()||!Ne.trim()||!he.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(_t,{size:14,className:"animate-spin"}):l.jsx(ti,{size:14}),d.isPending?"Creating...":"Create Preset"]}),l.jsx("button",{onClick:()=>te(!1),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]}),le&&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: ",le.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($=>l.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[l.jsx("input",{type:"checkbox",checked:A.has($),onChange:()=>R($),className:"rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),l.jsx("span",{className:"capitalize",children:$})]},$))})]}),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:"Model file path"}),l.jsx("input",{type:"text",value:g,onChange:$=>p($.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:j,onChange:$=>E($.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:T,onChange:$=>k($.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:y,onChange:$=>x($.target.value?parseInt($.target.value,10):""),placeholder:String(le.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:N,onChange:$=>M($.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:qx.map($=>l.jsx("option",{value:$,children:$},$))})]})]})]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[l.jsxs("button",{onClick:X,disabled:!g.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(_t,{size:14,className:"animate-spin"}):l.jsx(oi,{size:14}),i.isPending?"Applying...":"Apply Settings"]}),l.jsx("button",{onClick:()=>v(null),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]})}const Ku={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 n3(){const a=wa(),{data:s,isLoading:o}=yg(),[i,d]=S.useState("idle"),[f,m]=S.useState([]),[v,g]=S.useState(null),p=S.useRef(null),y=S.useCallback(M=>{m(j=>[...j,M])},[]);S.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[f]);async function x(){d("preflight"),m([]),g(null);try{const M=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),j=await fetch("/api/update/apply",{method:"POST",headers:{Authorization:`Bearer ${M}`}});if(!j.ok||!j.body){const A=await j.text();throw new Error(A||`HTTP ${j.status}`)}const E=j.body.getReader(),T=new TextDecoder;let k="";for(;;){const{done:A,value:V}=await E.read();if(A)break;k+=T.decode(V,{stream:!0});const q=k.split(`
17
+ `);k=q.pop()??"";for(const te of q)if(te.startsWith("data: "))try{const W=JSON.parse(te.slice(6));if(W.phase&&d(W.phase),W.message&&y({text:W.message,phase:W.phase}),W.stream&&W.text&&y({text:W.text.trim()}),W.restart){d("restarting"),y({text:"Admin server restarting with new version..."}),await r3(s?.latestVersion??""),d("done"),y({text:"Upgrade complete!"});return}if(W.done&&W.code!==0)throw new Error(W.error??"Upgrade failed");W.done&&W.code===0&&d("done")}catch(W){if(W instanceof SyntaxError)continue;throw W}}}catch(M){const j=M instanceof Error?M.message:String(M);g(j),d("error"),y({text:`Error: ${j}`})}}if(o)return l.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:l.jsx(aa,{size:24,className:"animate-spin text-[var(--color-primary)]"})});const N=Object.keys(Ku).filter(M=>{const j=Object.keys(Ku),E=j.indexOf(i);return j.indexOf(M)<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(Ku).map(([M,j])=>{const E=M===i,T=N.includes(M),k=M===i&&i==="error";return l.jsxs("div",{className:"flex items-center gap-2",children:[T?l.jsx(xt,{size:16,className:"text-green-500"}):k?l.jsx(na,{size:16,className:"text-red-500"}):E?l.jsx(aa,{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:ae("text-sm",E?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",T&&"text-green-500"),children:j})]},M)})}),f.length>0&&l.jsx("div",{ref:p,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((M,j)=>l.jsx("div",{children:M.text},j))}),v&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(na,{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(Jv,{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(xt,{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(_t,{size:16}),"Retry"]})]})]})}async function r3(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 Zu={regenerate:"Regenerating compose from registry",pull:"Pulling images for new release track",apply:"Applying changes (docker compose up)",done:"Complete"};function s3(){const a=wa(),s=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),[o,i]=S.useState("loading_options"),[d,f]=S.useState([]),[m,v]=S.useState(null),g=S.useRef(null),[p,y]=S.useState([]),[x,N]=S.useState(!1),[M,j]=S.useState("https://relay.jarvisautomation.io"),[E,T]=S.useState("/whisper-models/ggml-base.en.bin"),[k,A]=S.useState("stable"),V=S.useCallback(z=>{f(B=>[...B,z])},[]);S.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[d]),S.useEffect(()=>{async function z(){try{const B=await fetch("/api/install/reconcile/options",{headers:{Authorization:`Bearer ${s}`}});if(!B.ok)throw new Error(`HTTP ${B.status}`);const re=await B.json();y(re.services),N(re.relayEnabled),j(re.relayUrl||"https://relay.jarvisautomation.io"),T(re.whisperModelPath||"/whisper-models/ggml-base.en.bin"),A(re.releaseTrack??"stable"),i("options")}catch(B){v(B instanceof Error?B.message:"Failed to load options"),i("error")}}z()},[s]);function q(z){y(B=>B.map(re=>re.id===z?{...re,enabled:!re.enabled}:re))}async function te(){i("regenerate"),f([]),v(null);const z=p.filter(B=>B.enabled).map(B=>B.id);try{const B=await fetch("/api/install/reconcile",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({enabledModules:z,relayEnabled:x,relayUrl:M,whisperModelPath:E,releaseTrack:k})});if(!B.ok||!B.body){const he=await B.text();throw new Error(he||`HTTP ${B.status}`)}const re=B.body.getReader(),Ne=new TextDecoder;let oe="";for(;;){const{done:he,value:Ce}=await re.read();if(he)break;oe+=Ne.decode(Ce,{stream:!0});const Re=oe.split(`
18
+ `);oe=Re.pop()??"";for(const ee of Re)if(ee.startsWith("data: "))try{const w=JSON.parse(ee.slice(6));if(w.phase&&i(w.phase),w.message&&V({text:w.message,phase:w.phase}),w.stream&&w.text&&V({text:w.text.trim()}),w.done&&w.code!==0)throw new Error(w.message??"Reconcile failed")}catch(w){if(w instanceof SyntaxError)continue;throw w}}}catch(B){const re=B instanceof Error?B.message:String(B);v(re),i("error"),V({text:`Error: ${re}`})}}const W=Object.keys(Zu).filter(z=>{const B=Object.keys(Zu),re=B.indexOf(o);return B.indexOf(z)<re||o==="done"&&z==="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 and apply changes to the running stack."]})]}),o==="loading_options"&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(aa,{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:p.map(z=>l.jsxs("button",{onClick:()=>q(z.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:[z.enabled?l.jsx(xt,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(ls,{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:z.name}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:z.description})]})]},z.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:k==="dev"?"Dev":"Stable"}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:k==="dev"?"Using latest main branch builds (may be unstable)":"Using tagged releases"})]}),l.jsx("button",{type:"button",role:"switch","aria-checked":k==="dev",onClick:()=>A(k==="dev"?"stable":"dev"),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${k==="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 ${k==="dev"?"translate-x-5":"translate-x-0"}`})})]}),k==="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:()=>N(!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(xt,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(ls,{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:M,onChange:z=>j(z.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)]"})]})]}),p.some(z=>z.id==="jarvis-whisper-api"&&z.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:z=>T(z.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."]})]})]})]}),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(Zu).map(([z,B])=>{const re=z===o,Ne=W.includes(z),oe=z===o&&o==="error";return l.jsxs("div",{className:"flex items-center gap-2",children:[Ne?l.jsx(xt,{size:16,className:"text-green-500"}):oe?l.jsx(na,{size:16,className:"text-red-500"}):re?l.jsx(aa,{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:ae("text-sm",re?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",Ne&&"text-green-500"),children:B})]},z)})}),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((z,B)=>l.jsx("div",{children:z.text},B))}),m&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(na,{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:te,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(Wv,{size:16}),"Sync now"]}),(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(xt,{size:16}),"Back to dashboard"]}),o==="error"&&l.jsxs("button",{onClick:te,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(_t,{size:16}),"Retry"]})]})]})}async function l3(a={}){const{data:s}=await ye.get("/api/traces",{params:a});return s}async function o3(a){const{data:s}=await ye.get(`/api/traces/${a}`);return s}async function i3(){const{data:a}=await ye.get("/api/admin/households");return a}async function c3(){const{data:a}=await ye.get("/api/admin/nodes");return a}function Hx(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function Gx(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function u3(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 d3(a){return a==="mobile"?"📱":"🔊"}function f3(){const a=wa(),[s,o]=S.useState(""),[i,d]=S.useState(""),[f,m]=S.useState(""),[v,g]=S.useState(""),[p,y]=S.useState(new Set),x=jt({queryKey:["admin","households"],queryFn:i3,staleTime:6e4}),N=jt({queryKey:["admin","nodes"],queryFn:c3,staleTime:6e4}),{data:M,isLoading:j,error:E}=jt({queryKey:["traces",s,i,f,v],queryFn:()=>l3({limit:100,...s?{status:s}:{},...i?{source:i}:{},...f?{household_id:f}:{},...v?{node_id:v}:{}}),refetchInterval:1e4}),T=S.useMemo(()=>{const z=N.data??[];return f?z.filter(B=>B.household_id===f):z},[N.data,f]),k=S.useMemo(()=>{const z=new Map;for(const B of N.data??[])z.set(B.node_id,B.name);return z},[N.data]),A=S.useMemo(()=>{const z=new Map;for(const B of x.data??[])z.set(B.id,B.name);return z},[x.data]),V=S.useMemo(()=>M?u3(M.traces):[],[M]);function q(z){y(B=>{const re=new Set(B);return re.has(z)?re.delete(z):re.add(z),re})}function te(z){if(m(z),z&&v){const B=(N.data??[]).find(re=>re.node_id===v);B&&B.household_id!==z&&g("")}}const W="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:W,value:f,onChange:z=>te(z.target.value),disabled:x.isLoading,children:[l.jsx("option",{value:"",children:"All households"}),(x.data??[]).map(z=>l.jsx("option",{value:z.id,children:z.name},z.id))]}),l.jsxs("select",{className:W,value:v,onChange:z=>g(z.target.value),disabled:N.isLoading,children:[l.jsx("option",{value:"",children:"All nodes"}),T.map(z=>l.jsx("option",{value:z.node_id,children:z.name},z.node_id))]}),l.jsxs("select",{className:W,value:s,onChange:z=>o(z.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:W,value:i,onChange:z=>d(z.target.value),children:[l.jsx("option",{value:"",children:"All sources"}),l.jsx("option",{value:"node",children:"Node"}),l.jsx("option",{value:"mobile",children:"Mobile"})]})]})]}),j&&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"}),M&&l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[M.total," traces in ",V.length," conversation",V.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:[V.map(z=>{const B=p.has(z.conversation_id),re=z.traces.length,Ne=z.node_id?k.get(z.node_id)??z.node_id.slice(0,8):"-";return l.jsxs(S.Fragment,{children:[l.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>q(z.conversation_id),children:[l.jsx("td",{className:"px-2 py-2 text-center text-[var(--color-text-muted)]",children:re>1?B?"▼":"▶":""}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] whitespace-nowrap",children:Gx(z.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:[d3(z.source),z.source]})}),l.jsxs("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap",children:[Ne,z.household_id&&l.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["· ",A.get(z.household_id)??""]})]}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:z.user_command??"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] max-w-xs truncate",children:z.assistant_message??"-"}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:Hx(z.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 ${z.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:re})]}),B&&z.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"}),Gx(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?k.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:Hx(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))]},z.conversation_id)}),V.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 as(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}const Qx={cc:"#9e9e9e",llm_proxy:"#42a5f5",node:"#66bb6a",tts:"#ffa726",whisper:"#ab47bc"},Vx={cc:"Command Center",llm_proxy:"LLM Proxy",node:"Node",tts:"TTS",whisper:"Whisper"};function m3(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 h3(){const{id:a}=T0(),s=wa(),[o,i]=S.useState(!1),[d,f]=S.useState(null),{data:m,isLoading:v,error:g}=jt({queryKey:["trace",a],queryFn:()=>o3(a),enabled:!!a}),p=S.useMemo(()=>m?m3(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:as(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:p.map(y=>Vx[y.service]??y.service).join(" → ")}),l.jsx("div",{className:"space-y-2",children:p.map((y,x)=>{const N=Math.min(y.duration_ms/m.total_duration_ms*100,100),M=y.status==="error"?"#ef4444":Qx[y.service]??"#9e9e9e",j=Vx[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:M}}),l.jsx("span",{className:"w-32 text-sm text-[var(--color-text)] shrink-0",children:j}),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(N,1)}%`,backgroundColor:M,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:as(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 N=Math.min(y.duration_ms/m.total_duration_ms*100,100),M=y.start_ms/m.total_duration_ms*100,j=y.status==="error"?"#ef4444":Qx[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:`${M}%`,width:`${Math.max(N,.5)}%`,backgroundColor:j,minWidth:"2px"}})}),l.jsx("span",{className:"w-14 text-xs text-[var(--color-text-muted)] text-right shrink-0 tabular-nums",children:as(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:as(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:as(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:as(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 p3(){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(jd,{to:"/settings",className:"text-[var(--color-primary)] underline hover:opacity-80",children:"Go to Settings"})]})}const x3=7,v3={currentStep:0,totalSteps:x3,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 g3(a,s,o){return Math.max(s,Math.min(o,a))}function y3(a,s){switch(s.type){case"SET_STEP":return{...a,currentStep:g3(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_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 Sg=S.createContext(null);function b3({children:a}){const[s,o]=S.useReducer(y3,v3);return l.jsx(Sg.Provider,{value:{state:s,dispatch:o},children:a})}function dr(){const a=S.useContext(Sg);if(!a)throw new Error("useWizard must be used within a WizardProvider");return a}function S3(){const{state:a,dispatch:s}=dr(),[o,i]=S.useState(null),[d,f]=S.useState(!0),[m,v]=S.useState(!1);function g(){f(!0),v(!1),Qd().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))}S.useEffect(()=>{g()},[]);const p=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(aa,{size:20,className:"animate-spin text-[var(--color-primary)]"}):p?l.jsx(xt,{size:20,className:"text-green-500"}):l.jsx(Dd,{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...":p?"Docker is running":"Docker not found"}),!d&&!p&&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(vi,{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:ae("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(ij,{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:ae("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 Zo=[{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 N3(){const{state:a,dispatch:s}=dr(),[o,i]=S.useState(!a.hardware),[d,f]=S.useState(!1),[m,v]=S.useState(0),[g,p]=S.useState("");S.useEffect(()=>{a.hardware||hE().then(N=>{s({type:"SET_HARDWARE",hardware:N}),N.recommendedBackend==="remote"&&a.deploymentMode==="local"&&s({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"})}).catch(()=>{}).finally(()=>i(!1))},[]);function y(N,M){const j=Zo[N];if(!a.hardware)return;const E=j.gpu==="Other"?(parseInt(M??g,10)||0)*1024:j.vramMb,T={...a.hardware,gpuName:j.gpu,gpuVramMb:E||null,gpuType:j.gpuType,recommendedBackends:[...j.backends],recommendedBackend:j.defaultBackend};s({type:"SET_HARDWARE",hardware:T})}const x=a.hardware;return o?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[l.jsx(aa,{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(kn,{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(Ld,{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(kn,{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:N=>{const M=parseInt(N.target.value,10);v(M),Zo[M].gpu!=="Other"&&(y(M),f(!1))},className:ae("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:Zo.map((N,M)=>l.jsx("option",{value:M,children:N.label},`${N.label}-${M}`))})]}),Zo[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:N=>p(N.target.value),placeholder:"e.g. 24",className:ae("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:ae("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:N=>s({type:"SET_REMOTE_LLM_URL",url:N.target.value}),placeholder:"http://192.168.1.100:7704",className:ae("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:N=>s({type:"SET_REMOTE_WHISPER_URL",url:N.target.value}),placeholder:"http://192.168.1.100:7706",className:ae("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 j3(){const{state:a,dispatch:s}=dr(),[o,i]=S.useState(null),[d,f]=S.useState(!0);if(S.useEffect(()=>{Promise.all([gg(),pE()]).then(([p,y])=>{if(i(p),a.enabledModules.length===0&&s({type:"SET_ENABLED_MODULES",modules:y.enabledModules}),a.platform==="darwin"&&a.nativeServices.length===0){const x=p.services.filter(N=>N.nativeCapable).map(N=>N.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(aa,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const{core:m,recommended:v,optional:g}=w3(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($u,{title:"Core",subtitle:"Always included",services:m,enabled:m.map(p=>p.id),nativeServices:a.nativeServices,platform:a.platform,locked:!0}),l.jsx($u,{title:"Recommended",subtitle:"Enabled by default",services:v,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(p,y)=>s({type:"TOGGLE_MODULE",serviceId:p,enabled:y}),onToggleNative:(p,y)=>s({type:"TOGGLE_NATIVE_SERVICE",serviceId:p,enabled:y})}),g.length>0&&l.jsx($u,{title:"Optional",subtitle:"Off by default",services:g,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(p,y)=>s({type:"TOGGLE_MODULE",serviceId:p,enabled:y}),onToggleNative:(p,y)=>s({type:"TOGGLE_NATIVE_SERVICE",serviceId:p,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:ae("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(xt,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(ls,{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($N,{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 w3(a){return{core:a.filter(s=>s.category==="core"),recommended:a.filter(s=>s.category==="recommended"),optional:a.filter(s=>s.category==="optional")}}function $u({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(p=>{const y=i.includes(p.id),x=p.nativeCapable&&g==="darwin"&&y,N=d.includes(p.id);return l.jsxs("div",{className:ae("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?.(p.id,!y),className:ae("flex w-full items-center gap-3 px-3 py-2.5 text-left",f&&"cursor-default"),children:[f?l.jsx(Ud,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}):y?l.jsx(xt,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(ls,{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:p.name}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",p.port]}),p.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:p.description})]})]}),x&&l.jsxs("button",{type:"button",onClick:()=>v?.(p.id,!N),className:ae("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(kn,{size:12,className:N?"text-amber-500":"text-[var(--color-text-muted)]"}),l.jsx("span",{className:N?"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:N?"On (uses Apple GPU)":"Off (runs in Docker)"})]})]},p.id)})})]})}function E3(){const{state:a}=dr(),[s,o]=S.useState(null);if(S.useEffect(()=>{gg().then(o).catch(()=>{})},[]),!s)return l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(aa,{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 N=a.portOverrides[x.id]??x.port,M=m.get(N)??[];m.set(N,[...M,x.name])}const v=[...m.entries()].filter(([,x])=>x.length>1),g=f.filter(x=>x.database).length,p=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(Ju,{label:"Docker Services",value:y.length}),l.jsx(Ju,{label:"Native Services",value:p.length}),l.jsx(Ju,{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(xt,{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(na,{size:16,className:"text-amber-500"}),l.jsx("span",{className:"text-sm font-medium text-amber-500",children:"Port Conflicts"})]}),v.map(([x,N])=>l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Port ",x,": ",N.join(", ")]},x))]})]})}function Ju({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 Pu(){const[a,s]=S.useState({lines:[],running:!1,done:!1,exitCode:null,error:null,redirect:null}),o=S.useRef(null),i=S.useCallback((f,m)=>(o.current?.close(),s({lines:[],running:!0,done:!1,exitCode:null,error:null,redirect:null}),new Promise((v,g)=>{const p=new EventSource(f);o.current=p,p.onmessage=y=>{try{const x=JSON.parse(y.data);if(m&&m(x),"done"in x){if(s(N=>({...N,running:!1,done:!0,exitCode:x.code,redirect:x.redirect??null})),p.close(),x.code===0)v(x.code);else{const N=x.error?String(x.error):`Process exited with code ${x.code}`;g(new Error(N))}return}if("stream"in x&&"text"in x){const N={stream:x.stream,text:x.text,timestamp:Date.now()};s(M=>({...M,lines:[...M.lines,N]}))}}catch{}},p.onerror=()=>{const y=o.current===null;s(x=>({...x,running:!1,error:x.done?null:"Connection lost"})),p.close(),y||g(new Error("Connection lost"))}})),[]),d=S.useCallback(()=>{o.current?.close(),o.current=null,s(f=>({...f,running:!1}))},[]);return{...a,run:i,stop:d}}function Iu({lines:a,running:s,title:o,className:i}){const d=S.useRef(null),f=S.useRef(!0);S.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:ae("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:ae("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 T3(){const{state:a,dispatch:s}=dr(),o=Pu(),i=Pu(),d=Pu(),[f,m]=S.useState("idle"),[v,g]=S.useState(null),[p,y]=S.useState(null),[x,N]=S.useState({}),[M,j]=S.useState({}),[E,T]=S.useState(null),[k,A]=S.useState(null),[V,q]=S.useState(null),[te,W]=S.useState({});S.useEffect(()=>{const ee=i.redirect;if(f!=="done"||!ee)return;A(5);const w=setInterval(()=>{A(F=>F===null||F<=1?(clearInterval(w),window.location.href=ee,0):F-1)},1e3);return()=>clearInterval(w)},[f,i.redirect]);const z=S.useCallback(async()=>{m("preflight"),y(null),g(null);try{const ee=await mE(a.enabledModules);return y(ee),ee.canProceed?!0:(g("Pre-flight checks failed. Fix the issues above and retry."),m("error"),T("preflight"),!1)}catch(ee){return g(`Pre-flight check failed: ${ee instanceof Error?ee.message:String(ee)}`),m("error"),T("preflight"),!1}},[a.enabledModules]);async function B(){if(a.nativeServices.length!==0){m("native");for(const ee of a.nativeServices){q(ee);try{await d.run(`/api/native-services/${ee}/install`),W(w=>({...w,[ee]:{ok:!0}}))}catch(w){const F=w instanceof Error?w.message:String(w);W(Y=>({...Y,[ee]:{ok:!1,error:F}}))}}q(null)}}async function re(){g(null),N({}),T(null),W({}),s({type:"SET_INSTALL_RUNNING",running:!0});try{if(!await z()){s({type:"SET_INSTALL_RUNNING",running:!1});return}m("generating"),await zx(a),m("pulling"),await o.run("/api/install/pull"),m("starting"),await i.run("/api/install/start",w=>{if(w.phase==="health"&&typeof w.service=="string"&&N(F=>({...F,[w.service]:{healthy:w.healthy,error:w.error}})),w.serviceHealth&&typeof w.serviceHealth=="object"){const F=w.serviceHealth;N(Y=>({...Y,...F}))}}),await B(),m("done"),s({type:"SET_INSTALL_COMPLETE"})}catch(ee){g(ee instanceof Error?ee.message:String(ee)),m("error"),T(f),s({type:"SET_INSTALL_RUNNING",running:!1})}}async function Ne(){if(E==="preflight"){if(g(null),s({type:"SET_INSTALL_RUNNING",running:!0}),!await z()){s({type:"SET_INSTALL_RUNNING",running:!1});return}try{m("generating"),await zx(a),m("pulling"),await o.run("/api/install/pull"),m("starting"),await i.run("/api/install/start",w=>{if(w.phase==="health"&&typeof w.service=="string"&&N(F=>({...F,[w.service]:{healthy:w.healthy,error:w.error}})),w.serviceHealth&&typeof w.serviceHealth=="object"){const F=w.serviceHealth;N(Y=>({...Y,...F}))}}),await B(),m("done"),s({type:"SET_INSTALL_COMPLETE"})}catch(w){g(w instanceof Error?w.message:String(w)),m("error"),s({type:"SET_INSTALL_RUNNING",running:!1})}}else re()}async function oe(ee){try{const w=await fetch(`/api/containers/${ee}/logs`);if(w.ok){const F=await w.text();j(Y=>({...Y,[ee]:F}))}else j(F=>({...F,[ee]:`Failed to fetch logs: HTTP ${w.status}`}))}catch(w){j(F=>({...F,[ee]:`Failed to fetch logs: ${w instanceof Error?w.message:String(w)}`}))}}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"}`}]:[]],Re=he.map(ee=>ee.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?`Installation complete! Redirecting to your admin dashboard in ${k??"..."}s...`:"Installation complete! All services are running.":f==="error"?"Installation encountered an error.":"Installing..."})]}),p&&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:p.checks.map(ee=>l.jsx("div",{className:"flex items-center justify-between px-3 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[ee.status==="pass"?l.jsx(xt,{size:14,className:"text-green-500"}):ee.status==="warn"?l.jsx(na,{size:14,className:"text-amber-500"}):l.jsx(pl,{size:14,className:"text-red-500"}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ee.name}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:ee.message}),ee.details&&ee.status!=="pass"&&l.jsx("p",{className:"text-xs text-[var(--color-text-muted)] opacity-60",children:ee.details})]})]})},ee.name))})]}),l.jsx("div",{className:"space-y-2",children:he.map((ee,w)=>{const F=ee.key===f,Y=Re>w||f==="done",xe=f==="error"&&ee.key===E;return l.jsxs("div",{className:"flex items-center gap-3",children:[Y?l.jsx(xt,{size:18,className:"text-green-500"}):xe?l.jsx(pl,{size:18,className:"text-red-500"}):F?l.jsx(aa,{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:ae("text-sm",Y?"text-green-500":F?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:ee.label})]},ee.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(([ee,w])=>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:ee}),l.jsxs("div",{className:"flex items-center gap-2",children:[!w.healthy&&l.jsxs("button",{type:"button",onClick:()=>oe(ee),className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[l.jsx(Iv,{size:12}),"Logs"]}),w.healthy?l.jsx(xt,{size:14,className:"text-green-500"}):l.jsx(pl,{size:14,className:"text-red-500"})]})]}),w.error&&l.jsx("p",{className:"px-3 pb-2 text-xs text-red-400",children:w.error}),M[ee]&&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:M[ee]})})]},ee))})]}),(o.lines.length>0||o.running)&&l.jsx(Iu,{lines:o.lines,running:o.running,title:"docker compose pull"}),(i.lines.length>0||i.running)&&l.jsx(Iu,{lines:i.lines,running:i.running,title:"docker compose up -d"}),(f==="native"||Object.keys(te).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(ee=>{const w=te[ee],F=V===ee&&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:ee}),w?.ok?l.jsx(xt,{size:14,className:"text-green-500"}):w?l.jsx(pl,{size:14,className:"text-red-500"}):F?l.jsx(aa,{size:14,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-3 w-3 rounded-full border border-[var(--color-border)]"})]}),w?.error&&l.jsx("p",{className:"mt-1 text-xs text-red-400",children:w.error})]},ee)})})]}),(d.lines.length>0||d.running)&&l.jsx(Iu,{lines:d.lines,running:d.running,title:V?`deploy-launchd.sh (${V})`:"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"?Ne:re,className:ae("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(vi,{size:18}):l.jsx(eg,{size:18}),f==="error"?"Retry Installation":"Start Installation"]})]})}function C3(){const{state:a,dispatch:s}=dr(),o=vg(),i=bg(),[d,f]=S.useState("select"),[m,v]=S.useState(null),[g,p]=S.useState("GGUF"),[y,x]=S.useState(""),[N,M]=S.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:"LLM Configuration"}),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(xt,{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})]})]})]});if(a.platform==="darwin")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:"LLM Configuration"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"On macOS, the LLM proxy runs natively to access Metal/MLX. Configure it from the dashboard after setup, or run it directly from the jarvis-llm-proxy-api directory."})]}),l.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4 text-sm text-amber-500",children:"macOS native LLM proxy is not yet available as a pip package. Model download through this wizard requires the LLM proxy running in Docker."})]});const j=q=>{v(q),M(null),q.gated&&!y.trim()?f("token"):T(q,y.trim())},E=()=>{if(!y.trim()){M("HuggingFace token is required for gated models");return}m&&T(m,y)},T=async(q,te)=>{f("downloading"),M(null);const W=g==="GGUF"?q.hfRepoGguf:q.hfRepoVllm,z=g==="GGUF"?q.ggufFilename:void 0;try{await i.mutateAsync({repo:W,filename:z,token:te||void 0}),await k(q)}catch(B){M(`Download failed: ${B.message}`),f("select")}},k=async q=>{f("configuring");const W={"model.main.name":g==="GGUF"?`.models/${q.ggufFilename}`:`.models/${q.hfRepoVllm.split("/").pop()}`,"model.main.backend":g,"model.main.chat_format":q.chatFormat,"model.main.context_window":q.contextWindow,"llm.interface":q.promptProvider};g==="GGUF"&&(W["inference.gguf.n_gpu_layers"]=-1),g==="VLLM"&&q.quantization&&(W["inference.vllm.quantization"]=q.quantization);try{await o.mutateAsync(W),s({type:"SET_LLM_INTERFACE",interfaceId:q.promptProvider}),f("done")}catch(z){M(`Configuration failed: ${z.message}`),f("select")}},A=a.hardware?.gpuVramMb,V=A?rs.filter(q=>q.vramMb<=A):rs;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:"LLM Setup"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:d==="done"?"Model configured. The LLM proxy is restarting with the new model.":"Select and download a language model for Jarvis."})]}),N&&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(na,{size:16,className:"mt-0.5 shrink-0"}),N]}),m&&l.jsxs("button",{type:"button",onClick:()=>T(m,y),className:ae("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(vi,{size:14}),"Retry Download"]})]}),d==="select"&&l.jsxs(l.Fragment,{children:[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(q=>l.jsx("button",{type:"button",onClick:()=>p(q),className:ae("rounded-md px-3 py-1 text-xs font-medium transition-colors",g===q?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:q==="VLLM"?"vLLM":q},q))})]}),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:y,onChange:q=>x(q.target.value),placeholder:"hf_...",className:ae("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:[V.map(q=>l.jsxs("button",{type:"button",onClick:()=>j(q),className:ae("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:q.displayName}),q.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(Ud,{size:10}),"Gated"]})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[q.promptProvider," · ",q.contextWindow.toLocaleString()," ctx"]})]}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["~",g==="GGUF"?q.sizeGguf:q.sizeVllm]})]},q.id)),V.length===0&&l.jsxs("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:["No models fit your available VRAM (",A?Math.round(A/1024)+" GB":"unknown","). Consider using Remote LLM mode."]}),A&&V.length<rs.length&&l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Showing ",V.length," of ",rs.length," models that fit your ",Math.round(A/1024)," GB VRAM."]})]})]}),d==="token"&&m&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[l.jsx("strong",{children:m.displayName})," is a gated model. Accept the license on HuggingFace and paste your access token below."]}),l.jsx("input",{type:"password",value:y,onChange:q=>x(q.target.value),placeholder:"hf_...",className:ae("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:()=>{f("select"),M(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),l.jsx("button",{type:"button",onClick:E,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Download"})]})]}),d==="downloading"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(xl,{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 ",m?.displayName,"..."]}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["~",g==="GGUF"?m?.sizeGguf:m?.sizeVllm," · This may take several minutes"]})]}),d==="configuring"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(aa,{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..."})]}),d==="done"&&m&&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(xt,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:[m.displayName," configured"]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Backend: ",g," · Prompt provider: ",m.promptProvider]})]})]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["The LLM proxy is restarting with the new model. It may take a minute to load. Command Center will automatically use the ",l.jsx("strong",{children:m.promptProvider})," prompt provider for optimized command parsing."]})]})]})}function R3(){const[a,s]=S.useState(""),[o,i]=S.useState(""),[d,f]=S.useState(""),[m,v]=S.useState(""),[g,p]=S.useState(!1),[y,x]=S.useState(!1),[N,M]=S.useState(null),j=o===d,E=a&&o&&d&&m&&j&&!g;async function T(){if(E){p(!0),M(null);try{const A=await Xv(a,o,m);ns(A.access_token),localStorage.setItem("access_token",A.access_token),localStorage.setItem("refresh_token",A.refresh_token),x(!0)}catch(A){const V=A?.response?.data?.error??(A instanceof Error?A.message:"Failed to create account");M(V)}finally{p(!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(xt,{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 k=ae("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:A=>v(A.target.value),className:k,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:A=>s(A.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",value:o,onChange:A=>i(A.target.value),className:k,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:A=>f(A.target.value),className:ae(k,d&&!j&&"ring-2 ring-red-500"),placeholder:"Confirm password"}),d&&!j&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Passwords don't match"})]})]}),N&&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(Dd,{size:14,className:"text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm text-red-500",children:N})]}),l.jsxs("button",{type:"button",onClick:T,disabled:!E,className:ae("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(vi,{size:14}),"Retry"]})]}),!N&&l.jsx("button",{type:"button",onClick:T,disabled:!E,className:ae("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 $o=[{label:"Welcome",component:S3},{label:"Hardware",component:N3},{label:"Services",component:j3},{label:"Review",component:E3},{label:"Install",component:T3},{label:"Account",component:R3},{label:"LLM",component:C3}],_3=5;function M3({skipToAccount:a}){const{state:s,dispatch:o}=dr();S.useEffect(()=>{a&&o({type:"SET_STEP",step:_3})},[a,o]);const i=wa(),d=$o[s.currentStep].component,f=s.currentStep===0,m=s.currentStep===$o.length-1,p=s.currentStep===4&&!s.installComplete,y=s.installRunning||p;function x(){m?i("/login"):o({type:"NEXT_STEP"})}function N(){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:$o.map((M,j)=>l.jsxs("button",{type:"button",onClick:()=>!y&&o({type:"SET_STEP",step:j}),disabled:y,className:ae("flex items-center gap-1",y&&"cursor-not-allowed"),children:[l.jsx("div",{className:ae("flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium transition-colors",j===s.currentStep?"bg-[var(--color-primary)] text-white":j<s.currentStep?"bg-[var(--color-primary)]/20 text-[var(--color-primary)]":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:j+1}),l.jsx("span",{className:ae("hidden text-xs sm:inline",j===s.currentStep?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:M.label}),j<$o.length-1&&l.jsx("div",{className:ae("mx-1 h-px w-4 sm:w-6",j<s.currentStep?"bg-[var(--color-primary)]/30":"bg-[var(--color-border)]")})]},M.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:N,disabled:f||y,className:ae("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:ae("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(b3,{children:l.jsx(M3,{skipToAccount:a})})}function k3(){const a=wa(),s=vg(),o=fE(),[i,d]=S.useState("select"),[f,m]=S.useState(null),[v,g]=S.useState("GGUF"),[p,y]=S.useState(""),[x,N]=S.useState(null),M=A=>{m(A),A.gated?d("token"):E(A,"")},j=()=>{if(!p.trim()){N("HuggingFace token is required for gated models");return}N(null),f&&E(f,p)},E=async(A,V)=>{d("download"),N(null);const q=v==="GGUF"?A.hfRepoGguf:A.hfRepoVllm,te=v==="GGUF"?A.ggufFilename:void 0;try{await o.mutateAsync({repo:q,filename:te,token:V||void 0}),T(A)}catch(W){N(`Download failed: ${W.message}`),d("select")}},T=async A=>{d("configure"),N(null);const q={"model.main.name":v==="GGUF"?`.models/${A.ggufFilename}`:`.models/${A.hfRepoVllm.split("/").pop()}`,"model.main.backend":v,"model.main.chat_format":A.chatFormat,"model.main.context_window":A.contextWindow};v==="GGUF"&&(q["inference.gguf.n_gpu_layers"]=-1),v==="VLLM"&&A.quantization&&(q["inference.vllm.quantization"]=A.quantization);try{await s.mutateAsync(q),d("done"),ze.success("LLM configured successfully")}catch(te){N(`Configuration failed: ${te.message}`),d("select")}},k=()=>{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(md,{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((A,V)=>{const q=i==="token"?"select":i,te=["select","download","configure","done"];return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:ae("h-2 w-2 rounded-full",q===A?"bg-[var(--color-primary)]":te.indexOf(q)>V?"bg-green-500":"bg-[var(--color-border)]")}),V<3&&l.jsx("div",{className:"h-px w-8 bg-[var(--color-border)]"})]},A)})}),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(na,{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:ae("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:ae("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:rs.map(A=>l.jsxs("button",{onClick:()=>M(A),className:ae("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:A.displayName}),A.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(Ud,{size:10}),"Gated"]})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[A.quantization?`${A.quantization.toUpperCase()} 4-bit`:A.chatFormat," · ",A.contextWindow.toLocaleString()," ctx"]})]}),l.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["~",v==="GGUF"?A.sizeGguf:A.sizeVllm]})]},A.id))}),l.jsx("div",{className:"flex justify-end pt-2",children:l.jsx("button",{onClick:k,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:p,onChange:A=>y(A.target.value),placeholder:"hf_...",className:ae("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"),N(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),l.jsx("button",{onClick:j,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(xl,{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(tg,{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(DN,{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(aa,{className:"animate-spin text-white",size:32})})]})})}const O3=new X1;function z3(){const[a,s]=S.useState(!0),[o,i]=S.useState(!1),[d,f]=S.useState(!1);return S.useEffect(()=>{Qd().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(Q0,{children:[l.jsx(pt,{path:"/setup",element:l.jsx(A3,{skipToAccount:d})}),l.jsx(pt,{path:"/login",element:l.jsx(Aw,{})}),l.jsx(pt,{path:"/llm-setup",element:l.jsx(k3,{})}),l.jsxs(pt,{element:l.jsx(Mw,{}),children:[l.jsx(pt,{path:"/dashboard",element:l.jsx(yE,{})}),l.jsx(pt,{path:"/settings",element:l.jsx(Fw,{})}),l.jsx(pt,{path:"/services",element:l.jsx(lE,{})}),l.jsx(pt,{path:"/models",element:l.jsx(KE,{})}),l.jsx(pt,{path:"/quick-sets",element:l.jsx(a3,{})}),l.jsx(pt,{path:"/traces",element:l.jsx(f3,{})}),l.jsx(pt,{path:"/traces/:id",element:l.jsx(h3,{})}),l.jsx(pt,{path:"/update",element:l.jsx(n3,{})}),l.jsx(pt,{path:"/reconcile",element:l.jsx(s3,{})}),l.jsx(pt,{path:"/nodes",element:l.jsx(RE,{})}),l.jsx(pt,{path:"/native-services",element:l.jsx(qE,{})}),l.jsx(pt,{path:"/",element:o?l.jsx(ni,{to:"/setup",replace:!0}):l.jsx(ni,{to:"/dashboard",replace:!0})}),l.jsx(pt,{path:"*",element:l.jsx(p3,{})})]})]})}function D3(){return l.jsx(O2,{children:l.jsx(K1,{client:O3,children:l.jsxs(xN,{children:[l.jsx(f1,{children:l.jsx(z3,{})}),l.jsx(A2,{position:"bottom-right",richColors:!0})]})})})}Gb.createRoot(document.getElementById("root")).render(l.jsx(S.StrictMode,{children:l.jsx(D3,{})}));