nestor-sh 2.0.2 → 2.0.3
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.
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
var Dp=Object.defineProperty;var Op=(l,c,u)=>c in l?Dp(l,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[c]=u;var tu=(l,c,u)=>Op(l,typeof c!="symbol"?c+"":c,u);(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const x of f)if(x.type==="childList")for(const g of x.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function u(f){const x={};return f.integrity&&(x.integrity=f.integrity),f.referrerPolicy&&(x.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?x.credentials="include":f.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function o(f){if(f.ep)return;f.ep=!0;const x=u(f);fetch(f.href,x)}})();var au={exports:{}},Sl={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Gx;function Lp(){if(Gx)return Sl;Gx=1;var l=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(o,f,x){var g=null;if(x!==void 0&&(g=""+x),f.key!==void 0&&(g=""+f.key),"key"in f){x={};for(var v in f)v!=="key"&&(x[v]=f[v])}else x=f;return f=x.ref,{$$typeof:l,type:o,key:g,ref:f!==void 0?f:null,props:x}}return Sl.Fragment=c,Sl.jsx=u,Sl.jsxs=u,Sl}var Vx;function _p(){return Vx||(Vx=1,au.exports=Lp()),au.exports}var a=_p(),nu={exports:{}},fe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Yx;function Up(){if(Yx)return fe;Yx=1;var l=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),g=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),j=Symbol.iterator;function A(R){return R===null||typeof R!="object"?null:(R=j&&R[j]||R["@@iterator"],typeof R=="function"?R:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,S={};function k(R,X,te){this.props=R,this.context=X,this.refs=S,this.updater=te||z}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 D(){}D.prototype=k.prototype;function U(R,X,te){this.props=R,this.context=X,this.refs=S,this.updater=te||z}var E=U.prototype=new D;E.constructor=U,N(E,k.prototype),E.isPureReactComponent=!0;var F=Array.isArray;function se(){}var B={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function ee(R,X,te){var le=te.ref;return{$$typeof:l,type:R,key:X,ref:le!==void 0?le:null,props:te}}function W(R,X){return ee(R.type,X,R.props)}function Q(R){return typeof R=="object"&&R!==null&&R.$$typeof===l}function ae(R){var X={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(te){return X[te]})}var K=/\/+/g;function de(R,X){return typeof R=="object"&&R!==null&&R.key!=null?ae(""+R.key):X.toString(36)}function ye(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(se,se):(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 $(R,X,te,le,me){var pe=typeof R;(pe==="undefined"||pe==="boolean")&&(R=null);var we=!1;if(R===null)we=!0;else switch(pe){case"bigint":case"string":case"number":we=!0;break;case"object":switch(R.$$typeof){case l:case c:we=!0;break;case w:return we=R._init,$(we(R._payload),X,te,le,me)}}if(we)return me=me(R),we=le===""?"."+de(R,0):le,F(me)?(te="",we!=null&&(te=we.replace(K,"$&/")+"/"),$(me,X,te,"",function(rn){return rn})):me!=null&&(Q(me)&&(me=W(me,te+(me.key==null||R&&R.key===me.key?"":(""+me.key).replace(K,"$&/")+"/")+we)),X.push(me)),1;we=0;var at=le===""?".":le+":";if(F(R))for(var Te=0;Te<R.length;Te++)le=R[Te],pe=at+de(le,Te),we+=$(le,X,te,pe,me);else if(Te=A(R),typeof Te=="function")for(R=Te.call(R),Te=0;!(le=R.next()).done;)le=le.value,pe=at+de(le,Te++),we+=$(le,X,te,pe,me);else if(pe==="object"){if(typeof R.then=="function")return $(ye(R),X,te,le,me);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 we}function P(R,X,te){if(R==null)return R;var le=[],me=0;return $(R,le,"","",function(pe){return X.call(te,pe,me++)}),le}function oe(R){if(R._status===-1){var X=R._result;X=X(),X.then(function(te){(R._status===0||R._status===-1)&&(R._status=1,R._result=te)},function(te){(R._status===0||R._status===-1)&&(R._status=2,R._result=te)}),R._status===-1&&(R._status=0,R._result=X)}if(R._status===1)return R._result.default;throw R._result}var Ce=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)},Ae={map:P,forEach:function(R,X,te){P(R,function(){X.apply(this,arguments)},te)},count:function(R){var X=0;return P(R,function(){X++}),X},toArray:function(R){return P(R,function(X){return X})||[]},only:function(R){if(!Q(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return fe.Activity=b,fe.Children=Ae,fe.Component=k,fe.Fragment=u,fe.Profiler=f,fe.PureComponent=U,fe.StrictMode=o,fe.Suspense=y,fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,fe.__COMPILER_RUNTIME={__proto__:null,c:function(R){return B.H.useMemoCache(R)}},fe.cache=function(R){return function(){return R.apply(null,arguments)}},fe.cacheSignal=function(){return null},fe.cloneElement=function(R,X,te){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var le=N({},R.props),me=R.key;if(X!=null)for(pe in X.key!==void 0&&(me=""+X.key),X)!Z.call(X,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&X.ref===void 0||(le[pe]=X[pe]);var pe=arguments.length-2;if(pe===1)le.children=te;else if(1<pe){for(var we=Array(pe),at=0;at<pe;at++)we[at]=arguments[at+2];le.children=we}return ee(R.type,me,le)},fe.createContext=function(R){return R={$$typeof:g,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:x,_context:R},R},fe.createElement=function(R,X,te){var le,me={},pe=null;if(X!=null)for(le in X.key!==void 0&&(pe=""+X.key),X)Z.call(X,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(me[le]=X[le]);var we=arguments.length-2;if(we===1)me.children=te;else if(1<we){for(var at=Array(we),Te=0;Te<we;Te++)at[Te]=arguments[Te+2];me.children=at}if(R&&R.defaultProps)for(le in we=R.defaultProps,we)me[le]===void 0&&(me[le]=we[le]);return ee(R,pe,me)},fe.createRef=function(){return{current:null}},fe.forwardRef=function(R){return{$$typeof:v,render:R}},fe.isValidElement=Q,fe.lazy=function(R){return{$$typeof:w,_payload:{_status:-1,_result:R},_init:oe}},fe.memo=function(R,X){return{$$typeof:h,type:R,compare:X===void 0?null:X}},fe.startTransition=function(R){var X=B.T,te={};B.T=te;try{var le=R(),me=B.S;me!==null&&me(te,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(se,Ce)}catch(pe){Ce(pe)}finally{X!==null&&te.types!==null&&(X.types=te.types),B.T=X}},fe.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},fe.use=function(R){return B.H.use(R)},fe.useActionState=function(R,X,te){return B.H.useActionState(R,X,te)},fe.useCallback=function(R,X){return B.H.useCallback(R,X)},fe.useContext=function(R){return B.H.useContext(R)},fe.useDebugValue=function(){},fe.useDeferredValue=function(R,X){return B.H.useDeferredValue(R,X)},fe.useEffect=function(R,X){return B.H.useEffect(R,X)},fe.useEffectEvent=function(R){return B.H.useEffectEvent(R)},fe.useId=function(){return B.H.useId()},fe.useImperativeHandle=function(R,X,te){return B.H.useImperativeHandle(R,X,te)},fe.useInsertionEffect=function(R,X){return B.H.useInsertionEffect(R,X)},fe.useLayoutEffect=function(R,X){return B.H.useLayoutEffect(R,X)},fe.useMemo=function(R,X){return B.H.useMemo(R,X)},fe.useOptimistic=function(R,X){return B.H.useOptimistic(R,X)},fe.useReducer=function(R,X,te){return B.H.useReducer(R,X,te)},fe.useRef=function(R){return B.H.useRef(R)},fe.useState=function(R){return B.H.useState(R)},fe.useSyncExternalStore=function(R,X,te){return B.H.useSyncExternalStore(R,X,te)},fe.useTransition=function(){return B.H.useTransition()},fe.version="19.2.4",fe}var Xx;function zu(){return Xx||(Xx=1,nu.exports=Up()),nu.exports}var d=zu(),su={exports:{}},zl={},lu={exports:{}},iu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Qx;function Bp(){return Qx||(Qx=1,(function(l){function c($,P){var oe=$.length;$.push(P);e:for(;0<oe;){var Ce=oe-1>>>1,Ae=$[Ce];if(0<f(Ae,P))$[Ce]=P,$[oe]=Ae,oe=Ce;else break e}}function u($){return $.length===0?null:$[0]}function o($){if($.length===0)return null;var P=$[0],oe=$.pop();if(oe!==P){$[0]=oe;e:for(var Ce=0,Ae=$.length,R=Ae>>>1;Ce<R;){var X=2*(Ce+1)-1,te=$[X],le=X+1,me=$[le];if(0>f(te,oe))le<Ae&&0>f(me,te)?($[Ce]=me,$[le]=oe,Ce=le):($[Ce]=te,$[X]=oe,Ce=X);else if(le<Ae&&0>f(me,oe))$[Ce]=me,$[le]=oe,Ce=le;else break e}}return P}function f($,P){var oe=$.sortIndex-P.sortIndex;return oe!==0?oe:$.id-P.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;l.unstable_now=function(){return x.now()}}else{var g=Date,v=g.now();l.unstable_now=function(){return g.now()-v}}var y=[],h=[],w=1,b=null,j=3,A=!1,z=!1,N=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function E($){for(var P=u(h);P!==null;){if(P.callback===null)o(h);else if(P.startTime<=$)o(h),P.sortIndex=P.expirationTime,c(y,P);else break;P=u(h)}}function F($){if(N=!1,E($),!z)if(u(y)!==null)z=!0,se||(se=!0,ae());else{var P=u(h);P!==null&&ye(F,P.startTime-$)}}var se=!1,B=-1,Z=5,ee=-1;function W(){return S?!0:!(l.unstable_now()-ee<Z)}function Q(){if(S=!1,se){var $=l.unstable_now();ee=$;var P=!0;try{e:{z=!1,N&&(N=!1,D(B),B=-1),A=!0;var oe=j;try{t:{for(E($),b=u(y);b!==null&&!(b.expirationTime>$&&W());){var Ce=b.callback;if(typeof Ce=="function"){b.callback=null,j=b.priorityLevel;var Ae=Ce(b.expirationTime<=$);if($=l.unstable_now(),typeof Ae=="function"){b.callback=Ae,E($),P=!0;break t}b===u(y)&&o(y),E($)}else o(y);b=u(y)}if(b!==null)P=!0;else{var R=u(h);R!==null&&ye(F,R.startTime-$),P=!1}}break e}finally{b=null,j=oe,A=!1}P=void 0}}finally{P?ae():se=!1}}}var ae;if(typeof U=="function")ae=function(){U(Q)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,de=K.port2;K.port1.onmessage=Q,ae=function(){de.postMessage(null)}}else ae=function(){k(Q,0)};function ye($,P){B=k(function(){$(l.unstable_now())},P)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function($){$.callback=null},l.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<$?Math.floor(1e3/$):5},l.unstable_getCurrentPriorityLevel=function(){return j},l.unstable_next=function($){switch(j){case 1:case 2:case 3:var P=3;break;default:P=j}var oe=j;j=P;try{return $()}finally{j=oe}},l.unstable_requestPaint=function(){S=!0},l.unstable_runWithPriority=function($,P){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var oe=j;j=$;try{return P()}finally{j=oe}},l.unstable_scheduleCallback=function($,P,oe){var Ce=l.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?Ce+oe:Ce):oe=Ce,$){case 1:var Ae=-1;break;case 2:Ae=250;break;case 5:Ae=1073741823;break;case 4:Ae=1e4;break;default:Ae=5e3}return Ae=oe+Ae,$={id:w++,callback:P,priorityLevel:$,startTime:oe,expirationTime:Ae,sortIndex:-1},oe>Ce?($.sortIndex=oe,c(h,$),u(y)===null&&$===u(h)&&(N?(D(B),B=-1):N=!0,ye(F,oe-Ce))):($.sortIndex=Ae,c(y,$),z||A||(z=!0,se||(se=!0,ae()))),$},l.unstable_shouldYield=W,l.unstable_wrapCallback=function($){var P=j;return function(){var oe=j;j=P;try{return $.apply(this,arguments)}finally{j=oe}}}})(iu)),iu}var Kx;function Hp(){return Kx||(Kx=1,lu.exports=Bp()),lu.exports}var cu={exports:{}},ot={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Zx;function qp(){if(Zx)return ot;Zx=1;var l=zu();function c(y){var h="https://react.dev/errors/"+y;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)h+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+y+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(c(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},f=Symbol.for("react.portal");function x(y,h,w){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:b==null?null:""+b,children:y,containerInfo:h,implementation:w}}var g=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(y,h){if(y==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ot.createPortal=function(y,h){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(c(299));return x(y,h,null,w)},ot.flushSync=function(y){var h=g.T,w=o.p;try{if(g.T=null,o.p=2,y)return y()}finally{g.T=h,o.p=w,o.d.f()}},ot.preconnect=function(y,h){typeof y=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(y,h))},ot.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},ot.preinit=function(y,h){if(typeof y=="string"&&h&&typeof h.as=="string"){var w=h.as,b=v(w,h.crossOrigin),j=typeof h.integrity=="string"?h.integrity:void 0,A=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;w==="style"?o.d.S(y,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:j,fetchPriority:A}):w==="script"&&o.d.X(y,{crossOrigin:b,integrity:j,fetchPriority:A,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ot.preinitModule=function(y,h){if(typeof y=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var w=v(h.as,h.crossOrigin);o.d.M(y,{crossOrigin:w,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(y)},ot.preload=function(y,h){if(typeof y=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var w=h.as,b=v(w,h.crossOrigin);o.d.L(y,w,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ot.preloadModule=function(y,h){if(typeof y=="string")if(h){var w=v(h.as,h.crossOrigin);o.d.m(y,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:w,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(y)},ot.requestFormReset=function(y){o.d.r(y)},ot.unstable_batchedUpdates=function(y,h){return y(h)},ot.useFormState=function(y,h,w){return g.H.useFormState(y,h,w)},ot.useFormStatus=function(){return g.H.useHostTransitionStatus()},ot.version="19.2.4",ot}var Jx;function $p(){if(Jx)return cu.exports;Jx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(c){console.error(c)}}return l(),cu.exports=qp(),cu.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Fx;function Gp(){if(Fx)return zl;Fx=1;var l=Hp(),c=zu(),u=$p();function o(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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function x(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 g(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 y(e){if(x(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=x(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,s=t;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(s=i.return,s!==null){n=s;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return y(i),e;if(r===s)return y(i),t;r=r.sibling}throw Error(o(188))}if(n.return!==s.return)n=i,s=r;else{for(var m=!1,p=i.child;p;){if(p===n){m=!0,n=i,s=r;break}if(p===s){m=!0,s=i,n=r;break}p=p.sibling}if(!m){for(p=r.child;p;){if(p===n){m=!0,n=r,s=i;break}if(p===s){m=!0,s=r,n=i;break}p=p.sibling}if(!m)throw Error(o(189))}}if(n.alternate!==s)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,j=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),U=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var K=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===K?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case k:return"Profiler";case S:return"StrictMode";case F:return"Suspense";case se:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case U:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case E:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var ye=Array.isArray,$=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},Ce=[],Ae=-1;function R(e){return{current:e}}function X(e){0>Ae||(e.current=Ce[Ae],Ce[Ae]=null,Ae--)}function te(e,t){Ae++,Ce[Ae]=e.current,e.current=t}var le=R(null),me=R(null),pe=R(null),we=R(null);function at(e,t){switch(te(pe,t),te(me,e),te(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dx(t),e=mx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}X(le),te(le,e)}function Te(){X(le),X(me),X(pe)}function rn(e){e.memoizedState!==null&&te(we,e);var t=le.current,n=mx(t,e.type);t!==n&&(te(me,e),te(le,n))}function on(e){me.current===e&&(X(le),X(me)),we.current===e&&(X(we),vl._currentValue=oe)}var As,$l;function Pt(e){if(As===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);As=t&&t[1]||"",$l=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+As+e+$l}var Es=!1;function Ts(e,t){if(!e||Es)return"";Es=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(q){var _=q}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(q){_=q}e.call(Y.prototype)}}else{try{throw Error()}catch(q){_=q}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(q){if(q&&_&&typeof q.stack=="string")return[q.stack,_.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=s.DetermineComponentFrameRoot(),m=r[0],p=r[1];if(m&&p){var C=m.split(`
|
|
44
|
+
`),L=p.split(`
|
|
45
|
+
`);for(i=s=0;s<C.length&&!C[s].includes("DetermineComponentFrameRoot");)s++;for(;i<L.length&&!L[i].includes("DetermineComponentFrameRoot");)i++;if(s===C.length||i===L.length)for(s=C.length-1,i=L.length-1;1<=s&&0<=i&&C[s]!==L[i];)i--;for(;1<=s&&0<=i;s--,i--)if(C[s]!==L[i]){if(s!==1||i!==1)do if(s--,i--,0>i||C[s]!==L[i]){var G=`
|
|
46
|
+
`+C[s].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=s&&0<=i);break}}}finally{Es=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Pt(n):""}function Gl(e,t){switch(e.tag){case 26:case 27:case 5:return Pt(e.type);case 16:return Pt("Lazy");case 13:return e.child!==t&&t!==null?Pt("Suspense Fallback"):Pt("Suspense");case 19:return Pt("SuspenseList");case 0:case 15:return Ts(e.type,!1);case 11:return Ts(e.type.render,!1);case 1:return Ts(e.type,!0);case 31:return Pt("Activity");default:return""}}function H(e){try{var t="",n=null;do t+=Gl(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
|
|
47
|
+
Error generating stack: `+s.message+`
|
|
48
|
+
`+s.stack}}var ne=Object.prototype.hasOwnProperty,xe=l.unstable_scheduleCallback,wt=l.unstable_cancelCallback,qc=l.unstable_shouldYield,$c=l.unstable_requestPaint,rt=l.unstable_now,Vl=l.unstable_getCurrentPriorityLevel,Rs=l.unstable_ImmediatePriority,Yl=l.unstable_UserBlockingPriority,Mn=l.unstable_NormalPriority,x0=l.unstable_LowPriority,Yu=l.unstable_IdlePriority,h0=l.log,g0=l.unstable_setDisableYieldValue,Ms=null,St=null;function Ma(e){if(typeof h0=="function"&&g0(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Ms,e)}catch{}}var zt=Math.clz32?Math.clz32:b0,p0=Math.log,y0=Math.LN2;function b0(e){return e>>>=0,e===0?32:31-(p0(e)/y0|0)|0}var Xl=256,Ql=262144,Kl=4194304;function un(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 Zl(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,r=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var p=s&134217727;return p!==0?(s=p&~r,s!==0?i=un(s):(m&=p,m!==0?i=un(m):n||(n=p&~e,n!==0&&(i=un(n))))):(p=s&~r,p!==0?i=un(p):m!==0?i=un(m):n||(n=s&~e,n!==0&&(i=un(n)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function Ds(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function v0(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 Xu(){var e=Kl;return Kl<<=1,(Kl&62914560)===0&&(Kl=4194304),e}function Gc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Os(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function j0(e,t,n,s,i,r){var m=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 p=e.entanglements,C=e.expirationTimes,L=e.hiddenUpdates;for(n=m&~n;0<n;){var G=31-zt(n),Y=1<<G;p[G]=0,C[G]=-1;var _=L[G];if(_!==null)for(L[G]=null,G=0;G<_.length;G++){var q=_[G];q!==null&&(q.lane&=-536870913)}n&=~Y}s!==0&&Qu(e,s,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(m&~t))}function Qu(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-zt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function Ku(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-zt(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}function Zu(e,t){var n=t&-t;return n=(n&42)!==0?1:Vc(n),(n&(e.suspendedLanes|t))!==0?0:n}function Vc(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 Yc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ju(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:Lx(e.type))}function Fu(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var Da=Math.random().toString(36).slice(2),nt="__reactFiber$"+Da,xt="__reactProps$"+Da,Dn="__reactContainer$"+Da,Xc="__reactEvents$"+Da,N0="__reactListeners$"+Da,w0="__reactHandles$"+Da,Wu="__reactResources$"+Da,Ls="__reactMarker$"+Da;function Qc(e){delete e[nt],delete e[xt],delete e[Xc],delete e[N0],delete e[w0]}function On(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Dn]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bx(e);e!==null;){if(n=e[nt])return n;e=bx(e)}return t}e=n,n=e.parentNode}return null}function Ln(e){if(e=e[nt]||e[Dn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _s(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function _n(e){var t=e[Wu];return t||(t=e[Wu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[Ls]=!0}var Iu=new Set,Pu={};function dn(e,t){Un(e,t),Un(e+"Capture",t)}function Un(e,t){for(Pu[e]=t,e=0;e<t.length;e++)Iu.add(t[e])}var S0=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]*$"),ed={},td={};function z0(e){return ne.call(td,e)?!0:ne.call(ed,e)?!1:S0.test(e)?td[e]=!0:(ed[e]=!0,!1)}function Jl(e,t,n){if(z0(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Fl(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 ra(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function _t(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ad(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function k0(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var i=s.get,r=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(m){n=""+m,r.call(this,m)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kc(e){if(!e._valueTracker){var t=ad(e)?"checked":"value";e._valueTracker=k0(e,t,""+e[t])}}function nd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=ad(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Wl(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 C0=/[\n"\\]/g;function Ut(e){return e.replace(C0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Zc(e,t,n,s,i,r,m,p){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+_t(t)):e.value!==""+_t(t)&&(e.value=""+_t(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?Jc(e,m,_t(t)):n!=null?Jc(e,m,_t(n)):s!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+_t(p):e.removeAttribute("name")}function sd(e,t,n,s,i,r,m,p){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Kc(e);return}n=n!=null?""+_t(n):"",t=t!=null?""+_t(t):n,p||t===e.value||(e.value=t),e.defaultValue=t}s=s??i,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=p?e.checked:!!s,e.defaultChecked=!!s,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),Kc(e)}function Jc(e,t,n){t==="number"&&Wl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Bn(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&s&&(e[n].defaultSelected=!0)}else{for(n=""+_t(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ld(e,t,n){if(t!=null&&(t=""+_t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+_t(n):""}function id(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(o(92));if(ye(s)){if(1<s.length)throw Error(o(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=_t(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),Kc(e)}function Hn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var A0=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 cd(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||A0.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function rd(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var i in t)s=t[i],t.hasOwnProperty(i)&&n[i]!==s&&cd(e,i,s)}else for(var r in t)t.hasOwnProperty(r)&&cd(e,r,t[r])}function Fc(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 E0=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"]]),T0=/^[\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 Il(e){return T0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function oa(){}var Wc=null;function Ic(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qn=null,$n=null;function od(e){var t=Ln(e);if(t&&(e=t.stateNode)){var n=e[xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Zc(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="'+Ut(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var i=s[xt]||null;if(!i)throw Error(o(90));Zc(s,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&nd(s)}break e;case"textarea":ld(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Bn(e,!!n.multiple,t,!1)}}}var Pc=!1;function ud(e,t,n){if(Pc)return e(t,n);Pc=!0;try{var s=e(t);return s}finally{if(Pc=!1,(qn!==null||$n!==null)&&(Hi(),qn&&(t=qn,e=$n,$n=qn=null,od(t),e)))for(t=0;t<e.length;t++)od(e[t])}}function Us(e,t){var n=e.stateNode;if(n===null)return null;var s=n[xt]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),er=!1;if(ua)try{var Bs={};Object.defineProperty(Bs,"passive",{get:function(){er=!0}}),window.addEventListener("test",Bs,Bs),window.removeEventListener("test",Bs,Bs)}catch{er=!1}var Oa=null,tr=null,Pl=null;function dd(){if(Pl)return Pl;var e,t=tr,n=t.length,s,i="value"in Oa?Oa.value:Oa.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var m=n-e;for(s=1;s<=m&&t[n-s]===i[r-s];s++);return Pl=i.slice(e,1<s?1-s:void 0)}function ei(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 ti(){return!0}function md(){return!1}function ht(e){function t(n,s,i,r,m){this._reactName=n,this._targetInst=i,this.type=s,this.nativeEvent=r,this.target=m,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(n=e[p],this[p]=n?n(r):r[p]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ti:md,this.isPropagationStopped=md,this}return b(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=ti)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ti)},persist:function(){},isPersistent:ti}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ai=ht(mn),Hs=b({},mn,{view:0,detail:0}),R0=ht(Hs),ar,nr,qs,ni=b({},Hs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lr,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!==qs&&(qs&&e.type==="mousemove"?(ar=e.screenX-qs.screenX,nr=e.screenY-qs.screenY):nr=ar=0,qs=e),ar)},movementY:function(e){return"movementY"in e?e.movementY:nr}}),fd=ht(ni),M0=b({},ni,{dataTransfer:0}),D0=ht(M0),O0=b({},Hs,{relatedTarget:0}),sr=ht(O0),L0=b({},mn,{animationName:0,elapsedTime:0,pseudoElement:0}),_0=ht(L0),U0=b({},mn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),B0=ht(U0),H0=b({},mn,{data:0}),xd=ht(H0),q0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$0={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"},G0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function V0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=G0[e])?!!t[e]:!1}function lr(){return V0}var Y0=b({},Hs,{key:function(e){if(e.key){var t=q0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ei(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lr,charCode:function(e){return e.type==="keypress"?ei(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ei(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),X0=ht(Y0),Q0=b({},ni,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hd=ht(Q0),K0=b({},Hs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lr}),Z0=ht(K0),J0=b({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0}),F0=ht(J0),W0=b({},ni,{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}),I0=ht(W0),P0=b({},mn,{newState:0,oldState:0}),eg=ht(P0),tg=[9,13,27,32],ir=ua&&"CompositionEvent"in window,$s=null;ua&&"documentMode"in document&&($s=document.documentMode);var ag=ua&&"TextEvent"in window&&!$s,gd=ua&&(!ir||$s&&8<$s&&11>=$s),pd=" ",yd=!1;function bd(e,t){switch(e){case"keyup":return tg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gn=!1;function ng(e,t){switch(e){case"compositionend":return vd(t);case"keypress":return t.which!==32?null:(yd=!0,pd);case"textInput":return e=t.data,e===pd&&yd?null:e;default:return null}}function sg(e,t){if(Gn)return e==="compositionend"||!ir&&bd(e,t)?(e=dd(),Pl=tr=Oa=null,Gn=!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 gd&&t.locale!=="ko"?null:t.data;default:return null}}var lg={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 jd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lg[e.type]:t==="textarea"}function Nd(e,t,n,s){qn?$n?$n.push(s):$n=[s]:qn=s,t=Qi(t,"onChange"),0<t.length&&(n=new ai("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Gs=null,Vs=null;function ig(e){lx(e,0)}function si(e){var t=_s(e);if(nd(t))return e}function wd(e,t){if(e==="change")return t}var Sd=!1;if(ua){var cr;if(ua){var rr="oninput"in document;if(!rr){var zd=document.createElement("div");zd.setAttribute("oninput","return;"),rr=typeof zd.oninput=="function"}cr=rr}else cr=!1;Sd=cr&&(!document.documentMode||9<document.documentMode)}function kd(){Gs&&(Gs.detachEvent("onpropertychange",Cd),Vs=Gs=null)}function Cd(e){if(e.propertyName==="value"&&si(Vs)){var t=[];Nd(t,Vs,e,Ic(e)),ud(ig,t)}}function cg(e,t,n){e==="focusin"?(kd(),Gs=t,Vs=n,Gs.attachEvent("onpropertychange",Cd)):e==="focusout"&&kd()}function rg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return si(Vs)}function og(e,t){if(e==="click")return si(t)}function ug(e,t){if(e==="input"||e==="change")return si(t)}function dg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:dg;function Ys(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var i=n[s];if(!ne.call(t,i)||!kt(e[i],t[i]))return!1}return!0}function Ad(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ed(e,t){var n=Ad(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ad(n)}}function Td(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Td(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wl(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=Wl(e.document)}return t}function or(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 mg=ua&&"documentMode"in document&&11>=document.documentMode,Vn=null,ur=null,Xs=null,dr=!1;function Md(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;dr||Vn==null||Vn!==Wl(s)||(s=Vn,"selectionStart"in s&&or(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Xs&&Ys(Xs,s)||(Xs=s,s=Qi(ur,"onSelect"),0<s.length&&(t=new ai("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Vn)))}function fn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Yn={animationend:fn("Animation","AnimationEnd"),animationiteration:fn("Animation","AnimationIteration"),animationstart:fn("Animation","AnimationStart"),transitionrun:fn("Transition","TransitionRun"),transitionstart:fn("Transition","TransitionStart"),transitioncancel:fn("Transition","TransitionCancel"),transitionend:fn("Transition","TransitionEnd")},mr={},Dd={};ua&&(Dd=document.createElement("div").style,"AnimationEvent"in window||(delete Yn.animationend.animation,delete Yn.animationiteration.animation,delete Yn.animationstart.animation),"TransitionEvent"in window||delete Yn.transitionend.transition);function xn(e){if(mr[e])return mr[e];if(!Yn[e])return e;var t=Yn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Dd)return mr[e]=t[n];return e}var Od=xn("animationend"),Ld=xn("animationiteration"),_d=xn("animationstart"),fg=xn("transitionrun"),xg=xn("transitionstart"),hg=xn("transitioncancel"),Ud=xn("transitionend"),Bd=new Map,fr="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(" ");fr.push("scrollEnd");function Kt(e,t){Bd.set(e,t),dn(t,[e])}var li=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)},Bt=[],Xn=0,xr=0;function ii(){for(var e=Xn,t=xr=Xn=0;t<e;){var n=Bt[t];Bt[t++]=null;var s=Bt[t];Bt[t++]=null;var i=Bt[t];Bt[t++]=null;var r=Bt[t];if(Bt[t++]=null,s!==null&&i!==null){var m=s.pending;m===null?i.next=i:(i.next=m.next,m.next=i),s.pending=i}r!==0&&Hd(n,i,r)}}function ci(e,t,n,s){Bt[Xn++]=e,Bt[Xn++]=t,Bt[Xn++]=n,Bt[Xn++]=s,xr|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function hr(e,t,n,s){return ci(e,t,n,s),ri(e)}function hn(e,t){return ci(e,null,null,t),ri(e)}function Hd(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var i=!1,r=e.return;r!==null;)r.childLanes|=n,s=r.alternate,s!==null&&(s.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-zt(n),e=r.hiddenUpdates,s=e[i],s===null?e[i]=[t]:s.push(t),t.lane=n|536870912),r):null}function ri(e){if(50<fl)throw fl=0,zo=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qn={};function gg(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ct(e,t,n,s){return new gg(e,t,n,s)}function gr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function da(e,t){var n=e.alternate;return n===null?(n=Ct(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 qd(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 oi(e,t,n,s,i,r){var m=0;if(s=e,typeof e=="function")gr(e)&&(m=1);else if(typeof e=="string")m=jp(e,n,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=Ct(31,n,t,i),e.elementType=ee,e.lanes=r,e;case N:return gn(n.children,i,r,t);case S:m=8,i|=24;break;case k:return e=Ct(12,n,t,i|2),e.elementType=k,e.lanes=r,e;case F:return e=Ct(13,n,t,i),e.elementType=F,e.lanes=r,e;case se:return e=Ct(19,n,t,i),e.elementType=se,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case U:m=10;break e;case D:m=9;break e;case E:m=11;break e;case B:m=14;break e;case Z:m=16,s=null;break e}m=29,n=Error(o(130,e===null?"null":typeof e,"")),s=null}return t=Ct(m,n,t,i),t.elementType=e,t.type=s,t.lanes=r,t}function gn(e,t,n,s){return e=Ct(7,e,s,t),e.lanes=n,e}function pr(e,t,n){return e=Ct(6,e,null,t),e.lanes=n,e}function $d(e){var t=Ct(18,null,null,0);return t.stateNode=e,t}function yr(e,t,n){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gd=new WeakMap;function Ht(e,t){if(typeof e=="object"&&e!==null){var n=Gd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:H(t)},Gd.set(e,t),t)}return{value:e,source:t,stack:H(t)}}var Kn=[],Zn=0,ui=null,Qs=0,qt=[],$t=0,La=null,ea=1,ta="";function ma(e,t){Kn[Zn++]=Qs,Kn[Zn++]=ui,ui=e,Qs=t}function Vd(e,t,n){qt[$t++]=ea,qt[$t++]=ta,qt[$t++]=La,La=e;var s=ea;e=ta;var i=32-zt(s)-1;s&=~(1<<i),n+=1;var r=32-zt(t)+i;if(30<r){var m=i-i%5;r=(s&(1<<m)-1).toString(32),s>>=m,i-=m,ea=1<<32-zt(t)+i|n<<i|s,ta=r+e}else ea=1<<r|n<<i|s,ta=e}function br(e){e.return!==null&&(ma(e,1),Vd(e,1,0))}function vr(e){for(;e===ui;)ui=Kn[--Zn],Kn[Zn]=null,Qs=Kn[--Zn],Kn[Zn]=null;for(;e===La;)La=qt[--$t],qt[$t]=null,ta=qt[--$t],qt[$t]=null,ea=qt[--$t],qt[$t]=null}function Yd(e,t){qt[$t++]=ea,qt[$t++]=ta,qt[$t++]=La,ea=t.id,ta=t.overflow,La=e}var st=null,Be=null,Se=!1,_a=null,Gt=!1,jr=Error(o(519));function Ua(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ks(Ht(t,e)),jr}function Xd(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[nt]=e,t[xt]=s,n){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(n=0;n<hl.length;n++)ve(hl[n],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),sd(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),id(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||ox(t.textContent,n)?(s.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),s.onScroll!=null&&ve("scroll",t),s.onScrollEnd!=null&&ve("scrollend",t),s.onClick!=null&&(t.onclick=oa),t=!0):t=!1,t||Ua(e,!0)}function Qd(e){for(st=e.return;st;)switch(st.tag){case 5:case 31:case 13:Gt=!1;return;case 27:case 3:Gt=!0;return;default:st=st.return}}function Jn(e){if(e!==st)return!1;if(!Se)return Qd(e),Se=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||qo(e.type,e.memoizedProps)),n=!n),n&&Be&&Ua(e),Qd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Be=yx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Be=yx(e)}else t===27?(t=Be,Wa(e.type)?(e=Xo,Xo=null,Be=e):Be=t):Be=st?Yt(e.stateNode.nextSibling):null;return!0}function pn(){Be=st=null,Se=!1}function Nr(){var e=_a;return e!==null&&(bt===null?bt=e:bt.push.apply(bt,e),_a=null),e}function Ks(e){_a===null?_a=[e]:_a.push(e)}var wr=R(null),yn=null,fa=null;function Ba(e,t,n){te(wr,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=wr.current,X(wr)}function Sr(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function zr(e,t,n,s){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var m=i.child;r=r.firstContext;e:for(;r!==null;){var p=r;r=i;for(var C=0;C<t.length;C++)if(p.context===t[C]){r.lanes|=n,p=r.alternate,p!==null&&(p.lanes|=n),Sr(r.return,n,e),s||(m=null);break e}r=p.next}}else if(i.tag===18){if(m=i.return,m===null)throw Error(o(341));m.lanes|=n,r=m.alternate,r!==null&&(r.lanes|=n),Sr(m,n,e),m=null}else m=i.child;if(m!==null)m.return=i;else for(m=i;m!==null;){if(m===e){m=null;break}if(i=m.sibling,i!==null){i.return=m.return,m=i;break}m=m.return}i=m}}function Fn(e,t,n,s){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var m=i.alternate;if(m===null)throw Error(o(387));if(m=m.memoizedProps,m!==null){var p=i.type;kt(i.pendingProps.value,m.value)||(e!==null?e.push(p):e=[p])}}else if(i===we.current){if(m=i.alternate,m===null)throw Error(o(387));m.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(vl):e=[vl])}i=i.return}e!==null&&zr(t,e,n,s),t.flags|=262144}function di(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bn(e){yn=e,fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return Kd(yn,e)}function mi(e,t){return yn===null&&bn(e),Kd(e,t)}function Kd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fa===null){if(e===null)throw Error(o(308));fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fa=fa.next=t;return n}var pg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},yg=l.unstable_scheduleCallback,bg=l.unstable_NormalPriority,Ze={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kr(){return{controller:new pg,data:new Map,refCount:0}}function Zs(e){e.refCount--,e.refCount===0&&yg(bg,function(){e.controller.abort()})}var Js=null,Cr=0,Wn=0,In=null;function vg(e,t){if(Js===null){var n=Js=[];Cr=0,Wn=Ro(),In={status:"pending",value:void 0,then:function(s){n.push(s)}}}return Cr++,t.then(Zd,Zd),t}function Zd(){if(--Cr===0&&Js!==null){In!==null&&(In.status="fulfilled");var e=Js;Js=null,Wn=0,In=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function jg(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(s.status="rejected",s.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),s}var Jd=$.S;$.S=function(e,t){Df=rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&vg(e,t),Jd!==null&&Jd(e,t)};var vn=R(null);function Ar(){var e=vn.current;return e!==null?e:Ue.pooledCache}function fi(e,t){t===null?te(vn,vn.current):te(vn,t.pool)}function Fd(){var e=Ar();return e===null?null:{parent:Ze._currentValue,pool:e}}var Pn=Error(o(460)),Er=Error(o(474)),xi=Error(o(542)),hi={then:function(){}};function Wd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Id(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(oa,oa),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,em(e),e;default:if(typeof t.status=="string")t.then(oa,oa);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=s}},function(s){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,em(e),e}throw Nn=t,Pn}}function jn(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Nn=n,Pn):n}}var Nn=null;function Pd(){if(Nn===null)throw Error(o(459));var e=Nn;return Nn=null,e}function em(e){if(e===Pn||e===xi)throw Error(o(483))}var es=null,Fs=0;function gi(e){var t=Fs;return Fs+=1,es===null&&(es=[]),Id(es,e,t)}function Ws(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function pi(e,t){throw t.$$typeof===j?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function tm(e){function t(M,T){if(e){var O=M.deletions;O===null?(M.deletions=[T],M.flags|=16):O.push(T)}}function n(M,T){if(!e)return null;for(;T!==null;)t(M,T),T=T.sibling;return null}function s(M){for(var T=new Map;M!==null;)M.key!==null?T.set(M.key,M):T.set(M.index,M),M=M.sibling;return T}function i(M,T){return M=da(M,T),M.index=0,M.sibling=null,M}function r(M,T,O){return M.index=O,e?(O=M.alternate,O!==null?(O=O.index,O<T?(M.flags|=67108866,T):O):(M.flags|=67108866,T)):(M.flags|=1048576,T)}function m(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function p(M,T,O,V){return T===null||T.tag!==6?(T=pr(O,M.mode,V),T.return=M,T):(T=i(T,O),T.return=M,T)}function C(M,T,O,V){var re=O.type;return re===N?G(M,T,O.props.children,V,O.key):T!==null&&(T.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Z&&jn(re)===T.type)?(T=i(T,O.props),Ws(T,O),T.return=M,T):(T=oi(O.type,O.key,O.props,null,M.mode,V),Ws(T,O),T.return=M,T)}function L(M,T,O,V){return T===null||T.tag!==4||T.stateNode.containerInfo!==O.containerInfo||T.stateNode.implementation!==O.implementation?(T=yr(O,M.mode,V),T.return=M,T):(T=i(T,O.children||[]),T.return=M,T)}function G(M,T,O,V,re){return T===null||T.tag!==7?(T=gn(O,M.mode,V,re),T.return=M,T):(T=i(T,O),T.return=M,T)}function Y(M,T,O){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=pr(""+T,M.mode,O),T.return=M,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case A:return O=oi(T.type,T.key,T.props,null,M.mode,O),Ws(O,T),O.return=M,O;case z:return T=yr(T,M.mode,O),T.return=M,T;case Z:return T=jn(T),Y(M,T,O)}if(ye(T)||ae(T))return T=gn(T,M.mode,O,null),T.return=M,T;if(typeof T.then=="function")return Y(M,gi(T),O);if(T.$$typeof===U)return Y(M,mi(M,T),O);pi(M,T)}return null}function _(M,T,O,V){var re=T!==null?T.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return re!==null?null:p(M,T,""+O,V);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case A:return O.key===re?C(M,T,O,V):null;case z:return O.key===re?L(M,T,O,V):null;case Z:return O=jn(O),_(M,T,O,V)}if(ye(O)||ae(O))return re!==null?null:G(M,T,O,V,null);if(typeof O.then=="function")return _(M,T,gi(O),V);if(O.$$typeof===U)return _(M,T,mi(M,O),V);pi(M,O)}return null}function q(M,T,O,V,re){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return M=M.get(O)||null,p(T,M,""+V,re);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case A:return M=M.get(V.key===null?O:V.key)||null,C(T,M,V,re);case z:return M=M.get(V.key===null?O:V.key)||null,L(T,M,V,re);case Z:return V=jn(V),q(M,T,O,V,re)}if(ye(V)||ae(V))return M=M.get(O)||null,G(T,M,V,re,null);if(typeof V.then=="function")return q(M,T,O,gi(V),re);if(V.$$typeof===U)return q(M,T,O,mi(T,V),re);pi(T,V)}return null}function ie(M,T,O,V){for(var re=null,ze=null,ce=T,ge=T=0,Ne=null;ce!==null&&ge<O.length;ge++){ce.index>ge?(Ne=ce,ce=null):Ne=ce.sibling;var ke=_(M,ce,O[ge],V);if(ke===null){ce===null&&(ce=Ne);break}e&&ce&&ke.alternate===null&&t(M,ce),T=r(ke,T,ge),ze===null?re=ke:ze.sibling=ke,ze=ke,ce=Ne}if(ge===O.length)return n(M,ce),Se&&ma(M,ge),re;if(ce===null){for(;ge<O.length;ge++)ce=Y(M,O[ge],V),ce!==null&&(T=r(ce,T,ge),ze===null?re=ce:ze.sibling=ce,ze=ce);return Se&&ma(M,ge),re}for(ce=s(ce);ge<O.length;ge++)Ne=q(ce,M,ge,O[ge],V),Ne!==null&&(e&&Ne.alternate!==null&&ce.delete(Ne.key===null?ge:Ne.key),T=r(Ne,T,ge),ze===null?re=Ne:ze.sibling=Ne,ze=Ne);return e&&ce.forEach(function(an){return t(M,an)}),Se&&ma(M,ge),re}function ue(M,T,O,V){if(O==null)throw Error(o(151));for(var re=null,ze=null,ce=T,ge=T=0,Ne=null,ke=O.next();ce!==null&&!ke.done;ge++,ke=O.next()){ce.index>ge?(Ne=ce,ce=null):Ne=ce.sibling;var an=_(M,ce,ke.value,V);if(an===null){ce===null&&(ce=Ne);break}e&&ce&&an.alternate===null&&t(M,ce),T=r(an,T,ge),ze===null?re=an:ze.sibling=an,ze=an,ce=Ne}if(ke.done)return n(M,ce),Se&&ma(M,ge),re;if(ce===null){for(;!ke.done;ge++,ke=O.next())ke=Y(M,ke.value,V),ke!==null&&(T=r(ke,T,ge),ze===null?re=ke:ze.sibling=ke,ze=ke);return Se&&ma(M,ge),re}for(ce=s(ce);!ke.done;ge++,ke=O.next())ke=q(ce,M,ge,ke.value,V),ke!==null&&(e&&ke.alternate!==null&&ce.delete(ke.key===null?ge:ke.key),T=r(ke,T,ge),ze===null?re=ke:ze.sibling=ke,ze=ke);return e&&ce.forEach(function(Mp){return t(M,Mp)}),Se&&ma(M,ge),re}function Le(M,T,O,V){if(typeof O=="object"&&O!==null&&O.type===N&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case A:e:{for(var re=O.key;T!==null;){if(T.key===re){if(re=O.type,re===N){if(T.tag===7){n(M,T.sibling),V=i(T,O.props.children),V.return=M,M=V;break e}}else if(T.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Z&&jn(re)===T.type){n(M,T.sibling),V=i(T,O.props),Ws(V,O),V.return=M,M=V;break e}n(M,T);break}else t(M,T);T=T.sibling}O.type===N?(V=gn(O.props.children,M.mode,V,O.key),V.return=M,M=V):(V=oi(O.type,O.key,O.props,null,M.mode,V),Ws(V,O),V.return=M,M=V)}return m(M);case z:e:{for(re=O.key;T!==null;){if(T.key===re)if(T.tag===4&&T.stateNode.containerInfo===O.containerInfo&&T.stateNode.implementation===O.implementation){n(M,T.sibling),V=i(T,O.children||[]),V.return=M,M=V;break e}else{n(M,T);break}else t(M,T);T=T.sibling}V=yr(O,M.mode,V),V.return=M,M=V}return m(M);case Z:return O=jn(O),Le(M,T,O,V)}if(ye(O))return ie(M,T,O,V);if(ae(O)){if(re=ae(O),typeof re!="function")throw Error(o(150));return O=re.call(O),ue(M,T,O,V)}if(typeof O.then=="function")return Le(M,T,gi(O),V);if(O.$$typeof===U)return Le(M,T,mi(M,O),V);pi(M,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,T!==null&&T.tag===6?(n(M,T.sibling),V=i(T,O),V.return=M,M=V):(n(M,T),V=pr(O,M.mode,V),V.return=M,M=V),m(M)):n(M,T)}return function(M,T,O,V){try{Fs=0;var re=Le(M,T,O,V);return es=null,re}catch(ce){if(ce===Pn||ce===xi)throw ce;var ze=Ct(29,ce,null,M.mode);return ze.lanes=V,ze.return=M,ze}finally{}}}var wn=tm(!0),am=tm(!1),Ha=!1;function Tr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rr(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 qa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function $a(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ee&2)!==0){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,t=ri(e),Hd(e,null,n),t}return ci(e,s,t,n),ri(e)}function Is(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Ku(e,n)}}function Mr(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=m:r=r.next=m,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Dr=!1;function Ps(){if(Dr){var e=In;if(e!==null)throw e}}function el(e,t,n,s){Dr=!1;var i=e.updateQueue;Ha=!1;var r=i.firstBaseUpdate,m=i.lastBaseUpdate,p=i.shared.pending;if(p!==null){i.shared.pending=null;var C=p,L=C.next;C.next=null,m===null?r=L:m.next=L,m=C;var G=e.alternate;G!==null&&(G=G.updateQueue,p=G.lastBaseUpdate,p!==m&&(p===null?G.firstBaseUpdate=L:p.next=L,G.lastBaseUpdate=C))}if(r!==null){var Y=i.baseState;m=0,G=L=C=null,p=r;do{var _=p.lane&-536870913,q=_!==p.lane;if(q?(je&_)===_:(s&_)===_){_!==0&&_===Wn&&(Dr=!0),G!==null&&(G=G.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ie=e,ue=p;_=t;var Le=n;switch(ue.tag){case 1:if(ie=ue.payload,typeof ie=="function"){Y=ie.call(Le,Y,_);break e}Y=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=ue.payload,_=typeof ie=="function"?ie.call(Le,Y,_):ie,_==null)break e;Y=b({},Y,_);break e;case 2:Ha=!0}}_=p.callback,_!==null&&(e.flags|=64,q&&(e.flags|=8192),q=i.callbacks,q===null?i.callbacks=[_]:q.push(_))}else q={lane:_,tag:p.tag,payload:p.payload,callback:p.callback,next:null},G===null?(L=G=q,C=Y):G=G.next=q,m|=_;if(p=p.next,p===null){if(p=i.shared.pending,p===null)break;q=p,p=q.next,q.next=null,i.lastBaseUpdate=q,i.shared.pending=null}}while(!0);G===null&&(C=Y),i.baseState=C,i.firstBaseUpdate=L,i.lastBaseUpdate=G,r===null&&(i.shared.lanes=0),Qa|=m,e.lanes=m,e.memoizedState=Y}}function nm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function sm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)nm(n[e],t)}var ts=R(null),yi=R(0);function lm(e,t){e=wa,te(yi,e),te(ts,t),wa=e|t.baseLanes}function Or(){te(yi,wa),te(ts,ts.current)}function Lr(){wa=yi.current,X(ts),X(yi)}var At=R(null),Vt=null;function Ga(e){var t=e.alternate;te(Xe,Xe.current&1),te(At,e),Vt===null&&(t===null||ts.current!==null||t.memoizedState!==null)&&(Vt=e)}function _r(e){te(Xe,Xe.current),te(At,e),Vt===null&&(Vt=e)}function im(e){e.tag===22?(te(Xe,Xe.current),te(At,e),Vt===null&&(Vt=e)):Va()}function Va(){te(Xe,Xe.current),te(At,At.current)}function Et(e){X(At),Vt===e&&(Vt=null),X(Xe)}var Xe=R(0);function bi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Vo(n)||Yo(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 ha=0,he=null,De=null,Je=null,vi=!1,as=!1,Sn=!1,ji=0,tl=0,ns=null,Ng=0;function Ve(){throw Error(o(321))}function Ur(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kt(e[n],t[n]))return!1;return!0}function Br(e,t,n,s,i,r){return ha=r,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$.H=e===null||e.memoizedState===null?Vm:Pr,Sn=!1,r=n(s,i),Sn=!1,as&&(r=rm(t,n,s,i)),cm(e),r}function cm(e){$.H=sl;var t=De!==null&&De.next!==null;if(ha=0,Je=De=he=null,vi=!1,tl=0,ns=null,t)throw Error(o(300));e===null||Fe||(e=e.dependencies,e!==null&&di(e)&&(Fe=!0))}function rm(e,t,n,s){he=e;var i=0;do{if(as&&(ns=null),tl=0,as=!1,25<=i)throw Error(o(301));if(i+=1,Je=De=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}$.H=Ym,r=t(n,s)}while(as);return r}function wg(){var e=$.H,t=e.useState()[0];return t=typeof t.then=="function"?al(t):t,e=e.useState()[0],(De!==null?De.memoizedState:null)!==e&&(he.flags|=1024),t}function Hr(){var e=ji!==0;return ji=0,e}function qr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $r(e){if(vi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vi=!1}ha=0,Je=De=he=null,as=!1,tl=ji=0,ns=null}function mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?he.memoizedState=Je=e:Je=Je.next=e,Je}function Qe(){if(De===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=De.next;var t=Je===null?he.memoizedState:Je.next;if(t!==null)Je=t,De=e;else{if(e===null)throw he.alternate===null?Error(o(467)):Error(o(310));De=e,e={memoizedState:De.memoizedState,baseState:De.baseState,baseQueue:De.baseQueue,queue:De.queue,next:null},Je===null?he.memoizedState=Je=e:Je=Je.next=e}return Je}function Ni(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function al(e){var t=tl;return tl+=1,ns===null&&(ns=[]),e=Id(ns,e,t),t=he,(Je===null?t.memoizedState:Je.next)===null&&(t=t.alternate,$.H=t===null||t.memoizedState===null?Vm:Pr),e}function wi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return al(e);if(e.$$typeof===U)return lt(e)}throw Error(o(438,String(e)))}function Gr(e){var t=null,n=he.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=he.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ni(),he.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=W;return t.index++,n}function ga(e,t){return typeof t=="function"?t(e):t}function Si(e){var t=Qe();return Vr(t,De,e)}function Vr(e,t,n){var s=e.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=n;var i=e.baseQueue,r=s.pending;if(r!==null){if(i!==null){var m=i.next;i.next=r.next,r.next=m}t.baseQueue=i=r,s.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var p=m=null,C=null,L=t,G=!1;do{var Y=L.lane&-536870913;if(Y!==L.lane?(je&Y)===Y:(ha&Y)===Y){var _=L.revertLane;if(_===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),Y===Wn&&(G=!0);else if((ha&_)===_){L=L.next,_===Wn&&(G=!0);continue}else Y={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(p=C=Y,m=r):C=C.next=Y,he.lanes|=_,Qa|=_;Y=L.action,Sn&&n(r,Y),r=L.hasEagerState?L.eagerState:n(r,Y)}else _={lane:Y,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(p=C=_,m=r):C=C.next=_,he.lanes|=Y,Qa|=Y;L=L.next}while(L!==null&&L!==t);if(C===null?m=r:C.next=p,!kt(r,e.memoizedState)&&(Fe=!0,G&&(n=In,n!==null)))throw n;e.memoizedState=r,e.baseState=m,e.baseQueue=C,s.lastRenderedState=r}return i===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Yr(e){var t=Qe(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var s=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var m=i=i.next;do r=e(r,m.action),m=m.next;while(m!==i);kt(r,t.memoizedState)||(Fe=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,s]}function om(e,t,n){var s=he,i=Qe(),r=Se;if(r){if(n===void 0)throw Error(o(407));n=n()}else n=t();var m=!kt((De||i).memoizedState,n);if(m&&(i.memoizedState=n,Fe=!0),i=i.queue,Kr(mm.bind(null,s,i,e),[e]),i.getSnapshot!==t||m||Je!==null&&Je.memoizedState.tag&1){if(s.flags|=2048,ss(9,{destroy:void 0},dm.bind(null,s,i,n,t),null),Ue===null)throw Error(o(349));r||(ha&127)!==0||um(s,t,n)}return n}function um(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=he.updateQueue,t===null?(t=Ni(),he.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function dm(e,t,n,s){t.value=n,t.getSnapshot=s,fm(t)&&xm(e)}function mm(e,t,n){return n(function(){fm(t)&&xm(e)})}function fm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kt(e,n)}catch{return!0}}function xm(e){var t=hn(e,2);t!==null&&vt(t,e,2)}function Xr(e){var t=mt();if(typeof e=="function"){var n=e;if(e=n(),Sn){Ma(!0);try{n()}finally{Ma(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:e},t}function hm(e,t,n,s){return e.baseState=n,Vr(e,De,typeof s=="function"?s:ga)}function Sg(e,t,n,s,i){if(Ci(e))throw Error(o(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){r.listeners.push(m)}};$.T!==null?n(!0):r.isTransition=!1,s(r),n=t.pending,n===null?(r.next=t.pending=r,gm(t,r)):(r.next=n.next,t.pending=n.next=r)}}function gm(e,t){var n=t.action,s=t.payload,i=e.state;if(t.isTransition){var r=$.T,m={};$.T=m;try{var p=n(i,s),C=$.S;C!==null&&C(m,p),pm(e,t,p)}catch(L){Qr(e,t,L)}finally{r!==null&&m.types!==null&&(r.types=m.types),$.T=r}}else try{r=n(i,s),pm(e,t,r)}catch(L){Qr(e,t,L)}}function pm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){ym(e,t,s)},function(s){return Qr(e,t,s)}):ym(e,t,n)}function ym(e,t,n){t.status="fulfilled",t.value=n,bm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,gm(e,n)))}function Qr(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,bm(t),t=t.next;while(t!==s)}e.action=null}function bm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vm(e,t){return t}function jm(e,t){if(Se){var n=Ue.formState;if(n!==null){e:{var s=he;if(Se){if(Be){t:{for(var i=Be,r=Gt;i.nodeType!==8;){if(!r){i=null;break t}if(i=Yt(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){Be=Yt(i.nextSibling),s=i.data==="F!";break e}}Ua(s)}s=!1}s&&(t=n[0])}}return n=mt(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vm,lastRenderedState:t},n.queue=s,n=qm.bind(null,he,s),s.dispatch=n,s=Xr(!1),r=Ir.bind(null,he,!1,s.queue),s=mt(),i={state:t,dispatch:null,action:e,pending:null},s.queue=i,n=Sg.bind(null,he,i,r,n),i.dispatch=n,s.memoizedState=e,[t,n,!1]}function Nm(e){var t=Qe();return wm(t,De,e)}function wm(e,t,n){if(t=Vr(e,t,vm)[0],e=Si(ga)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=al(t)}catch(m){throw m===Pn?xi:m}else s=t;t=Qe();var i=t.queue,r=i.dispatch;return n!==t.memoizedState&&(he.flags|=2048,ss(9,{destroy:void 0},zg.bind(null,i,n),null)),[s,r,e]}function zg(e,t){e.action=t}function Sm(e){var t=Qe(),n=De;if(n!==null)return wm(t,n,e);Qe(),t=t.memoizedState,n=Qe();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function ss(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=he.updateQueue,t===null&&(t=Ni(),he.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function zm(){return Qe().memoizedState}function zi(e,t,n,s){var i=mt();he.flags|=e,i.memoizedState=ss(1|t,{destroy:void 0},n,s===void 0?null:s)}function ki(e,t,n,s){var i=Qe();s=s===void 0?null:s;var r=i.memoizedState.inst;De!==null&&s!==null&&Ur(s,De.memoizedState.deps)?i.memoizedState=ss(t,r,n,s):(he.flags|=e,i.memoizedState=ss(1|t,r,n,s))}function km(e,t){zi(8390656,8,e,t)}function Kr(e,t){ki(2048,8,e,t)}function kg(e){he.flags|=4;var t=he.updateQueue;if(t===null)t=Ni(),he.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Cm(e){var t=Qe().memoizedState;return kg({ref:t,nextImpl:e}),function(){if((Ee&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Am(e,t){return ki(4,2,e,t)}function Em(e,t){return ki(4,4,e,t)}function Tm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rm(e,t,n){n=n!=null?n.concat([e]):null,ki(4,4,Tm.bind(null,t,e),n)}function Zr(){}function Mm(e,t){var n=Qe();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Ur(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Dm(e,t){var n=Qe();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Ur(t,s[1]))return s[0];if(s=e(),Sn){Ma(!0);try{e()}finally{Ma(!1)}}return n.memoizedState=[s,t],s}function Jr(e,t,n){return n===void 0||(ha&1073741824)!==0&&(je&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Lf(),he.lanes|=e,Qa|=e,n)}function Om(e,t,n,s){return kt(n,t)?n:ts.current!==null?(e=Jr(e,n,s),kt(e,t)||(Fe=!0),e):(ha&42)===0||(ha&1073741824)!==0&&(je&261930)===0?(Fe=!0,e.memoizedState=n):(e=Lf(),he.lanes|=e,Qa|=e,t)}function Lm(e,t,n,s,i){var r=P.p;P.p=r!==0&&8>r?r:8;var m=$.T,p={};$.T=p,Ir(e,!1,t,n);try{var C=i(),L=$.S;if(L!==null&&L(p,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var G=jg(C,s);nl(e,t,G,Mt(e))}else nl(e,t,s,Mt(e))}catch(Y){nl(e,t,{then:function(){},status:"rejected",reason:Y},Mt())}finally{P.p=r,m!==null&&p.types!==null&&(m.types=p.types),$.T=m}}function Cg(){}function Fr(e,t,n,s){if(e.tag!==5)throw Error(o(476));var i=_m(e).queue;Lm(e,i,t,oe,n===null?Cg:function(){return Um(e),n(s)})}function _m(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Um(e){var t=_m(e);t.next===null&&(t=e.alternate.memoizedState),nl(e,t.next.queue,{},Mt())}function Wr(){return lt(vl)}function Bm(){return Qe().memoizedState}function Hm(){return Qe().memoizedState}function Ag(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Mt();e=qa(n);var s=$a(t,e,n);s!==null&&(vt(s,t,n),Is(s,t,n)),t={cache:kr()},e.payload=t;return}t=t.return}}function Eg(e,t,n){var s=Mt();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ci(e)?$m(t,n):(n=hr(e,t,n,s),n!==null&&(vt(n,e,s),Gm(n,t,s)))}function qm(e,t,n){var s=Mt();nl(e,t,n,s)}function nl(e,t,n,s){var i={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ci(e))$m(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var m=t.lastRenderedState,p=r(m,n);if(i.hasEagerState=!0,i.eagerState=p,kt(p,m))return ci(e,t,i,0),Ue===null&&ii(),!1}catch{}finally{}if(n=hr(e,t,i,s),n!==null)return vt(n,e,s),Gm(n,t,s),!0}return!1}function Ir(e,t,n,s){if(s={lane:2,revertLane:Ro(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ci(e)){if(t)throw Error(o(479))}else t=hr(e,n,s,2),t!==null&&vt(t,e,2)}function Ci(e){var t=e.alternate;return e===he||t!==null&&t===he}function $m(e,t){as=vi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gm(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Ku(e,n)}}var sl={readContext:lt,use:wi,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve};sl.useEffectEvent=Ve;var Vm={readContext:lt,use:wi,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:km,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,zi(4194308,4,Tm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zi(4194308,4,e,t)},useInsertionEffect:function(e,t){zi(4,2,e,t)},useMemo:function(e,t){var n=mt();t=t===void 0?null:t;var s=e();if(Sn){Ma(!0);try{e()}finally{Ma(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=mt();if(n!==void 0){var i=n(t);if(Sn){Ma(!0);try{n(t)}finally{Ma(!1)}}}else i=t;return s.memoizedState=s.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},s.queue=e,e=e.dispatch=Eg.bind(null,he,e),[s.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:function(e){e=Xr(e);var t=e.queue,n=qm.bind(null,he,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Zr,useDeferredValue:function(e,t){var n=mt();return Jr(n,e,t)},useTransition:function(){var e=Xr(!1);return e=Lm.bind(null,he,e.queue,!0,!1),mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=he,i=mt();if(Se){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Ue===null)throw Error(o(349));(je&127)!==0||um(s,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,km(mm.bind(null,s,r,e),[e]),s.flags|=2048,ss(9,{destroy:void 0},dm.bind(null,s,r,n,t),null),n},useId:function(){var e=mt(),t=Ue.identifierPrefix;if(Se){var n=ta,s=ea;n=(s&~(1<<32-zt(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ji++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Ng++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Wr,useFormState:jm,useActionState:jm,useOptimistic:function(e){var t=mt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ir.bind(null,he,!0,n),n.dispatch=t,[e,t]},useMemoCache:Gr,useCacheRefresh:function(){return mt().memoizedState=Ag.bind(null,he)},useEffectEvent:function(e){var t=mt(),n={impl:e};return t.memoizedState=n,function(){if((Ee&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Pr={readContext:lt,use:wi,useCallback:Mm,useContext:lt,useEffect:Kr,useImperativeHandle:Rm,useInsertionEffect:Am,useLayoutEffect:Em,useMemo:Dm,useReducer:Si,useRef:zm,useState:function(){return Si(ga)},useDebugValue:Zr,useDeferredValue:function(e,t){var n=Qe();return Om(n,De.memoizedState,e,t)},useTransition:function(){var e=Si(ga)[0],t=Qe().memoizedState;return[typeof e=="boolean"?e:al(e),t]},useSyncExternalStore:om,useId:Bm,useHostTransitionStatus:Wr,useFormState:Nm,useActionState:Nm,useOptimistic:function(e,t){var n=Qe();return hm(n,De,e,t)},useMemoCache:Gr,useCacheRefresh:Hm};Pr.useEffectEvent=Cm;var Ym={readContext:lt,use:wi,useCallback:Mm,useContext:lt,useEffect:Kr,useImperativeHandle:Rm,useInsertionEffect:Am,useLayoutEffect:Em,useMemo:Dm,useReducer:Yr,useRef:zm,useState:function(){return Yr(ga)},useDebugValue:Zr,useDeferredValue:function(e,t){var n=Qe();return De===null?Jr(n,e,t):Om(n,De.memoizedState,e,t)},useTransition:function(){var e=Yr(ga)[0],t=Qe().memoizedState;return[typeof e=="boolean"?e:al(e),t]},useSyncExternalStore:om,useId:Bm,useHostTransitionStatus:Wr,useFormState:Sm,useActionState:Sm,useOptimistic:function(e,t){var n=Qe();return De!==null?hm(n,De,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Gr,useCacheRefresh:Hm};Ym.useEffectEvent=Cm;function eo(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:b({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var to={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Mt(),i=qa(s);i.payload=t,n!=null&&(i.callback=n),t=$a(e,i,s),t!==null&&(vt(t,e,s),Is(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Mt(),i=qa(s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=$a(e,i,s),t!==null&&(vt(t,e,s),Is(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Mt(),s=qa(n);s.tag=2,t!=null&&(s.callback=t),t=$a(e,s,n),t!==null&&(vt(t,e,n),Is(t,e,n))}};function Xm(e,t,n,s,i,r,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,r,m):t.prototype&&t.prototype.isPureReactComponent?!Ys(n,s)||!Ys(i,r):!0}function Qm(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&to.enqueueReplaceState(t,t.state,null)}function zn(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=b({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function Km(e){li(e)}function Zm(e){console.error(e)}function Jm(e){li(e)}function Ai(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Fm(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function ao(e,t,n){return n=qa(n),n.tag=3,n.payload={element:null},n.callback=function(){Ai(e,t)},n}function Wm(e){return e=qa(e),e.tag=3,e}function Im(e,t,n,s){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=s.value;e.payload=function(){return i(r)},e.callback=function(){Fm(t,n,s)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Fm(t,n,s),typeof i!="function"&&(Ka===null?Ka=new Set([this]):Ka.add(this));var p=s.stack;this.componentDidCatch(s.value,{componentStack:p!==null?p:""})})}function Tg(e,t,n,s,i){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Fn(t,n,i,!0),n=At.current,n!==null){switch(n.tag){case 31:case 13:return Vt===null?qi():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=i,s===hi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),Ao(e,s,i)),!1;case 22:return n.flags|=65536,s===hi?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),Ao(e,s,i)),!1}throw Error(o(435,n.tag))}return Ao(e,s,i),qi(),!1}if(Se)return t=At.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,s!==jr&&(e=Error(o(422),{cause:s}),Ks(Ht(e,n)))):(s!==jr&&(t=Error(o(423),{cause:s}),Ks(Ht(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,s=Ht(s,n),i=ao(e.stateNode,s,i),Mr(e,i),Ye!==4&&(Ye=2)),!1;var r=Error(o(520),{cause:s});if(r=Ht(r,n),ml===null?ml=[r]:ml.push(r),Ye!==4&&(Ye=2),t===null)return!0;s=Ht(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=ao(n.stateNode,s,e),Mr(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Ka===null||!Ka.has(r))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Wm(i),Im(i,e,n,s),Mr(n,i),!1}n=n.return}while(n!==null);return!1}var no=Error(o(461)),Fe=!1;function it(e,t,n,s){t.child=e===null?am(t,null,n,s):wn(t,e.child,n,s)}function Pm(e,t,n,s,i){n=n.render;var r=t.ref;if("ref"in s){var m={};for(var p in s)p!=="ref"&&(m[p]=s[p])}else m=s;return bn(t),s=Br(e,t,n,m,r,i),p=Hr(),e!==null&&!Fe?(qr(e,t,i),pa(e,t,i)):(Se&&p&&br(t),t.flags|=1,it(e,t,s,i),t.child)}function ef(e,t,n,s,i){if(e===null){var r=n.type;return typeof r=="function"&&!gr(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,tf(e,t,r,s,i)):(e=oi(n.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!mo(e,i)){var m=r.memoizedProps;if(n=n.compare,n=n!==null?n:Ys,n(m,s)&&e.ref===t.ref)return pa(e,t,i)}return t.flags|=1,e=da(r,s),e.ref=t.ref,e.return=t,t.child=e}function tf(e,t,n,s,i){if(e!==null){var r=e.memoizedProps;if(Ys(r,s)&&e.ref===t.ref)if(Fe=!1,t.pendingProps=s=r,mo(e,i))(e.flags&131072)!==0&&(Fe=!0);else return t.lanes=e.lanes,pa(e,t,i)}return so(e,t,n,s,i)}function af(e,t,n,s){var i=s.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(s=t.child=e.child,i=0;s!==null;)i=i|s.lanes|s.childLanes,s=s.sibling;s=i&~r}else s=0,t.child=null;return nf(e,t,r,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fi(t,r!==null?r.cachePool:null),r!==null?lm(t,r):Or(),im(t);else return s=t.lanes=536870912,nf(e,t,r!==null?r.baseLanes|n:n,n,s)}else r!==null?(fi(t,r.cachePool),lm(t,r),Va(),t.memoizedState=null):(e!==null&&fi(t,null),Or(),Va());return it(e,t,i,n),t.child}function ll(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nf(e,t,n,s,i){var r=Ar();return r=r===null?null:{parent:Ze._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&fi(t,null),Or(),im(t),e!==null&&Fn(e,t,s,!0),t.childLanes=i,null}function Ei(e,t){return t=Ri({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sf(e,t,n){return wn(t,e.child,null,n),e=Ei(t,t.pendingProps),e.flags|=2,Et(t),t.memoizedState=null,e}function Rg(e,t,n){var s=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(s.mode==="hidden")return e=Ei(t,s),t.lanes=536870912,ll(null,e);if(_r(t),(e=Be)?(e=px(e,Gt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:La!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},n=$d(e),n.return=t,t.child=n,st=t,Be=null)):e=null,e===null)throw Ua(t);return t.lanes=536870912,null}return Ei(t,s)}var r=e.memoizedState;if(r!==null){var m=r.dehydrated;if(_r(t),i)if(t.flags&256)t.flags&=-257,t=sf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Fe||Fn(e,t,n,!1),i=(n&e.childLanes)!==0,Fe||i){if(s=Ue,s!==null&&(m=Zu(s,n),m!==0&&m!==r.retryLane))throw r.retryLane=m,hn(e,m),vt(s,e,m),no;qi(),t=sf(e,t,n)}else e=r.treeContext,Be=Yt(m.nextSibling),st=t,Se=!0,_a=null,Gt=!1,e!==null&&Yd(t,e),t=Ei(t,s),t.flags|=4096;return t}return e=da(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ti(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(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function so(e,t,n,s,i){return bn(t),n=Br(e,t,n,s,void 0,i),s=Hr(),e!==null&&!Fe?(qr(e,t,i),pa(e,t,i)):(Se&&s&&br(t),t.flags|=1,it(e,t,n,i),t.child)}function lf(e,t,n,s,i,r){return bn(t),t.updateQueue=null,n=rm(t,s,n,i),cm(e),s=Hr(),e!==null&&!Fe?(qr(e,t,r),pa(e,t,r)):(Se&&s&&br(t),t.flags|=1,it(e,t,n,r),t.child)}function cf(e,t,n,s,i){if(bn(t),t.stateNode===null){var r=Qn,m=n.contextType;typeof m=="object"&&m!==null&&(r=lt(m)),r=new n(s,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=to,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=s,r.state=t.memoizedState,r.refs={},Tr(t),m=n.contextType,r.context=typeof m=="object"&&m!==null?lt(m):Qn,r.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(eo(t,n,m,s),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(m=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),m!==r.state&&to.enqueueReplaceState(r,r.state,null),el(t,s,r,i),Ps(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){r=t.stateNode;var p=t.memoizedProps,C=zn(n,p);r.props=C;var L=r.context,G=n.contextType;m=Qn,typeof G=="object"&&G!==null&&(m=lt(G));var Y=n.getDerivedStateFromProps;G=typeof Y=="function"||typeof r.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,G||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(p||L!==m)&&Qm(t,r,s,m),Ha=!1;var _=t.memoizedState;r.state=_,el(t,s,r,i),Ps(),L=t.memoizedState,p||_!==L||Ha?(typeof Y=="function"&&(eo(t,n,Y,s),L=t.memoizedState),(C=Ha||Xm(t,n,C,s,_,L,m))?(G||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=L),r.props=s,r.state=L,r.context=m,s=C):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{r=t.stateNode,Rr(e,t),m=t.memoizedProps,G=zn(n,m),r.props=G,Y=t.pendingProps,_=r.context,L=n.contextType,C=Qn,typeof L=="object"&&L!==null&&(C=lt(L)),p=n.getDerivedStateFromProps,(L=typeof p=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(m!==Y||_!==C)&&Qm(t,r,s,C),Ha=!1,_=t.memoizedState,r.state=_,el(t,s,r,i),Ps();var q=t.memoizedState;m!==Y||_!==q||Ha||e!==null&&e.dependencies!==null&&di(e.dependencies)?(typeof p=="function"&&(eo(t,n,p,s),q=t.memoizedState),(G=Ha||Xm(t,n,G,s,_,q,C)||e!==null&&e.dependencies!==null&&di(e.dependencies))?(L||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(s,q,C),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(s,q,C)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||m===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=q),r.props=s,r.state=q,r.context=C,s=G):(typeof r.componentDidUpdate!="function"||m===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),s=!1)}return r=s,Ti(e,t),s=(t.flags&128)!==0,r||s?(r=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&s?(t.child=wn(t,e.child,null,i),t.child=wn(t,null,n,i)):it(e,t,n,i),t.memoizedState=r.state,e=t.child):e=pa(e,t,i),e}function rf(e,t,n,s){return pn(),t.flags|=256,it(e,t,n,s),t.child}var lo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function io(e){return{baseLanes:e,cachePool:Fd()}}function co(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Rt),e}function of(e,t,n){var s=t.pendingProps,i=!1,r=(t.flags&128)!==0,m;if((m=r)||(m=e!==null&&e.memoizedState===null?!1:(Xe.current&2)!==0),m&&(i=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(i?Ga(t):Va(),(e=Be)?(e=px(e,Gt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:La!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},n=$d(e),n.return=t,t.child=n,st=t,Be=null)):e=null,e===null)throw Ua(t);return Yo(e)?t.lanes=32:t.lanes=536870912,null}var p=s.children;return s=s.fallback,i?(Va(),i=t.mode,p=Ri({mode:"hidden",children:p},i),s=gn(s,i,n,null),p.return=t,s.return=t,p.sibling=s,t.child=p,s=t.child,s.memoizedState=io(n),s.childLanes=co(e,m,n),t.memoizedState=lo,ll(null,s)):(Ga(t),ro(t,p))}var C=e.memoizedState;if(C!==null&&(p=C.dehydrated,p!==null)){if(r)t.flags&256?(Ga(t),t.flags&=-257,t=oo(e,t,n)):t.memoizedState!==null?(Va(),t.child=e.child,t.flags|=128,t=null):(Va(),p=s.fallback,i=t.mode,s=Ri({mode:"visible",children:s.children},i),p=gn(p,i,n,null),p.flags|=2,s.return=t,p.return=t,s.sibling=p,t.child=s,wn(t,e.child,null,n),s=t.child,s.memoizedState=io(n),s.childLanes=co(e,m,n),t.memoizedState=lo,t=ll(null,s));else if(Ga(t),Yo(p)){if(m=p.nextSibling&&p.nextSibling.dataset,m)var L=m.dgst;m=L,s=Error(o(419)),s.stack="",s.digest=m,Ks({value:s,source:null,stack:null}),t=oo(e,t,n)}else if(Fe||Fn(e,t,n,!1),m=(n&e.childLanes)!==0,Fe||m){if(m=Ue,m!==null&&(s=Zu(m,n),s!==0&&s!==C.retryLane))throw C.retryLane=s,hn(e,s),vt(m,e,s),no;Vo(p)||qi(),t=oo(e,t,n)}else Vo(p)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,Be=Yt(p.nextSibling),st=t,Se=!0,_a=null,Gt=!1,e!==null&&Yd(t,e),t=ro(t,s.children),t.flags|=4096);return t}return i?(Va(),p=s.fallback,i=t.mode,C=e.child,L=C.sibling,s=da(C,{mode:"hidden",children:s.children}),s.subtreeFlags=C.subtreeFlags&65011712,L!==null?p=da(L,p):(p=gn(p,i,n,null),p.flags|=2),p.return=t,s.return=t,s.sibling=p,t.child=s,ll(null,s),s=t.child,p=e.child.memoizedState,p===null?p=io(n):(i=p.cachePool,i!==null?(C=Ze._currentValue,i=i.parent!==C?{parent:C,pool:C}:i):i=Fd(),p={baseLanes:p.baseLanes|n,cachePool:i}),s.memoizedState=p,s.childLanes=co(e,m,n),t.memoizedState=lo,ll(e.child,s)):(Ga(t),n=e.child,e=n.sibling,n=da(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function ro(e,t){return t=Ri({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ri(e,t){return e=Ct(22,e,null,t),e.lanes=0,e}function oo(e,t,n){return wn(t,e.child,null,n),e=ro(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uf(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Sr(e.return,t,n)}function uo(e,t,n,s,i,r){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:i,treeForkCount:r}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=s,m.tail=n,m.tailMode=i,m.treeForkCount=r)}function df(e,t,n){var s=t.pendingProps,i=s.revealOrder,r=s.tail;s=s.children;var m=Xe.current,p=(m&2)!==0;if(p?(m=m&1|2,t.flags|=128):m&=1,te(Xe,m),it(e,t,s,n),s=Se?Qs:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uf(e,n,t);else if(e.tag===19)uf(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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&bi(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),uo(t,!1,i,n,r,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&bi(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}uo(t,!0,n,null,r,s);break;case"together":uo(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function pa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Fn(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=da(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=da(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&di(e)))}function Mg(e,t,n){switch(t.tag){case 3:at(t,t.stateNode.containerInfo),Ba(t,Ze,e.memoizedState.cache),pn();break;case 27:case 5:rn(t);break;case 4:at(t,t.stateNode.containerInfo);break;case 10:Ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,_r(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ga(t),t.flags|=128,null):(n&t.child.childLanes)!==0?of(e,t,n):(Ga(t),e=pa(e,t,n),e!==null?e.sibling:null);Ga(t);break;case 19:var i=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Fn(e,t,n,!1),s=(n&t.childLanes)!==0),i){if(s)return df(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),te(Xe,Xe.current),s)break;return null;case 22:return t.lanes=0,af(e,t,n,t.pendingProps);case 24:Ba(t,Ze,e.memoizedState.cache)}return pa(e,t,n)}function mf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Fe=!0;else{if(!mo(e,n)&&(t.flags&128)===0)return Fe=!1,Mg(e,t,n);Fe=(e.flags&131072)!==0}else Fe=!1,Se&&(t.flags&1048576)!==0&&Vd(t,Qs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=jn(t.elementType),t.type=e,typeof e=="function")gr(e)?(s=zn(e,s),t.tag=1,t=cf(null,t,e,s,n)):(t.tag=0,t=so(null,t,e,s,n));else{if(e!=null){var i=e.$$typeof;if(i===E){t.tag=11,t=Pm(null,t,e,s,n);break e}else if(i===B){t.tag=14,t=ef(null,t,e,s,n);break e}}throw t=de(e)||e,Error(o(306,t,""))}}return t;case 0:return so(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,i=zn(s,t.pendingProps),cf(e,t,s,i,n);case 3:e:{if(at(t,t.stateNode.containerInfo),e===null)throw Error(o(387));s=t.pendingProps;var r=t.memoizedState;i=r.element,Rr(e,t),el(t,s,null,n);var m=t.memoizedState;if(s=m.cache,Ba(t,Ze,s),s!==r.cache&&zr(t,[Ze],n,!0),Ps(),s=m.element,r.isDehydrated)if(r={element:s,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=rf(e,t,s,n);break e}else if(s!==i){i=Ht(Error(o(424)),t),Ks(i),t=rf(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Be=Yt(e.firstChild),st=t,Se=!0,_a=null,Gt=!0,n=am(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(pn(),s===i){t=pa(e,t,n);break e}it(e,t,s,n)}t=t.child}return t;case 26:return Ti(e,t),e===null?(n=wx(t.type,null,t.pendingProps,null))?t.memoizedState=n:Se||(n=t.type,e=t.pendingProps,s=Ki(pe.current).createElement(n),s[nt]=t,s[xt]=e,ct(s,n,e),Pe(s),t.stateNode=s):t.memoizedState=wx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return rn(t),e===null&&Se&&(s=t.stateNode=vx(t.type,t.pendingProps,pe.current),st=t,Gt=!0,i=Be,Wa(t.type)?(Xo=i,Be=Yt(s.firstChild)):Be=i),it(e,t,t.pendingProps.children,n),Ti(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((i=s=Be)&&(s=rp(s,t.type,t.pendingProps,Gt),s!==null?(t.stateNode=s,st=t,Be=Yt(s.firstChild),Gt=!1,i=!0):i=!1),i||Ua(t)),rn(t),i=t.type,r=t.pendingProps,m=e!==null?e.memoizedProps:null,s=r.children,qo(i,r)?s=null:m!==null&&qo(i,m)&&(t.flags|=32),t.memoizedState!==null&&(i=Br(e,t,wg,null,null,n),vl._currentValue=i),Ti(e,t),it(e,t,s,n),t.child;case 6:return e===null&&Se&&((e=n=Be)&&(n=op(n,t.pendingProps,Gt),n!==null?(t.stateNode=n,st=t,Be=null,e=!0):e=!1),e||Ua(t)),null;case 13:return of(e,t,n);case 4:return at(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=wn(t,null,s,n):it(e,t,s,n),t.child;case 11:return Pm(e,t,t.type,t.pendingProps,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Ba(t,t.type,s.value),it(e,t,s.children,n),t.child;case 9:return i=t.type._context,s=t.pendingProps.children,bn(t),i=lt(i),s=s(i),t.flags|=1,it(e,t,s,n),t.child;case 14:return ef(e,t,t.type,t.pendingProps,n);case 15:return tf(e,t,t.type,t.pendingProps,n);case 19:return df(e,t,n);case 31:return Rg(e,t,n);case 22:return af(e,t,n,t.pendingProps);case 24:return bn(t),s=lt(Ze),e===null?(i=Ar(),i===null&&(i=Ue,r=kr(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),t.memoizedState={parent:s,cache:i},Tr(t),Ba(t,Ze,i)):((e.lanes&n)!==0&&(Rr(e,t),el(t,null,null,n),Ps()),i=e.memoizedState,r=t.memoizedState,i.parent!==s?(i={parent:s,cache:s},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ba(t,Ze,s)):(s=r.cache,Ba(t,Ze,s),s!==i.cache&&zr(t,[Ze],n,!0))),it(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ya(e){e.flags|=4}function fo(e,t,n,s,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Hf())e.flags|=8192;else throw Nn=hi,Er}else e.flags&=-16777217}function ff(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ax(t))if(Hf())e.flags|=8192;else throw Nn=hi,Er}function Mi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Xu():536870912,e.lanes|=t,rs|=t)}function il(e,t){if(!Se)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags&65011712,s|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Dg(e,t,n){var s=t.pendingProps;switch(vr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),xa(Ze),Te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Jn(t)?ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nr())),He(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(ya(t),r!==null?(He(t),ff(t,r)):(He(t),fo(t,i,null,s,n))):r?r!==e.memoizedState?(ya(t),He(t),ff(t,r)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ya(t),He(t),fo(t,i,e,s,n)),null;case 27:if(on(t),n=pe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ya(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return He(t),null}e=le.current,Jn(t)?Xd(t):(e=vx(i,s,n),t.stateNode=e,ya(t))}return He(t),null;case 5:if(on(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ya(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return He(t),null}if(r=le.current,Jn(t))Xd(t);else{var m=Ki(pe.current);switch(r){case 1:r=m.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=m.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=m.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof s.is=="string"?m.createElement("select",{is:s.is}):m.createElement("select"),s.multiple?r.multiple=!0:s.size&&(r.size=s.size);break;default:r=typeof s.is=="string"?m.createElement(i,{is:s.is}):m.createElement(i)}}r[nt]=t,r[xt]=s;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)r.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=r;e:switch(ct(r,i,s),i){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ya(t)}}return He(t),fo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ya(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(o(166));if(e=pe.current,Jn(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,i=st,i!==null)switch(i.tag){case 27:case 5:s=i.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||ox(e.nodeValue,n)),e||Ua(t,!0)}else e=Ki(e).createTextNode(s),e[nt]=t,t.stateNode=e}return He(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Jn(t),n!==null){if(e===null){if(!s)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[nt]=t}else pn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else n=Nr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Et(t),t):(Et(t),null);if((t.flags&128)!==0)throw Error(o(558))}return He(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Jn(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[nt]=t}else pn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),i=!1}else i=Nr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Et(t),t):(Et(t),null)}return Et(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,i=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(i=s.alternate.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==i&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mi(t,t.updateQueue),He(t),null);case 4:return Te(),e===null&&Lo(t.stateNode.containerInfo),He(t),null;case 10:return xa(t.type),He(t),null;case 19:if(X(Xe),s=t.memoizedState,s===null)return He(t),null;if(i=(t.flags&128)!==0,r=s.rendering,r===null)if(i)il(s,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=bi(e),r!==null){for(t.flags|=128,il(s,!1),e=r.updateQueue,t.updateQueue=e,Mi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)qd(n,e),n=n.sibling;return te(Xe,Xe.current&1|2),Se&&ma(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&rt()>Ui&&(t.flags|=128,i=!0,il(s,!1),t.lanes=4194304)}else{if(!i)if(e=bi(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Mi(t,e),il(s,!0),s.tail===null&&s.tailMode==="hidden"&&!r.alternate&&!Se)return He(t),null}else 2*rt()-s.renderingStartTime>Ui&&n!==536870912&&(t.flags|=128,i=!0,il(s,!1),t.lanes=4194304);s.isBackwards?(r.sibling=t.child,t.child=r):(e=s.last,e!==null?e.sibling=r:t.child=r,s.last=r)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=rt(),e.sibling=null,n=Xe.current,te(Xe,i?n&1|2:n&1),Se&&ma(t,s.treeForkCount),e):(He(t),null);case 22:case 23:return Et(t),Lr(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),n=t.updateQueue,n!==null&&Mi(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&X(vn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(Ze),He(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Og(e,t){switch(vr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Ze),Te(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return on(t),null;case 31:if(t.memoizedState!==null){if(Et(t),t.alternate===null)throw Error(o(340));pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Et(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(Xe),null;case 4:return Te(),null;case 10:return xa(t.type),null;case 22:case 23:return Et(t),Lr(),e!==null&&X(vn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Ze),null;case 25:return null;default:return null}}function xf(e,t){switch(vr(t),t.tag){case 3:xa(Ze),Te();break;case 26:case 27:case 5:on(t);break;case 4:Te();break;case 31:t.memoizedState!==null&&Et(t);break;case 13:Et(t);break;case 19:X(Xe);break;case 10:xa(t.type);break;case 22:case 23:Et(t),Lr(),e!==null&&X(vn);break;case 24:xa(Ze)}}function cl(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){s=void 0;var r=n.create,m=n.inst;s=r(),m.destroy=s}n=n.next}while(n!==i)}}catch(p){Me(t,t.return,p)}}function Ya(e,t,n){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var r=i.next;s=r;do{if((s.tag&e)===e){var m=s.inst,p=m.destroy;if(p!==void 0){m.destroy=void 0,i=t;var C=n,L=p;try{L()}catch(G){Me(i,C,G)}}}s=s.next}while(s!==r)}}catch(G){Me(t,t.return,G)}}function hf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{sm(t,n)}catch(s){Me(e,e.return,s)}}}function gf(e,t,n){n.props=zn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Me(e,t,s)}}function rl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(i){Me(e,t,i)}}function aa(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(i){Me(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Me(e,t,i)}else n.current=null}function pf(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(i){Me(e,e.return,i)}}function xo(e,t,n){try{var s=e.stateNode;ap(s,e.type,n,t),s[xt]=t}catch(i){Me(e,e.return,i)}}function yf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wa(e.type)||e.tag===4}function ho(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yf(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&&Wa(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 go(e,t,n){var s=e.tag;if(s===5||s===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=oa));else if(s!==4&&(s===27&&Wa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(go(e,t,n),e=e.sibling;e!==null;)go(e,t,n),e=e.sibling}function Di(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Wa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Di(e,t,n),e=e.sibling;e!==null;)Di(e,t,n),e=e.sibling}function bf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ct(t,s,n),t[nt]=e,t[xt]=n}catch(r){Me(e,e.return,r)}}var ba=!1,We=!1,po=!1,vf=typeof WeakSet=="function"?WeakSet:Set,et=null;function Lg(e,t){if(e=e.containerInfo,Bo=ec,e=Rd(e),or(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var i=s.anchorOffset,r=s.focusNode;s=s.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var m=0,p=-1,C=-1,L=0,G=0,Y=e,_=null;t:for(;;){for(var q;Y!==n||i!==0&&Y.nodeType!==3||(p=m+i),Y!==r||s!==0&&Y.nodeType!==3||(C=m+s),Y.nodeType===3&&(m+=Y.nodeValue.length),(q=Y.firstChild)!==null;)_=Y,Y=q;for(;;){if(Y===e)break t;if(_===n&&++L===i&&(p=m),_===r&&++G===s&&(C=m),(q=Y.nextSibling)!==null)break;Y=_,_=Y.parentNode}Y=q}n=p===-1||C===-1?null:{start:p,end:C}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ho={focusedElem:e,selectionRange:n},ec=!1,et=t;et!==null;)if(t=et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,et=e;else for(;et!==null;){switch(t=et,r=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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,i=r.memoizedProps,r=r.memoizedState,s=n.stateNode;try{var ie=zn(n.type,i);e=s.getSnapshotBeforeUpdate(ie,r),s.__reactInternalSnapshotBeforeUpdate=e}catch(ue){Me(n,n.return,ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Go(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Go(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,et=e;break}et=t.return}}function jf(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:ja(e,n),s&4&&cl(5,n);break;case 1:if(ja(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){Me(n,n.return,m)}else{var i=zn(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Me(n,n.return,m)}}s&64&&hf(n),s&512&&rl(n,n.return);break;case 3:if(ja(e,n),s&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{sm(e,t)}catch(m){Me(n,n.return,m)}}break;case 27:t===null&&s&4&&bf(n);case 26:case 5:ja(e,n),t===null&&s&4&&pf(n),s&512&&rl(n,n.return);break;case 12:ja(e,n);break;case 31:ja(e,n),s&4&&Sf(e,n);break;case 13:ja(e,n),s&4&&zf(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Yg.bind(null,n),up(e,n))));break;case 22:if(s=n.memoizedState!==null||ba,!s){t=t!==null&&t.memoizedState!==null||We,i=ba;var r=We;ba=s,(We=t)&&!r?Na(e,n,(n.subtreeFlags&8772)!==0):ja(e,n),ba=i,We=r}break;case 30:break;default:ja(e,n)}}function Nf(e){var t=e.alternate;t!==null&&(e.alternate=null,Nf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qc(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 qe=null,gt=!1;function va(e,t,n){for(n=n.child;n!==null;)wf(e,t,n),n=n.sibling}function wf(e,t,n){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Ms,n)}catch{}switch(n.tag){case 26:We||aa(n,t),va(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:We||aa(n,t);var s=qe,i=gt;Wa(n.type)&&(qe=n.stateNode,gt=!1),va(e,t,n),pl(n.stateNode),qe=s,gt=i;break;case 5:We||aa(n,t);case 6:if(s=qe,i=gt,qe=null,va(e,t,n),qe=s,gt=i,qe!==null)if(gt)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(r){Me(n,t,r)}else try{qe.removeChild(n.stateNode)}catch(r){Me(n,t,r)}break;case 18:qe!==null&&(gt?(e=qe,hx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),gs(e)):hx(qe,n.stateNode));break;case 4:s=qe,i=gt,qe=n.stateNode.containerInfo,gt=!0,va(e,t,n),qe=s,gt=i;break;case 0:case 11:case 14:case 15:Ya(2,n,t),We||Ya(4,n,t),va(e,t,n);break;case 1:We||(aa(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&gf(n,t,s)),va(e,t,n);break;case 21:va(e,t,n);break;case 22:We=(s=We)||n.memoizedState!==null,va(e,t,n),We=s;break;default:va(e,t,n)}}function Sf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gs(e)}catch(n){Me(t,t.return,n)}}}function zf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gs(e)}catch(n){Me(t,t.return,n)}}function _g(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vf),t;default:throw Error(o(435,e.tag))}}function Oi(e,t){var n=_g(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var i=Xg.bind(null,e,s);s.then(i,i)}})}function pt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s],r=e,m=t,p=m;e:for(;p!==null;){switch(p.tag){case 27:if(Wa(p.type)){qe=p.stateNode,gt=!1;break e}break;case 5:qe=p.stateNode,gt=!1;break e;case 3:case 4:qe=p.stateNode.containerInfo,gt=!0;break e}p=p.return}if(qe===null)throw Error(o(160));wf(r,m,i),qe=null,gt=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kf(t,e),t=t.sibling}var Zt=null;function kf(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pt(t,e),yt(e),s&4&&(Ya(3,e,e.return),cl(3,e),Ya(5,e,e.return));break;case 1:pt(t,e),yt(e),s&512&&(We||n===null||aa(n,n.return)),s&64&&ba&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var i=Zt;if(pt(t,e),yt(e),s&512&&(We||n===null||aa(n,n.return)),s&4){var r=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(s){case"title":r=i.getElementsByTagName("title")[0],(!r||r[Ls]||r[nt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(s),i.head.insertBefore(r,i.querySelector("head > title"))),ct(r,s,n),r[nt]=e,Pe(r),s=r;break e;case"link":var m=kx("link","href",i).get(s+(n.href||""));if(m){for(var p=0;p<m.length;p++)if(r=m[p],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(p,1);break t}}r=i.createElement(s),ct(r,s,n),i.head.appendChild(r);break;case"meta":if(m=kx("meta","content",i).get(s+(n.content||""))){for(p=0;p<m.length;p++)if(r=m[p],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(p,1);break t}}r=i.createElement(s),ct(r,s,n),i.head.appendChild(r);break;default:throw Error(o(468,s))}r[nt]=e,Pe(r),s=r}e.stateNode=s}else Cx(i,e.type,e.stateNode);else e.stateNode=zx(i,s,e.memoizedProps);else r!==s?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,s===null?Cx(i,e.type,e.stateNode):zx(i,s,e.memoizedProps)):s===null&&e.stateNode!==null&&xo(e,e.memoizedProps,n.memoizedProps)}break;case 27:pt(t,e),yt(e),s&512&&(We||n===null||aa(n,n.return)),n!==null&&s&4&&xo(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pt(t,e),yt(e),s&512&&(We||n===null||aa(n,n.return)),e.flags&32){i=e.stateNode;try{Hn(i,"")}catch(ie){Me(e,e.return,ie)}}s&4&&e.stateNode!=null&&(i=e.memoizedProps,xo(e,i,n!==null?n.memoizedProps:i)),s&1024&&(po=!0);break;case 6:if(pt(t,e),yt(e),s&4){if(e.stateNode===null)throw Error(o(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(ie){Me(e,e.return,ie)}}break;case 3:if(Fi=null,i=Zt,Zt=Zi(t.containerInfo),pt(t,e),Zt=i,yt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{gs(t.containerInfo)}catch(ie){Me(e,e.return,ie)}po&&(po=!1,Cf(e));break;case 4:s=Zt,Zt=Zi(e.stateNode.containerInfo),pt(t,e),yt(e),Zt=s;break;case 12:pt(t,e),yt(e);break;case 31:pt(t,e),yt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Oi(e,s)));break;case 13:pt(t,e),yt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(_i=rt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Oi(e,s)));break;case 22:i=e.memoizedState!==null;var C=n!==null&&n.memoizedState!==null,L=ba,G=We;if(ba=L||i,We=G||C,pt(t,e),We=G,ba=L,yt(e),s&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||C||ba||We||kn(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){C=n=t;try{if(r=C.stateNode,i)m=r.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{p=C.stateNode;var Y=C.memoizedProps.style,_=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;p.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ie){Me(C,C.return,ie)}}}else if(t.tag===6){if(n===null){C=t;try{C.stateNode.nodeValue=i?"":C.memoizedProps}catch(ie){Me(C,C.return,ie)}}}else if(t.tag===18){if(n===null){C=t;try{var q=C.stateNode;i?gx(q,!0):gx(C.stateNode,!1)}catch(ie){Me(C,C.return,ie)}}}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}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Oi(e,n))));break;case 19:pt(t,e),yt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Oi(e,s)));break;case 30:break;case 21:break;default:pt(t,e),yt(e)}}function yt(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(yf(s)){n=s;break}s=s.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode,r=ho(e);Di(e,r,i);break;case 5:var m=n.stateNode;n.flags&32&&(Hn(m,""),n.flags&=-33);var p=ho(e);Di(e,p,m);break;case 3:case 4:var C=n.stateNode.containerInfo,L=ho(e);go(e,L,C);break;default:throw Error(o(161))}}catch(G){Me(e,e.return,G)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)jf(e,t.alternate,t),t=t.sibling}function kn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ya(4,t,t.return),kn(t);break;case 1:aa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&gf(t,t.return,n),kn(t);break;case 27:pl(t.stateNode);case 26:case 5:aa(t,t.return),kn(t);break;case 22:t.memoizedState===null&&kn(t);break;case 30:kn(t);break;default:kn(t)}e=e.sibling}}function Na(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,i=e,r=t,m=r.flags;switch(r.tag){case 0:case 11:case 15:Na(i,r,n),cl(4,r);break;case 1:if(Na(i,r,n),s=r,i=s.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(L){Me(s,s.return,L)}if(s=r,i=s.updateQueue,i!==null){var p=s.stateNode;try{var C=i.shared.hiddenCallbacks;if(C!==null)for(i.shared.hiddenCallbacks=null,i=0;i<C.length;i++)nm(C[i],p)}catch(L){Me(s,s.return,L)}}n&&m&64&&hf(r),rl(r,r.return);break;case 27:bf(r);case 26:case 5:Na(i,r,n),n&&s===null&&m&4&&pf(r),rl(r,r.return);break;case 12:Na(i,r,n);break;case 31:Na(i,r,n),n&&m&4&&Sf(i,r);break;case 13:Na(i,r,n),n&&m&4&&zf(i,r);break;case 22:r.memoizedState===null&&Na(i,r,n),rl(r,r.return);break;case 30:break;default:Na(i,r,n)}t=t.sibling}}function yo(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&&Zs(n))}function bo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zs(e))}function Jt(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Af(e,t,n,s),t=t.sibling}function Af(e,t,n,s){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Jt(e,t,n,s),i&2048&&cl(9,t);break;case 1:Jt(e,t,n,s);break;case 3:Jt(e,t,n,s),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zs(e)));break;case 12:if(i&2048){Jt(e,t,n,s),e=t.stateNode;try{var r=t.memoizedProps,m=r.id,p=r.onPostCommit;typeof p=="function"&&p(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){Me(t,t.return,C)}}else Jt(e,t,n,s);break;case 31:Jt(e,t,n,s);break;case 13:Jt(e,t,n,s);break;case 23:break;case 22:r=t.stateNode,m=t.alternate,t.memoizedState!==null?r._visibility&2?Jt(e,t,n,s):ol(e,t):r._visibility&2?Jt(e,t,n,s):(r._visibility|=2,ls(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),i&2048&&yo(m,t);break;case 24:Jt(e,t,n,s),i&2048&&bo(t.alternate,t);break;default:Jt(e,t,n,s)}}function ls(e,t,n,s,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,m=t,p=n,C=s,L=m.flags;switch(m.tag){case 0:case 11:case 15:ls(r,m,p,C,i),cl(8,m);break;case 23:break;case 22:var G=m.stateNode;m.memoizedState!==null?G._visibility&2?ls(r,m,p,C,i):ol(r,m):(G._visibility|=2,ls(r,m,p,C,i)),i&&L&2048&&yo(m.alternate,m);break;case 24:ls(r,m,p,C,i),i&&L&2048&&bo(m.alternate,m);break;default:ls(r,m,p,C,i)}t=t.sibling}}function ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,i=s.flags;switch(s.tag){case 22:ol(n,s),i&2048&&yo(s.alternate,s);break;case 24:ol(n,s),i&2048&&bo(s.alternate,s);break;default:ol(n,s)}t=t.sibling}}var ul=8192;function is(e,t,n){if(e.subtreeFlags&ul)for(e=e.child;e!==null;)Ef(e,t,n),e=e.sibling}function Ef(e,t,n){switch(e.tag){case 26:is(e,t,n),e.flags&ul&&e.memoizedState!==null&&Np(n,Zt,e.memoizedState,e.memoizedProps);break;case 5:is(e,t,n);break;case 3:case 4:var s=Zt;Zt=Zi(e.stateNode.containerInfo),is(e,t,n),Zt=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=ul,ul=16777216,is(e,t,n),ul=s):is(e,t,n));break;default:is(e,t,n)}}function Tf(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 dl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];et=s,Mf(s,e)}Tf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rf(e),e=e.sibling}function Rf(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&Ya(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Li(e)):dl(e);break;default:dl(e)}}function Li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];et=s,Mf(s,e)}Tf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ya(8,t,t.return),Li(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Li(t));break;default:Li(t)}e=e.sibling}}function Mf(e,t){for(;et!==null;){var n=et;switch(n.tag){case 0:case 11:case 15:Ya(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Zs(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,et=s;else e:for(n=e;et!==null;){s=et;var i=s.sibling,r=s.return;if(Nf(s),s===n){et=null;break e}if(i!==null){i.return=r,et=i;break e}et=r}}}var Ug={getCacheForType:function(e){var t=lt(Ze),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return lt(Ze).controller.signal}},Bg=typeof WeakMap=="function"?WeakMap:Map,Ee=0,Ue=null,be=null,je=0,Re=0,Tt=null,Xa=!1,cs=!1,vo=!1,wa=0,Ye=0,Qa=0,Cn=0,jo=0,Rt=0,rs=0,ml=null,bt=null,No=!1,_i=0,Df=0,Ui=1/0,Bi=null,Ka=null,Ie=0,Za=null,os=null,Sa=0,wo=0,So=null,Of=null,fl=0,zo=null;function Mt(){return(Ee&2)!==0&&je!==0?je&-je:$.T!==null?Ro():Ju()}function Lf(){if(Rt===0)if((je&536870912)===0||Se){var e=Ql;Ql<<=1,(Ql&3932160)===0&&(Ql=262144),Rt=e}else Rt=536870912;return e=At.current,e!==null&&(e.flags|=32),Rt}function vt(e,t,n){(e===Ue&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(us(e,0),Ja(e,je,Rt,!1)),Os(e,n),((Ee&2)===0||e!==Ue)&&(e===Ue&&((Ee&2)===0&&(Cn|=n),Ye===4&&Ja(e,je,Rt,!1)),na(e))}function _f(e,t,n){if((Ee&6)!==0)throw Error(o(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ds(e,t),i=s?$g(e,t):Co(e,t,!0),r=s;do{if(i===0){cs&&!s&&Ja(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!Hg(n)){i=Co(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var p=e;i=ml;var C=p.current.memoizedState.isDehydrated;if(C&&(us(p,m).flags|=256),m=Co(p,m,!1),m!==2){if(vo&&!C){p.errorRecoveryDisabledLanes|=r,Cn|=r,i=4;break e}r=bt,bt=i,r!==null&&(bt===null?bt=r:bt.push.apply(bt,r))}i=m}if(r=!1,i!==2)continue}}if(i===1){us(e,0),Ja(e,t,0,!0);break}e:{switch(s=e,r=i,r){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Ja(s,t,Rt,!Xa);break e;case 2:bt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=_i+300-rt(),10<i)){if(Ja(s,t,Rt,!Xa),Zl(s,0,!0)!==0)break e;Sa=t,s.timeoutHandle=fx(Uf.bind(null,s,n,bt,Bi,No,t,Rt,Cn,rs,Xa,r,"Throttled",-0,0),i);break e}Uf(s,n,bt,Bi,No,t,Rt,Cn,rs,Xa,r,null,-0,0)}}break}while(!0);na(e)}function Uf(e,t,n,s,i,r,m,p,C,L,G,Y,_,q){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oa},Ef(t,r,Y);var ie=(r&62914560)===r?_i-rt():(r&4194048)===r?Df-rt():0;if(ie=wp(Y,ie),ie!==null){Sa=r,e.cancelPendingCommit=ie(Xf.bind(null,e,t,r,n,s,i,m,p,C,G,Y,null,_,q)),Ja(e,r,m,!L);return}}Xf(e,t,r,n,s,i,m,p,C)}function Hg(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 s=0;s<n.length;s++){var i=n[s],r=i.getSnapshot;i=i.value;try{if(!kt(r(),i))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 Ja(e,t,n,s){t&=~jo,t&=~Cn,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var i=t;0<i;){var r=31-zt(i),m=1<<r;s[r]=-1,i&=~m}n!==0&&Qu(e,n,t)}function Hi(){return(Ee&6)===0?(xl(0),!1):!0}function ko(){if(be!==null){if(Re===0)var e=be.return;else e=be,fa=yn=null,$r(e),es=null,Fs=0,e=be;for(;e!==null;)xf(e.alternate,e),e=e.return;be=null}}function us(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,lp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sa=0,ko(),Ue=e,be=n=da(e.current,null),je=t,Re=0,Tt=null,Xa=!1,cs=Ds(e,t),vo=!1,rs=Rt=jo=Cn=Qa=Ye=0,bt=ml=null,No=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var i=31-zt(s),r=1<<i;t|=e[i],s&=~r}return wa=t,ii(),n}function Bf(e,t){he=null,$.H=sl,t===Pn||t===xi?(t=Pd(),Re=3):t===Er?(t=Pd(),Re=4):Re=t===no?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Tt=t,be===null&&(Ye=1,Ai(e,Ht(t,e.current)))}function Hf(){var e=At.current;return e===null?!0:(je&4194048)===je?Vt===null:(je&62914560)===je||(je&536870912)!==0?e===Vt:!1}function qf(){var e=$.H;return $.H=sl,e===null?sl:e}function $f(){var e=$.A;return $.A=Ug,e}function qi(){Ye=4,Xa||(je&4194048)!==je&&At.current!==null||(cs=!0),(Qa&134217727)===0&&(Cn&134217727)===0||Ue===null||Ja(Ue,je,Rt,!1)}function Co(e,t,n){var s=Ee;Ee|=2;var i=qf(),r=$f();(Ue!==e||je!==t)&&(Bi=null,us(e,t)),t=!1;var m=Ye;e:do try{if(Re!==0&&be!==null){var p=be,C=Tt;switch(Re){case 8:ko(),m=6;break e;case 3:case 2:case 9:case 6:At.current===null&&(t=!0);var L=Re;if(Re=0,Tt=null,ds(e,p,C,L),n&&cs){m=0;break e}break;default:L=Re,Re=0,Tt=null,ds(e,p,C,L)}}qg(),m=Ye;break}catch(G){Bf(e,G)}while(!0);return t&&e.shellSuspendCounter++,fa=yn=null,Ee=s,$.H=i,$.A=r,be===null&&(Ue=null,je=0,ii()),m}function qg(){for(;be!==null;)Gf(be)}function $g(e,t){var n=Ee;Ee|=2;var s=qf(),i=$f();Ue!==e||je!==t?(Bi=null,Ui=rt()+500,us(e,t)):cs=Ds(e,t);e:do try{if(Re!==0&&be!==null){t=be;var r=Tt;t:switch(Re){case 1:Re=0,Tt=null,ds(e,t,r,1);break;case 2:case 9:if(Wd(r)){Re=0,Tt=null,Vf(t);break}t=function(){Re!==2&&Re!==9||Ue!==e||(Re=7),na(e)},r.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:Wd(r)?(Re=0,Tt=null,Vf(t)):(Re=0,Tt=null,ds(e,t,r,7));break;case 5:var m=null;switch(be.tag){case 26:m=be.memoizedState;case 5:case 27:var p=be;if(m?Ax(m):p.stateNode.complete){Re=0,Tt=null;var C=p.sibling;if(C!==null)be=C;else{var L=p.return;L!==null?(be=L,$i(L)):be=null}break t}}Re=0,Tt=null,ds(e,t,r,5);break;case 6:Re=0,Tt=null,ds(e,t,r,6);break;case 8:ko(),Ye=6;break e;default:throw Error(o(462))}}Gg();break}catch(G){Bf(e,G)}while(!0);return fa=yn=null,$.H=s,$.A=i,Ee=n,be!==null?0:(Ue=null,je=0,ii(),Ye)}function Gg(){for(;be!==null&&!qc();)Gf(be)}function Gf(e){var t=mf(e.alternate,e,wa);e.memoizedProps=e.pendingProps,t===null?$i(e):be=t}function Vf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lf(n,t,t.pendingProps,t.type,void 0,je);break;case 11:t=lf(n,t,t.pendingProps,t.type.render,t.ref,je);break;case 5:$r(t);default:xf(n,t),t=be=qd(t,wa),t=mf(n,t,wa)}e.memoizedProps=e.pendingProps,t===null?$i(e):be=t}function ds(e,t,n,s){fa=yn=null,$r(t),es=null,Fs=0;var i=t.return;try{if(Tg(e,i,t,n,je)){Ye=1,Ai(e,Ht(n,e.current)),be=null;return}}catch(r){if(i!==null)throw be=i,r;Ye=1,Ai(e,Ht(n,e.current)),be=null;return}t.flags&32768?(Se||s===1?e=!0:cs||(je&536870912)!==0?e=!1:(Xa=e=!0,(s===2||s===9||s===3||s===6)&&(s=At.current,s!==null&&s.tag===13&&(s.flags|=16384))),Yf(t,e)):$i(t)}function $i(e){var t=e;do{if((t.flags&32768)!==0){Yf(t,Xa);return}e=t.return;var n=Dg(t.alternate,t,wa);if(n!==null){be=n;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ye===0&&(Ye=5)}function Yf(e,t){do{var n=Og(e.alternate,e);if(n!==null){n.flags&=32767,be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=n}while(e!==null);Ye=6,be=null}function Xf(e,t,n,s,i,r,m,p,C){e.cancelPendingCommit=null;do Gi();while(Ie!==0);if((Ee&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(r=t.lanes|t.childLanes,r|=xr,j0(e,n,r,m,p,C),e===Ue&&(be=Ue=null,je=0),os=t,Za=e,Sa=n,wo=r,So=i,Of=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Qg(Mn,function(){return Ff(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=$.T,$.T=null,i=P.p,P.p=2,m=Ee,Ee|=4;try{Lg(e,t,n)}finally{Ee=m,P.p=i,$.T=s}}Ie=1,Qf(),Kf(),Zf()}}function Qf(){if(Ie===1){Ie=0;var e=Za,t=os,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=$.T,$.T=null;var s=P.p;P.p=2;var i=Ee;Ee|=4;try{kf(t,e);var r=Ho,m=Rd(e.containerInfo),p=r.focusedElem,C=r.selectionRange;if(m!==p&&p&&p.ownerDocument&&Td(p.ownerDocument.documentElement,p)){if(C!==null&&or(p)){var L=C.start,G=C.end;if(G===void 0&&(G=L),"selectionStart"in p)p.selectionStart=L,p.selectionEnd=Math.min(G,p.value.length);else{var Y=p.ownerDocument||document,_=Y&&Y.defaultView||window;if(_.getSelection){var q=_.getSelection(),ie=p.textContent.length,ue=Math.min(C.start,ie),Le=C.end===void 0?ue:Math.min(C.end,ie);!q.extend&&ue>Le&&(m=Le,Le=ue,ue=m);var M=Ed(p,ue),T=Ed(p,Le);if(M&&T&&(q.rangeCount!==1||q.anchorNode!==M.node||q.anchorOffset!==M.offset||q.focusNode!==T.node||q.focusOffset!==T.offset)){var O=Y.createRange();O.setStart(M.node,M.offset),q.removeAllRanges(),ue>Le?(q.addRange(O),q.extend(T.node,T.offset)):(O.setEnd(T.node,T.offset),q.addRange(O))}}}}for(Y=[],q=p;q=q.parentNode;)q.nodeType===1&&Y.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<Y.length;p++){var V=Y[p];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}ec=!!Bo,Ho=Bo=null}finally{Ee=i,P.p=s,$.T=n}}e.current=t,Ie=2}}function Kf(){if(Ie===2){Ie=0;var e=Za,t=os,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=$.T,$.T=null;var s=P.p;P.p=2;var i=Ee;Ee|=4;try{jf(e,t.alternate,t)}finally{Ee=i,P.p=s,$.T=n}}Ie=3}}function Zf(){if(Ie===4||Ie===3){Ie=0,$c();var e=Za,t=os,n=Sa,s=Of;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,os=Za=null,Jf(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ka=null),Yc(n),t=t.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Ms,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=$.T,i=P.p,P.p=2,$.T=null;try{for(var r=e.onRecoverableError,m=0;m<s.length;m++){var p=s[m];r(p.value,{componentStack:p.stack})}}finally{$.T=t,P.p=i}}(Sa&3)!==0&&Gi(),na(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===zo?fl++:(fl=0,zo=e):fl=0,xl(0)}}function Jf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Zs(t)))}function Gi(){return Qf(),Kf(),Zf(),Ff()}function Ff(){if(Ie!==5)return!1;var e=Za,t=wo;wo=0;var n=Yc(Sa),s=$.T,i=P.p;try{P.p=32>n?32:n,$.T=null,n=So,So=null;var r=Za,m=Sa;if(Ie=0,os=Za=null,Sa=0,(Ee&6)!==0)throw Error(o(331));var p=Ee;if(Ee|=4,Rf(r.current),Af(r,r.current,m,n),Ee=p,xl(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Ms,r)}catch{}return!0}finally{P.p=i,$.T=s,Jf(e,t)}}function Wf(e,t,n){t=Ht(n,t),t=ao(e.stateNode,t,2),e=$a(e,t,2),e!==null&&(Os(e,2),na(e))}function Me(e,t,n){if(e.tag===3)Wf(e,e,n);else for(;t!==null;){if(t.tag===3){Wf(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ka===null||!Ka.has(s))){e=Ht(n,e),n=Wm(2),s=$a(t,n,2),s!==null&&(Im(n,s,t,e),Os(s,2),na(s));break}}t=t.return}}function Ao(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Bg;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(vo=!0,i.add(n),e=Vg.bind(null,e,t,n),t.then(e,e))}function Vg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ue===e&&(je&n)===n&&(Ye===4||Ye===3&&(je&62914560)===je&&300>rt()-_i?(Ee&2)===0&&us(e,0):jo|=n,rs===je&&(rs=0)),na(e)}function If(e,t){t===0&&(t=Xu()),e=hn(e,t),e!==null&&(Os(e,t),na(e))}function Yg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),If(e,n)}function Xg(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(o(314))}s!==null&&s.delete(t),If(e,n)}function Qg(e,t){return xe(e,t)}var Vi=null,ms=null,Eo=!1,Yi=!1,To=!1,Fa=0;function na(e){e!==ms&&e.next===null&&(ms===null?Vi=ms=e:ms=ms.next=e),Yi=!0,Eo||(Eo=!0,Zg())}function xl(e,t){if(!To&&Yi){To=!0;do for(var n=!1,s=Vi;s!==null;){if(e!==0){var i=s.pendingLanes;if(i===0)var r=0;else{var m=s.suspendedLanes,p=s.pingedLanes;r=(1<<31-zt(42|e)+1)-1,r&=i&~(m&~p),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,ax(s,r))}else r=je,r=Zl(s,s===Ue?r:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(r&3)===0||Ds(s,r)||(n=!0,ax(s,r));s=s.next}while(n);To=!1}}function Kg(){Pf()}function Pf(){Yi=Eo=!1;var e=0;Fa!==0&&sp()&&(e=Fa);for(var t=rt(),n=null,s=Vi;s!==null;){var i=s.next,r=ex(s,t);r===0?(s.next=null,n===null?Vi=i:n.next=i,i===null&&(ms=n)):(n=s,(e!==0||(r&3)!==0)&&(Yi=!0)),s=i}Ie!==0&&Ie!==5||xl(e),Fa!==0&&(Fa=0)}function ex(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var m=31-zt(r),p=1<<m,C=i[m];C===-1?((p&n)===0||(p&s)!==0)&&(i[m]=v0(p,t)):C<=t&&(e.expiredLanes|=p),r&=~p}if(t=Ue,n=je,n=Zl(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&wt(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ds(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&wt(s),Yc(n)){case 2:case 8:n=Yl;break;case 32:n=Mn;break;case 268435456:n=Yu;break;default:n=Mn}return s=tx.bind(null,e),n=xe(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&wt(s),e.callbackPriority=2,e.callbackNode=null,2}function tx(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gi()&&e.callbackNode!==n)return null;var s=je;return s=Zl(e,e===Ue?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(_f(e,s,t),ex(e,rt()),e.callbackNode!=null&&e.callbackNode===n?tx.bind(null,e):null)}function ax(e,t){if(Gi())return null;_f(e,t,!0)}function Zg(){ip(function(){(Ee&6)!==0?xe(Rs,Kg):Pf()})}function Ro(){if(Fa===0){var e=Wn;e===0&&(e=Xl,Xl<<=1,(Xl&261888)===0&&(Xl=256)),Fa=e}return Fa}function nx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Il(""+e)}function sx(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 Jg(e,t,n,s,i){if(t==="submit"&&n&&n.stateNode===i){var r=nx((i[xt]||null).action),m=s.submitter;m&&(t=(t=m[xt]||null)?nx(t.formAction):m.getAttribute("formAction"),t!==null&&(r=t,m=null));var p=new ai("action","action",null,s,i);e.push({event:p,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Fa!==0){var C=m?sx(i,m):new FormData(i);Fr(n,{pending:!0,data:C,method:i.method,action:r},null,C)}}else typeof r=="function"&&(p.preventDefault(),C=m?sx(i,m):new FormData(i),Fr(n,{pending:!0,data:C,method:i.method,action:r},r,C))},currentTarget:i}]})}}for(var Mo=0;Mo<fr.length;Mo++){var Do=fr[Mo],Fg=Do.toLowerCase(),Wg=Do[0].toUpperCase()+Do.slice(1);Kt(Fg,"on"+Wg)}Kt(Od,"onAnimationEnd"),Kt(Ld,"onAnimationIteration"),Kt(_d,"onAnimationStart"),Kt("dblclick","onDoubleClick"),Kt("focusin","onFocus"),Kt("focusout","onBlur"),Kt(fg,"onTransitionRun"),Kt(xg,"onTransitionStart"),Kt(hg,"onTransitionCancel"),Kt(Ud,"onTransitionEnd"),Un("onMouseEnter",["mouseout","mouseover"]),Un("onMouseLeave",["mouseout","mouseover"]),Un("onPointerEnter",["pointerout","pointerover"]),Un("onPointerLeave",["pointerout","pointerover"]),dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="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(" "),Ig=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hl));function lx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],i=s.event;s=s.listeners;e:{var r=void 0;if(t)for(var m=s.length-1;0<=m;m--){var p=s[m],C=p.instance,L=p.currentTarget;if(p=p.listener,C!==r&&i.isPropagationStopped())break e;r=p,i.currentTarget=L;try{r(i)}catch(G){li(G)}i.currentTarget=null,r=C}else for(m=0;m<s.length;m++){if(p=s[m],C=p.instance,L=p.currentTarget,p=p.listener,C!==r&&i.isPropagationStopped())break e;r=p,i.currentTarget=L;try{r(i)}catch(G){li(G)}i.currentTarget=null,r=C}}}}function ve(e,t){var n=t[Xc];n===void 0&&(n=t[Xc]=new Set);var s=e+"__bubble";n.has(s)||(ix(t,e,2,!1),n.add(s))}function Oo(e,t,n){var s=0;t&&(s|=4),ix(n,e,s,t)}var Xi="_reactListening"+Math.random().toString(36).slice(2);function Lo(e){if(!e[Xi]){e[Xi]=!0,Iu.forEach(function(n){n!=="selectionchange"&&(Ig.has(n)||Oo(n,!1,e),Oo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xi]||(t[Xi]=!0,Oo("selectionchange",!1,t))}}function ix(e,t,n,s){switch(Lx(t)){case 2:var i=kp;break;case 8:i=Cp;break;default:i=Fo}n=i.bind(null,t,n,e),i=void 0,!er||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function _o(e,t,n,s,i){var r=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var m=s.tag;if(m===3||m===4){var p=s.stateNode.containerInfo;if(p===i)break;if(m===4)for(m=s.return;m!==null;){var C=m.tag;if((C===3||C===4)&&m.stateNode.containerInfo===i)return;m=m.return}for(;p!==null;){if(m=On(p),m===null)return;if(C=m.tag,C===5||C===6||C===26||C===27){s=r=m;continue e}p=p.parentNode}}s=s.return}ud(function(){var L=r,G=Ic(n),Y=[];e:{var _=Bd.get(e);if(_!==void 0){var q=ai,ie=e;switch(e){case"keypress":if(ei(n)===0)break e;case"keydown":case"keyup":q=X0;break;case"focusin":ie="focus",q=sr;break;case"focusout":ie="blur",q=sr;break;case"beforeblur":case"afterblur":q=sr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=fd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=D0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Z0;break;case Od:case Ld:case _d:q=_0;break;case Ud:q=F0;break;case"scroll":case"scrollend":q=R0;break;case"wheel":q=I0;break;case"copy":case"cut":case"paste":q=B0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=hd;break;case"toggle":case"beforetoggle":q=eg}var ue=(t&4)!==0,Le=!ue&&(e==="scroll"||e==="scrollend"),M=ue?_!==null?_+"Capture":null:_;ue=[];for(var T=L,O;T!==null;){var V=T;if(O=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||O===null||M===null||(V=Us(T,M),V!=null&&ue.push(gl(T,V,O))),Le)break;T=T.return}0<ue.length&&(_=new q(_,ie,null,n,G),Y.push({event:_,listeners:ue}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",_&&n!==Wc&&(ie=n.relatedTarget||n.fromElement)&&(On(ie)||ie[Dn]))break e;if((q||_)&&(_=G.window===G?G:(_=G.ownerDocument)?_.defaultView||_.parentWindow:window,q?(ie=n.relatedTarget||n.toElement,q=L,ie=ie?On(ie):null,ie!==null&&(Le=x(ie),ue=ie.tag,ie!==Le||ue!==5&&ue!==27&&ue!==6)&&(ie=null)):(q=null,ie=L),q!==ie)){if(ue=fd,V="onMouseLeave",M="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(ue=hd,V="onPointerLeave",M="onPointerEnter",T="pointer"),Le=q==null?_:_s(q),O=ie==null?_:_s(ie),_=new ue(V,T+"leave",q,n,G),_.target=Le,_.relatedTarget=O,V=null,On(G)===L&&(ue=new ue(M,T+"enter",ie,n,G),ue.target=O,ue.relatedTarget=Le,V=ue),Le=V,q&&ie)t:{for(ue=Pg,M=q,T=ie,O=0,V=M;V;V=ue(V))O++;V=0;for(var re=T;re;re=ue(re))V++;for(;0<O-V;)M=ue(M),O--;for(;0<V-O;)T=ue(T),V--;for(;O--;){if(M===T||T!==null&&M===T.alternate){ue=M;break t}M=ue(M),T=ue(T)}ue=null}else ue=null;q!==null&&cx(Y,_,q,ue,!1),ie!==null&&Le!==null&&cx(Y,Le,ie,ue,!0)}}e:{if(_=L?_s(L):window,q=_.nodeName&&_.nodeName.toLowerCase(),q==="select"||q==="input"&&_.type==="file")var ze=wd;else if(jd(_))if(Sd)ze=ug;else{ze=rg;var ce=cg}else q=_.nodeName,!q||q.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?L&&Fc(L.elementType)&&(ze=wd):ze=og;if(ze&&(ze=ze(e,L))){Nd(Y,ze,n,G);break e}ce&&ce(e,_,L),e==="focusout"&&L&&_.type==="number"&&L.memoizedProps.value!=null&&Jc(_,"number",_.value)}switch(ce=L?_s(L):window,e){case"focusin":(jd(ce)||ce.contentEditable==="true")&&(Vn=ce,ur=L,Xs=null);break;case"focusout":Xs=ur=Vn=null;break;case"mousedown":dr=!0;break;case"contextmenu":case"mouseup":case"dragend":dr=!1,Md(Y,n,G);break;case"selectionchange":if(mg)break;case"keydown":case"keyup":Md(Y,n,G)}var ge;if(ir)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Gn?bd(e,n)&&(Ne="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ne="onCompositionStart");Ne&&(gd&&n.locale!=="ko"&&(Gn||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Gn&&(ge=dd()):(Oa=G,tr="value"in Oa?Oa.value:Oa.textContent,Gn=!0)),ce=Qi(L,Ne),0<ce.length&&(Ne=new xd(Ne,e,null,n,G),Y.push({event:Ne,listeners:ce}),ge?Ne.data=ge:(ge=vd(n),ge!==null&&(Ne.data=ge)))),(ge=ag?ng(e,n):sg(e,n))&&(Ne=Qi(L,"onBeforeInput"),0<Ne.length&&(ce=new xd("onBeforeInput","beforeinput",null,n,G),Y.push({event:ce,listeners:Ne}),ce.data=ge)),Jg(Y,e,L,n,G)}lx(Y,t)})}function gl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Qi(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=Us(e,n),i!=null&&s.unshift(gl(e,i,r)),i=Us(e,t),i!=null&&s.push(gl(e,i,r))),e.tag===3)return s;e=e.return}return[]}function Pg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function cx(e,t,n,s,i){for(var r=t._reactName,m=[];n!==null&&n!==s;){var p=n,C=p.alternate,L=p.stateNode;if(p=p.tag,C!==null&&C===s)break;p!==5&&p!==26&&p!==27||L===null||(C=L,i?(L=Us(n,r),L!=null&&m.unshift(gl(n,L,C))):i||(L=Us(n,r),L!=null&&m.push(gl(n,L,C)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function rx(e){return(typeof e=="string"?e:""+e).replace(ep,`
|
|
49
|
+
`).replace(tp,"")}function ox(e,t){return t=rx(t),rx(e)===t}function Oe(e,t,n,s,i,r){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Hn(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Hn(e,""+s);break;case"className":Fl(e,"class",s);break;case"tabIndex":Fl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Fl(e,n,s);break;case"style":rd(e,s,r);break;case"data":if(t!=="object"){Fl(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Il(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="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 r=="function"&&(n==="formAction"?(t!=="input"&&Oe(e,t,"name",i.name,i,null),Oe(e,t,"formEncType",i.formEncType,i,null),Oe(e,t,"formMethod",i.formMethod,i,null),Oe(e,t,"formTarget",i.formTarget,i,null)):(Oe(e,t,"encType",i.encType,i,null),Oe(e,t,"method",i.method,i,null),Oe(e,t,"target",i.target,i,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Il(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=oa);break;case"onScroll":s!=null&&ve("scroll",e);break;case"onScrollEnd":s!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(n=s.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=Il(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":ve("beforetoggle",e),ve("toggle",e),Jl(e,"popover",s);break;case"xlinkActuate":ra(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ra(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ra(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ra(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ra(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ra(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ra(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ra(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ra(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Jl(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=E0.get(n)||n,Jl(e,n,s))}}function Uo(e,t,n,s,i,r){switch(n){case"style":rd(e,s,r);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(n=s.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof s=="string"?Hn(e,s):(typeof s=="number"||typeof s=="bigint")&&Hn(e,""+s);break;case"onScroll":s!=null&&ve("scroll",e);break;case"onScrollEnd":s!=null&&ve("scrollend",e);break;case"onClick":s!=null&&(e.onclick=oa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pu.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),r=e[xt]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,i),typeof s=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,i);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):Jl(e,n,s)}}}function ct(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var s=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var m=n[r];if(m!=null)switch(r){case"src":s=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Oe(e,t,r,m,n,null)}}i&&Oe(e,t,"srcSet",n.srcSet,n,null),s&&Oe(e,t,"src",n.src,n,null);return;case"input":ve("invalid",e);var p=r=m=i=null,C=null,L=null;for(s in n)if(n.hasOwnProperty(s)){var G=n[s];if(G!=null)switch(s){case"name":i=G;break;case"type":m=G;break;case"checked":C=G;break;case"defaultChecked":L=G;break;case"value":r=G;break;case"defaultValue":p=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(137,t));break;default:Oe(e,t,s,G,n,null)}}sd(e,r,p,C,L,m,i,!1);return;case"select":ve("invalid",e),s=m=r=null;for(i in n)if(n.hasOwnProperty(i)&&(p=n[i],p!=null))switch(i){case"value":r=p;break;case"defaultValue":m=p;break;case"multiple":s=p;default:Oe(e,t,i,p,n,null)}t=r,n=m,e.multiple=!!s,t!=null?Bn(e,!!s,t,!1):n!=null&&Bn(e,!!s,n,!0);return;case"textarea":ve("invalid",e),r=i=s=null;for(m in n)if(n.hasOwnProperty(m)&&(p=n[m],p!=null))switch(m){case"value":s=p;break;case"defaultValue":i=p;break;case"children":r=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:Oe(e,t,m,p,n,null)}id(e,s,i,r);return;case"option":for(C in n)if(n.hasOwnProperty(C)&&(s=n[C],s!=null))switch(C){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Oe(e,t,C,s,n,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(s=0;s<hl.length;s++)ve(hl[s],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("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)&&(s=n[L],s!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Oe(e,t,L,s,n,null)}return;default:if(Fc(t)){for(G in n)n.hasOwnProperty(G)&&(s=n[G],s!==void 0&&Uo(e,t,G,s,n,void 0));return}}for(p in n)n.hasOwnProperty(p)&&(s=n[p],s!=null&&Oe(e,t,p,s,n,null))}function ap(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,m=null,p=null,C=null,L=null,G=null;for(q in n){var Y=n[q];if(n.hasOwnProperty(q)&&Y!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":C=Y;default:s.hasOwnProperty(q)||Oe(e,t,q,null,s,Y)}}for(var _ in s){var q=s[_];if(Y=n[_],s.hasOwnProperty(_)&&(q!=null||Y!=null))switch(_){case"type":r=q;break;case"name":i=q;break;case"checked":L=q;break;case"defaultChecked":G=q;break;case"value":m=q;break;case"defaultValue":p=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(o(137,t));break;default:q!==Y&&Oe(e,t,_,q,s,Y)}}Zc(e,m,p,C,L,G,r,i);return;case"select":q=m=p=_=null;for(r in n)if(C=n[r],n.hasOwnProperty(r)&&C!=null)switch(r){case"value":break;case"multiple":q=C;default:s.hasOwnProperty(r)||Oe(e,t,r,null,s,C)}for(i in s)if(r=s[i],C=n[i],s.hasOwnProperty(i)&&(r!=null||C!=null))switch(i){case"value":_=r;break;case"defaultValue":p=r;break;case"multiple":m=r;default:r!==C&&Oe(e,t,i,r,s,C)}t=p,n=m,s=q,_!=null?Bn(e,!!n,_,!1):!!s!=!!n&&(t!=null?Bn(e,!!n,t,!0):Bn(e,!!n,n?[]:"",!1));return;case"textarea":q=_=null;for(p in n)if(i=n[p],n.hasOwnProperty(p)&&i!=null&&!s.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:Oe(e,t,p,null,s,i)}for(m in s)if(i=s[m],r=n[m],s.hasOwnProperty(m)&&(i!=null||r!=null))switch(m){case"value":_=i;break;case"defaultValue":q=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==r&&Oe(e,t,m,i,s,r)}ld(e,_,q);return;case"option":for(var ie in n)if(_=n[ie],n.hasOwnProperty(ie)&&_!=null&&!s.hasOwnProperty(ie))switch(ie){case"selected":e.selected=!1;break;default:Oe(e,t,ie,null,s,_)}for(C in s)if(_=s[C],q=n[C],s.hasOwnProperty(C)&&_!==q&&(_!=null||q!=null))switch(C){case"selected":e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:Oe(e,t,C,_,s,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in n)_=n[ue],n.hasOwnProperty(ue)&&_!=null&&!s.hasOwnProperty(ue)&&Oe(e,t,ue,null,s,_);for(L in s)if(_=s[L],q=n[L],s.hasOwnProperty(L)&&_!==q&&(_!=null||q!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(o(137,t));break;default:Oe(e,t,L,_,s,q)}return;default:if(Fc(t)){for(var Le in n)_=n[Le],n.hasOwnProperty(Le)&&_!==void 0&&!s.hasOwnProperty(Le)&&Uo(e,t,Le,void 0,s,_);for(G in s)_=s[G],q=n[G],!s.hasOwnProperty(G)||_===q||_===void 0&&q===void 0||Uo(e,t,G,_,s,q);return}}for(var M in n)_=n[M],n.hasOwnProperty(M)&&_!=null&&!s.hasOwnProperty(M)&&Oe(e,t,M,null,s,_);for(Y in s)_=s[Y],q=n[Y],!s.hasOwnProperty(Y)||_===q||_==null&&q==null||Oe(e,t,Y,_,s,q)}function ux(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function np(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var i=n[s],r=i.transferSize,m=i.initiatorType,p=i.duration;if(r&&p&&ux(m)){for(m=0,p=i.responseEnd,s+=1;s<n.length;s++){var C=n[s],L=C.startTime;if(L>p)break;var G=C.transferSize,Y=C.initiatorType;G&&ux(Y)&&(C=C.responseEnd,m+=G*(C<p?1:(p-L)/(C-L)))}if(--s,t+=8*(r+m)/(i.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 Bo=null,Ho=null;function Ki(e){return e.nodeType===9?e:e.ownerDocument}function dx(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 mx(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 qo(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 $o=null;function sp(){var e=window.event;return e&&e.type==="popstate"?e===$o?!1:($o=e,!0):($o=null,!1)}var fx=typeof setTimeout=="function"?setTimeout:void 0,lp=typeof clearTimeout=="function"?clearTimeout:void 0,xx=typeof Promise=="function"?Promise:void 0,ip=typeof queueMicrotask=="function"?queueMicrotask:typeof xx<"u"?function(e){return xx.resolve(null).then(e).catch(cp)}:fx;function cp(e){setTimeout(function(){throw e})}function Wa(e){return e==="head"}function hx(e,t){var n=t,s=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(i),gs(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")pl(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,pl(n);for(var r=n.firstChild;r;){var m=r.nextSibling,p=r.nodeName;r[Ls]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=m}}else n==="body"&&pl(e.ownerDocument.body);n=i}while(n);gs(t)}function gx(e,t){var n=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function Go(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":Go(n),Qc(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function rp(e,t,n,s){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Ls])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Yt(e.nextSibling),e===null)break}return null}function op(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Yt(e.nextSibling),e===null))return null;return e}function px(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Yt(e.nextSibling),e===null))return null;return e}function Vo(e){return e.data==="$?"||e.data==="$~"}function Yo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function up(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Yt(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 Xo=null;function yx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Yt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function bx(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 vx(e,t,n){switch(t=Ki(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function pl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qc(e)}var Xt=new Map,jx=new Set;function Zi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var za=P.d;P.d={f:dp,r:mp,D:fp,C:xp,L:hp,m:gp,X:yp,S:pp,M:bp};function dp(){var e=za.f(),t=Hi();return e||t}function mp(e){var t=Ln(e);t!==null&&t.tag===5&&t.type==="form"?Um(t):za.r(e)}var fs=typeof document>"u"?null:document;function Nx(e,t,n){var s=fs;if(s&&typeof t=="string"&&t){var i=Ut(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),jx.has(i)||(jx.add(i),e={rel:e,crossOrigin:n,href:t},s.querySelector(i)===null&&(t=s.createElement("link"),ct(t,"link",e),Pe(t),s.head.appendChild(t)))}}function fp(e){za.D(e),Nx("dns-prefetch",e,null)}function xp(e,t){za.C(e,t),Nx("preconnect",e,t)}function hp(e,t,n){za.L(e,t,n);var s=fs;if(s&&e&&t){var i='link[rel="preload"][as="'+Ut(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Ut(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Ut(n.imageSizes)+'"]')):i+='[href="'+Ut(e)+'"]';var r=i;switch(t){case"style":r=xs(e);break;case"script":r=hs(e)}Xt.has(r)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Xt.set(r,e),s.querySelector(i)!==null||t==="style"&&s.querySelector(yl(r))||t==="script"&&s.querySelector(bl(r))||(t=s.createElement("link"),ct(t,"link",e),Pe(t),s.head.appendChild(t)))}}function gp(e,t){za.m(e,t);var n=fs;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Ut(s)+'"][href="'+Ut(e)+'"]',r=i;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=hs(e)}if(!Xt.has(r)&&(e=b({rel:"modulepreload",href:e},t),Xt.set(r,e),n.querySelector(i)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(bl(r)))return}s=n.createElement("link"),ct(s,"link",e),Pe(s),n.head.appendChild(s)}}}function pp(e,t,n){za.S(e,t,n);var s=fs;if(s&&e){var i=_n(s).hoistableStyles,r=xs(e);t=t||"default";var m=i.get(r);if(!m){var p={loading:0,preload:null};if(m=s.querySelector(yl(r)))p.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Xt.get(r))&&Qo(e,n);var C=m=s.createElement("link");Pe(C),ct(C,"link",e),C._p=new Promise(function(L,G){C.onload=L,C.onerror=G}),C.addEventListener("load",function(){p.loading|=1}),C.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Ji(m,t,s)}m={type:"stylesheet",instance:m,count:1,state:p},i.set(r,m)}}}function yp(e,t){za.X(e,t);var n=fs;if(n&&e){var s=_n(n).hoistableScripts,i=hs(e),r=s.get(i);r||(r=n.querySelector(bl(i)),r||(e=b({src:e,async:!0},t),(t=Xt.get(i))&&Ko(e,t),r=n.createElement("script"),Pe(r),ct(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function bp(e,t){za.M(e,t);var n=fs;if(n&&e){var s=_n(n).hoistableScripts,i=hs(e),r=s.get(i);r||(r=n.querySelector(bl(i)),r||(e=b({src:e,async:!0,type:"module"},t),(t=Xt.get(i))&&Ko(e,t),r=n.createElement("script"),Pe(r),ct(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function wx(e,t,n,s){var i=(i=pe.current)?Zi(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=xs(n.href),n=_n(i).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=xs(n.href);var r=_n(i).hoistableStyles,m=r.get(e);if(m||(i=i.ownerDocument||i,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,m),(r=i.querySelector(yl(e)))&&!r._p&&(m.instance=r,m.state.loading=5),Xt.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},Xt.set(e,n),r||vp(i,e,n,m.state))),t&&s===null)throw Error(o(528,""));return m}if(t&&s!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=hs(n),n=_n(i).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function xs(e){return'href="'+Ut(e)+'"'}function yl(e){return'link[rel="stylesheet"]['+e+"]"}function Sx(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function vp(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),ct(t,"link",n),Pe(t),e.head.appendChild(t))}function hs(e){return'[src="'+Ut(e)+'"]'}function bl(e){return"script[async]"+e}function zx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ut(n.href)+'"]');if(s)return t.instance=s,Pe(s),s;var i=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Pe(s),ct(s,"style",i),Ji(s,n.precedence,e),t.instance=s;case"stylesheet":i=xs(n.href);var r=e.querySelector(yl(i));if(r)return t.state.loading|=4,t.instance=r,Pe(r),r;s=Sx(n),(i=Xt.get(i))&&Qo(s,i),r=(e.ownerDocument||e).createElement("link"),Pe(r);var m=r;return m._p=new Promise(function(p,C){m.onload=p,m.onerror=C}),ct(r,"link",s),t.state.loading|=4,Ji(r,n.precedence,e),t.instance=r;case"script":return r=hs(n.src),(i=e.querySelector(bl(r)))?(t.instance=i,Pe(i),i):(s=n,(i=Xt.get(r))&&(s=b({},n),Ko(s,i)),e=e.ownerDocument||e,i=e.createElement("script"),Pe(i),ct(i,"link",s),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Ji(s,n.precedence,e));return t.instance}function Ji(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=s.length?s[s.length-1]:null,r=i,m=0;m<s.length;m++){var p=s[m];if(p.dataset.precedence===t)r=p;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ko(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Fi=null;function kx(e,t,n){if(Fi===null){var s=new Map,i=Fi=new Map;i.set(n,s)}else i=Fi,s=i.get(n),s||(s=new Map,i.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[Ls]||r[nt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var m=r.getAttribute(t)||"";m=e+m;var p=s.get(m);p?p.push(r):s.set(m,[r])}}return s}function Cx(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function jp(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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ax(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Np(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=xs(s.href),r=t.querySelector(yl(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Wi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,Pe(r);return}r=t.ownerDocument||t,s=Sx(s),(i=Xt.get(i))&&Qo(s,i),r=r.createElement("link"),Pe(r);var m=r;m._p=new Promise(function(p,C){m.onload=p,m.onerror=C}),ct(r,"link",s),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Wi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Zo=0;function wp(e,t){return e.stylesheets&&e.count===0&&Pi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&Pi(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Zo===0&&(Zo=62500*np());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Pi(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Zo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(i)}}:null}function Wi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ii=null;function Pi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ii=new Map,t.forEach(Sp,e),Ii=null,Wi.call(e))}function Sp(e,t){if(!(t.state.loading&4)){var n=Ii.get(e);if(n)var s=n.get(null);else{n=new Map,Ii.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var m=i[r];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),s=m)}s&&n.set(null,s)}i=t.instance,m=i.getAttribute("data-precedence"),r=n.get(m)||s,r===s&&n.set(null,i),n.set(m,i),this.count++,s=Wi.bind(this),i.addEventListener("load",s),i.addEventListener("error",s),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var vl={$$typeof:U,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function zp(e,t,n,s,i,r,m,p,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=Gc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gc(0),this.hiddenUpdates=Gc(null),this.identifierPrefix=s,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Ex(e,t,n,s,i,r,m,p,C,L,G,Y){return e=new zp(e,t,n,m,C,L,G,Y,p),t=1,r===!0&&(t|=24),r=Ct(3,null,null,t),e.current=r,r.stateNode=e,t=kr(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:s,isDehydrated:n,cache:t},Tr(r),e}function Tx(e){return e?(e=Qn,e):Qn}function Rx(e,t,n,s,i,r){i=Tx(i),s.context===null?s.context=i:s.pendingContext=i,s=qa(t),s.payload={element:n},r=r===void 0?null:r,r!==null&&(s.callback=r),n=$a(e,s,t),n!==null&&(vt(n,e,t),Is(n,e,t))}function Mx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jo(e,t){Mx(e,t),(e=e.alternate)&&Mx(e,t)}function Dx(e){if(e.tag===13||e.tag===31){var t=hn(e,67108864);t!==null&&vt(t,e,67108864),Jo(e,67108864)}}function Ox(e){if(e.tag===13||e.tag===31){var t=Mt();t=Vc(t);var n=hn(e,t);n!==null&&vt(n,e,t),Jo(e,t)}}var ec=!0;function kp(e,t,n,s){var i=$.T;$.T=null;var r=P.p;try{P.p=2,Fo(e,t,n,s)}finally{P.p=r,$.T=i}}function Cp(e,t,n,s){var i=$.T;$.T=null;var r=P.p;try{P.p=8,Fo(e,t,n,s)}finally{P.p=r,$.T=i}}function Fo(e,t,n,s){if(ec){var i=Wo(s);if(i===null)_o(e,t,s,tc,n),_x(e,s);else if(Ep(i,e,t,n,s))s.stopPropagation();else if(_x(e,s),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var r=Ln(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var m=un(r.pendingLanes);if(m!==0){var p=r;for(p.pendingLanes|=2,p.entangledLanes|=2;m;){var C=1<<31-zt(m);p.entanglements[1]|=C,m&=~C}na(r),(Ee&6)===0&&(Ui=rt()+500,xl(0))}}break;case 31:case 13:p=hn(r,2),p!==null&&vt(p,r,2),Hi(),Jo(r,2)}if(r=Wo(s),r===null&&_o(e,t,s,tc,n),r===i)break;i=r}i!==null&&s.stopPropagation()}else _o(e,t,s,null,n)}}function Wo(e){return e=Ic(e),Io(e)}var tc=null;function Io(e){if(tc=null,e=On(e),e!==null){var t=x(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g(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 tc=e,null}function Lx(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(Vl()){case Rs:return 2;case Yl:return 8;case Mn:case x0:return 32;case Yu:return 268435456;default:return 32}default:return 32}}var Po=!1,Ia=null,Pa=null,en=null,jl=new Map,Nl=new Map,tn=[],Ap="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 _x(e,t){switch(e){case"focusin":case"focusout":Ia=null;break;case"dragenter":case"dragleave":Pa=null;break;case"mouseover":case"mouseout":en=null;break;case"pointerover":case"pointerout":jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nl.delete(t.pointerId)}}function wl(e,t,n,s,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Ln(t),t!==null&&Dx(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,s,i){switch(t){case"focusin":return Ia=wl(Ia,e,t,n,s,i),!0;case"dragenter":return Pa=wl(Pa,e,t,n,s,i),!0;case"mouseover":return en=wl(en,e,t,n,s,i),!0;case"pointerover":var r=i.pointerId;return jl.set(r,wl(jl.get(r)||null,e,t,n,s,i)),!0;case"gotpointercapture":return r=i.pointerId,Nl.set(r,wl(Nl.get(r)||null,e,t,n,s,i)),!0}return!1}function Ux(e){var t=On(e.target);if(t!==null){var n=x(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,Fu(e.priority,function(){Ox(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,Fu(e.priority,function(){Ox(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 ac(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Wo(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Wc=s,n.target.dispatchEvent(s),Wc=null}else return t=Ln(n),t!==null&&Dx(t),e.blockedOn=n,!1;t.shift()}return!0}function Bx(e,t,n){ac(e)&&n.delete(t)}function Tp(){Po=!1,Ia!==null&&ac(Ia)&&(Ia=null),Pa!==null&&ac(Pa)&&(Pa=null),en!==null&&ac(en)&&(en=null),jl.forEach(Bx),Nl.forEach(Bx)}function nc(e,t){e.blockedOn===t&&(e.blockedOn=null,Po||(Po=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Tp)))}var sc=null;function Hx(e){sc!==e&&(sc=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){sc===e&&(sc=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],i=e[t+2];if(typeof s!="function"){if(Io(s||n)===null)continue;break}var r=Ln(n);r!==null&&(e.splice(t,3),t-=3,Fr(r,{pending:!0,data:i,method:n.method,action:s},s,i))}}))}function gs(e){function t(C){return nc(C,e)}Ia!==null&&nc(Ia,e),Pa!==null&&nc(Pa,e),en!==null&&nc(en,e),jl.forEach(t),Nl.forEach(t);for(var n=0;n<tn.length;n++){var s=tn[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<tn.length&&(n=tn[0],n.blockedOn===null);)Ux(n),n.blockedOn===null&&tn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var i=n[s],r=n[s+1],m=i[xt]||null;if(typeof r=="function")m||Hx(n);else if(m){var p=null;if(r&&r.hasAttribute("formAction")){if(i=r,m=r[xt]||null)p=m.formAction;else if(Io(i)!==null)continue}else p=m.action;typeof p=="function"?n[s+1]=p:(n.splice(s,3),s-=3),Hx(n)}}}function qx(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(m){return i=m})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function eu(e){this._internalRoot=e}lc.prototype.render=eu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,s=Mt();Rx(n,s,e,t,null,null)},lc.prototype.unmount=eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rx(e.current,2,null,e,null,null),Hi(),t[Dn]=null}};function lc(e){this._internalRoot=e}lc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ju();e={blockedOn:null,target:e,priority:t};for(var n=0;n<tn.length&&t!==0&&t<tn[n].priority;n++);tn.splice(n,0,e),n===0&&Ux(e)}};var $x=c.version;if($x!=="19.2.4")throw Error(o(527,$x,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{Ms=ic.inject(Rp),St=ic}catch{}}return zl.createRoot=function(e,t){if(!f(e))throw Error(o(299));var n=!1,s="",i=Km,r=Zm,m=Jm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Ex(e,1,!1,null,null,n,s,null,i,r,m,qx),e[Dn]=t.current,Lo(e),new eu(t)},zl.hydrateRoot=function(e,t,n){if(!f(e))throw Error(o(299));var s=!1,i="",r=Km,m=Zm,p=Jm,C=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(p=n.onRecoverableError),n.formState!==void 0&&(C=n.formState)),t=Ex(e,1,!0,t,n??null,s,i,C,r,m,p,qx),t.context=Tx(null),n=t.current,s=Mt(),s=Vc(s),i=qa(s),i.callback=null,$a(n,i,s),n=s,t.current.lanes=n,Os(t,n),na(t),e[Dn]=t.current,Lo(e),new lc(t)},zl.version="19.2.4",zl}var Wx;function Vp(){if(Wx)return su.exports;Wx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(c){console.error(c)}}return l(),su.exports=Gp(),su.exports}var Yp=Vp();/**
|
|
50
|
+
* react-router v7.13.2
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var Ix="popstate";function Px(l){return typeof l=="object"&&l!=null&&"pathname"in l&&"search"in l&&"hash"in l&&"state"in l&&"key"in l}function Xp(l={}){function c(o,f){var h;let x=(h=f.state)==null?void 0:h.masked,{pathname:g,search:v,hash:y}=x||o.location;return gu("",{pathname:g,search:v,hash:y},f.state&&f.state.usr||null,f.state&&f.state.key||"default",x?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function u(o,f){return typeof f=="string"?f:Tl(f)}return Kp(c,u,null,l)}function $e(l,c){if(l===!1||l===null||typeof l>"u")throw new Error(c)}function Ft(l,c){if(!l){typeof console<"u"&&console.warn(c);try{throw new Error(c)}catch{}}}function Qp(){return Math.random().toString(36).substring(2,10)}function eh(l,c){return{usr:l.state,key:l.key,idx:c,masked:l.unstable_mask?{pathname:l.pathname,search:l.search,hash:l.hash}:void 0}}function gu(l,c,u=null,o,f){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof c=="string"?ws(c):c,state:u,key:c&&c.key||o||Qp(),unstable_mask:f}}function Tl({pathname:l="/",search:c="",hash:u=""}){return c&&c!=="?"&&(l+=c.charAt(0)==="?"?c:"?"+c),u&&u!=="#"&&(l+=u.charAt(0)==="#"?u:"#"+u),l}function ws(l){let c={};if(l){let u=l.indexOf("#");u>=0&&(c.hash=l.substring(u),l=l.substring(0,u));let o=l.indexOf("?");o>=0&&(c.search=l.substring(o),l=l.substring(0,o)),l&&(c.pathname=l)}return c}function Kp(l,c,u,o={}){let{window:f=document.defaultView,v5Compat:x=!1}=o,g=f.history,v="POP",y=null,h=w();h==null&&(h=0,g.replaceState({...g.state,idx:h},""));function w(){return(g.state||{idx:null}).idx}function b(){v="POP";let S=w(),k=S==null?null:S-h;h=S,y&&y({action:v,location:N.location,delta:k})}function j(S,k){v="PUSH";let D=Px(S)?S:gu(N.location,S,k);h=w()+1;let U=eh(D,h),E=N.createHref(D.unstable_mask||D);try{g.pushState(U,"",E)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;f.location.assign(E)}x&&y&&y({action:v,location:N.location,delta:1})}function A(S,k){v="REPLACE";let D=Px(S)?S:gu(N.location,S,k);h=w();let U=eh(D,h),E=N.createHref(D.unstable_mask||D);g.replaceState(U,"",E),x&&y&&y({action:v,location:N.location,delta:0})}function z(S){return Zp(S)}let N={get action(){return v},get location(){return l(f,g)},listen(S){if(y)throw new Error("A history only accepts one active listener");return f.addEventListener(Ix,b),y=S,()=>{f.removeEventListener(Ix,b),y=null}},createHref(S){return c(f,S)},createURL:z,encodeLocation(S){let k=z(S);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:j,replace:A,go(S){return g.go(S)}};return N}function Zp(l,c=!1){let u="http://localhost";typeof window<"u"&&(u=window.location.origin!=="null"?window.location.origin:window.location.href),$e(u,"No window.location.(origin|href) available to create URL");let o=typeof l=="string"?l:Tl(l);return o=o.replace(/ $/,"%20"),!c&&o.startsWith("//")&&(o=u+o),new URL(o,u)}function wh(l,c,u="/"){return Jp(l,c,u,!1)}function Jp(l,c,u,o){let f=typeof c=="string"?ws(c):c,x=ka(f.pathname||"/",u);if(x==null)return null;let g=Sh(l);Fp(g);let v=null;for(let y=0;v==null&&y<g.length;++y){let h=cy(x);v=ly(g[y],h,o)}return v}function Sh(l,c=[],u=[],o="",f=!1){let x=(g,v,y=f,h)=>{let w={relativePath:h===void 0?g.path||"":h,caseSensitive:g.caseSensitive===!0,childrenIndex:v,route:g};if(w.relativePath.startsWith("/")){if(!w.relativePath.startsWith(o)&&y)return;$e(w.relativePath.startsWith(o),`Absolute route path "${w.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),w.relativePath=w.relativePath.slice(o.length)}let b=sa([o,w.relativePath]),j=u.concat(w);g.children&&g.children.length>0&&($e(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),Sh(g.children,c,j,b,y)),!(g.path==null&&!g.index)&&c.push({path:b,score:ny(b,g.index),routesMeta:j})};return l.forEach((g,v)=>{var y;if(g.path===""||!((y=g.path)!=null&&y.includes("?")))x(g,v);else for(let h of zh(g.path))x(g,v,!0,h)}),c}function zh(l){let c=l.split("/");if(c.length===0)return[];let[u,...o]=c,f=u.endsWith("?"),x=u.replace(/\?$/,"");if(o.length===0)return f?[x,""]:[x];let g=zh(o.join("/")),v=[];return v.push(...g.map(y=>y===""?x:[x,y].join("/"))),f&&v.push(...g),v.map(y=>l.startsWith("/")&&y===""?"/":y)}function Fp(l){l.sort((c,u)=>c.score!==u.score?u.score-c.score:sy(c.routesMeta.map(o=>o.childrenIndex),u.routesMeta.map(o=>o.childrenIndex)))}var Wp=/^:[\w-]+$/,Ip=3,Pp=2,ey=1,ty=10,ay=-2,th=l=>l==="*";function ny(l,c){let u=l.split("/"),o=u.length;return u.some(th)&&(o+=ay),c&&(o+=Pp),u.filter(f=>!th(f)).reduce((f,x)=>f+(Wp.test(x)?Ip:x===""?ey:ty),o)}function sy(l,c){return l.length===c.length&&l.slice(0,-1).every((o,f)=>o===c[f])?l[l.length-1]-c[c.length-1]:0}function ly(l,c,u=!1){let{routesMeta:o}=l,f={},x="/",g=[];for(let v=0;v<o.length;++v){let y=o[v],h=v===o.length-1,w=x==="/"?c:c.slice(x.length)||"/",b=bc({path:y.relativePath,caseSensitive:y.caseSensitive,end:h},w),j=y.route;if(!b&&h&&u&&!o[o.length-1].route.index&&(b=bc({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},w)),!b)return null;Object.assign(f,b.params),g.push({params:f,pathname:sa([x,b.pathname]),pathnameBase:dy(sa([x,b.pathnameBase])),route:j}),b.pathnameBase!=="/"&&(x=sa([x,b.pathnameBase]))}return g}function bc(l,c){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[u,o]=iy(l.path,l.caseSensitive,l.end),f=c.match(u);if(!f)return null;let x=f[0],g=x.replace(/(.)\/+$/,"$1"),v=f.slice(1);return{params:o.reduce((h,{paramName:w,isOptional:b},j)=>{if(w==="*"){let z=v[j]||"";g=x.slice(0,x.length-z.length).replace(/(.)\/+$/,"$1")}const A=v[j];return b&&!A?h[w]=void 0:h[w]=(A||"").replace(/%2F/g,"/"),h},{}),pathname:x,pathnameBase:g,pattern:l}}function iy(l,c=!1,u=!0){Ft(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let o=[],f="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,v,y,h,w)=>{if(o.push({paramName:v,isOptional:y!=null}),y){let b=w.charAt(h+g.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(o.push({paramName:"*"}),f+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?f+="\\/*$":l!==""&&l!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,c?void 0:"i"),o]}function cy(l){try{return l.split("/").map(c=>decodeURIComponent(c).replace(/\//g,"%2F")).join("/")}catch(c){return Ft(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${c}).`),l}}function ka(l,c){if(c==="/")return l;if(!l.toLowerCase().startsWith(c.toLowerCase()))return null;let u=c.endsWith("/")?c.length-1:c.length,o=l.charAt(u);return o&&o!=="/"?null:l.slice(u)||"/"}var ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function oy(l,c="/"){let{pathname:u,search:o="",hash:f=""}=typeof l=="string"?ws(l):l,x;return u?(u=u.replace(/\/\/+/g,"/"),u.startsWith("/")?x=ah(u.substring(1),"/"):x=ah(u,c)):x=c,{pathname:x,search:my(o),hash:fy(f)}}function ah(l,c){let u=c.replace(/\/+$/,"").split("/");return l.split("/").forEach(f=>{f===".."?u.length>1&&u.pop():f!=="."&&u.push(f)}),u.length>1?u.join("/"):"/"}function ru(l,c,u,o){return`Cannot include a '${l}' character in a manually specified \`to.${c}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${u}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function uy(l){return l.filter((c,u)=>u===0||c.route.path&&c.route.path.length>0)}function ku(l){let c=uy(l);return c.map((u,o)=>o===c.length-1?u.pathname:u.pathnameBase)}function zc(l,c,u,o=!1){let f;typeof l=="string"?f=ws(l):(f={...l},$e(!f.pathname||!f.pathname.includes("?"),ru("?","pathname","search",f)),$e(!f.pathname||!f.pathname.includes("#"),ru("#","pathname","hash",f)),$e(!f.search||!f.search.includes("#"),ru("#","search","hash",f)));let x=l===""||f.pathname==="",g=x?"/":f.pathname,v;if(g==null)v=u;else{let b=c.length-1;if(!o&&g.startsWith("..")){let j=g.split("/");for(;j[0]==="..";)j.shift(),b-=1;f.pathname=j.join("/")}v=b>=0?c[b]:"/"}let y=oy(f,v),h=g&&g!=="/"&&g.endsWith("/"),w=(x||g===".")&&u.endsWith("/");return!y.pathname.endsWith("/")&&(h||w)&&(y.pathname+="/"),y}var sa=l=>l.join("/").replace(/\/\/+/g,"/"),dy=l=>l.replace(/\/+$/,"").replace(/^\/*/,"/"),my=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,fy=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,xy=class{constructor(l,c,u,o=!1){this.status=l,this.statusText=c||"",this.internal=o,u instanceof Error?(this.data=u.toString(),this.error=u):this.data=u}};function hy(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function gy(l){return l.map(c=>c.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var kh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ch(l,c){let u=l;if(typeof u!="string"||!ry.test(u))return{absoluteURL:void 0,isExternal:!1,to:u};let o=u,f=!1;if(kh)try{let x=new URL(window.location.href),g=u.startsWith("//")?new URL(x.protocol+u):new URL(u),v=ka(g.pathname,c);g.origin===x.origin&&v!=null?u=v+g.search+g.hash:f=!0}catch{Ft(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:f,to:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ah=["POST","PUT","PATCH","DELETE"];new Set(Ah);var py=["GET",...Ah];new Set(py);var Ss=d.createContext(null);Ss.displayName="DataRouter";var kc=d.createContext(null);kc.displayName="DataRouterState";var yy=d.createContext(!1),Eh=d.createContext({isTransitioning:!1});Eh.displayName="ViewTransition";var by=d.createContext(new Map);by.displayName="Fetchers";var vy=d.createContext(null);vy.displayName="Await";var Lt=d.createContext(null);Lt.displayName="Navigation";var Ol=d.createContext(null);Ol.displayName="Location";var Qt=d.createContext({outlet:null,matches:[],isDataRoute:!1});Qt.displayName="Route";var Cu=d.createContext(null);Cu.displayName="RouteError";var Th="REACT_ROUTER_ERROR",jy="REDIRECT",Ny="ROUTE_ERROR_RESPONSE";function wy(l){if(l.startsWith(`${Th}:${jy}:{`))try{let c=JSON.parse(l.slice(28));if(typeof c=="object"&&c&&typeof c.status=="number"&&typeof c.statusText=="string"&&typeof c.location=="string"&&typeof c.reloadDocument=="boolean"&&typeof c.replace=="boolean")return c}catch{}}function Sy(l){if(l.startsWith(`${Th}:${Ny}:{`))try{let c=JSON.parse(l.slice(40));if(typeof c=="object"&&c&&typeof c.status=="number"&&typeof c.statusText=="string")return new xy(c.status,c.statusText,c.data)}catch{}}function zy(l,{relative:c}={}){$e(zs(),"useHref() may be used only in the context of a <Router> component.");let{basename:u,navigator:o}=d.useContext(Lt),{hash:f,pathname:x,search:g}=Ll(l,{relative:c}),v=x;return u!=="/"&&(v=x==="/"?u:sa([u,x])),o.createHref({pathname:v,search:g,hash:f})}function zs(){return d.useContext(Ol)!=null}function Ta(){return $e(zs(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(Ol).location}var Rh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Mh(l){d.useContext(Lt).static||d.useLayoutEffect(l)}function ca(){let{isDataRoute:l}=d.useContext(Qt);return l?qy():ky()}function ky(){$e(zs(),"useNavigate() may be used only in the context of a <Router> component.");let l=d.useContext(Ss),{basename:c,navigator:u}=d.useContext(Lt),{matches:o}=d.useContext(Qt),{pathname:f}=Ta(),x=JSON.stringify(ku(o)),g=d.useRef(!1);return Mh(()=>{g.current=!0}),d.useCallback((y,h={})=>{if(Ft(g.current,Rh),!g.current)return;if(typeof y=="number"){u.go(y);return}let w=zc(y,JSON.parse(x),f,h.relative==="path");l==null&&c!=="/"&&(w.pathname=w.pathname==="/"?c:sa([c,w.pathname])),(h.replace?u.replace:u.push)(w,h.state,h)},[c,u,x,f,l])}var Cy=d.createContext(null);function Ay(l){let c=d.useContext(Qt).outlet;return d.useMemo(()=>c&&d.createElement(Cy.Provider,{value:l},c),[c,l])}function ks(){let{matches:l}=d.useContext(Qt),c=l[l.length-1];return c?c.params:{}}function Ll(l,{relative:c}={}){let{matches:u}=d.useContext(Qt),{pathname:o}=Ta(),f=JSON.stringify(ku(u));return d.useMemo(()=>zc(l,JSON.parse(f),o,c==="path"),[l,f,o,c])}function Ey(l,c){return Dh(l,c)}function Dh(l,c,u){var S;$e(zs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=d.useContext(Lt),{matches:f}=d.useContext(Qt),x=f[f.length-1],g=x?x.params:{},v=x?x.pathname:"/",y=x?x.pathnameBase:"/",h=x&&x.route;{let k=h&&h.path||"";Lh(v,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${v}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let w=Ta(),b;if(c){let k=typeof c=="string"?ws(c):c;$e(y==="/"||((S=k.pathname)==null?void 0:S.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=w;let j=b.pathname||"/",A=j;if(y!=="/"){let k=y.replace(/^\//,"").split("/");A="/"+j.replace(/^\//,"").split("/").slice(k.length).join("/")}let z=wh(l,{pathname:A});Ft(h||z!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ft(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 N=Oy(z&&z.map(k=>Object.assign({},k,{params:Object.assign({},g,k.params),pathname:sa([y,o.encodeLocation?o.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?y:sa([y,o.encodeLocation?o.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),f,u);return c&&N?d.createElement(Ol.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},N):N}function Ty(){let l=Hy(),c=hy(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),u=l instanceof Error?l.stack:null,o="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:o},x={padding:"2px 4px",backgroundColor:o},g=null;return console.error("Error handled by React Router default ErrorBoundary:",l),g=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:x},"ErrorBoundary")," or"," ",d.createElement("code",{style:x},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},c),u?d.createElement("pre",{style:f},u):null,g)}var Ry=d.createElement(Ty,null),Oh=class extends d.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,c){return c.location!==l.location||c.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:c.error,location:c.location,revalidation:l.revalidation||c.revalidation}}componentDidCatch(l,c){this.props.onError?this.props.onError(l,c):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const u=Sy(l.digest);u&&(l=u)}let c=l!==void 0?d.createElement(Qt.Provider,{value:this.props.routeContext},d.createElement(Cu.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?d.createElement(My,{error:l},c):c}};Oh.contextType=yy;var ou=new WeakMap;function My({children:l,error:c}){let{basename:u}=d.useContext(Lt);if(typeof c=="object"&&c&&"digest"in c&&typeof c.digest=="string"){let o=wy(c.digest);if(o){let f=ou.get(c);if(f)throw f;let x=Ch(o.location,u);if(kh&&!ou.get(c))if(x.isExternal||o.reloadDocument)window.location.href=x.absoluteURL||x.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:o.replace}));throw ou.set(c,g),g}return d.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x.absoluteURL||x.to}`})}}return l}function Dy({routeContext:l,match:c,children:u}){let o=d.useContext(Ss);return o&&o.static&&o.staticContext&&(c.route.errorElement||c.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=c.route.id),d.createElement(Qt.Provider,{value:l},u)}function Oy(l,c=[],u){let o=u==null?void 0:u.state;if(l==null){if(!o)return null;if(o.errors)l=o.matches;else if(c.length===0&&!o.initialized&&o.matches.length>0)l=o.matches;else return null}let f=l,x=o==null?void 0:o.errors;if(x!=null){let w=f.findIndex(b=>b.route.id&&(x==null?void 0:x[b.route.id])!==void 0);$e(w>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),f=f.slice(0,Math.min(f.length,w+1))}let g=!1,v=-1;if(u&&o){g=o.renderFallback;for(let w=0;w<f.length;w++){let b=f[w];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(v=w),b.route.id){let{loaderData:j,errors:A}=o,z=b.route.loader&&!j.hasOwnProperty(b.route.id)&&(!A||A[b.route.id]===void 0);if(b.route.lazy||z){u.isStatic&&(g=!0),v>=0?f=f.slice(0,v+1):f=[f[0]];break}}}}let y=u==null?void 0:u.onError,h=o&&y?(w,b)=>{var j,A;y(w,{location:o.location,params:((A=(j=o.matches)==null?void 0:j[0])==null?void 0:A.params)??{},unstable_pattern:gy(o.matches),errorInfo:b})}:void 0;return f.reduceRight((w,b,j)=>{let A,z=!1,N=null,S=null;o&&(A=x&&b.route.id?x[b.route.id]:void 0,N=b.route.errorElement||Ry,g&&(v<0&&j===0?(Lh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,S=null):v===j&&(z=!0,S=b.route.hydrateFallbackElement||null)));let k=c.concat(f.slice(0,j+1)),D=()=>{let U;return A?U=N:z?U=S:b.route.Component?U=d.createElement(b.route.Component,null):b.route.element?U=b.route.element:U=w,d.createElement(Dy,{match:b,routeContext:{outlet:w,matches:k,isDataRoute:o!=null},children:U})};return o&&(b.route.ErrorBoundary||b.route.errorElement||j===0)?d.createElement(Oh,{location:o.location,revalidation:o.revalidation,component:N,error:A,children:D(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:h}):D()},null)}function Au(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ly(l){let c=d.useContext(Ss);return $e(c,Au(l)),c}function _y(l){let c=d.useContext(kc);return $e(c,Au(l)),c}function Uy(l){let c=d.useContext(Qt);return $e(c,Au(l)),c}function Eu(l){let c=Uy(l),u=c.matches[c.matches.length-1];return $e(u.route.id,`${l} can only be used on routes that contain a unique "id"`),u.route.id}function By(){return Eu("useRouteId")}function Hy(){var o;let l=d.useContext(Cu),c=_y("useRouteError"),u=Eu("useRouteError");return l!==void 0?l:(o=c.errors)==null?void 0:o[u]}function qy(){let{router:l}=Ly("useNavigate"),c=Eu("useNavigate"),u=d.useRef(!1);return Mh(()=>{u.current=!0}),d.useCallback(async(f,x={})=>{Ft(u.current,Rh),u.current&&(typeof f=="number"?await l.navigate(f):await l.navigate(f,{fromRouteId:c,...x}))},[l,c])}var nh={};function Lh(l,c,u){!c&&!nh[l]&&(nh[l]=!0,Ft(!1,u))}d.memo($y);function $y({routes:l,future:c,state:u,isStatic:o,onError:f}){return Dh(l,void 0,{state:u,isStatic:o,onError:f})}function Gy({to:l,replace:c,state:u,relative:o}){$e(zs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:f}=d.useContext(Lt);Ft(!f,"<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:x}=d.useContext(Qt),{pathname:g}=Ta(),v=ca(),y=zc(l,ku(x),g,o==="path"),h=JSON.stringify(y);return d.useEffect(()=>{v(JSON.parse(h),{replace:c,state:u,relative:o})},[v,h,o,c,u]),null}function Vy(l){return Ay(l.context)}function _e(l){$e(!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 Yy({basename:l="/",children:c=null,location:u,navigationType:o="POP",navigator:f,static:x=!1,unstable_useTransitions:g}){$e(!zs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let v=l.replace(/^\/*/,"/"),y=d.useMemo(()=>({basename:v,navigator:f,static:x,unstable_useTransitions:g,future:{}}),[v,f,x,g]);typeof u=="string"&&(u=ws(u));let{pathname:h="/",search:w="",hash:b="",state:j=null,key:A="default",unstable_mask:z}=u,N=d.useMemo(()=>{let S=ka(h,v);return S==null?null:{location:{pathname:S,search:w,hash:b,state:j,key:A,unstable_mask:z},navigationType:o}},[v,h,w,b,j,A,o,z]);return Ft(N!=null,`<Router basename="${v}"> is not able to match the URL "${h}${w}${b}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:d.createElement(Lt.Provider,{value:y},d.createElement(Ol.Provider,{children:c,value:N}))}function _h({children:l,location:c}){return Ey(pu(l),c)}function pu(l,c=[]){let u=[];return d.Children.forEach(l,(o,f)=>{if(!d.isValidElement(o))return;let x=[...c,f];if(o.type===d.Fragment){u.push.apply(u,pu(o.props.children,x));return}$e(o.type===_e,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$e(!o.props.index||!o.props.children,"An index route cannot have child routes.");let g={id:o.props.id||x.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(g.children=pu(o.props.children,x)),u.push(g)}),u}var gc="get",pc="application/x-www-form-urlencoded";function Cc(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function Xy(l){return Cc(l)&&l.tagName.toLowerCase()==="button"}function Qy(l){return Cc(l)&&l.tagName.toLowerCase()==="form"}function Ky(l){return Cc(l)&&l.tagName.toLowerCase()==="input"}function Zy(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function Jy(l,c){return l.button===0&&(!c||c==="_self")&&!Zy(l)}var cc=null;function Fy(){if(cc===null)try{new FormData(document.createElement("form"),0),cc=!1}catch{cc=!0}return cc}var Wy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function uu(l){return l!=null&&!Wy.has(l)?(Ft(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pc}"`),null):l}function Iy(l,c){let u,o,f,x,g;if(Qy(l)){let v=l.getAttribute("action");o=v?ka(v,c):null,u=l.getAttribute("method")||gc,f=uu(l.getAttribute("enctype"))||pc,x=new FormData(l)}else if(Xy(l)||Ky(l)&&(l.type==="submit"||l.type==="image")){let v=l.form;if(v==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=l.getAttribute("formaction")||v.getAttribute("action");if(o=y?ka(y,c):null,u=l.getAttribute("formmethod")||v.getAttribute("method")||gc,f=uu(l.getAttribute("formenctype"))||uu(v.getAttribute("enctype"))||pc,x=new FormData(v,l),!Fy()){let{name:h,type:w,value:b}=l;if(w==="image"){let j=h?`${h}.`:"";x.append(`${j}x`,"0"),x.append(`${j}y`,"0")}else h&&x.append(h,b)}}else{if(Cc(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');u=gc,o=null,f=pc,g=l}return x&&f==="text/plain"&&(g=x,x=void 0),{action:o,method:u.toLowerCase(),encType:f,formData:x,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Tu(l,c){if(l===!1||l===null||typeof l>"u")throw new Error(c)}function Py(l,c,u,o){let f=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return u?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${o}`:f.pathname=`${f.pathname}.${o}`:f.pathname==="/"?f.pathname=`_root.${o}`:c&&ka(f.pathname,c)==="/"?f.pathname=`${c.replace(/\/$/,"")}/_root.${o}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${o}`,f}async function eb(l,c){if(l.id in c)return c[l.id];try{let u=await import(l.module);return c[l.id]=u,u}catch(u){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(u),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tb(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function ab(l,c,u){let o=await Promise.all(l.map(async f=>{let x=c.routes[f.route.id];if(x){let g=await eb(x,u);return g.links?g.links():[]}return[]}));return ib(o.flat(1).filter(tb).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function sh(l,c,u,o,f,x){let g=(y,h)=>u[h]?y.route.id!==u[h].route.id:!0,v=(y,h)=>{var w;return u[h].pathname!==y.pathname||((w=u[h].route.path)==null?void 0:w.endsWith("*"))&&u[h].params["*"]!==y.params["*"]};return x==="assets"?c.filter((y,h)=>g(y,h)||v(y,h)):x==="data"?c.filter((y,h)=>{var b;let w=o.routes[y.route.id];if(!w||!w.hasLoader)return!1;if(g(y,h)||v(y,h))return!0;if(y.route.shouldRevalidate){let j=y.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((b=u[0])==null?void 0:b.params)||{},nextUrl:new URL(l,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function nb(l,c,{includeHydrateFallback:u}={}){return sb(l.map(o=>{let f=c.routes[o.route.id];if(!f)return[];let x=[f.module];return f.clientActionModule&&(x=x.concat(f.clientActionModule)),f.clientLoaderModule&&(x=x.concat(f.clientLoaderModule)),u&&f.hydrateFallbackModule&&(x=x.concat(f.hydrateFallbackModule)),f.imports&&(x=x.concat(f.imports)),x}).flat(1))}function sb(l){return[...new Set(l)]}function lb(l){let c={},u=Object.keys(l).sort();for(let o of u)c[o]=l[o];return c}function ib(l,c){let u=new Set;return new Set(c),l.reduce((o,f)=>{let x=JSON.stringify(lb(f));return u.has(x)||(u.add(x),o.push({key:x,link:f})),o},[])}function Uh(){let l=d.useContext(Ss);return Tu(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function cb(){let l=d.useContext(kc);return Tu(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var Ru=d.createContext(void 0);Ru.displayName="FrameworkContext";function Bh(){let l=d.useContext(Ru);return Tu(l,"You must render this element inside a <HydratedRouter> element"),l}function rb(l,c){let u=d.useContext(Ru),[o,f]=d.useState(!1),[x,g]=d.useState(!1),{onFocus:v,onBlur:y,onMouseEnter:h,onMouseLeave:w,onTouchStart:b}=c,j=d.useRef(null);d.useEffect(()=>{if(l==="render"&&g(!0),l==="viewport"){let N=k=>{k.forEach(D=>{g(D.isIntersecting)})},S=new IntersectionObserver(N,{threshold:.5});return j.current&&S.observe(j.current),()=>{S.disconnect()}}},[l]),d.useEffect(()=>{if(o){let N=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(N)}}},[o]);let A=()=>{f(!0)},z=()=>{f(!1),g(!1)};return u?l!=="intent"?[x,j,{}]:[x,j,{onFocus:kl(v,A),onBlur:kl(y,z),onMouseEnter:kl(h,A),onMouseLeave:kl(w,z),onTouchStart:kl(b,A)}]:[!1,j,{}]}function kl(l,c){return u=>{l&&l(u),u.defaultPrevented||c(u)}}function ob({page:l,...c}){let{router:u}=Uh(),o=d.useMemo(()=>wh(u.routes,l,u.basename),[u.routes,l,u.basename]);return o?d.createElement(db,{page:l,matches:o,...c}):null}function ub(l){let{manifest:c,routeModules:u}=Bh(),[o,f]=d.useState([]);return d.useEffect(()=>{let x=!1;return ab(l,c,u).then(g=>{x||f(g)}),()=>{x=!0}},[l,c,u]),o}function db({page:l,matches:c,...u}){let o=Ta(),{future:f,manifest:x,routeModules:g}=Bh(),{basename:v}=Uh(),{loaderData:y,matches:h}=cb(),w=d.useMemo(()=>sh(l,c,h,x,o,"data"),[l,c,h,x,o]),b=d.useMemo(()=>sh(l,c,h,x,o,"assets"),[l,c,h,x,o]),j=d.useMemo(()=>{if(l===o.pathname+o.search+o.hash)return[];let N=new Set,S=!1;if(c.forEach(D=>{var E;let U=x.routes[D.route.id];!U||!U.hasLoader||(!w.some(F=>F.route.id===D.route.id)&&D.route.id in y&&((E=g[D.route.id])!=null&&E.shouldRevalidate)||U.hasClientLoader?S=!0:N.add(D.route.id))}),N.size===0)return[];let k=Py(l,v,f.unstable_trailingSlashAwareDataRequests,"data");return S&&N.size>0&&k.searchParams.set("_routes",c.filter(D=>N.has(D.route.id)).map(D=>D.route.id).join(",")),[k.pathname+k.search]},[v,f.unstable_trailingSlashAwareDataRequests,y,o,x,w,c,l,g]),A=d.useMemo(()=>nb(b,x),[b,x]),z=ub(b);return d.createElement(d.Fragment,null,j.map(N=>d.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...u})),A.map(N=>d.createElement("link",{key:N,rel:"modulepreload",href:N,...u})),z.map(({key:N,link:S})=>d.createElement("link",{key:N,nonce:u.nonce,...S,crossOrigin:S.crossOrigin??u.crossOrigin})))}function mb(...l){return c=>{l.forEach(u=>{typeof u=="function"?u(c):u!=null&&(u.current=c)})}}var fb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fb&&(window.__reactRouterVersion="7.13.2")}catch{}function xb({basename:l,children:c,unstable_useTransitions:u,window:o}){let f=d.useRef();f.current==null&&(f.current=Xp({window:o,v5Compat:!0}));let x=f.current,[g,v]=d.useState({action:x.action,location:x.location}),y=d.useCallback(h=>{u===!1?v(h):d.startTransition(()=>v(h))},[u]);return d.useLayoutEffect(()=>x.listen(y),[x,y]),d.createElement(Yy,{basename:l,children:c,location:g.location,navigationType:g.action,navigator:x,unstable_useTransitions:u})}var Hh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cn=d.forwardRef(function({onClick:c,discover:u="render",prefetch:o="none",relative:f,reloadDocument:x,replace:g,unstable_mask:v,state:y,target:h,to:w,preventScrollReset:b,viewTransition:j,unstable_defaultShouldRevalidate:A,...z},N){let{basename:S,navigator:k,unstable_useTransitions:D}=d.useContext(Lt),U=typeof w=="string"&&Hh.test(w),E=Ch(w,S);w=E.to;let F=zy(w,{relative:f}),se=Ta(),B=null;if(v){let ye=zc(v,[],se.unstable_mask?se.unstable_mask.pathname:"/",!0);S!=="/"&&(ye.pathname=ye.pathname==="/"?S:sa([S,ye.pathname])),B=k.createHref(ye)}let[Z,ee,W]=rb(o,z),Q=pb(w,{replace:g,unstable_mask:v,state:y,target:h,preventScrollReset:b,relative:f,viewTransition:j,unstable_defaultShouldRevalidate:A,unstable_useTransitions:D});function ae(ye){c&&c(ye),ye.defaultPrevented||Q(ye)}let K=!(E.isExternal||x),de=d.createElement("a",{...z,...W,href:(K?B:void 0)||E.absoluteURL||F,onClick:K?ae:c,ref:mb(N,ee),target:h,"data-discover":!U&&u==="render"?"true":void 0});return Z&&!U?d.createElement(d.Fragment,null,de,d.createElement(ob,{page:F})):de});cn.displayName="Link";var vc=d.forwardRef(function({"aria-current":c="page",caseSensitive:u=!1,className:o="",end:f=!1,style:x,to:g,viewTransition:v,children:y,...h},w){let b=Ll(g,{relative:h.relative}),j=Ta(),A=d.useContext(kc),{navigator:z,basename:N}=d.useContext(Lt),S=A!=null&&Nb(b)&&v===!0,k=z.encodeLocation?z.encodeLocation(b).pathname:b.pathname,D=j.pathname,U=A&&A.navigation&&A.navigation.location?A.navigation.location.pathname:null;u||(D=D.toLowerCase(),U=U?U.toLowerCase():null,k=k.toLowerCase()),U&&N&&(U=ka(U,N)||U);const E=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let F=D===k||!f&&D.startsWith(k)&&D.charAt(E)==="/",se=U!=null&&(U===k||!f&&U.startsWith(k)&&U.charAt(k.length)==="/"),B={isActive:F,isPending:se,isTransitioning:S},Z=F?c:void 0,ee;typeof o=="function"?ee=o(B):ee=[o,F?"active":null,se?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let W=typeof x=="function"?x(B):x;return d.createElement(cn,{...h,"aria-current":Z,className:ee,ref:w,style:W,to:g,viewTransition:v},typeof y=="function"?y(B):y)});vc.displayName="NavLink";var hb=d.forwardRef(({discover:l="render",fetcherKey:c,navigate:u,reloadDocument:o,replace:f,state:x,method:g=gc,action:v,onSubmit:y,relative:h,preventScrollReset:w,viewTransition:b,unstable_defaultShouldRevalidate:j,...A},z)=>{let{unstable_useTransitions:N}=d.useContext(Lt),S=vb(),k=jb(v,{relative:h}),D=g.toLowerCase()==="get"?"get":"post",U=typeof v=="string"&&Hh.test(v),E=F=>{if(y&&y(F),F.defaultPrevented)return;F.preventDefault();let se=F.nativeEvent.submitter,B=(se==null?void 0:se.getAttribute("formmethod"))||g,Z=()=>S(se||F.currentTarget,{fetcherKey:c,method:B,navigate:u,replace:f,state:x,relative:h,preventScrollReset:w,viewTransition:b,unstable_defaultShouldRevalidate:j});N&&u!==!1?d.startTransition(()=>Z()):Z()};return d.createElement("form",{ref:z,method:D,action:k,onSubmit:o?y:E,...A,"data-discover":!U&&l==="render"?"true":void 0})});hb.displayName="Form";function gb(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qh(l){let c=d.useContext(Ss);return $e(c,gb(l)),c}function pb(l,{target:c,replace:u,unstable_mask:o,state:f,preventScrollReset:x,relative:g,viewTransition:v,unstable_defaultShouldRevalidate:y,unstable_useTransitions:h}={}){let w=ca(),b=Ta(),j=Ll(l,{relative:g});return d.useCallback(A=>{if(Jy(A,c)){A.preventDefault();let z=u!==void 0?u:Tl(b)===Tl(j),N=()=>w(l,{replace:z,unstable_mask:o,state:f,preventScrollReset:x,relative:g,viewTransition:v,unstable_defaultShouldRevalidate:y});h?d.startTransition(()=>N()):N()}},[b,w,j,u,o,f,c,l,x,g,v,y,h])}var yb=0,bb=()=>`__${String(++yb)}__`;function vb(){let{router:l}=qh("useSubmit"),{basename:c}=d.useContext(Lt),u=By(),o=l.fetch,f=l.navigate;return d.useCallback(async(x,g={})=>{let{action:v,method:y,encType:h,formData:w,body:b}=Iy(x,c);if(g.navigate===!1){let j=g.fetcherKey||bb();await o(j,u,g.action||v,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:w,body:b,formMethod:g.method||y,formEncType:g.encType||h,flushSync:g.flushSync})}else await f(g.action||v,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:w,body:b,formMethod:g.method||y,formEncType:g.encType||h,replace:g.replace,state:g.state,fromRouteId:u,flushSync:g.flushSync,viewTransition:g.viewTransition})},[o,f,c,u])}function jb(l,{relative:c}={}){let{basename:u}=d.useContext(Lt),o=d.useContext(Qt);$e(o,"useFormAction must be used inside a RouteContext");let[f]=o.matches.slice(-1),x={...Ll(l||".",{relative:c})},g=Ta();if(l==null){x.search=g.search;let v=new URLSearchParams(x.search),y=v.getAll("index");if(y.some(w=>w==="")){v.delete("index"),y.filter(b=>b).forEach(b=>v.append("index",b));let w=v.toString();x.search=w?`?${w}`:""}}return(!l||l===".")&&f.route.index&&(x.search=x.search?x.search.replace(/^\?/,"?index&"):"?index"),u!=="/"&&(x.pathname=x.pathname==="/"?u:sa([u,x.pathname])),Tl(x)}function Nb(l,{relative:c}={}){let u=d.useContext(Eh);$e(u!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=qh("useViewTransitionState"),f=Ll(l,{relative:c});if(!u.isTransitioning)return!1;let x=ka(u.currentLocation.pathname,o)||u.currentLocation.pathname,g=ka(u.nextLocation.pathname,o)||u.nextLocation.pathname;return bc(f.pathname,g)!=null||bc(f.pathname,x)!=null}/**
|
|
61
|
+
* @license lucide-react v0.468.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const wb=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$h=(...l)=>l.filter((c,u,o)=>!!c&&c.trim()!==""&&o.indexOf(c)===u).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.468.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var Sb={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"};/**
|
|
71
|
+
* @license lucide-react v0.468.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const zb=d.forwardRef(({color:l="currentColor",size:c=24,strokeWidth:u=2,absoluteStrokeWidth:o,className:f="",children:x,iconNode:g,...v},y)=>d.createElement("svg",{ref:y,...Sb,width:c,height:c,stroke:l,strokeWidth:o?Number(u)*24/Number(c):u,className:$h("lucide",f),...v},[...g.map(([h,w])=>d.createElement(h,w)),...Array.isArray(x)?x:[x]]));/**
|
|
76
|
+
* @license lucide-react v0.468.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const J=(l,c)=>{const u=d.forwardRef(({className:o,...f},x)=>d.createElement(zb,{ref:x,iconNode:c,className:$h(`lucide-${wb(l)}`,o),...f}));return u.displayName=`${l}`,u};/**
|
|
81
|
+
* @license lucide-react v0.468.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const Dt=J("Activity",[["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"}]]);/**
|
|
86
|
+
* @license lucide-react v0.468.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const bs=J("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
91
|
+
* @license lucide-react v0.468.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const kb=J("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
96
|
+
* @license lucide-react v0.468.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const Cb=J("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
101
|
+
* @license lucide-react v0.468.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const Ca=J("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
106
|
+
* @license lucide-react v0.468.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const ys=J("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
111
|
+
* @license lucide-react v0.468.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const Ab=J("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
|
|
116
|
+
* @license lucide-react v0.468.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const Gh=J("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
121
|
+
* @license lucide-react v0.468.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const Mu=J("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
126
|
+
* @license lucide-react v0.468.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const Eb=J("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
|
|
131
|
+
* @license lucide-react v0.468.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const Tb=J("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
136
|
+
* @license lucide-react v0.468.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const Aa=J("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
141
|
+
* @license lucide-react v0.468.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const vs=J("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
146
|
+
* @license lucide-react v0.468.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const Rl=J("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
151
|
+
* @license lucide-react v0.468.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const _l=J("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
156
|
+
* @license lucide-react v0.468.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const Vh=J("CircleAlert",[["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"}]]);/**
|
|
161
|
+
* @license lucide-react v0.468.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const jc=J("CircleArrowRight",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"m12 16 4-4-4-4",key:"1i9zcv"}]]);/**
|
|
166
|
+
* @license lucide-react v0.468.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const tt=J("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
171
|
+
* @license lucide-react v0.468.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const Yh=J("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
176
|
+
* @license lucide-react v0.468.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const Rb=J("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
|
181
|
+
* @license lucide-react v0.468.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const Xh=J("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
186
|
+
* @license lucide-react v0.468.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const Ot=J("CircleX",[["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"}]]);/**
|
|
191
|
+
* @license lucide-react v0.468.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const Mb=J("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
196
|
+
* @license lucide-react v0.468.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const js=J("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
201
|
+
* @license lucide-react v0.468.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const Db=J("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
206
|
+
* @license lucide-react v0.468.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const Qh=J("Database",[["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"}]]);/**
|
|
211
|
+
* @license lucide-react v0.468.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const Ra=J("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
216
|
+
* @license lucide-react v0.468.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const yu=J("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
221
|
+
* @license lucide-react v0.468.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const Ac=J("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
226
|
+
* @license lucide-react v0.468.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const Kh=J("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
231
|
+
* @license lucide-react v0.468.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const lh=J("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
|
|
236
|
+
* @license lucide-react v0.468.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const du=J("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
241
|
+
* @license lucide-react v0.468.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const Ob=J("FolderSearch",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);/**
|
|
246
|
+
* @license lucide-react v0.468.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const Nc=J("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
251
|
+
* @license lucide-react v0.468.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const Zh=J("Globe",[["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"}]]);/**
|
|
256
|
+
* @license lucide-react v0.468.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const ih=J("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
261
|
+
* @license lucide-react v0.468.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const Lb=J("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["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"}]]);/**
|
|
266
|
+
* @license lucide-react v0.468.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const _b=J("Key",[["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"}]]);/**
|
|
271
|
+
* @license lucide-react v0.468.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const Ec=J("LayoutDashboard",[["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"}]]);/**
|
|
276
|
+
* @license lucide-react v0.468.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const bu=J("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
281
|
+
* @license lucide-react v0.468.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const Ub=J("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
286
|
+
* @license lucide-react v0.468.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const Bb=J("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
|
|
291
|
+
* @license lucide-react v0.468.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const vu=J("Lock",[["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"}]]);/**
|
|
296
|
+
* @license lucide-react v0.468.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const Hb=J("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
|
|
301
|
+
* @license lucide-react v0.468.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const qb=J("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
306
|
+
* @license lucide-react v0.468.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const $b=J("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
311
|
+
* @license lucide-react v0.468.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const wc=J("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
316
|
+
* @license lucide-react v0.468.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const Gb=J("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
321
|
+
* @license lucide-react v0.468.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const Vb=J("Monitor",[["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"}]]);/**
|
|
326
|
+
* @license lucide-react v0.468.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const Tc=J("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
331
|
+
* @license lucide-react v0.468.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const Yb=J("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
336
|
+
* @license lucide-react v0.468.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const Du=J("Pencil",[["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"}]]);/**
|
|
341
|
+
* @license lucide-react v0.468.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const dt=J("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
346
|
+
* @license lucide-react v0.468.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const Nt=J("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
351
|
+
* @license lucide-react v0.468.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const Rc=J("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
|
|
356
|
+
* @license lucide-react v0.468.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const Jh=J("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
361
|
+
* @license lucide-react v0.468.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const Wt=J("RefreshCw",[["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"}]]);/**
|
|
366
|
+
* @license lucide-react v0.468.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const Fh=J("RotateCcw",[["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"}]]);/**
|
|
371
|
+
* @license lucide-react v0.468.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const Ou=J("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
376
|
+
* @license lucide-react v0.468.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const Ul=J("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
381
|
+
* @license lucide-react v0.468.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const Xb=J("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
386
|
+
* @license lucide-react v0.468.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const Lu=J("Server",[["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"}]]);/**
|
|
391
|
+
* @license lucide-react v0.468.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const Bl=J("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
396
|
+
* @license lucide-react v0.468.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const ia=J("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
401
|
+
* @license lucide-react v0.468.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const Mc=J("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
406
|
+
* @license lucide-react v0.468.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const Dc=J("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
411
|
+
* @license lucide-react v0.468.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const Qb=J("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
|
|
416
|
+
* @license lucide-react v0.468.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const Kb=J("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
421
|
+
* @license lucide-react v0.468.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const Zb=J("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
426
|
+
* @license lucide-react v0.468.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const Jb=J("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
431
|
+
* @license lucide-react v0.468.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const Ml=J("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
436
|
+
* @license lucide-react v0.468.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/const Fb=J("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
441
|
+
* @license lucide-react v0.468.0 - ISC
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the ISC license.
|
|
444
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
+
*/const ju=J("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
|
|
446
|
+
* @license lucide-react v0.468.0 - ISC
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the ISC license.
|
|
449
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
+
*/const Dl=J("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
|
|
451
|
+
* @license lucide-react v0.468.0 - ISC
|
|
452
|
+
*
|
|
453
|
+
* This source code is licensed under the ISC license.
|
|
454
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
+
*/const Wb=J("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
456
|
+
* @license lucide-react v0.468.0 - ISC
|
|
457
|
+
*
|
|
458
|
+
* This source code is licensed under the ISC license.
|
|
459
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
+
*/const Ib=J("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
|
|
461
|
+
* @license lucide-react v0.468.0 - ISC
|
|
462
|
+
*
|
|
463
|
+
* This source code is licensed under the ISC license.
|
|
464
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
+
*/const Pb=J("ToggleRight",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]);/**
|
|
466
|
+
* @license lucide-react v0.468.0 - ISC
|
|
467
|
+
*
|
|
468
|
+
* This source code is licensed under the ISC license.
|
|
469
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
+
*/const It=J("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
471
|
+
* @license lucide-react v0.468.0 - ISC
|
|
472
|
+
*
|
|
473
|
+
* This source code is licensed under the ISC license.
|
|
474
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
+
*/const ev=J("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
|
|
476
|
+
* @license lucide-react v0.468.0 - ISC
|
|
477
|
+
*
|
|
478
|
+
* This source code is licensed under the ISC license.
|
|
479
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
+
*/const _u=J("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
481
|
+
* @license lucide-react v0.468.0 - ISC
|
|
482
|
+
*
|
|
483
|
+
* This source code is licensed under the ISC license.
|
|
484
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
+
*/const ft=J("TriangleAlert",[["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"}]]);/**
|
|
486
|
+
* @license lucide-react v0.468.0 - ISC
|
|
487
|
+
*
|
|
488
|
+
* This source code is licensed under the ISC license.
|
|
489
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
+
*/const ps=J("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
|
|
491
|
+
* @license lucide-react v0.468.0 - ISC
|
|
492
|
+
*
|
|
493
|
+
* This source code is licensed under the ISC license.
|
|
494
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
+
*/const tv=J("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
496
|
+
* @license lucide-react v0.468.0 - ISC
|
|
497
|
+
*
|
|
498
|
+
* This source code is licensed under the ISC license.
|
|
499
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
500
|
+
*/const Cs=J("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
501
|
+
* @license lucide-react v0.468.0 - ISC
|
|
502
|
+
*
|
|
503
|
+
* This source code is licensed under the ISC license.
|
|
504
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
505
|
+
*/const av=J("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
506
|
+
* @license lucide-react v0.468.0 - ISC
|
|
507
|
+
*
|
|
508
|
+
* This source code is licensed under the ISC license.
|
|
509
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
510
|
+
*/const nv=J("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
|
|
511
|
+
* @license lucide-react v0.468.0 - ISC
|
|
512
|
+
*
|
|
513
|
+
* This source code is licensed under the ISC license.
|
|
514
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
515
|
+
*/const Oc=J("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
516
|
+
* @license lucide-react v0.468.0 - ISC
|
|
517
|
+
*
|
|
518
|
+
* This source code is licensed under the ISC license.
|
|
519
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
520
|
+
*/const jt=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
521
|
+
* @license lucide-react v0.468.0 - ISC
|
|
522
|
+
*
|
|
523
|
+
* This source code is licensed under the ISC license.
|
|
524
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
525
|
+
*/const Lc=J("Zap",[["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"}]]),Nu={en:"English",fr:"Français",es:"Español",de:"Deutsch",pt:"Português",ja:"日本語",zh:"中文",ko:"한국어",ar:"العربية",ru:"Русский",it:"Italiano",nl:"Nederlands"},sv=["ar"],lv=Object.keys(Nu);function wu(l){return lv.includes(l)}function iv(l){if(!l)return"en";const c=l.toLowerCase();if(wu(c))return c;const u=c.split("-")[0];return wu(u)?u:"en"}const ch={en:{"nav.dashboard":"Dashboard","nav.agents":"Agents","nav.workflows":"Workflows","nav.skills":"Skills","nav.runs":"Runs","nav.approvals":"Approvals","nav.handoffs":"Handoffs","nav.settings":"Settings","nav.users":"Users","nav.prompts":"Prompts","dashboard.title":"Dashboard","dashboard.activeAgents":"Active Agents","dashboard.runningTasks":"Running Tasks","dashboard.costToday":"Cost Today","dashboard.skillsInstalled":"Skills Installed","dashboard.recentActivity":"Recent Activity","dashboard.quickActions":"Quick Actions","dashboard.systemHealth":"System Health","dashboard.createAgent":"Create Agent","dashboard.runWorkflow":"Run Workflow","dashboard.installSkill":"Install Skill","agents.title":"Agents","agents.create":"Create Agent","agents.empty":"No agents configured yet.","agents.emptyDesc":"Create your first AI agent to get started with automated tasks.","agent.overview":"Overview","agent.runs":"Runs","agent.events":"Events","agent.configuration":"Configuration","agent.budget":"Budget","agent.recentRuns":"Recent Runs","agent.delete":"Delete Agent","agent.start":"Start","agent.stop":"Stop","agent.run":"Run","workflows.title":"Workflows","workflows.create":"Create Workflow","workflows.empty":"No workflows defined yet.","workflows.emptyDesc":"Design your first workflow to orchestrate multiple agents.","workflows.nodes":"{count} nodes","workflows.edit":"Edit","workflow.editor":"Workflow Editor","workflow.addNode":"Add Node","workflow.save":"Save","workflow.run":"Run Workflow","skills.title":"Skills","skills.install":"Install Skill","skills.empty":"No skills installed yet.","skills.emptyDesc":"Browse and install skills to extend your agents' capabilities.","skills.scan":"Scan Directory","skills.source":"Source URL or path","runs.title":"Runs","runs.empty":"No runs recorded yet.","runs.emptyDesc":"Run an agent or workflow to see execution history.","runs.filter":"Filter","run.events":"Events","run.output":"Output","run.cost":"Cost Breakdown","run.duration":"Duration","approvals.title":"Approval Queue","approvals.empty":"No pending approvals.","approvals.emptyDesc":"All clear. Dangerous actions will appear here for review.","approvals.approve":"Approve","approvals.deny":"Deny","approvals.pending":"Pending","nav.analytics":"Analytics","nav.budget":"Budget","nav.traces":"Traces","nav.memory":"Memory","nav.goals":"Goals","nav.plans":"Plans","nav.guardrails":"Guardrails","analytics.title":"Cost Analytics","analytics.description":"Track spending, token usage, and budget utilization across agents.","analytics.totalSpend":"Total Spend","analytics.totalRuns":"Total Runs","analytics.avgCostPerRun":"Avg Cost/Run","analytics.monthlyEstimate":"Monthly Estimate","analytics.dailyCosts":"Daily Costs (30 days)","analytics.agentBreakdown":"Cost by Agent","analytics.modelBreakdown":"Cost by Model","analytics.budgetUtilization":"Budget Utilization","analytics.runs":"Runs","analytics.totalCost":"Total Cost","analytics.avgCost":"Avg Cost","analytics.model":"Model","analytics.tokens":"Tokens","analytics.cost":"Cost","analytics.noAgentData":"No agent cost data yet.","analytics.noModelData":"No model cost data yet.","settings.title":"Settings","settings.general":"General","settings.security":"Security","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Save Changes","settings.saved":"Settings saved successfully.","settings.language":"Language","common.loading":"Loading...","common.error":"An error occurred.","common.retry":"Retry","common.cancel":"Cancel","common.save":"Save","common.delete":"Delete","common.close":"Close","common.search":"Search...","common.noResults":"No results found.","common.name":"Name","common.description":"Description","common.status":"Status","common.type":"Type","common.actions":"Actions","common.created":"Created","common.updated":"Updated","status.running":"Running","status.completed":"Completed","status.failed":"Failed","status.pending":"Pending","status.paused":"Paused","status.cancelled":"Cancelled","status.idle":"Idle","trust.builtin":"Built-in","trust.official":"Official","trust.trusted":"Trusted","trust.community":"Community","trust.local":"Local"},fr:{"nav.dashboard":"Tableau de bord","nav.agents":"Agents","nav.workflows":"Workflows","nav.skills":"Compétences","nav.runs":"Exécutions","nav.approvals":"Approbations","nav.handoffs":"Transferts","nav.settings":"Paramètres","nav.users":"Utilisateurs","nav.prompts":"Prompts","dashboard.title":"Tableau de bord","dashboard.activeAgents":"Agents actifs","dashboard.runningTasks":"Tâches en cours","dashboard.costToday":"Coût aujourd'hui","dashboard.skillsInstalled":"Compétences installées","dashboard.recentActivity":"Activité récente","dashboard.quickActions":"Actions rapides","dashboard.systemHealth":"Santé système","dashboard.createAgent":"Créer un agent","dashboard.runWorkflow":"Lancer un workflow","dashboard.installSkill":"Installer une compétence","agents.title":"Agents","agents.create":"Créer un agent","agents.empty":"Aucun agent configuré.","agents.emptyDesc":"Créez votre premier agent IA pour automatiser vos tâches.","agent.overview":"Aperçu","agent.runs":"Exécutions","agent.events":"Événements","agent.configuration":"Configuration","agent.budget":"Budget","agent.recentRuns":"Exécutions récentes","agent.delete":"Supprimer l'agent","agent.start":"Démarrer","agent.stop":"Arrêter","agent.run":"Exécuter","workflows.title":"Workflows","workflows.create":"Créer un workflow","workflows.empty":"Aucun workflow défini.","workflows.emptyDesc":"Concevez votre premier workflow pour orchestrer vos agents.","workflows.nodes":"{count} nœuds","workflows.edit":"Modifier","workflow.editor":"Éditeur de workflow","workflow.addNode":"Ajouter un nœud","workflow.save":"Enregistrer","workflow.run":"Lancer le workflow","skills.title":"Compétences","skills.install":"Installer","skills.empty":"Aucune compétence installée.","skills.emptyDesc":"Parcourez et installez des compétences pour étendre les capacités de vos agents.","skills.scan":"Scanner un répertoire","skills.source":"URL ou chemin source","runs.title":"Exécutions","runs.empty":"Aucune exécution enregistrée.","runs.emptyDesc":"Lancez un agent ou un workflow pour voir l'historique.","runs.filter":"Filtrer","run.events":"Événements","run.output":"Sortie","run.cost":"Détail des coûts","run.duration":"Durée","approvals.title":"File d'approbation","approvals.empty":"Aucune approbation en attente.","approvals.emptyDesc":"Tout est clair. Les actions dangereuses apparaîtront ici.","approvals.approve":"Approuver","approvals.deny":"Refuser","approvals.pending":"En attente","nav.analytics":"Analytique","nav.budget":"Budget","nav.traces":"Traces","nav.memory":"Mémoire","nav.goals":"Objectifs","nav.plans":"Plans","nav.guardrails":"Garde-fous","analytics.title":"Analytique des coûts","analytics.description":"Suivez les dépenses, l'utilisation des tokens et le budget par agent.","analytics.totalSpend":"Dépense totale","analytics.totalRuns":"Total exécutions","analytics.avgCostPerRun":"Coût moyen/exéc.","analytics.monthlyEstimate":"Estimation mensuelle","analytics.dailyCosts":"Coûts quotidiens (30 jours)","analytics.agentBreakdown":"Coûts par agent","analytics.modelBreakdown":"Coûts par modèle","analytics.budgetUtilization":"Utilisation du budget","analytics.runs":"Exécutions","analytics.totalCost":"Coût total","analytics.avgCost":"Coût moyen","analytics.model":"Modèle","analytics.tokens":"Tokens","analytics.cost":"Coût","analytics.noAgentData":"Aucune donnée de coût par agent.","analytics.noModelData":"Aucune donnée de coût par modèle.","settings.title":"Paramètres","settings.general":"Général","settings.security":"Sécurité","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Enregistrer","settings.saved":"Paramètres sauvegardés.","settings.language":"Langue","common.loading":"Chargement...","common.error":"Une erreur est survenue.","common.retry":"Réessayer","common.cancel":"Annuler","common.save":"Enregistrer","common.delete":"Supprimer","common.close":"Fermer","common.search":"Rechercher...","common.noResults":"Aucun résultat.","common.name":"Nom","common.description":"Description","common.status":"Statut","common.type":"Type","common.actions":"Actions","common.created":"Créé","common.updated":"Mis à jour","status.running":"En cours","status.completed":"Terminé","status.failed":"Échoué","status.pending":"En attente","status.paused":"En pause","status.cancelled":"Annulé","status.idle":"Inactif","trust.builtin":"Intégré","trust.official":"Officiel","trust.trusted":"Vérifié","trust.community":"Communautaire","trust.local":"Local"},es:{"nav.dashboard":"Panel","nav.agents":"Agentes","nav.workflows":"Flujos de trabajo","nav.skills":"Habilidades","nav.runs":"Ejecuciones","nav.approvals":"Aprobaciones","nav.handoffs":"Transferencias","nav.settings":"Configuración","nav.users":"Usuarios","nav.prompts":"Prompts","dashboard.title":"Panel","dashboard.activeAgents":"Agentes activos","dashboard.runningTasks":"Tareas en ejecución","dashboard.costToday":"Coste hoy","dashboard.skillsInstalled":"Habilidades instaladas","dashboard.recentActivity":"Actividad reciente","dashboard.quickActions":"Acciones rápidas","dashboard.systemHealth":"Estado del sistema","dashboard.createAgent":"Crear agente","dashboard.runWorkflow":"Ejecutar flujo","dashboard.installSkill":"Instalar habilidad","agents.title":"Agentes","agents.create":"Crear agente","agents.empty":"No hay agentes configurados.","agents.emptyDesc":"Crea tu primer agente IA para empezar con tareas automatizadas.","agent.overview":"Resumen","agent.runs":"Ejecuciones","agent.events":"Eventos","agent.configuration":"Configuración","agent.budget":"Presupuesto","agent.recentRuns":"Ejecuciones recientes","agent.delete":"Eliminar agente","agent.start":"Iniciar","agent.stop":"Detener","agent.run":"Ejecutar","workflows.title":"Flujos de trabajo","workflows.create":"Crear flujo","workflows.empty":"No hay flujos definidos.","workflows.emptyDesc":"Diseña tu primer flujo de trabajo para orquestar múltiples agentes.","workflows.nodes":"{count} nodos","workflows.edit":"Editar","workflow.editor":"Editor de flujo","workflow.addNode":"Añadir nodo","workflow.save":"Guardar","workflow.run":"Ejecutar flujo","skills.title":"Habilidades","skills.install":"Instalar","skills.empty":"No hay habilidades instaladas.","skills.emptyDesc":"Explora e instala habilidades para ampliar las capacidades de tus agentes.","skills.scan":"Escanear directorio","skills.source":"URL o ruta de origen","runs.title":"Ejecuciones","runs.empty":"No hay ejecuciones registradas.","runs.emptyDesc":"Ejecuta un agente o flujo para ver el historial.","runs.filter":"Filtrar","run.events":"Eventos","run.output":"Salida","run.cost":"Desglose de costes","run.duration":"Duración","approvals.title":"Cola de aprobación","approvals.empty":"Sin aprobaciones pendientes.","approvals.emptyDesc":"Todo despejado. Las acciones peligrosas aparecerán aquí.","approvals.approve":"Aprobar","approvals.deny":"Denegar","approvals.pending":"Pendiente","nav.analytics":"Analíticas","nav.budget":"Presupuesto","nav.traces":"Trazas","nav.memory":"Memoria","nav.goals":"Objetivos","nav.plans":"Planes","nav.guardrails":"Salvaguardas","analytics.title":"Analíticas de coste","analytics.description":"Seguimiento de gastos, uso de tokens y presupuesto por agente.","analytics.totalSpend":"Gasto total","analytics.totalRuns":"Total ejecuciones","analytics.avgCostPerRun":"Coste medio/ejec.","analytics.monthlyEstimate":"Estimación mensual","analytics.dailyCosts":"Costes diarios (30 días)","analytics.agentBreakdown":"Coste por agente","analytics.modelBreakdown":"Coste por modelo","analytics.budgetUtilization":"Uso del presupuesto","analytics.runs":"Ejecuciones","analytics.totalCost":"Coste total","analytics.avgCost":"Coste medio","analytics.model":"Modelo","analytics.tokens":"Tokens","analytics.cost":"Coste","analytics.noAgentData":"Sin datos de coste por agente.","analytics.noModelData":"Sin datos de coste por modelo.","settings.title":"Configuración","settings.general":"General","settings.security":"Seguridad","settings.llm":"LLM","settings.budget":"Presupuesto","settings.save":"Guardar cambios","settings.saved":"Configuración guardada.","settings.language":"Idioma","common.loading":"Cargando...","common.error":"Se produjo un error.","common.retry":"Reintentar","common.cancel":"Cancelar","common.save":"Guardar","common.delete":"Eliminar","common.close":"Cerrar","common.search":"Buscar...","common.noResults":"Sin resultados.","common.name":"Nombre","common.description":"Descripción","common.status":"Estado","common.type":"Tipo","common.actions":"Acciones","common.created":"Creado","common.updated":"Actualizado","status.running":"En ejecución","status.completed":"Completado","status.failed":"Fallido","status.pending":"Pendiente","status.paused":"En pausa","status.cancelled":"Cancelado","status.idle":"Inactivo","trust.builtin":"Integrado","trust.official":"Oficial","trust.trusted":"Verificado","trust.community":"Comunidad","trust.local":"Local"},de:{"nav.dashboard":"Dashboard","nav.agents":"Agenten","nav.workflows":"Workflows","nav.skills":"Fähigkeiten","nav.runs":"Ausführungen","nav.approvals":"Genehmigungen","nav.handoffs":"Übergaben","nav.settings":"Einstellungen","nav.users":"Benutzer","nav.prompts":"Prompts","dashboard.title":"Dashboard","dashboard.activeAgents":"Aktive Agenten","dashboard.runningTasks":"Laufende Aufgaben","dashboard.costToday":"Kosten heute","dashboard.skillsInstalled":"Installierte Fähigkeiten","dashboard.recentActivity":"Letzte Aktivität","dashboard.quickActions":"Schnellaktionen","dashboard.systemHealth":"Systemstatus","dashboard.createAgent":"Agent erstellen","dashboard.runWorkflow":"Workflow starten","dashboard.installSkill":"Fähigkeit installieren","agents.title":"Agenten","agents.create":"Agent erstellen","agents.empty":"Keine Agenten konfiguriert.","agents.emptyDesc":"Erstellen Sie Ihren ersten KI-Agenten für automatisierte Aufgaben.","agent.overview":"Übersicht","agent.runs":"Ausführungen","agent.events":"Ereignisse","agent.configuration":"Konfiguration","agent.budget":"Budget","agent.recentRuns":"Letzte Ausführungen","agent.delete":"Agent löschen","agent.start":"Starten","agent.stop":"Stoppen","agent.run":"Ausführen","workflows.title":"Workflows","workflows.create":"Workflow erstellen","workflows.empty":"Keine Workflows definiert.","workflows.emptyDesc":"Entwerfen Sie Ihren ersten Workflow zur Orchestrierung mehrerer Agenten.","workflows.nodes":"{count} Knoten","workflows.edit":"Bearbeiten","workflow.editor":"Workflow-Editor","workflow.addNode":"Knoten hinzufügen","workflow.save":"Speichern","workflow.run":"Workflow starten","skills.title":"Fähigkeiten","skills.install":"Installieren","skills.empty":"Keine Fähigkeiten installiert.","skills.emptyDesc":"Durchsuchen und installieren Sie Fähigkeiten, um die Möglichkeiten Ihrer Agenten zu erweitern.","skills.scan":"Verzeichnis scannen","skills.source":"Quell-URL oder -pfad","runs.title":"Ausführungen","runs.empty":"Keine Ausführungen aufgezeichnet.","runs.emptyDesc":"Starten Sie einen Agenten oder Workflow, um den Verlauf anzuzeigen.","runs.filter":"Filtern","run.events":"Ereignisse","run.output":"Ausgabe","run.cost":"Kostenaufschlüsselung","run.duration":"Dauer","approvals.title":"Genehmigungswarteschlange","approvals.empty":"Keine ausstehenden Genehmigungen.","approvals.emptyDesc":"Alles in Ordnung. Gefährliche Aktionen erscheinen hier zur Überprüfung.","approvals.approve":"Genehmigen","approvals.deny":"Ablehnen","approvals.pending":"Ausstehend","nav.analytics":"Analytik","nav.budget":"Budget","nav.traces":"Traces","nav.memory":"Speicher","nav.goals":"Ziele","nav.plans":"Pläne","nav.guardrails":"Leitplanken","analytics.title":"Kostenanalytik","analytics.description":"Ausgaben, Token-Nutzung und Budgetauslastung pro Agent verfolgen.","analytics.totalSpend":"Gesamtausgaben","analytics.totalRuns":"Gesamtausführungen","analytics.avgCostPerRun":"Ø Kosten/Ausf.","analytics.monthlyEstimate":"Monatliche Schätzung","analytics.dailyCosts":"Tägliche Kosten (30 Tage)","analytics.agentBreakdown":"Kosten pro Agent","analytics.modelBreakdown":"Kosten pro Modell","analytics.budgetUtilization":"Budgetauslastung","analytics.runs":"Ausführungen","analytics.totalCost":"Gesamtkosten","analytics.avgCost":"Ø Kosten","analytics.model":"Modell","analytics.tokens":"Tokens","analytics.cost":"Kosten","analytics.noAgentData":"Noch keine Kostendaten pro Agent.","analytics.noModelData":"Noch keine Kostendaten pro Modell.","settings.title":"Einstellungen","settings.general":"Allgemein","settings.security":"Sicherheit","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Änderungen speichern","settings.saved":"Einstellungen gespeichert.","settings.language":"Sprache","common.loading":"Laden...","common.error":"Ein Fehler ist aufgetreten.","common.retry":"Erneut versuchen","common.cancel":"Abbrechen","common.save":"Speichern","common.delete":"Löschen","common.close":"Schließen","common.search":"Suchen...","common.noResults":"Keine Ergebnisse.","common.name":"Name","common.description":"Beschreibung","common.status":"Status","common.type":"Typ","common.actions":"Aktionen","common.created":"Erstellt","common.updated":"Aktualisiert","status.running":"Läuft","status.completed":"Abgeschlossen","status.failed":"Fehlgeschlagen","status.pending":"Ausstehend","status.paused":"Pausiert","status.cancelled":"Abgebrochen","status.idle":"Inaktiv","trust.builtin":"Integriert","trust.official":"Offiziell","trust.trusted":"Vertrauenswürdig","trust.community":"Community","trust.local":"Lokal"},pt:{"nav.dashboard":"Painel","nav.agents":"Agentes","nav.workflows":"Fluxos de trabalho","nav.skills":"Habilidades","nav.runs":"Execuções","nav.approvals":"Aprovações","nav.handoffs":"Transferências","nav.settings":"Configurações","nav.users":"Usuários","nav.prompts":"Prompts","dashboard.title":"Painel","dashboard.activeAgents":"Agentes ativos","dashboard.runningTasks":"Tarefas em execução","dashboard.costToday":"Custo hoje","dashboard.skillsInstalled":"Habilidades instaladas","dashboard.recentActivity":"Atividade recente","dashboard.quickActions":"Ações rápidas","dashboard.systemHealth":"Saúde do sistema","dashboard.createAgent":"Criar agente","dashboard.runWorkflow":"Executar fluxo","dashboard.installSkill":"Instalar habilidade","agents.title":"Agentes","agents.create":"Criar agente","agents.empty":"Nenhum agente configurado.","agents.emptyDesc":"Crie seu primeiro agente de IA para começar com tarefas automatizadas.","agent.overview":"Visão geral","agent.runs":"Execuções","agent.events":"Eventos","agent.configuration":"Configuração","agent.budget":"Orçamento","agent.recentRuns":"Execuções recentes","agent.delete":"Excluir agente","agent.start":"Iniciar","agent.stop":"Parar","agent.run":"Executar","workflows.title":"Fluxos de trabalho","workflows.create":"Criar fluxo","workflows.empty":"Nenhum fluxo definido.","workflows.emptyDesc":"Projete seu primeiro fluxo de trabalho para orquestrar múltiplos agentes.","workflows.nodes":"{count} nós","workflows.edit":"Editar","workflow.editor":"Editor de fluxo","workflow.addNode":"Adicionar nó","workflow.save":"Salvar","workflow.run":"Executar fluxo","skills.title":"Habilidades","skills.install":"Instalar","skills.empty":"Nenhuma habilidade instalada.","skills.emptyDesc":"Explore e instale habilidades para ampliar as capacidades dos seus agentes.","skills.scan":"Escanear diretório","skills.source":"URL ou caminho de origem","runs.title":"Execuções","runs.empty":"Nenhuma execução registrada.","runs.emptyDesc":"Execute um agente ou fluxo para ver o histórico.","runs.filter":"Filtrar","run.events":"Eventos","run.output":"Saída","run.cost":"Detalhamento de custos","run.duration":"Duração","approvals.title":"Fila de aprovação","approvals.empty":"Sem aprovações pendentes.","approvals.emptyDesc":"Tudo limpo. Ações perigosas aparecerão aqui para revisão.","approvals.approve":"Aprovar","approvals.deny":"Negar","approvals.pending":"Pendente","nav.analytics":"Análises","nav.budget":"Orçamento","nav.traces":"Rastros","nav.memory":"Memória","nav.goals":"Objetivos","nav.plans":"Planos","nav.guardrails":"Proteções","analytics.title":"Análise de custos","analytics.description":"Acompanhe gastos, uso de tokens e orçamento por agente.","analytics.totalSpend":"Gasto total","analytics.totalRuns":"Total de execuções","analytics.avgCostPerRun":"Custo médio/exec.","analytics.monthlyEstimate":"Estimativa mensal","analytics.dailyCosts":"Custos diários (30 dias)","analytics.agentBreakdown":"Custo por agente","analytics.modelBreakdown":"Custo por modelo","analytics.budgetUtilization":"Utilização do orçamento","analytics.runs":"Execuções","analytics.totalCost":"Custo total","analytics.avgCost":"Custo médio","analytics.model":"Modelo","analytics.tokens":"Tokens","analytics.cost":"Custo","analytics.noAgentData":"Sem dados de custo por agente.","analytics.noModelData":"Sem dados de custo por modelo.","settings.title":"Configurações","settings.general":"Geral","settings.security":"Segurança","settings.llm":"LLM","settings.budget":"Orçamento","settings.save":"Salvar alterações","settings.saved":"Configurações salvas.","settings.language":"Idioma","common.loading":"Carregando...","common.error":"Ocorreu um erro.","common.retry":"Tentar novamente","common.cancel":"Cancelar","common.save":"Salvar","common.delete":"Excluir","common.close":"Fechar","common.search":"Pesquisar...","common.noResults":"Nenhum resultado.","common.name":"Nome","common.description":"Descrição","common.status":"Status","common.type":"Tipo","common.actions":"Ações","common.created":"Criado","common.updated":"Atualizado","status.running":"Em execução","status.completed":"Concluído","status.failed":"Falhou","status.pending":"Pendente","status.paused":"Pausado","status.cancelled":"Cancelado","status.idle":"Inativo","trust.builtin":"Integrado","trust.official":"Oficial","trust.trusted":"Verificado","trust.community":"Comunidade","trust.local":"Local"},ja:{"nav.dashboard":"ダッシュボード","nav.agents":"エージェント","nav.workflows":"ワークフロー","nav.skills":"スキル","nav.runs":"実行履歴","nav.approvals":"承認","nav.handoffs":"引き継ぎ","nav.settings":"設定","nav.users":"ユーザー","nav.prompts":"プロンプト","dashboard.title":"ダッシュボード","dashboard.activeAgents":"アクティブなエージェント","dashboard.runningTasks":"実行中のタスク","dashboard.costToday":"本日のコスト","dashboard.skillsInstalled":"インストール済みスキル","dashboard.recentActivity":"最近のアクティビティ","dashboard.quickActions":"クイックアクション","dashboard.systemHealth":"システム状態","dashboard.createAgent":"エージェント作成","dashboard.runWorkflow":"ワークフロー実行","dashboard.installSkill":"スキルインストール","agents.title":"エージェント","agents.create":"エージェント作成","agents.empty":"エージェントが構成されていません。","agents.emptyDesc":"最初のAIエージェントを作成して自動化タスクを始めましょう。","agent.overview":"概要","agent.runs":"実行履歴","agent.events":"イベント","agent.configuration":"構成","agent.budget":"予算","agent.recentRuns":"最近の実行","agent.delete":"エージェント削除","agent.start":"開始","agent.stop":"停止","agent.run":"実行","workflows.title":"ワークフロー","workflows.create":"ワークフロー作成","workflows.empty":"ワークフローが定義されていません。","workflows.emptyDesc":"最初のワークフローを設計して複数のエージェントをオーケストレーションしましょう。","workflows.nodes":"{count} ノード","workflows.edit":"編集","workflow.editor":"ワークフローエディタ","workflow.addNode":"ノード追加","workflow.save":"保存","workflow.run":"ワークフロー実行","skills.title":"スキル","skills.install":"インストール","skills.empty":"スキルがインストールされていません。","skills.emptyDesc":"スキルを参照・インストールしてエージェントの機能を拡張しましょう。","skills.scan":"ディレクトリスキャン","skills.source":"ソースURLまたはパス","runs.title":"実行履歴","runs.empty":"実行記録がありません。","runs.emptyDesc":"エージェントまたはワークフローを実行して履歴を確認しましょう。","runs.filter":"フィルター","run.events":"イベント","run.output":"出力","run.cost":"コスト内訳","run.duration":"所要時間","approvals.title":"承認キュー","approvals.empty":"保留中の承認はありません。","approvals.emptyDesc":"問題なし。危険なアクションはここに表示されます。","approvals.approve":"承認","approvals.deny":"拒否","approvals.pending":"保留中","nav.analytics":"アナリティクス","nav.budget":"予算","nav.traces":"トレース","nav.memory":"メモリ","nav.goals":"目標","nav.plans":"プラン","nav.guardrails":"ガードレール","analytics.title":"コスト分析","analytics.description":"エージェントごとの支出、トークン使用量、予算利用状況を追跡。","analytics.totalSpend":"総支出","analytics.totalRuns":"総実行数","analytics.avgCostPerRun":"平均コスト/実行","analytics.monthlyEstimate":"月間見積もり","analytics.dailyCosts":"日次コスト(30日間)","analytics.agentBreakdown":"エージェント別コスト","analytics.modelBreakdown":"モデル別コスト","analytics.budgetUtilization":"予算利用率","analytics.runs":"実行回数","analytics.totalCost":"総コスト","analytics.avgCost":"平均コスト","analytics.model":"モデル","analytics.tokens":"トークン","analytics.cost":"コスト","analytics.noAgentData":"エージェントコストデータがまだありません。","analytics.noModelData":"モデルコストデータがまだありません。","settings.title":"設定","settings.general":"一般","settings.security":"セキュリティ","settings.llm":"LLM","settings.budget":"予算","settings.save":"変更を保存","settings.saved":"設定が保存されました。","settings.language":"言語","common.loading":"読み込み中...","common.error":"エラーが発生しました。","common.retry":"再試行","common.cancel":"キャンセル","common.save":"保存","common.delete":"削除","common.close":"閉じる","common.search":"検索...","common.noResults":"結果が見つかりません。","common.name":"名前","common.description":"説明","common.status":"ステータス","common.type":"タイプ","common.actions":"アクション","common.created":"作成日","common.updated":"更新日","status.running":"実行中","status.completed":"完了","status.failed":"失敗","status.pending":"保留中","status.paused":"一時停止","status.cancelled":"キャンセル済み","status.idle":"アイドル","trust.builtin":"組み込み","trust.official":"公式","trust.trusted":"信頼済み","trust.community":"コミュニティ","trust.local":"ローカル"},zh:{"nav.dashboard":"仪表盘","nav.agents":"代理","nav.workflows":"工作流","nav.skills":"技能","nav.runs":"执行记录","nav.approvals":"审批","nav.handoffs":"交接","nav.settings":"设置","nav.users":"用户","nav.prompts":"提示词","dashboard.title":"仪表盘","dashboard.activeAgents":"活跃代理","dashboard.runningTasks":"运行中的任务","dashboard.costToday":"今日费用","dashboard.skillsInstalled":"已安装技能","dashboard.recentActivity":"最近活动","dashboard.quickActions":"快捷操作","dashboard.systemHealth":"系统状态","dashboard.createAgent":"创建代理","dashboard.runWorkflow":"运行工作流","dashboard.installSkill":"安装技能","agents.title":"代理","agents.create":"创建代理","agents.empty":"尚无已配置的代理。","agents.emptyDesc":"创建您的第一个AI代理以开始自动化任务。","agent.overview":"概览","agent.runs":"执行记录","agent.events":"事件","agent.configuration":"配置","agent.budget":"预算","agent.recentRuns":"最近执行","agent.delete":"删除代理","agent.start":"启动","agent.stop":"停止","agent.run":"运行","workflows.title":"工作流","workflows.create":"创建工作流","workflows.empty":"尚无已定义的工作流。","workflows.emptyDesc":"设计您的第一个工作流以编排多个代理。","workflows.nodes":"{count} 个节点","workflows.edit":"编辑","workflow.editor":"工作流编辑器","workflow.addNode":"添加节点","workflow.save":"保存","workflow.run":"运行工作流","skills.title":"技能","skills.install":"安装","skills.empty":"尚无已安装的技能。","skills.emptyDesc":"浏览并安装技能以扩展代理的能力。","skills.scan":"扫描目录","skills.source":"源URL或路径","runs.title":"执行记录","runs.empty":"尚无执行记录。","runs.emptyDesc":"运行代理或工作流以查看执行历史。","runs.filter":"筛选","run.events":"事件","run.output":"输出","run.cost":"费用明细","run.duration":"持续时间","approvals.title":"审批队列","approvals.empty":"没有待审批项。","approvals.emptyDesc":"一切正常。危险操作将在此显示以供审查。","approvals.approve":"批准","approvals.deny":"拒绝","approvals.pending":"待处理","nav.analytics":"分析","nav.budget":"预算","nav.traces":"追踪","nav.memory":"记忆","nav.goals":"目标","nav.plans":"计划","nav.guardrails":"护栏","analytics.title":"费用分析","analytics.description":"追踪各代理的支出、令牌使用量和预算利用率。","analytics.totalSpend":"总支出","analytics.totalRuns":"总执行次数","analytics.avgCostPerRun":"平均费用/次","analytics.monthlyEstimate":"月度估算","analytics.dailyCosts":"每日费用(30天)","analytics.agentBreakdown":"按代理的费用","analytics.modelBreakdown":"按模型的费用","analytics.budgetUtilization":"预算利用率","analytics.runs":"执行次数","analytics.totalCost":"总费用","analytics.avgCost":"平均费用","analytics.model":"模型","analytics.tokens":"令牌","analytics.cost":"费用","analytics.noAgentData":"尚无代理费用数据。","analytics.noModelData":"尚无模型费用数据。","settings.title":"设置","settings.general":"通用","settings.security":"安全","settings.llm":"LLM","settings.budget":"预算","settings.save":"保存更改","settings.saved":"设置已保存。","settings.language":"语言","common.loading":"加载中...","common.error":"发生错误。","common.retry":"重试","common.cancel":"取消","common.save":"保存","common.delete":"删除","common.close":"关闭","common.search":"搜索...","common.noResults":"未找到结果。","common.name":"名称","common.description":"描述","common.status":"状态","common.type":"类型","common.actions":"操作","common.created":"创建时间","common.updated":"更新时间","status.running":"运行中","status.completed":"已完成","status.failed":"失败","status.pending":"待处理","status.paused":"已暂停","status.cancelled":"已取消","status.idle":"空闲","trust.builtin":"内置","trust.official":"官方","trust.trusted":"受信任","trust.community":"社区","trust.local":"本地"},ko:{"nav.dashboard":"대시보드","nav.agents":"에이전트","nav.workflows":"워크플로우","nav.skills":"스킬","nav.runs":"실행 기록","nav.approvals":"승인","nav.handoffs":"인수인계","nav.settings":"설정","nav.users":"사용자","nav.prompts":"프롬프트","dashboard.title":"대시보드","dashboard.activeAgents":"활성 에이전트","dashboard.runningTasks":"실행 중인 작업","dashboard.costToday":"오늘 비용","dashboard.skillsInstalled":"설치된 스킬","dashboard.recentActivity":"최근 활동","dashboard.quickActions":"빠른 작업","dashboard.systemHealth":"시스템 상태","dashboard.createAgent":"에이전트 생성","dashboard.runWorkflow":"워크플로우 실행","dashboard.installSkill":"스킬 설치","agents.title":"에이전트","agents.create":"에이전트 생성","agents.empty":"구성된 에이전트가 없습니다.","agents.emptyDesc":"첫 번째 AI 에이전트를 만들어 자동화 작업을 시작하세요.","agent.overview":"개요","agent.runs":"실행 기록","agent.events":"이벤트","agent.configuration":"구성","agent.budget":"예산","agent.recentRuns":"최근 실행","agent.delete":"에이전트 삭제","agent.start":"시작","agent.stop":"중지","agent.run":"실행","workflows.title":"워크플로우","workflows.create":"워크플로우 생성","workflows.empty":"정의된 워크플로우가 없습니다.","workflows.emptyDesc":"첫 번째 워크플로우를 설계하여 여러 에이전트를 조율하세요.","workflows.nodes":"{count}개 노드","workflows.edit":"편집","workflow.editor":"워크플로우 편집기","workflow.addNode":"노드 추가","workflow.save":"저장","workflow.run":"워크플로우 실행","skills.title":"스킬","skills.install":"설치","skills.empty":"설치된 스킬이 없습니다.","skills.emptyDesc":"스킬을 탐색하고 설치하여 에이전트의 기능을 확장하세요.","skills.scan":"디렉토리 스캔","skills.source":"소스 URL 또는 경로","runs.title":"실행 기록","runs.empty":"기록된 실행이 없습니다.","runs.emptyDesc":"에이전트 또는 워크플로우를 실행하여 실행 기록을 확인하세요.","runs.filter":"필터","run.events":"이벤트","run.output":"출력","run.cost":"비용 내역","run.duration":"소요 시간","approvals.title":"승인 대기열","approvals.empty":"대기 중인 승인이 없습니다.","approvals.emptyDesc":"문제 없음. 위험한 작업은 여기에 검토를 위해 표시됩니다.","approvals.approve":"승인","approvals.deny":"거부","approvals.pending":"대기 중","nav.analytics":"분석","nav.budget":"예산","nav.traces":"추적","nav.memory":"메모리","nav.goals":"목표","nav.plans":"계획","nav.guardrails":"가드레일","analytics.title":"비용 분석","analytics.description":"에이전트별 지출, 토큰 사용량 및 예산 활용도를 추적합니다.","analytics.totalSpend":"총 지출","analytics.totalRuns":"총 실행 수","analytics.avgCostPerRun":"평균 비용/실행","analytics.monthlyEstimate":"월간 추정","analytics.dailyCosts":"일별 비용 (30일)","analytics.agentBreakdown":"에이전트별 비용","analytics.modelBreakdown":"모델별 비용","analytics.budgetUtilization":"예산 활용률","analytics.runs":"실행 횟수","analytics.totalCost":"총 비용","analytics.avgCost":"평균 비용","analytics.model":"모델","analytics.tokens":"토큰","analytics.cost":"비용","analytics.noAgentData":"에이전트 비용 데이터가 없습니다.","analytics.noModelData":"모델 비용 데이터가 없습니다.","settings.title":"설정","settings.general":"일반","settings.security":"보안","settings.llm":"LLM","settings.budget":"예산","settings.save":"변경 사항 저장","settings.saved":"설정이 저장되었습니다.","settings.language":"언어","common.loading":"로딩 중...","common.error":"오류가 발생했습니다.","common.retry":"재시도","common.cancel":"취소","common.save":"저장","common.delete":"삭제","common.close":"닫기","common.search":"검색...","common.noResults":"결과를 찾을 수 없습니다.","common.name":"이름","common.description":"설명","common.status":"상태","common.type":"유형","common.actions":"작업","common.created":"생성일","common.updated":"수정일","status.running":"실행 중","status.completed":"완료","status.failed":"실패","status.pending":"대기 중","status.paused":"일시 중지","status.cancelled":"취소됨","status.idle":"유휴","trust.builtin":"내장","trust.official":"공식","trust.trusted":"신뢰됨","trust.community":"커뮤니티","trust.local":"로컬"},ar:{"nav.dashboard":"لوحة التحكم","nav.agents":"الوكلاء","nav.workflows":"مسارات العمل","nav.skills":"المهارات","nav.runs":"عمليات التنفيذ","nav.approvals":"الموافقات","nav.handoffs":"التسليمات","nav.settings":"الإعدادات","nav.users":"المستخدمون","nav.prompts":"التعليمات","dashboard.title":"لوحة التحكم","dashboard.activeAgents":"الوكلاء النشطون","dashboard.runningTasks":"المهام قيد التشغيل","dashboard.costToday":"تكلفة اليوم","dashboard.skillsInstalled":"المهارات المثبتة","dashboard.recentActivity":"النشاط الأخير","dashboard.quickActions":"إجراءات سريعة","dashboard.systemHealth":"حالة النظام","dashboard.createAgent":"إنشاء وكيل","dashboard.runWorkflow":"تشغيل مسار عمل","dashboard.installSkill":"تثبيت مهارة","agents.title":"الوكلاء","agents.create":"إنشاء وكيل","agents.empty":"لا توجد وكلاء مهيأة بعد.","agents.emptyDesc":"أنشئ أول وكيل ذكاء اصطناعي لبدء المهام الآلية.","agent.overview":"نظرة عامة","agent.runs":"عمليات التنفيذ","agent.events":"الأحداث","agent.configuration":"التكوين","agent.budget":"الميزانية","agent.recentRuns":"آخر عمليات التنفيذ","agent.delete":"حذف الوكيل","agent.start":"بدء","agent.stop":"إيقاف","agent.run":"تشغيل","workflows.title":"مسارات العمل","workflows.create":"إنشاء مسار عمل","workflows.empty":"لا توجد مسارات عمل معرّفة بعد.","workflows.emptyDesc":"صمّم أول مسار عمل لتنسيق عدة وكلاء.","workflows.nodes":"{count} عقدة","workflows.edit":"تعديل","workflow.editor":"محرر مسار العمل","workflow.addNode":"إضافة عقدة","workflow.save":"حفظ","workflow.run":"تشغيل مسار العمل","skills.title":"المهارات","skills.install":"تثبيت","skills.empty":"لا توجد مهارات مثبتة بعد.","skills.emptyDesc":"تصفّح وثبّت المهارات لتوسيع قدرات وكلائك.","skills.scan":"فحص المجلد","skills.source":"عنوان URL أو مسار المصدر","runs.title":"عمليات التنفيذ","runs.empty":"لا توجد عمليات تنفيذ مسجلة بعد.","runs.emptyDesc":"شغّل وكيلًا أو مسار عمل لعرض سجل التنفيذ.","runs.filter":"تصفية","run.events":"الأحداث","run.output":"المخرجات","run.cost":"تفصيل التكاليف","run.duration":"المدة","approvals.title":"قائمة الموافقات","approvals.empty":"لا توجد موافقات معلقة.","approvals.emptyDesc":"كل شيء على ما يرام. ستظهر الإجراءات الخطيرة هنا للمراجعة.","approvals.approve":"موافقة","approvals.deny":"رفض","approvals.pending":"معلّق","nav.analytics":"التحليلات","nav.budget":"الميزانية","nav.traces":"التتبع","nav.memory":"الذاكرة","nav.goals":"الأهداف","nav.plans":"الخطط","nav.guardrails":"الحواجز","analytics.title":"تحليل التكاليف","analytics.description":"تتبع الإنفاق واستخدام الرموز وميزانية كل وكيل.","analytics.totalSpend":"إجمالي الإنفاق","analytics.totalRuns":"إجمالي عمليات التنفيذ","analytics.avgCostPerRun":"متوسط التكلفة/تنفيذ","analytics.monthlyEstimate":"التقدير الشهري","analytics.dailyCosts":"التكاليف اليومية (30 يومًا)","analytics.agentBreakdown":"التكلفة حسب الوكيل","analytics.modelBreakdown":"التكلفة حسب النموذج","analytics.budgetUtilization":"استخدام الميزانية","analytics.runs":"عمليات التنفيذ","analytics.totalCost":"التكلفة الإجمالية","analytics.avgCost":"متوسط التكلفة","analytics.model":"النموذج","analytics.tokens":"الرموز","analytics.cost":"التكلفة","analytics.noAgentData":"لا توجد بيانات تكلفة للوكلاء بعد.","analytics.noModelData":"لا توجد بيانات تكلفة للنماذج بعد.","settings.title":"الإعدادات","settings.general":"عام","settings.security":"الأمان","settings.llm":"LLM","settings.budget":"الميزانية","settings.save":"حفظ التغييرات","settings.saved":"تم حفظ الإعدادات بنجاح.","settings.language":"اللغة","common.loading":"جارٍ التحميل...","common.error":"حدث خطأ.","common.retry":"إعادة المحاولة","common.cancel":"إلغاء","common.save":"حفظ","common.delete":"حذف","common.close":"إغلاق","common.search":"بحث...","common.noResults":"لم يتم العثور على نتائج.","common.name":"الاسم","common.description":"الوصف","common.status":"الحالة","common.type":"النوع","common.actions":"الإجراءات","common.created":"تاريخ الإنشاء","common.updated":"تاريخ التحديث","status.running":"قيد التشغيل","status.completed":"مكتمل","status.failed":"فشل","status.pending":"معلّق","status.paused":"متوقف مؤقتًا","status.cancelled":"ملغى","status.idle":"خامل","trust.builtin":"مدمج","trust.official":"رسمي","trust.trusted":"موثوق","trust.community":"مجتمعي","trust.local":"محلي"},ru:{"nav.dashboard":"Панель управления","nav.agents":"Агенты","nav.workflows":"Рабочие процессы","nav.skills":"Навыки","nav.runs":"Запуски","nav.approvals":"Одобрения","nav.handoffs":"Передачи","nav.settings":"Настройки","nav.users":"Пользователи","nav.prompts":"Промпты","dashboard.title":"Панель управления","dashboard.activeAgents":"Активные агенты","dashboard.runningTasks":"Запущенные задачи","dashboard.costToday":"Расходы сегодня","dashboard.skillsInstalled":"Установленные навыки","dashboard.recentActivity":"Последняя активность","dashboard.quickActions":"Быстрые действия","dashboard.systemHealth":"Состояние системы","dashboard.createAgent":"Создать агента","dashboard.runWorkflow":"Запустить процесс","dashboard.installSkill":"Установить навык","agents.title":"Агенты","agents.create":"Создать агента","agents.empty":"Нет настроенных агентов.","agents.emptyDesc":"Создайте первого ИИ-агента для автоматизации задач.","agent.overview":"Обзор","agent.runs":"Запуски","agent.events":"События","agent.configuration":"Конфигурация","agent.budget":"Бюджет","agent.recentRuns":"Последние запуски","agent.delete":"Удалить агента","agent.start":"Запустить","agent.stop":"Остановить","agent.run":"Выполнить","workflows.title":"Рабочие процессы","workflows.create":"Создать процесс","workflows.empty":"Нет определённых процессов.","workflows.emptyDesc":"Создайте первый рабочий процесс для оркестрации агентов.","workflows.nodes":"{count} узлов","workflows.edit":"Редактировать","workflow.editor":"Редактор процессов","workflow.addNode":"Добавить узел","workflow.save":"Сохранить","workflow.run":"Запустить процесс","skills.title":"Навыки","skills.install":"Установить","skills.empty":"Нет установленных навыков.","skills.emptyDesc":"Просматривайте и устанавливайте навыки для расширения возможностей агентов.","skills.scan":"Сканировать каталог","skills.source":"URL или путь к источнику","runs.title":"Запуски","runs.empty":"Нет записей о запусках.","runs.emptyDesc":"Запустите агента или процесс, чтобы увидеть историю выполнения.","runs.filter":"Фильтр","run.events":"События","run.output":"Вывод","run.cost":"Разбивка стоимости","run.duration":"Длительность","approvals.title":"Очередь одобрений","approvals.empty":"Нет ожидающих одобрений.","approvals.emptyDesc":"Всё в порядке. Опасные действия появятся здесь для проверки.","approvals.approve":"Одобрить","approvals.deny":"Отклонить","approvals.pending":"Ожидает","nav.analytics":"Аналитика","nav.budget":"Бюджет","nav.traces":"Трассировки","nav.memory":"Память","nav.goals":"Цели","nav.plans":"Планы","nav.guardrails":"Ограждения","analytics.title":"Аналитика расходов","analytics.description":"Отслеживание расходов, использования токенов и бюджета по агентам.","analytics.totalSpend":"Общие расходы","analytics.totalRuns":"Всего запусков","analytics.avgCostPerRun":"Ср. стоимость/запуск","analytics.monthlyEstimate":"Месячная оценка","analytics.dailyCosts":"Ежедневные расходы (30 дней)","analytics.agentBreakdown":"Расходы по агентам","analytics.modelBreakdown":"Расходы по моделям","analytics.budgetUtilization":"Использование бюджета","analytics.runs":"Запуски","analytics.totalCost":"Общая стоимость","analytics.avgCost":"Ср. стоимость","analytics.model":"Модель","analytics.tokens":"Токены","analytics.cost":"Стоимость","analytics.noAgentData":"Нет данных о расходах по агентам.","analytics.noModelData":"Нет данных о расходах по моделям.","settings.title":"Настройки","settings.general":"Общие","settings.security":"Безопасность","settings.llm":"LLM","settings.budget":"Бюджет","settings.save":"Сохранить изменения","settings.saved":"Настройки сохранены.","settings.language":"Язык","common.loading":"Загрузка...","common.error":"Произошла ошибка.","common.retry":"Повторить","common.cancel":"Отмена","common.save":"Сохранить","common.delete":"Удалить","common.close":"Закрыть","common.search":"Поиск...","common.noResults":"Результатов не найдено.","common.name":"Название","common.description":"Описание","common.status":"Статус","common.type":"Тип","common.actions":"Действия","common.created":"Создано","common.updated":"Обновлено","status.running":"Выполняется","status.completed":"Завершено","status.failed":"Ошибка","status.pending":"Ожидание","status.paused":"Пауза","status.cancelled":"Отменено","status.idle":"Простой","trust.builtin":"Встроенный","trust.official":"Официальный","trust.trusted":"Доверенный","trust.community":"Сообщество","trust.local":"Локальный"},it:{"nav.dashboard":"Pannello","nav.agents":"Agenti","nav.workflows":"Flussi di lavoro","nav.skills":"Competenze","nav.runs":"Esecuzioni","nav.approvals":"Approvazioni","nav.handoffs":"Passaggi","nav.settings":"Impostazioni","nav.users":"Utenti","nav.prompts":"Prompt","dashboard.title":"Pannello","dashboard.activeAgents":"Agenti attivi","dashboard.runningTasks":"Attività in corso","dashboard.costToday":"Costo oggi","dashboard.skillsInstalled":"Competenze installate","dashboard.recentActivity":"Attività recente","dashboard.quickActions":"Azioni rapide","dashboard.systemHealth":"Stato del sistema","dashboard.createAgent":"Crea agente","dashboard.runWorkflow":"Esegui flusso","dashboard.installSkill":"Installa competenza","agents.title":"Agenti","agents.create":"Crea agente","agents.empty":"Nessun agente configurato.","agents.emptyDesc":"Crea il tuo primo agente IA per iniziare con le attività automatizzate.","agent.overview":"Panoramica","agent.runs":"Esecuzioni","agent.events":"Eventi","agent.configuration":"Configurazione","agent.budget":"Budget","agent.recentRuns":"Esecuzioni recenti","agent.delete":"Elimina agente","agent.start":"Avvia","agent.stop":"Arresta","agent.run":"Esegui","workflows.title":"Flussi di lavoro","workflows.create":"Crea flusso","workflows.empty":"Nessun flusso di lavoro definito.","workflows.emptyDesc":"Progetta il tuo primo flusso di lavoro per orchestrare più agenti.","workflows.nodes":"{count} nodi","workflows.edit":"Modifica","workflow.editor":"Editor del flusso","workflow.addNode":"Aggiungi nodo","workflow.save":"Salva","workflow.run":"Esegui flusso","skills.title":"Competenze","skills.install":"Installa","skills.empty":"Nessuna competenza installata.","skills.emptyDesc":"Esplora e installa competenze per ampliare le capacità dei tuoi agenti.","skills.scan":"Scansiona directory","skills.source":"URL o percorso sorgente","runs.title":"Esecuzioni","runs.empty":"Nessuna esecuzione registrata.","runs.emptyDesc":"Esegui un agente o un flusso per vedere la cronologia.","runs.filter":"Filtra","run.events":"Eventi","run.output":"Output","run.cost":"Dettaglio costi","run.duration":"Durata","approvals.title":"Coda di approvazione","approvals.empty":"Nessuna approvazione in sospeso.","approvals.emptyDesc":"Tutto a posto. Le azioni pericolose appariranno qui per la revisione.","approvals.approve":"Approva","approvals.deny":"Nega","approvals.pending":"In sospeso","nav.analytics":"Analisi","nav.budget":"Budget","nav.traces":"Tracce","nav.memory":"Memoria","nav.goals":"Obiettivi","nav.plans":"Piani","nav.guardrails":"Protezioni","analytics.title":"Analisi dei costi","analytics.description":"Monitora spese, utilizzo dei token e budget per agente.","analytics.totalSpend":"Spesa totale","analytics.totalRuns":"Esecuzioni totali","analytics.avgCostPerRun":"Costo medio/esec.","analytics.monthlyEstimate":"Stima mensile","analytics.dailyCosts":"Costi giornalieri (30 giorni)","analytics.agentBreakdown":"Costo per agente","analytics.modelBreakdown":"Costo per modello","analytics.budgetUtilization":"Utilizzo del budget","analytics.runs":"Esecuzioni","analytics.totalCost":"Costo totale","analytics.avgCost":"Costo medio","analytics.model":"Modello","analytics.tokens":"Token","analytics.cost":"Costo","analytics.noAgentData":"Nessun dato di costo per agente.","analytics.noModelData":"Nessun dato di costo per modello.","settings.title":"Impostazioni","settings.general":"Generale","settings.security":"Sicurezza","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Salva modifiche","settings.saved":"Impostazioni salvate.","settings.language":"Lingua","common.loading":"Caricamento...","common.error":"Si è verificato un errore.","common.retry":"Riprova","common.cancel":"Annulla","common.save":"Salva","common.delete":"Elimina","common.close":"Chiudi","common.search":"Cerca...","common.noResults":"Nessun risultato.","common.name":"Nome","common.description":"Descrizione","common.status":"Stato","common.type":"Tipo","common.actions":"Azioni","common.created":"Creato","common.updated":"Aggiornato","status.running":"In esecuzione","status.completed":"Completato","status.failed":"Fallito","status.pending":"In sospeso","status.paused":"In pausa","status.cancelled":"Annullato","status.idle":"Inattivo","trust.builtin":"Integrato","trust.official":"Ufficiale","trust.trusted":"Affidabile","trust.community":"Comunità","trust.local":"Locale"},nl:{"nav.dashboard":"Dashboard","nav.agents":"Agents","nav.workflows":"Workflows","nav.skills":"Vaardigheden","nav.runs":"Uitvoeringen","nav.approvals":"Goedkeuringen","nav.handoffs":"Overdrachten","nav.settings":"Instellingen","nav.users":"Gebruikers","nav.prompts":"Prompts","dashboard.title":"Dashboard","dashboard.activeAgents":"Actieve agents","dashboard.runningTasks":"Lopende taken","dashboard.costToday":"Kosten vandaag","dashboard.skillsInstalled":"Geïnstalleerde vaardigheden","dashboard.recentActivity":"Recente activiteit","dashboard.quickActions":"Snelle acties","dashboard.systemHealth":"Systeemstatus","dashboard.createAgent":"Agent aanmaken","dashboard.runWorkflow":"Workflow uitvoeren","dashboard.installSkill":"Vaardigheid installeren","agents.title":"Agents","agents.create":"Agent aanmaken","agents.empty":"Geen agents geconfigureerd.","agents.emptyDesc":"Maak uw eerste AI-agent aan om te beginnen met geautomatiseerde taken.","agent.overview":"Overzicht","agent.runs":"Uitvoeringen","agent.events":"Gebeurtenissen","agent.configuration":"Configuratie","agent.budget":"Budget","agent.recentRuns":"Recente uitvoeringen","agent.delete":"Agent verwijderen","agent.start":"Starten","agent.stop":"Stoppen","agent.run":"Uitvoeren","workflows.title":"Workflows","workflows.create":"Workflow aanmaken","workflows.empty":"Geen workflows gedefinieerd.","workflows.emptyDesc":"Ontwerp uw eerste workflow om meerdere agents te orkestreren.","workflows.nodes":"{count} knooppunten","workflows.edit":"Bewerken","workflow.editor":"Workflow-editor","workflow.addNode":"Knooppunt toevoegen","workflow.save":"Opslaan","workflow.run":"Workflow uitvoeren","skills.title":"Vaardigheden","skills.install":"Installeren","skills.empty":"Geen vaardigheden geïnstalleerd.","skills.emptyDesc":"Blader door en installeer vaardigheden om de mogelijkheden van uw agents uit te breiden.","skills.scan":"Map scannen","skills.source":"Bron-URL of pad","runs.title":"Uitvoeringen","runs.empty":"Geen uitvoeringen geregistreerd.","runs.emptyDesc":"Voer een agent of workflow uit om de uitvoeringsgeschiedenis te bekijken.","runs.filter":"Filteren","run.events":"Gebeurtenissen","run.output":"Uitvoer","run.cost":"Kostenoverzicht","run.duration":"Duur","approvals.title":"Goedkeuringswachtrij","approvals.empty":"Geen wachtende goedkeuringen.","approvals.emptyDesc":"Alles in orde. Gevaarlijke acties verschijnen hier ter beoordeling.","approvals.approve":"Goedkeuren","approvals.deny":"Weigeren","approvals.pending":"In afwachting","nav.analytics":"Analyse","nav.budget":"Budget","nav.traces":"Traces","nav.memory":"Geheugen","nav.goals":"Doelen","nav.plans":"Plannen","nav.guardrails":"Vangrails","analytics.title":"Kostenanalyse","analytics.description":"Volg uitgaven, tokengebruik en budgetbenutting per agent.","analytics.totalSpend":"Totale uitgaven","analytics.totalRuns":"Totaal uitvoeringen","analytics.avgCostPerRun":"Gem. kosten/uitv.","analytics.monthlyEstimate":"Maandelijkse schatting","analytics.dailyCosts":"Dagelijkse kosten (30 dagen)","analytics.agentBreakdown":"Kosten per agent","analytics.modelBreakdown":"Kosten per model","analytics.budgetUtilization":"Budgetbenutting","analytics.runs":"Uitvoeringen","analytics.totalCost":"Totale kosten","analytics.avgCost":"Gem. kosten","analytics.model":"Model","analytics.tokens":"Tokens","analytics.cost":"Kosten","analytics.noAgentData":"Nog geen kostengegevens per agent.","analytics.noModelData":"Nog geen kostengegevens per model.","settings.title":"Instellingen","settings.general":"Algemeen","settings.security":"Beveiliging","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Wijzigingen opslaan","settings.saved":"Instellingen opgeslagen.","settings.language":"Taal","common.loading":"Laden...","common.error":"Er is een fout opgetreden.","common.retry":"Opnieuw proberen","common.cancel":"Annuleren","common.save":"Opslaan","common.delete":"Verwijderen","common.close":"Sluiten","common.search":"Zoeken...","common.noResults":"Geen resultaten gevonden.","common.name":"Naam","common.description":"Beschrijving","common.status":"Status","common.type":"Type","common.actions":"Acties","common.created":"Aangemaakt","common.updated":"Bijgewerkt","status.running":"Actief","status.completed":"Voltooid","status.failed":"Mislukt","status.pending":"In afwachting","status.paused":"Gepauzeerd","status.cancelled":"Geannuleerd","status.idle":"Inactief","trust.builtin":"Ingebouwd","trust.official":"Officieel","trust.trusted":"Vertrouwd","trust.community":"Community","trust.local":"Lokaal"}},Wh=d.createContext({lang:"en",setLang:()=>{},t:l=>l,isRTL:!1});function cv({children:l}){const[c,u]=d.useState(()=>{const g=localStorage.getItem("nestor_lang");return g&&wu(g)?g:iv(navigator.language)}),o=sv.includes(c);d.useEffect(()=>{document.documentElement.dir=o?"rtl":"ltr",document.documentElement.lang=c},[c,o]);const f=d.useCallback(g=>{u(g),localStorage.setItem("nestor_lang",g)},[]),x=d.useCallback((g,v)=>{var h;let y=((h=ch[c])==null?void 0:h[g])??ch.en[g]??g;if(v)for(const[w,b]of Object.entries(v))y=y.replace(`{${w}}`,String(b));return y},[c]);return a.jsx(Wh.Provider,{value:{lang:c,setLang:f,t:x,isRTL:o},children:l})}function Ke(){return d.useContext(Wh)}const rv={admin:{agents:["create","read","update","delete","execute","admin"],workflows:["create","read","update","delete","execute","admin"],skills:["create","read","update","delete","admin"],settings:["read","update","admin"],users:["create","read","update","delete","admin"],prompts:["create","read","update","delete","admin"]},member:{agents:["create","read","update","execute"],workflows:["create","read","update","execute"],skills:["read","create"],settings:["read"],prompts:["read","create","update"]},viewer:{agents:["read"],workflows:["read"],skills:["read"],settings:["read"],prompts:["read"]}},Ih=d.createContext({user:null,loading:!0,login:async()=>{},logout:async()=>{},register:async()=>{},isAdmin:!1,hasPermission:()=>!1}),ov="/api";function uv(){const l=document.cookie.match(/(?:^|; )nestor-csrf=([^;]*)/);return l?decodeURIComponent(l[1]):null}async function Cl(l,c){var g;const u={"Content-Type":"application/json",...(c==null?void 0:c.headers)||{}},o=((c==null?void 0:c.method)||"GET").toUpperCase();if(o!=="GET"&&o!=="HEAD"){const v=uv();v&&(u["X-CSRF-Token"]=v)}const f=await fetch(`${ov}${l}`,{credentials:"include",headers:u,...c}),x=await f.json().catch(()=>({}));if(!f.ok)throw new Error(((g=x==null?void 0:x.error)==null?void 0:g.message)||`Request failed (${f.status})`);return x}function dv({children:l}){const[c,u]=d.useState(null),[o,f]=d.useState(!0);d.useEffect(()=>{Cl("/auth/me").then(w=>{var b;(b=w.data)!=null&&b.user&&typeof w.data.user=="object"&&u(w.data.user)}).catch(async()=>{try{(await Cl("/health")).status==="ok"&&u({id:"local",email:"admin@localhost",name:"Admin",role:"admin"})}catch{}}).finally(()=>f(!1))},[]);const x=d.useCallback(async(w,b)=>{const j=await Cl("/auth/login",{method:"POST",body:JSON.stringify({email:w,password:b})});u(j.data.user)},[]),g=d.useCallback(async()=>{await Cl("/auth/logout",{method:"POST"}).catch(()=>{}),u(null)},[]),v=d.useCallback(async(w,b,j)=>{await Cl("/auth/register",{method:"POST",body:JSON.stringify({email:w,password:b,name:j})})},[]),y=(c==null?void 0:c.role)==="admin",h=d.useCallback((w,b)=>{if(!c)return!1;const j=rv[c.role];if(!j)return!1;const A=j[w];return A?A.includes(b)||A.includes("admin"):!1},[c]);return a.jsx(Ih.Provider,{value:{user:c,loading:o,login:x,logout:g,register:v,isAdmin:y,hasPermission:h},children:l})}function Hl(){return d.useContext(Ih)}const mv=[{to:"/",icon:Ec,labelKey:"nav.dashboard"},{to:"/agents",icon:Ca,labelKey:"nav.agents"},{to:"/workflows",icon:Nc,labelKey:"nav.workflows"},{to:"/skills",icon:Rc,labelKey:"nav.skills"},{to:"/runs",icon:dt,labelKey:"nav.runs"},{to:"/goals",icon:Ml,labelKey:"nav.goals"},{to:"/approvals",icon:Mc,labelKey:"nav.approvals"},{to:"/handoffs",icon:jc,labelKey:"nav.handoffs"},{to:"/analytics",icon:Aa,labelKey:"nav.analytics"},{to:"/budget",icon:Ra,labelKey:"nav.budget"},{to:"/traces",icon:Dt,labelKey:"nav.traces"},{to:"/memory",icon:ys,labelKey:"nav.memory"},{to:"/plans",icon:Mb,labelKey:"nav.plans"},{to:"/guardrails",icon:Dc,labelKey:"nav.guardrails"},{to:"/settings",icon:Bl,labelKey:"nav.settings"}],fv=[{to:"/users",icon:Cs,labelKey:"nav.users"},{to:"/admin",icon:Bl,labelKey:"nav.admin"}];function xv({onNavigate:l}){const{t:c}=Ke(),{user:u,isAdmin:o,logout:f}=Hl();return a.jsxs("aside",{className:"fixed inset-y-0 left-0 z-30 flex w-60 flex-col border-r border-border bg-surface",children:[a.jsxs("div",{className:"flex h-14 items-center gap-2.5 px-5 border-b border-border",children:[a.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-indigo-600 text-white",children:a.jsx(Lc,{className:"h-4 w-4"})}),a.jsxs("span",{className:"text-lg font-semibold text-white tracking-tight",children:["Nestor ",a.jsx("span",{className:"text-xs font-normal text-zinc-500",children:"Studio"})]})]}),a.jsxs("nav",{className:"flex-1 space-y-0.5 px-3 py-4 overflow-y-auto",children:[mv.map(x=>{const g=x.icon;return a.jsxs(vc,{to:x.to,end:x.to==="/",onClick:l,className:({isActive:v})=>`flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${v?"bg-indigo-500/10 text-indigo-400":"text-zinc-400 hover:bg-surface-hover hover:text-zinc-200"}`,children:[a.jsx(g,{className:"h-4 w-4 flex-shrink-0"}),c(x.labelKey)]},x.to)}),o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"my-2 border-t border-border/50"}),a.jsx("div",{className:"px-3 py-1 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Admin"}),fv.map(x=>{const g=x.icon;return a.jsxs(vc,{to:x.to,onClick:l,className:({isActive:v})=>`flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${v?"bg-indigo-500/10 text-indigo-400":"text-zinc-400 hover:bg-surface-hover hover:text-zinc-200"}`,children:[a.jsx(g,{className:"h-4 w-4 flex-shrink-0"}),c(x.labelKey)]},x.to)})]})]}),a.jsxs("div",{className:"border-t border-border px-4 py-3",children:[u&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"truncate text-sm font-medium text-zinc-200",children:u.name}),a.jsx("p",{className:"truncate text-xs text-zinc-500",children:u.role})]}),a.jsx("button",{onClick:f,className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-surface-hover hover:text-zinc-200",title:"Sign out",children:a.jsx(qb,{className:"h-4 w-4"})})]}),a.jsx("p",{className:"mt-2 text-xs text-zinc-600",children:"Nestor v0.1.0"})]})]})}const hv=["system","agents","runs","approvals"],gv=10,pv=1e3,yv=3e4,bv=3e4,vv=200;function jv(l,c,u){const o=Math.min(c*2**l,u),f=o*Math.random()*.25;return o+f}function Nv(){const l=window.location.protocol==="https:"?"wss:":"ws:",c=window.location.host,u=localStorage.getItem("nestor_token"),o=u?`?token=${encodeURIComponent(u)}`:"";return`${l}//${c}/ws${o}`}function Uu(l=hv,c){const{reconnect:u=!0,maxRetries:o=gv,baseDelay:f=pv,maxDelay:x=yv}={},[g,v]=d.useState([]),[y,h]=d.useState("disconnected"),[w,b]=d.useState(0),j=d.useRef(null),A=d.useRef(),z=d.useRef(),N=d.useRef(l),S=d.useRef(!1),k=d.useRef(0);N.current=l;const D=d.useCallback(()=>{A.current&&(clearTimeout(A.current),A.current=void 0)},[]),U=d.useCallback(()=>{z.current&&(clearInterval(z.current),z.current=void 0)},[]),E=d.useCallback(ae=>{U(),z.current=setInterval(()=>{ae.readyState===WebSocket.OPEN&&ae.send(JSON.stringify({type:"ping"}))},bv)},[U]),F=d.useCallback((ae,K)=>{for(const de of K)ae.readyState===WebSocket.OPEN&&ae.send(JSON.stringify({type:"subscribe",channel:de}))},[]),se=d.useCallback(ae=>{if(!u||S.current)return;if(k.current>=o){console.warn(`[Nestor WS] Max retries (${o}) reached. Giving up.`),h("disconnected");return}const K=jv(k.current,f,x);console.info(`[Nestor WS] Reconnecting in ${Math.round(K)}ms (attempt ${k.current+1}/${o})`),h("reconnecting"),D(),A.current=setTimeout(()=>{k.current+=1,b(k.current),ae()},K)},[u,o,f,x,D]),B=d.useCallback(()=>{if(!(j.current&&(j.current.readyState===WebSocket.OPEN||j.current.readyState===WebSocket.CONNECTING)))try{const ae=Nv(),K=new WebSocket(ae);j.current=K,h("connecting"),K.onopen=()=>{console.info("[Nestor WS] Connected"),h("connected"),k.current=0,b(0),S.current=!1,F(K,N.current),E(K)},K.onmessage=de=>{try{const ye=JSON.parse(de.data);if(ye.type==="ping"){K.send(JSON.stringify({type:"pong"}));return}if(ye.type==="pong")return;if(ye.type==="event"){const $=ye;v(P=>[...P.slice(-(vv-1)),$])}}catch{}},K.onclose=de=>{if(console.info(`[Nestor WS] Closed (code=${de.code}, reason=${de.reason||"none"})`),j.current=null,U(),S.current){h("disconnected");return}se(B)},K.onerror=de=>{console.error("[Nestor WS] Error:",de),K.close()}}catch{se(B)}},[F,E,U,se]);d.useEffect(()=>(S.current=!1,B(),()=>{S.current=!0,D(),U(),j.current&&(j.current.close(1e3,"Component unmount"),j.current=null)}),[B,D,U]),d.useEffect(()=>{const ae=j.current;!ae||ae.readyState!==WebSocket.OPEN||F(ae,l)},[l,F]);const Z=d.useCallback(ae=>{const K=j.current;K&&K.readyState===WebSocket.OPEN&&K.send(JSON.stringify({type:"subscribe",channel:ae}))},[]),ee=d.useCallback(ae=>{const K=j.current;K&&K.readyState===WebSocket.OPEN&&K.send(JSON.stringify({type:"unsubscribe",channel:ae}))},[]),W=d.useCallback(()=>{v([])},[]),Q=d.useCallback(()=>{S.current=!0,D(),U(),j.current&&(j.current.close(1e3,"Manual close"),j.current=null),h("disconnected")},[D,U]);return{events:g,connected:y==="connected",status:y,retryCount:w,subscribe:Z,unsubscribe:ee,clearEvents:W,close:Q}}const wv="/api";class Sv extends Error{constructor(c,u,o){super(`API Error ${c}: ${u}`),this.status=c,this.statusText=u,this.body=o,this.name="ApiError"}}function zv(l){const c=document.cookie.match(new RegExp(`(?:^|; )${l}=([^;]*)`));return c?decodeURIComponent(c[1]):null}async function I(l,c={}){const u=`${wv}${l}`,o={"Content-Type":"application/json",...c.headers},f=localStorage.getItem("nestor_token");f&&(o.Authorization=`Bearer ${f}`);const x=(c.method||"GET").toUpperCase();if(x!=="GET"&&x!=="HEAD"){const y=zv("nestor-csrf");y&&(o["X-CSRF-Token"]=y)}const g=localStorage.getItem("nestor_tenant_id");g&&(o["X-Tenant-ID"]=g);const v=await fetch(u,{...c,headers:o});if(!v.ok){let y;try{y=await v.json()}catch{y=await v.text()}throw new Sv(v.status,v.statusText,y)}if(v.status!==204)return v.json()}const Ns={list:l=>{const c=new URLSearchParams;l!=null&&l.limit&&c.set("limit",String(l.limit)),l!=null&&l.offset&&c.set("offset",String(l.offset));const u=c.toString();return I(`/agents${u?`?${u}`:""}`)},get:l=>I(`/agents/${l}`),create:l=>I("/agents",{method:"POST",body:JSON.stringify(l)}),update:(l,c)=>I(`/agents/${l}`,{method:"PATCH",body:JSON.stringify(c)}),delete:l=>I(`/agents/${l}`,{method:"DELETE"}),run:(l,c)=>I(`/agents/${l}/run`,{method:"POST",body:JSON.stringify({prompt:c})}),getStatus:l=>I(`/agents/${l}/status`),start:(l,c="daemon")=>I(`/agents/${l}/start`,{method:"POST",body:JSON.stringify({mode:c})}),stop:l=>I(`/agents/${l}/stop`,{method:"POST"})},Bu={list:l=>{const c=new URLSearchParams;l!=null&&l.limit&&c.set("limit",String(l.limit)),l!=null&&l.offset&&c.set("offset",String(l.offset));const u=c.toString();return I(`/workflows${u?`?${u}`:""}`)},get:l=>I(`/workflows/${l}`),create:l=>I("/workflows",{method:"POST",body:JSON.stringify(l)}),run:(l,c={})=>I(`/workflows/${l}/run`,{method:"POST",body:JSON.stringify({input:c})})},En={list:l=>{const c=new URLSearchParams;l!=null&&l.limit&&c.set("limit",String(l.limit)),l!=null&&l.offset&&c.set("offset",String(l.offset)),l!=null&&l.status&&c.set("status",l.status),l!=null&&l.agentId&&c.set("agentId",l.agentId),l!=null&&l.workflowId&&c.set("workflowId",l.workflowId);const u=c.toString();return I(`/runs${u?`?${u}`:""}`)},get:l=>I(`/runs/${l}`),getEvents:l=>I(`/runs/${l}/events`),abort:l=>I(`/runs/${l}/abort`,{method:"POST"}),delete:l=>I(`/runs/${l}`,{method:"DELETE"})},yc={list:l=>{const c=new URLSearchParams;l!=null&&l.limit&&c.set("limit",String(l.limit)),l!=null&&l.offset&&c.set("offset",String(l.offset));const u=c.toString();return I(`/skills${u?`?${u}`:""}`)},install:l=>I("/skills/install",{method:"POST",body:JSON.stringify(l)}),scan:l=>I("/skills/scan",{method:"POST",body:JSON.stringify({path:l})}),delete:l=>I(`/skills/${l}`,{method:"DELETE"})},la={stats:()=>I("/system/stats"),health:()=>I("/health"),getConfig:()=>I("/system/config"),updateConfig:l=>I("/system/config",{method:"PUT",body:JSON.stringify(l)})},rc={summary:l=>{const c=new URLSearchParams;l!=null&&l.from&&c.set("from",String(l.from)),l!=null&&l.to&&c.set("to",String(l.to)),l!=null&&l.agentId&&c.set("agentId",l.agentId);const u=c.toString();return I(`/analytics/summary${u?`?${u}`:""}`)},daily:(l=30)=>I(`/analytics/daily?days=${l}`),budget:()=>I("/analytics/budget"),estimate:()=>I("/analytics/estimate"),agentBreakdown:l=>I(`/analytics/agents/${l}`),qualityOverview:(l=30)=>I(`/analytics/quality?days=${l}`),qualityAgent:(l,c=30)=>I(`/analytics/quality/${l}?days=${c}`)},mu={list:l=>{const c=new URLSearchParams;l!=null&&l.limit&&c.set("limit",String(l.limit)),l!=null&&l.status&&c.set("status",l.status);const u=c.toString();return I(`/traces${u?`?${u}`:""}`)},get:l=>I(`/traces/${l}`),clear:()=>I("/traces",{method:"DELETE"})},rh={list:()=>I("/tenants"),get:l=>I(`/tenants/${l}`),create:l=>I("/tenants",{method:"POST",body:JSON.stringify(l)}),update:(l,c)=>I(`/tenants/${l}`,{method:"PUT",body:JSON.stringify(c)}),delete:l=>I(`/tenants/${l}`,{method:"DELETE"}),switch:l=>I(`/tenants/${l}/switch`,{method:"POST"})},Al={tree:()=>I("/goals"),get:l=>I(`/goals/${l}`),create:l=>I("/goals",{method:"POST",body:JSON.stringify(l)}),update:(l,c)=>I(`/goals/${l}`,{method:"PUT",body:JSON.stringify(c)}),delete:l=>I(`/goals/${l}`,{method:"DELETE"}),ancestry:l=>I(`/goals/${l}/ancestry`),assign:(l,c)=>I(`/goals/${l}/assign/${c}`,{method:"POST"}),agentGoals:l=>I(`/agents/${l}/goals`)},El={list:l=>{const c=new URLSearchParams;l!=null&&l.status&&c.set("status",l.status),l!=null&&l.agentId&&c.set("agentId",l.agentId),l!=null&&l.type&&c.set("type",l.type),l!=null&&l.limit&&c.set("limit",String(l.limit)),l!=null&&l.offset&&c.set("offset",String(l.offset));const u=c.toString();return I(`/approvals${u?`?${u}`:""}`)},create:l=>I("/approvals",{method:"POST",body:JSON.stringify(l)}),get:l=>I(`/approvals/${l}`),approve:(l,c)=>I(`/approvals/${l}/approve`,{method:"POST",body:JSON.stringify({decidedBy:(c==null?void 0:c.reviewerId)??"user",comment:c==null?void 0:c.comment})}),reject:(l,c)=>I(`/approvals/${l}/reject`,{method:"POST",body:JSON.stringify({decidedBy:(c==null?void 0:c.reviewerId)??"user",reason:c==null?void 0:c.reason})}),history:l=>{const c=new URLSearchParams;l!=null&&l.limit&&c.set("limit",String(l.limit)),l!=null&&l.agentId&&c.set("agentId",l.agentId);const u=c.toString();return I(`/approvals/history${u?`?${u}`:""}`)},stats:()=>I("/approvals/stats")},fu={forRun:l=>I(`/runs/${l}/annotations`),create:(l,c)=>I(`/runs/${l}/annotate`,{method:"POST",body:JSON.stringify(c)}),delete:l=>I(`/annotations/${l}`,{method:"DELETE"})},Sc={list:l=>{const c=new URLSearchParams;l!=null&&l.status&&c.set("status",l.status);const u=c.toString();return I(`/handoffs${u?`?${u}`:""}`)},get:l=>I(`/handoffs/${l}`),create:(l,c)=>I(`/runs/${l}/handoff`,{method:"POST",body:JSON.stringify(c)}),resume:(l,c)=>I(`/handoffs/${l}/resume`,{method:"POST",body:JSON.stringify({humanResolution:c})})},ut={overview:()=>I("/admin/overview"),tenants:{list:()=>I("/tenants"),create:l=>I("/tenants",{method:"POST",body:JSON.stringify(l)}),get:l=>I(`/tenants/${l}`),update:(l,c)=>I(`/tenants/${l}`,{method:"PUT",body:JSON.stringify(c)})},users:{list:l=>{const c=new URLSearchParams;l!=null&&l.tenantId&&c.set("tenantId",l.tenantId),l!=null&&l.role&&c.set("role",l.role);const u=c.toString();return I(`/users${u?`?${u}`:""}`)},updateRole:(l,c)=>I(`/users/${l}`,{method:"PATCH",body:JSON.stringify({role:c})}),lock:l=>I(`/users/${l}`,{method:"PATCH",body:JSON.stringify({isActive:!1})}),unlock:l=>I(`/users/${l}`,{method:"PATCH",body:JSON.stringify({isActive:!0})})},system:{info:()=>I("/admin/system-info"),dbStats:()=>I("/admin/db-stats"),rateLimitStats:()=>I("/admin/rate-limit-stats")},audit:{query:l=>{const c=new URLSearchParams;l!=null&&l.userId&&c.set("userId",l.userId),l!=null&&l.resourceType&&c.set("resourceType",l.resourceType),l!=null&&l.action&&c.set("action",l.action),l!=null&&l.limit&&c.set("limit",String(l.limit));const u=c.toString();return I(`/users/audit${u?`?${u}`:""}`)},export:l=>I(`/users/audit?limit=10000&format=${l}`)},security:{failedLogins:(l=24)=>I(`/admin/security/failed-logins?hours=${l}`),lockedAccounts:()=>I("/admin/security/locked-accounts"),activeSessions:()=>I("/admin/security/active-sessions"),rateLimitViolations:(l=100)=>I(`/admin/security/rate-violations?limit=${l}`)}};function kv({onMenuClick:l,showMenu:c}){const{lang:u,setLang:o,t:f}=Ke(),{connected:x}=Uu(),[g,v]=d.useState([]),[y,h]=d.useState(()=>localStorage.getItem("nestor_tenant_id")??"default"),[w,b]=d.useState(!1),[j,A]=d.useState(!1),z=d.useRef(null),N=d.useRef(null),S=g.find(E=>E.id===y)??null,k=d.useCallback(async()=>{try{const E=await rh.list();v(E.data)}catch{}},[]);d.useEffect(()=>{k()},[k]),d.useEffect(()=>{const E=F=>{z.current&&!z.current.contains(F.target)&&b(!1),N.current&&!N.current.contains(F.target)&&A(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);const D=async E=>{try{await rh.switch(E.id),localStorage.setItem("nestor_tenant_id",E.id),h(E.id),b(!1),window.location.reload()}catch(F){console.error("Failed to switch tenant:",F)}},U=Object.keys(Nu);return a.jsxs("header",{className:"header sticky top-0 z-20 flex h-14 items-center justify-between border-b border-border bg-[#0a0a0f]/80 px-6 backdrop-blur-sm",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[c&&a.jsx("button",{onClick:l,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors","aria-label":"Toggle menu",children:a.jsx($b,{className:"h-5 w-5 text-zinc-400"})}),a.jsxs("div",{className:"relative max-w-md flex-1",children:[a.jsx(Ul,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),a.jsx("input",{type:"text",placeholder:f("common.search"),className:"input pl-9 max-w-sm"})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[g.length>0&&a.jsxs("div",{className:"relative hidden sm:block",ref:z,children:[a.jsxs("button",{onClick:()=>b(!w),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-1.5 text-sm transition-colors hover:border-zinc-600",children:[a.jsx(Mu,{className:"h-3.5 w-3.5 text-indigo-400"}),a.jsx("span",{className:"text-zinc-200 max-w-[120px] truncate",children:(S==null?void 0:S.name)??"Default"}),a.jsx(Rl,{className:`h-3.5 w-3.5 text-zinc-500 transition-transform ${w?"rotate-180":""}`})]}),w&&a.jsxs("div",{className:"absolute right-0 top-full mt-1 w-56 rounded-lg border border-border bg-surface shadow-xl z-50",children:[a.jsx("div",{className:"px-3 py-2 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Switch Tenant"}),a.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:g.map(E=>a.jsxs("button",{onClick:()=>D(E),className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-zinc-300 transition-colors hover:bg-surface-hover",children:[E.id===y?a.jsx(vs,{className:"h-3.5 w-3.5 text-indigo-400"}):a.jsx("div",{className:"h-3.5 w-3.5"}),a.jsxs("div",{className:"flex-1 text-left",children:[a.jsx("div",{className:"font-medium",children:E.name}),a.jsx("div",{className:"text-xs text-zinc-500",children:E.slug})]})]},E.id))})]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[x?a.jsx(nv,{className:"h-4 w-4 text-green-400"}):a.jsx(av,{className:"h-4 w-4 text-zinc-500"}),a.jsx("span",{className:`text-xs hidden sm:inline ${x?"text-green-400":"text-zinc-500"}`,children:x?"Connected":"Offline"})]}),a.jsxs("div",{className:"relative",ref:N,children:[a.jsxs("button",{onClick:()=>A(!j),className:"btn-ghost btn-sm flex items-center gap-1.5",title:"Switch language",children:[a.jsx(Zh,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs uppercase",children:u}),a.jsx(Rl,{className:`h-3 w-3 text-zinc-500 transition-transform ${j?"rotate-180":""}`})]}),j&&a.jsx("div",{className:"absolute right-0 top-full mt-1 w-48 rounded-lg border border-border bg-surface shadow-xl z-50 max-h-80 overflow-y-auto",children:U.map(E=>a.jsxs("button",{onClick:()=>{o(E),A(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-zinc-300 transition-colors hover:bg-surface-hover",children:[E===u?a.jsx(vs,{className:"h-3.5 w-3.5 text-indigo-400"}):a.jsx("div",{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"flex-1 text-left",children:Nu[E]}),a.jsx("span",{className:"text-xs text-zinc-500 uppercase",children:E})]},E))})]})]})]})}const Cv=[{to:"/",icon:Ec,labelKey:"nav.dashboard"},{to:"/agents",icon:Ca,labelKey:"nav.agents"},{to:"/runs",icon:dt,labelKey:"nav.runs"},{to:"/approvals",icon:Mc,labelKey:"nav.approvals"},{to:"/settings",icon:Bl,labelKey:"nav.settings"}];function Av(){const{t:l}=Ke();return a.jsx("nav",{className:"mobile-bottom-nav",children:Cv.map(c=>{const u=c.icon;return a.jsxs(vc,{to:c.to,end:c.to==="/",className:({isActive:o})=>`mobile-bottom-nav-item ${o?"active":""}`,children:[a.jsx(u,{className:"h-5 w-5"}),a.jsx("span",{className:"mobile-bottom-nav-label",children:l(c.labelKey)})]},c.to)})})}function Ev(){const[l,c]=d.useState(!1),[u,o]=d.useState(!1);d.useEffect(()=>{const x=()=>o(window.innerWidth<769);return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const f=()=>{u&&c(!1)};return a.jsxs("div",{className:"flex min-h-screen bg-[#0a0a0f]",children:[u&&l&&a.jsx("div",{className:"sidebar-overlay",onClick:()=>c(!1)}),a.jsx("div",{className:`sidebar ${u&&l?"open":""}`,children:a.jsx(xv,{onNavigate:f})}),a.jsxs("div",{className:`flex flex-1 flex-col ${u?"":"pl-60"}`,children:[a.jsx(kv,{onMenuClick:()=>c(!l),showMenu:u}),a.jsx("main",{className:`main-content flex-1 p-6 ${u?"pb-20":""}`,children:a.jsx(Vy,{})}),u&&a.jsx(Av,{})]})]})}class Tv extends d.Component{constructor(){super(...arguments);tu(this,"state",{hasError:!1,error:null});tu(this,"handleReset",()=>{this.setState({hasError:!1,error:null})})}static getDerivedStateFromError(u){return{hasError:!0,error:u}}componentDidCatch(u,o){var f,x;console.error("[Nestor] UI Error:",u,o),(x=(f=this.props).onError)==null||x.call(f,u,o)}render(){var u;return this.state.hasError?this.props.fallback?this.props.fallback:a.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8",children:[a.jsx("div",{className:"text-red-500 text-xl mb-4",children:"Something went wrong"}),a.jsx("pre",{className:"bg-gray-100 dark:bg-gray-800 p-4 rounded-lg text-sm max-w-lg overflow-auto mb-4",children:(u=this.state.error)==null?void 0:u.message}),a.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Try Again"})]}):this.props.children}}function Rv(){const l=ca();return a.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-8 text-center",children:[a.jsx("div",{className:"w-16 h-16 mb-6 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:a.jsx("svg",{className:"w-8 h-8 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),a.jsx("h2",{className:"text-2xl font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Page Error"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-8 max-w-md",children:"An unexpected error occurred while rendering this page. The error has been logged for investigation."}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:"Reload Page"}),a.jsx("button",{onClick:()=>l("/"),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Go Home"})]})]})}const Mv={node_started:{icon:dt,color:"text-blue-400"},node_completed:{icon:tt,color:"text-green-400"},node_failed:{icon:Ot,color:"text-red-400"},tool_call_requested:{icon:Lc,color:"text-amber-400"},tool_call_approved:{icon:tt,color:"text-green-400"},tool_call_denied:{icon:ia,color:"text-red-400"},tool_call_completed:{icon:tt,color:"text-emerald-400"},approval_requested:{icon:ia,color:"text-amber-400"},approval_resolved:{icon:tt,color:"text-green-400"},budget_warning:{icon:ft,color:"text-amber-400"},budget_exceeded:{icon:Ra,color:"text-red-400"},run_paused:{icon:Tc,color:"text-blue-400"},run_resumed:{icon:Fh,color:"text-blue-400"}};function Dv(l){try{return new Date(l).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return l}}function Ov(l,c){switch(l){case"node_started":return`Node started: ${c.nodeId??c.label??""}`;case"node_completed":return`Node completed: ${c.nodeId??c.label??""}`;case"node_failed":return`Node failed: ${c.error??c.nodeId??""}`;case"tool_call_requested":return`Tool call: ${c.toolName??""}`;case"tool_call_approved":return`Tool approved: ${c.toolName??""}`;case"tool_call_denied":return`Tool denied: ${c.toolName??""}`;case"tool_call_completed":return`Tool completed: ${c.toolName??""}`;case"approval_requested":return`Approval required: ${c.toolName??c.action??""}`;case"approval_resolved":return`Approval resolved: ${c.decision??""}`;case"budget_warning":return`Budget warning: ${c.percent??""}% used`;case"budget_exceeded":return"Budget exceeded";case"run_paused":return"Run paused";case"run_resumed":return"Run resumed";default:return l.replace(/_/g," ")}}function Hu({events:l,maxHeight:c="400px"}){return l.length===0?a.jsxs("div",{className:"flex items-center justify-center py-8 text-sm text-zinc-500",children:[a.jsx(js,{className:"mr-2 h-4 w-4"}),"Waiting for events..."]}):a.jsx("div",{className:"overflow-y-auto",style:{maxHeight:c},children:a.jsx("div",{className:"space-y-0.5",children:[...l].reverse().map(u=>{const o=Mv[u.type]??{icon:Lc,color:"text-zinc-400"},f=o.icon;return a.jsxs("div",{className:"flex items-start gap-3 rounded-lg px-3 py-2 hover:bg-surface-hover transition-colors",children:[a.jsx("div",{className:`mt-0.5 flex-shrink-0 ${o.color}`,children:a.jsx(f,{className:"h-4 w-4"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-sm text-zinc-300 truncate",children:Ov(u.type,u.data)}),u.nodeId&&a.jsxs("p",{className:"text-xs text-zinc-500 truncate",children:["Node: ",u.nodeId]})]}),a.jsx("time",{className:"flex-shrink-0 text-xs text-zinc-500",children:Dv(u.timestamp)})]},u.id)})})})}function oc({label:l,value:c,icon:u,color:o,bgColor:f}){return a.jsx("div",{className:"card",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-zinc-400",children:l}),a.jsx("p",{className:"mt-1 text-2xl font-semibold text-white",children:c})]}),a.jsx("div",{className:`flex h-11 w-11 items-center justify-center rounded-xl ${f}`,children:a.jsx(u,{className:`h-5 w-5 ${o}`})})]})})}function Lv(){const{t:l}=Ke(),{events:c}=Uu(),[u,o]=d.useState(null),[f,x]=d.useState("healthy"),[g,v]=d.useState(!0),[y,h]=d.useState(null);d.useEffect(()=>{la.stats().then(z=>{o(z.data),x("healthy"),h(null)}).catch(z=>{x("down"),h(z instanceof Error?z.message:"Failed to connect to server")}).finally(()=>{v(!1)}),la.health().then(z=>{x(z.status==="healthy"?"healthy":"degraded")}).catch(()=>{x("down")})},[]),d.useEffect(()=>{c.length!==0&&la.stats().then(z=>o(z.data)).catch(()=>{})},[c.length]);const b={healthy:{icon:tt,color:"text-green-400",bg:"bg-green-500/10",label:"All systems operational"},degraded:{icon:ft,color:"text-amber-400",bg:"bg-amber-500/10",label:"Some services degraded"},down:{icon:Ot,color:"text-red-400",bg:"bg-red-500/10",label:"Services unavailable"}}[f],j=b.icon,A=c.map((z,N)=>{var S;return{id:String(N),type:typeof z.data=="object"&&z.data!==null&&"kind"in z.data?z.data.kind:z.channel,data:z.data??{},timestamp:((S=z.data)==null?void 0:S.timestamp)??new Date().toISOString()}});return g?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:l("dashboard.title")}),y&&a.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:["Unable to connect to the Nestor server. Make sure the server is running.",a.jsx("span",{className:"ml-2 text-xs text-red-500/70",children:y})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsx(oc,{label:l("dashboard.activeAgents"),value:(u==null?void 0:u.agents.total)??0,icon:Ca,color:"text-indigo-400",bgColor:"bg-indigo-500/10"}),a.jsx(oc,{label:l("dashboard.runningTasks"),value:(u==null?void 0:u.runs.running)??0,icon:dt,color:"text-emerald-400",bgColor:"bg-emerald-500/10"}),a.jsx(oc,{label:l("dashboard.costToday"),value:"$0.00",icon:Ra,color:"text-amber-400",bgColor:"bg-amber-500/10"}),a.jsx(oc,{label:l("dashboard.skillsInstalled"),value:(u==null?void 0:u.skills.total)??0,icon:Rc,color:"text-violet-400",bgColor:"bg-violet-500/10"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"card lg:col-span-2",children:[a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:l("dashboard.recentActivity")}),a.jsx(Dt,{className:"h-4 w-4 text-zinc-500"})]}),a.jsx(Hu,{events:A,maxHeight:"300px"})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:l("dashboard.quickActions")}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(cn,{to:"/agents",className:"btn-secondary w-full justify-start",children:[a.jsx(Nt,{className:"h-4 w-4"}),l("dashboard.createAgent")]}),a.jsxs(cn,{to:"/workflows",className:"btn-secondary w-full justify-start",children:[a.jsx(Nc,{className:"h-4 w-4"}),l("dashboard.runWorkflow")]}),a.jsxs(cn,{to:"/skills",className:"btn-secondary w-full justify-start",children:[a.jsx(yu,{className:"h-4 w-4"}),l("dashboard.installSkill")]})]})]}),a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:l("dashboard.systemHealth")}),a.jsxs("div",{className:`flex items-center gap-3 rounded-lg p-3 ${b.bg}`,children:[a.jsx(j,{className:`h-5 w-5 ${b.color}`}),a.jsxs("div",{children:[a.jsx("p",{className:`text-sm font-medium ${b.color}`,children:b.label}),a.jsx("p",{className:"text-xs text-zinc-500",children:u?`${u.agents.total} agents | ${u.workflows.total} workflows | ${u.runs.today} runs today`:"Loading..."})]})]}),(u==null?void 0:u.server)&&a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[a.jsxs("div",{className:"rounded bg-[#0a0a0f] p-2",children:[a.jsx("span",{className:"text-zinc-500",children:"Version"}),a.jsx("p",{className:"text-zinc-300 font-mono",children:u.server.version})]}),a.jsxs("div",{className:"rounded bg-[#0a0a0f] p-2",children:[a.jsx("span",{className:"text-zinc-500",children:"Uptime"}),a.jsxs("p",{className:"text-zinc-300 font-mono",children:[Math.floor(u.server.uptime/3600),"h ",Math.floor(u.server.uptime%3600/60),"m"]})]}),a.jsxs("div",{className:"rounded bg-[#0a0a0f] p-2",children:[a.jsx("span",{className:"text-zinc-500",children:"Memory (RSS)"}),a.jsxs("p",{className:"text-zinc-300 font-mono",children:[u.server.memoryUsage.rss," MB"]})]}),a.jsxs("div",{className:"rounded bg-[#0a0a0f] p-2",children:[a.jsx("span",{className:"text-zinc-500",children:"WS Connections"}),a.jsx("p",{className:"text-zinc-300 font-mono",children:u.websocket.connections})]})]})]})]})]})]})}function _v(){const[l,c]=d.useState([]),[u,o]=d.useState(!0),[f,x]=d.useState(null),g=d.useCallback(async()=>{o(!0),x(null);try{const v=await Ns.list({limit:200});c(v.data)}catch(v){x(v instanceof Error?v.message:"Failed to fetch agents")}finally{o(!1)}},[]);return d.useEffect(()=>{g()},[g]),{agents:l,loading:u,error:f,refetch:g}}function Uv(l){const[c,u]=d.useState(null),[o,f]=d.useState(!0),[x,g]=d.useState(null),v=d.useCallback(async()=>{if(l){f(!0),g(null);try{const y=await Ns.get(l);u(y.data)}catch(y){g(y instanceof Error?y.message:"Failed to fetch agent")}finally{f(!1)}}},[l]);return d.useEffect(()=>{v()},[v]),{agent:c,loading:o,error:x,refetch:v}}const oh={running:{bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"bg-emerald-400"},completed:{bg:"bg-green-500/10",text:"text-green-400",dot:"bg-green-400"},failed:{bg:"bg-red-500/10",text:"text-red-400",dot:"bg-red-400"},pending:{bg:"bg-amber-500/10",text:"text-amber-400",dot:"bg-amber-400"},paused:{bg:"bg-blue-500/10",text:"text-blue-400",dot:"bg-blue-400"},cancelled:{bg:"bg-zinc-500/10",text:"text-zinc-400",dot:"bg-zinc-400"},idle:{bg:"bg-zinc-500/10",text:"text-zinc-500",dot:"bg-zinc-500"}};function ql({status:l,pulse:c}){const{t:u}=Ke(),o=oh[l]??oh.idle;return a.jsxs("span",{className:`badge ${o.bg} ${o.text}`,children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${o.dot} ${c&&l==="running"?"animate-pulse":""}`}),u(`status.${l}`)]})}const Bv={builtin:{bg:"bg-indigo-500/10",text:"text-indigo-400"},official:{bg:"bg-blue-500/10",text:"text-blue-400"},trusted:{bg:"bg-emerald-500/10",text:"text-emerald-400"},community:{bg:"bg-amber-500/10",text:"text-amber-400"},local:{bg:"bg-zinc-500/10",text:"text-zinc-400"}};function qu({level:l}){const{t:c}=Ke(),u=Bv[l];return a.jsxs("span",{className:`badge ${u.bg} ${u.text}`,children:[l==="builtin"||l==="official"?a.jsx("svg",{className:"h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):null,c(`trust.${l}`)]})}function Ph({spent:l,limit:c,currency:u="$"}){const o=c>0?Math.min(l/c*100,100):0,f=o>=75,x=o>=90,g=x?"bg-red-500":f?"bg-amber-500":"bg-indigo-500";return a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsxs("span",{className:"text-zinc-400",children:[u,l.toFixed(2)," / ",u,c.toFixed(2)]}),a.jsxs("span",{className:`font-medium ${x?"text-red-400":f?"text-amber-400":"text-zinc-400"}`,children:[o.toFixed(0),"%"]})]}),a.jsx("div",{className:"h-1.5 w-full rounded-full bg-zinc-800",children:a.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${g}`,style:{width:`${o}%`}})})]})}const Hv={anthropic:Ca,openai:Ca,local:Db};function qv({agent:l,status:c="idle",budgetSpent:u=0,budgetLimit:o=10}){const f=Hv[l.adapterType]??Ca;return a.jsxs(cn,{to:`/agents/${l.id}`,className:"card group hover:border-indigo-500/30 hover:bg-surface-hover transition-all duration-200",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-500/10 text-indigo-400 group-hover:bg-indigo-500/20 transition-colors",children:a.jsx(f,{className:"h-5 w-5"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-zinc-200 group-hover:text-white transition-colors",children:l.name}),a.jsxs("p",{className:"text-xs text-zinc-500",children:[l.adapterType," ",l.adapterConfig.model?`/ ${l.adapterConfig.model}`:""]})]})]}),a.jsx(ql,{status:c,pulse:!0})]}),l.description&&a.jsx("p",{className:"mt-3 text-sm text-zinc-400 line-clamp-2",children:l.description}),a.jsx("div",{className:"mt-4 flex items-center justify-between",children:a.jsx(qu,{level:l.trustLevel})}),a.jsx("div",{className:"mt-3",children:a.jsx(Ph,{spent:u,limit:o})})]})}function Tn({icon:l,title:c,description:u,action:o}){return a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[a.jsx("div",{className:"mb-4 rounded-2xl bg-surface p-4 text-zinc-500",children:l??a.jsx(Lb,{className:"h-8 w-8"})}),a.jsx("h3",{className:"text-lg font-medium text-zinc-300",children:c}),u&&a.jsx("p",{className:"mt-1.5 max-w-sm text-sm text-zinc-500",children:u}),o&&a.jsx("div",{className:"mt-4",children:o})]})}function $v(){const{t:l}=Ke(),{agents:c,loading:u,error:o,refetch:f}=_v(),[x,g]=d.useState(!1),[v,y]=d.useState(!1),[h,w]=d.useState({name:"",description:"",adapterType:"anthropic",model:"",trustLevel:"community"}),b=async()=>{if(h.name.trim()){y(!0);try{await Ns.create({name:h.name,description:h.description||void 0,adapterType:h.adapterType,adapterConfig:h.model?{model:h.model}:{},trustLevel:h.trustLevel}),g(!1),w({name:"",description:"",adapterType:"anthropic",model:"",trustLevel:"community"}),f()}catch(j){console.error("Failed to create agent:",j)}finally{y(!1)}}};return u?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:l("agents.title")}),a.jsxs("button",{onClick:()=>g(!0),className:"btn-primary",children:[a.jsx(Nt,{className:"h-4 w-4"}),l("agents.create")]})]}),o&&a.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[o,a.jsx("button",{onClick:f,className:"ml-3 underline",children:"Retry"})]}),c.length===0&&!o?a.jsx(Tn,{icon:a.jsx(Ca,{className:"h-8 w-8"}),title:l("agents.empty"),description:l("agents.emptyDesc"),action:a.jsxs("button",{onClick:()=>g(!0),className:"btn-primary",children:[a.jsx(Nt,{className:"h-4 w-4"}),l("agents.create")]})}):a.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:c.map(j=>a.jsx(qv,{agent:j},j.id))}),x&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-5",children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:l("agents.create")}),a.jsx("button",{onClick:()=>g(!1),className:"btn-ghost btn-sm",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:l("common.name")}),a.jsx("input",{className:"input",value:h.name,onChange:j=>w({...h,name:j.target.value}),placeholder:"My Agent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:l("common.description")}),a.jsx("textarea",{className:"input min-h-[80px] resize-none",value:h.description,onChange:j=>w({...h,description:j.target.value}),placeholder:"What does this agent do?"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Adapter"}),a.jsxs("select",{className:"input",value:h.adapterType,onChange:j=>w({...h,adapterType:j.target.value}),children:[a.jsx("option",{value:"anthropic",children:"Anthropic"}),a.jsx("option",{value:"openai",children:"OpenAI"}),a.jsx("option",{value:"ollama",children:"Ollama"}),a.jsx("option",{value:"local",children:"Local"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Model"}),a.jsx("input",{className:"input",value:h.model,onChange:j=>w({...h,model:j.target.value}),placeholder:"claude-sonnet-4-20250514"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Trust Level"}),a.jsxs("select",{className:"input",value:h.trustLevel,onChange:j=>w({...h,trustLevel:j.target.value}),children:[a.jsx("option",{value:"builtin",children:"Built-in"}),a.jsx("option",{value:"official",children:"Official"}),a.jsx("option",{value:"trusted",children:"Trusted"}),a.jsx("option",{value:"community",children:"Community"}),a.jsx("option",{value:"local",children:"Local"})]})]})]}),a.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[a.jsx("button",{onClick:()=>g(!1),className:"btn-secondary",children:l("common.cancel")}),a.jsx("button",{onClick:b,disabled:!h.name.trim()||v,className:"btn-primary",children:l(v?"common.loading":"agents.create")})]})]})})]})}const Gv="/api";async function Vv(l){const c=localStorage.getItem("nestor_token"),u={"Content-Type":"application/json"};c&&(u.Authorization=`Bearer ${c}`);const o=localStorage.getItem("nestor_tenant_id");o&&(u["X-Tenant-ID"]=o);try{const f=await fetch(`${Gv}/agents/${l}/quality`,{headers:u});return f.ok?(await f.json()).data??null:null}catch{return null}}function uh(l){return`${(l*100).toFixed(0)}%`}function uc({icon:l,label:c,value:u,subtext:o,color:f}){return a.jsxs("div",{className:"rounded-lg bg-zinc-800/50 p-4 border border-zinc-700/50",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(l,{className:`h-4 w-4 ${f}`}),a.jsx("span",{className:"text-xs text-zinc-500 uppercase tracking-wide",children:c})]}),a.jsx("p",{className:`text-2xl font-bold ${f}`,children:u}),o&&a.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:o})]})}function Yv({agentId:l}){const[c,u]=d.useState(null),[o,f]=d.useState(!0),x=d.useCallback(async()=>{f(!0);const N=await Vv(l);u(N),f(!1)},[l]);if(d.useEffect(()=>{x()},[x]),o)return a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:"Quality"}),a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})})]});if(!c)return a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:"Quality"}),a.jsx("p",{className:"text-sm text-zinc-500",children:"No quality data available yet."})]});const g=c.satisfactionRate>=.8?"text-green-400":c.satisfactionRate>=.5?"text-yellow-400":"text-red-400",v=c.successRate>=.8?"text-green-400":c.successRate>=.5?"text-yellow-400":"text-red-400",y=c.recentFeedback.filter(N=>N.rating===1).length,h=c.recentFeedback.length,w=h>0?y/h:0,b=c.satisfactionRate,j=h<3?"stable":w>b+.1?"improving":w<b-.1?"declining":"stable",A=j==="improving"?_u:j==="declining"?ev:Gb,z=j==="improving"?"text-green-400":j==="declining"?"text-red-400":"text-zinc-400";return a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Quality"}),a.jsxs("div",{className:`flex items-center gap-1 text-xs ${z}`,children:[a.jsx(A,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"capitalize",children:j})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[a.jsx(uc,{icon:Dl,label:"Satisfaction",value:uh(c.satisfactionRate),subtext:`${c.positiveFeedback}/${c.totalFeedback} positive`,color:g}),a.jsx(uc,{icon:tt,label:"Success Rate",value:uh(c.successRate),subtext:`${c.completedRuns} completed, ${c.failedRuns} failed`,color:v}),a.jsx(uc,{icon:Ra,label:"Avg Cost / Run",value:`$${c.avgCostPerRun.toFixed(4)}`,subtext:`${c.totalRuns} total runs`,color:"text-blue-400"}),a.jsx(uc,{icon:Aa,label:"Total Runs",value:c.totalRuns.toString(),subtext:`${c.totalFeedback} rated`,color:"text-indigo-400"})]}),c.recentFeedback.length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("h3",{className:"text-xs font-medium text-zinc-500 uppercase tracking-wide mb-2",children:"Recent Feedback"}),a.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:c.recentFeedback.slice(0,10).map((N,S)=>a.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[a.jsx("span",{className:N.rating===1?"text-green-400":"text-red-400",children:N.rating===1?"+":"-"}),a.jsx("span",{className:"text-zinc-400 flex-1",children:N.comment??(N.rating===1?"Positive":"Negative")}),a.jsx("span",{className:"text-zinc-600 shrink-0",children:new Date(N.createdAt).toLocaleDateString()})]},S))})]})]})}function Xv({event:l}){switch(l.type){case"tool_start":return a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-500/20 bg-amber-500/5 px-3 py-1.5",children:[a.jsx(Oc,{className:"h-3.5 w-3.5 text-amber-400"}),a.jsx("span",{className:"text-xs text-amber-300 font-medium",children:l.name}),a.jsx(Ub,{className:"h-3 w-3 text-amber-400 animate-spin"})]});case"tool_result":return a.jsxs("div",{className:`flex items-center gap-2 rounded-md border px-3 py-1.5 ${l.success?"border-emerald-500/20 bg-emerald-500/5":"border-red-500/20 bg-red-500/5"}`,children:[l.success?a.jsx(tt,{className:"h-3.5 w-3.5 text-emerald-400"}):a.jsx(Ot,{className:"h-3.5 w-3.5 text-red-400"}),a.jsxs("span",{className:`text-xs font-medium ${l.success?"text-emerald-300":"text-red-300"}`,children:[l.name," ",l.success?"completed":"failed"]})]});case"reasoning":return a.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-yellow-500/20 bg-yellow-500/5 px-3 py-1.5",children:[a.jsx(bu,{className:"h-3.5 w-3.5 text-yellow-400 mt-0.5 shrink-0"}),a.jsxs("div",{className:"min-w-0",children:[l.phase&&a.jsx("span",{className:"text-[10px] uppercase text-yellow-600 font-mono",children:l.phase}),a.jsx("p",{className:"text-xs text-yellow-200/80 break-words",children:l.reasoning}),l.confidence!=null&&a.jsxs("span",{className:"text-[10px] text-yellow-600",children:["confidence: ",(l.confidence*100).toFixed(0),"%"]})]})]});case"error":return a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-red-500/20 bg-red-500/5 px-3 py-1.5",children:[a.jsx(Ot,{className:"h-3.5 w-3.5 text-red-400"}),a.jsx("span",{className:"text-xs text-red-300",children:l.text})]});default:return null}}function Qv({runId:l,onComplete:c}){const[u,o]=d.useState(""),[f,x]=d.useState([]),[g,v]=d.useState(!0),y=d.useRef(null),h=d.useRef(0),{subscribe:w,unsubscribe:b,events:j,connected:A}=Uu([`run:${l}`]);return d.useEffect(()=>(A&&w(`run:${l}`),()=>{b(`run:${l}`)}),[A,l,w,b]),d.useEffect(()=>{for(const z of j){if(z.channel!==`run:${l}`)continue;const N=z.data;if(!N||N.runId!==l)continue;const S=N.type,k=++h.current;switch(S){case"token":o(D=>D+(N.text??""));break;case"tool_start":x(D=>[...D,{id:k,type:"tool_start",name:N.name,args:N.args,timestamp:Date.now()}]);break;case"tool_result":x(D=>[...D,{id:k,type:"tool_result",name:N.name,result:N.result,success:N.success,timestamp:Date.now()}]);break;case"reasoning":{const D=N.entry;x(U=>[...U,{id:k,type:"reasoning",reasoning:(D==null?void 0:D.reasoning)??N.reasoning??"",phase:(D==null?void 0:D.phase)??void 0,confidence:(D==null?void 0:D.confidence)??void 0,timestamp:Date.now()}]);break}case"error":x(D=>[...D,{id:k,type:"error",text:N.message,timestamp:Date.now()}]);break;case"done":v(!1),c==null||c();break}}},[j,l,c]),d.useEffect(()=>{y.current&&(y.current.scrollTop=y.current.scrollHeight)},[u]),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Jh,{className:`h-3.5 w-3.5 ${g?"text-green-400 animate-pulse":"text-zinc-500"}`}),a.jsx("span",{className:"text-xs font-medium text-zinc-400",children:g?"Live Output":"Run Completed"}),!A&&a.jsx("span",{className:"text-[10px] text-red-400 ml-auto",children:"Disconnected"})]}),a.jsx("div",{ref:y,className:"bg-gray-900 p-4 rounded-lg max-h-96 overflow-y-auto whitespace-pre-wrap font-mono text-sm text-zinc-200 border border-zinc-700",children:u||a.jsx("span",{className:"text-zinc-500 italic",children:g?"Waiting for output...":"No output produced."})}),f.length>0&&a.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:f.map(z=>a.jsx(Xv,{event:z},z.id))})]})}function Kv(){const{id:l}=ks(),c=ca(),{t:u}=Ke(),{agent:o,loading:f,error:x}=Uv(l),[g,v]=d.useState("overview"),[y,h]=d.useState(""),[w,b]=d.useState(!1),[j,A]=d.useState(null);if(f)return a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});if(x||!o)return a.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[a.jsx("p",{className:"text-red-400",children:x??"Agent not found"}),a.jsxs("button",{onClick:()=>c("/agents"),className:"btn-secondary mt-4",children:[a.jsx(bs,{className:"h-4 w-4"})," Back to Agents"]})]});const z=async()=>{var k;if(!(!y.trim()||!l)){b(!0);try{const D=await Ns.run(l,y),U=((k=D==null?void 0:D.data)==null?void 0:k.id)??null;A(U),h("")}catch(D){console.error("Run failed:",D)}finally{b(!1)}}},N=async()=>{if(l&&window.confirm(`Delete agent "${o.name}"?`))try{await Ns.delete(l),c("/agents")}catch(k){console.error("Delete failed:",k)}},S=[{key:"overview",label:u("agent.overview"),icon:Aa},{key:"quality",label:"Quality",icon:Dt},{key:"runs",label:u("agent.runs"),icon:dt},{key:"events",label:u("agent.events"),icon:Dt},{key:"configuration",label:u("agent.configuration"),icon:Bl}];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>c("/agents"),className:"btn-ghost btn-sm",children:a.jsx(bs,{className:"h-4 w-4"})}),a.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-indigo-500/10 text-indigo-400",children:a.jsx(Ca,{className:"h-6 w-6"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:o.name}),a.jsx(ql,{status:"idle"})]}),a.jsxs("p",{className:"text-sm text-zinc-400",children:[o.adapterType,o.adapterConfig.model?` / ${o.adapterConfig.model}`:"",a.jsx("span",{className:"mx-2 text-zinc-600",children:"|"}),a.jsx(qu,{level:o.trustLevel})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{className:"btn-secondary btn-sm",children:[a.jsx(dt,{className:"h-3.5 w-3.5"})," ",u("agent.start")]}),a.jsxs("button",{className:"btn-secondary btn-sm",children:[a.jsx(Zb,{className:"h-3.5 w-3.5"})," ",u("agent.stop")]}),a.jsxs("button",{onClick:N,className:"btn-danger btn-sm",children:[a.jsx(It,{className:"h-3.5 w-3.5"})," ",u("agent.delete")]})]})]}),a.jsx("div",{className:"card",children:a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Fb,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),a.jsx("input",{className:"input pl-9",placeholder:"Enter a prompt to run this agent...",value:y,onChange:k=>h(k.target.value),onKeyDown:k=>k.key==="Enter"&&z()})]}),a.jsxs("button",{onClick:z,disabled:!y.trim()||w,className:"btn-primary",children:[a.jsx(dt,{className:"h-4 w-4"}),u(w?"common.loading":"agent.run")]})]})}),j&&a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Jh,{className:"h-4 w-4 text-green-400 animate-pulse"}),a.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Live Output"}),a.jsxs("span",{className:"text-[10px] font-mono text-zinc-500",children:[j.slice(0,12),"..."]})]}),a.jsx("button",{onClick:()=>A(null),className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors",children:"Dismiss"})]}),a.jsx(Qv,{runId:j,onComplete:()=>{}})]}),a.jsx("div",{className:"flex gap-1 border-b border-border",children:S.map(({key:k,label:D,icon:U})=>a.jsxs("button",{onClick:()=>v(k),className:`flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-colors border-b-2 ${g===k?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-200"}`,children:[a.jsx(U,{className:"h-4 w-4"}),D]},k))}),g==="quality"&&l&&a.jsx(Yv,{agentId:l}),g==="overview"&&a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"mb-4 text-lg font-medium text-zinc-200",children:u("agent.budget")}),a.jsx(Ph,{spent:0,limit:10}),a.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"rounded-lg bg-[#0a0a0f] p-3",children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Total Spent"}),a.jsx("p",{className:"text-lg font-semibold text-white",children:"$0.00"})]}),a.jsxs("div",{className:"rounded-lg bg-[#0a0a0f] p-3",children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Runs Today"}),a.jsx("p",{className:"text-lg font-semibold text-white",children:"0"})]})]})]}),a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"mb-4 text-lg font-medium text-zinc-200",children:u("agent.recentRuns")}),a.jsx("p",{className:"text-sm text-zinc-500",children:"No runs recorded yet."})]}),o.description&&a.jsxs("div",{className:"card lg:col-span-2",children:[a.jsx("h3",{className:"mb-2 text-lg font-medium text-zinc-200",children:u("common.description")}),a.jsx("p",{className:"text-sm text-zinc-400",children:o.description})]})]}),g==="runs"&&a.jsx("div",{className:"card",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left",children:[a.jsx("th",{className:"pb-3 pr-4 text-zinc-400 font-medium",children:"Run ID"}),a.jsx("th",{className:"pb-3 pr-4 text-zinc-400 font-medium",children:u("common.status")}),a.jsx("th",{className:"pb-3 pr-4 text-zinc-400 font-medium",children:u("run.duration")}),a.jsx("th",{className:"pb-3 pr-4 text-zinc-400 font-medium",children:"Cost"}),a.jsx("th",{className:"pb-3 text-zinc-400 font-medium",children:u("common.created")})]})}),a.jsx("tbody",{children:a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"py-8 text-center text-zinc-500",children:"No runs recorded for this agent."})})})]})})}),g==="events"&&a.jsx("div",{className:"card",children:a.jsx(Hu,{events:[],maxHeight:"500px"})}),g==="configuration"&&a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"mb-4 text-lg font-medium text-zinc-200",children:"Agent Configuration"}),a.jsx("pre",{className:"overflow-auto rounded-lg bg-[#0a0a0f] p-4 text-sm text-zinc-300",children:JSON.stringify(o,null,2)})]})]})}function Zv(){const[l,c]=d.useState([]),[u,o]=d.useState(!0),[f,x]=d.useState(null),g=d.useCallback(async()=>{o(!0),x(null);try{const v=await Bu.list({limit:200});c(v.data)}catch(v){x(v instanceof Error?v.message:"Failed to fetch workflows")}finally{o(!1)}},[]);return d.useEffect(()=>{g()},[g]),{workflows:l,loading:u,error:f,refetch:g}}function Jv(l){const[c,u]=d.useState(null),[o,f]=d.useState(!0),[x,g]=d.useState(null),v=d.useCallback(async()=>{if(l){f(!0),g(null);try{const y=await Bu.get(l);u(y.data)}catch(y){g(y instanceof Error?y.message:"Failed to fetch workflow")}finally{f(!1)}}},[l]);return d.useEffect(()=>{v()},[v]),{workflow:c,loading:o,error:x,refetch:v}}function Fv(){const{t:l}=Ke(),{workflows:c,loading:u,error:o,refetch:f}=Zv(),[x,g]=d.useState(!1),[v,y]=d.useState(!1),[h,w]=d.useState({name:"",description:""}),b=async()=>{if(h.name.trim()){y(!0);try{const j={id:"start",type:"agent",label:"Start",config:{},next:[]};await Bu.create({name:h.name,description:h.description||void 0,nodes:[j],entryNodeId:"start"}),g(!1),w({name:"",description:""}),f()}catch(j){console.error("Failed to create workflow:",j)}finally{y(!1)}}};return u?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:l("workflows.title")}),a.jsxs("button",{onClick:()=>g(!0),className:"btn-primary",children:[a.jsx(Nt,{className:"h-4 w-4"}),l("workflows.create")]})]}),o&&a.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[o,a.jsx("button",{onClick:f,className:"ml-3 underline",children:"Retry"})]}),c.length===0&&!o?a.jsx(Tn,{icon:a.jsx(Nc,{className:"h-8 w-8"}),title:l("workflows.empty"),description:l("workflows.emptyDesc"),action:a.jsxs("button",{onClick:()=>g(!0),className:"btn-primary",children:[a.jsx(Nt,{className:"h-4 w-4"}),l("workflows.create")]})}):a.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:c.map(j=>a.jsxs("div",{className:"card group hover:border-indigo-500/30 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-blue-500/10 text-blue-400",children:a.jsx(Nc,{className:"h-5 w-5"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-zinc-200",children:j.name}),a.jsxs("p",{className:"text-xs text-zinc-500",children:["v",j.currentVersion]})]})]}),a.jsx(ql,{status:"idle"})]}),j.description&&a.jsx("p",{className:"mt-3 text-sm text-zinc-400 line-clamp-2",children:j.description}),a.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[a.jsxs("span",{className:"text-xs text-zinc-500",children:[l("common.updated"),": ",new Date(j.updatedAt).toLocaleDateString()]}),a.jsxs("div",{className:"flex gap-1.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[a.jsx(cn,{to:`/workflows/${j.id}/edit`,className:"btn-ghost btn-sm",children:a.jsx(Du,{className:"h-3.5 w-3.5"})}),a.jsx("button",{className:"btn-ghost btn-sm text-green-400",children:a.jsx(dt,{className:"h-3.5 w-3.5"})})]})]})]},j.id))}),x&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-5",children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:l("workflows.create")}),a.jsx("button",{onClick:()=>g(!1),className:"btn-ghost btn-sm",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:l("common.name")}),a.jsx("input",{className:"input",value:h.name,onChange:j=>w({...h,name:j.target.value}),placeholder:"My Workflow"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:l("common.description")}),a.jsx("textarea",{className:"input min-h-[80px] resize-none",value:h.description,onChange:j=>w({...h,description:j.target.value}),placeholder:"What does this workflow do?"})]})]}),a.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[a.jsx("button",{onClick:()=>g(!1),className:"btn-secondary",children:l("common.cancel")}),a.jsx("button",{onClick:b,disabled:!h.name.trim()||v,className:"btn-primary",children:l(v?"common.loading":"workflows.create")})]})]})})]})}const dh={agent:"border-indigo-500 bg-indigo-500/10",tool:"border-emerald-500 bg-emerald-500/10",condition:"border-amber-500 bg-amber-500/10",parallel:"border-blue-500 bg-blue-500/10",loop:"border-violet-500 bg-violet-500/10",human:"border-rose-500 bg-rose-500/10"},dc={agent:"Agent",tool:"Tool",condition:"Condition",parallel:"Parallel",loop:"Loop",human:"Human"};function Wv(l,c){var y;const u=new Map;if(l.length===0)return u;const o=new Set,f=[],x=new Map,g=c??((y=l[0])==null?void 0:y.id);for(g&&f.push({id:g,depth:0,index:0});f.length>0;){const{id:h,depth:w}=f.shift();if(o.has(h))continue;o.add(h);const b=x.get(w)??0;x.set(w,b+1),u.set(h,{x:80+b*220,y:60+w*120});const j=l.find(A=>A.id===h);if(j)for(const A of j.next)o.has(A)||f.push({id:A,depth:w+1,index:0})}let v=(x.get(0)??0)*220+80;for(const h of l)o.has(h.id)||(u.set(h.id,{x:v,y:60}),v+=220);return u}function Iv(){const{id:l}=ks(),c=ca(),{t:u}=Ke(),{workflow:o,loading:f,error:x}=Jv(l),[g,v]=d.useState([]),[y,h]=d.useState(),[w,b]=d.useState(null),[j,A]=d.useState(!1),[z,N]=d.useState({label:"",type:"agent"});d.useEffect(()=>{o!=null&&o.nodes&&(v(o.nodes),h(o.entryNodeId))},[o]);const S=d.useMemo(()=>Wv(g,y),[g,y]),k=Math.max(800,...Array.from(S.values()).map(B=>B.x+200)),D=Math.max(400,...Array.from(S.values()).map(B=>B.y+100)),U=d.useMemo(()=>{const B=[];for(const Z of g){const ee=S.get(Z.id);if(ee)for(const W of Z.next){const Q=S.get(W);Q&&B.push({from:ee,to:Q,fromId:Z.id,toId:W})}}return B},[g,S]),E=d.useCallback(()=>{if(!z.label.trim())return;const B=`node_${Date.now()}`;v(Z=>[...Z,{id:B,type:z.type,label:z.label,config:{},next:[]}]),g.length===0&&h(B),N({label:"",type:"agent"}),A(!1)},[z,g.length]),F=d.useCallback(B=>{var Z;v(ee=>ee.filter(Q=>Q.id!==B).map(Q=>({...Q,next:Q.next.filter(ae=>ae!==B)}))),w===B&&b(null),y===B&&h((Z=g.find(ee=>ee.id!==B))==null?void 0:Z.id)},[w,y,g]),se=g.find(B=>B.id===w);return f?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):x?a.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[a.jsx("p",{className:"text-red-400",children:x}),a.jsxs("button",{onClick:()=>c("/workflows"),className:"btn-secondary mt-4",children:[a.jsx(bs,{className:"h-4 w-4"})," Back to Workflows"]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:()=>c("/workflows"),className:"btn-ghost btn-sm",children:a.jsx(bs,{className:"h-4 w-4"})}),a.jsx("h1",{className:"text-2xl font-semibold text-white",children:(o==null?void 0:o.name)??u("workflow.editor")})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>A(!0),className:"btn-secondary btn-sm",children:[a.jsx(Nt,{className:"h-3.5 w-3.5"})," ",u("workflow.addNode")]}),a.jsxs("button",{className:"btn-secondary btn-sm",children:[a.jsx(Ou,{className:"h-3.5 w-3.5"})," ",u("workflow.save")]}),a.jsxs("button",{className:"btn-primary btn-sm",children:[a.jsx(dt,{className:"h-3.5 w-3.5"})," ",u("workflow.run")]})]})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"card flex-1 overflow-auto p-0",style:{minHeight:"500px"},children:[a.jsxs("svg",{width:k,height:D,className:"w-full",children:[U.map((B,Z)=>{const ee=B.from.x+80,W=B.from.y+40,Q=B.to.x+80,ae=B.to.y,K=(W+ae)/2;return a.jsx("path",{d:`M ${ee} ${W} C ${ee} ${K}, ${Q} ${K}, ${Q} ${ae}`,fill:"none",stroke:"#2a2a35",strokeWidth:"2",markerEnd:"url(#arrowhead)"},Z)}),a.jsx("defs",{children:a.jsx("marker",{id:"arrowhead",markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto",children:a.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:"#2a2a35"})})})]}),a.jsx("div",{className:"absolute inset-0",style:{width:k,height:D},children:g.map(B=>{const Z=S.get(B.id);if(!Z)return null;const ee=B.id===y,W=B.id===w;return a.jsxs("div",{className:`absolute cursor-pointer rounded-lg border-2 px-4 py-2.5 text-sm transition-all ${dh[B.type]} ${W?"ring-2 ring-indigo-500 ring-offset-2 ring-offset-[#0a0a0f]":""} ${ee?"shadow-lg":""}`,style:{left:Z.x,top:Z.y,width:160},onClick:()=>b(B.id),children:[a.jsx("div",{className:"font-medium text-zinc-200 truncate",children:B.label}),a.jsx("div",{className:"text-xs text-zinc-500 mt-0.5",children:dc[B.type]}),ee&&a.jsx("div",{className:"absolute -top-2 -right-2 h-4 w-4 rounded-full bg-indigo-500 border-2 border-[#0a0a0f]"})]},B.id)})}),g.length===0&&a.jsx("div",{className:"flex items-center justify-center h-full text-zinc-500 text-sm",children:"Add nodes to build your workflow DAG"})]}),se&&a.jsxs("div",{className:"w-72 card space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-medium text-zinc-200",children:"Node Properties"}),a.jsx("button",{onClick:()=>b(null),className:"btn-ghost btn-sm",children:a.jsx(jt,{className:"h-3.5 w-3.5"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Label"}),a.jsx("input",{className:"input",value:se.label,onChange:B=>v(Z=>Z.map(ee=>ee.id===se.id?{...ee,label:B.target.value}:ee))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:u("common.type")}),a.jsx("select",{className:"input",value:se.type,onChange:B=>v(Z=>Z.map(ee=>ee.id===se.id?{...ee,type:B.target.value}:ee)),children:Object.entries(dc).map(([B,Z])=>a.jsx("option",{value:B,children:Z},B))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Agent ID"}),a.jsx("input",{className:"input",value:se.agentId??"",onChange:B=>v(Z=>Z.map(ee=>ee.id===se.id?{...ee,agentId:B.target.value||void 0}:ee)),placeholder:"Optional agent ID"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Connect to"}),a.jsxs("select",{className:"input",value:"",onChange:B=>{B.target.value&&v(Z=>Z.map(ee=>ee.id===se.id&&!ee.next.includes(B.target.value)?{...ee,next:[...ee.next,B.target.value]}:ee))},children:[a.jsx("option",{value:"",children:"Select a node..."}),g.filter(B=>B.id!==se.id&&!se.next.includes(B.id)).map(B=>a.jsx("option",{value:B.id,children:B.label},B.id))]}),se.next.length>0&&a.jsx("div",{className:"mt-2 space-y-1",children:se.next.map(B=>{const Z=g.find(ee=>ee.id===B);return a.jsxs("div",{className:"flex items-center justify-between rounded bg-[#0a0a0f] px-2 py-1 text-xs",children:[a.jsx("span",{className:"text-zinc-400",children:(Z==null?void 0:Z.label)??B}),a.jsx("button",{onClick:()=>v(ee=>ee.map(W=>W.id===se.id?{...W,next:W.next.filter(Q=>Q!==B)}:W)),className:"text-zinc-500 hover:text-red-400",children:a.jsx(jt,{className:"h-3 w-3"})})]},B)})})]}),a.jsxs("button",{onClick:()=>F(se.id),className:"btn-danger w-full",children:[a.jsx(It,{className:"h-3.5 w-3.5"}),"Delete Node"]})]})]}),j&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-5",children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:u("workflow.addNode")}),a.jsx("button",{onClick:()=>A(!1),className:"btn-ghost btn-sm",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Label"}),a.jsx("input",{className:"input",value:z.label,onChange:B=>N({...z,label:B.target.value}),placeholder:"Node label"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:u("common.type")}),a.jsx("div",{className:"grid grid-cols-3 gap-2",children:Object.keys(dc).map(B=>a.jsx("button",{onClick:()=>N({...z,type:B}),className:`rounded-lg border-2 p-2.5 text-center text-xs font-medium transition-colors ${z.type===B?dh[B]:"border-border text-zinc-400 hover:border-zinc-600"}`,children:dc[B]},B))})]})]}),a.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[a.jsx("button",{onClick:()=>A(!1),className:"btn-secondary",children:u("common.cancel")}),a.jsx("button",{onClick:E,disabled:!z.label.trim(),className:"btn-primary",children:u("workflow.addNode")})]})]})})]})}function Pv(){const[l,c]=d.useState([]),[u,o]=d.useState(!0),[f,x]=d.useState(null),g=d.useCallback(async()=>{o(!0),x(null);try{const v=await yc.list({limit:200});c(v.data)}catch(v){x(v instanceof Error?v.message:"Failed to fetch skills")}finally{o(!1)}},[]);return d.useEffect(()=>{g()},[g]),{skills:l,loading:u,error:f,refetch:g}}function ej({skill:l,onDelete:c}){return a.jsxs("div",{className:"card group hover:border-indigo-500/30 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-violet-500/10 text-violet-400",children:a.jsx(Rc,{className:"h-5 w-5"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-zinc-200",children:l.name}),a.jsxs("p",{className:"text-xs text-zinc-500",children:["v",l.version," by ",l.author]})]})]}),a.jsx(qu,{level:l.trustLevel})]}),l.description&&a.jsx("p",{className:"mt-3 text-sm text-zinc-400 line-clamp-2",children:l.description}),a.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.tags.slice(0,3).map(u=>a.jsx("span",{className:"rounded-md bg-zinc-800 px-2 py-0.5 text-xs text-zinc-400",children:u},u)),l.tags.length>3&&a.jsxs("span",{className:"text-xs text-zinc-500",children:["+",l.tags.length-3]})]}),c&&a.jsx("button",{onClick:u=>{u.preventDefault(),c(l.id)},className:"btn-ghost btn-sm text-zinc-500 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(It,{className:"h-3.5 w-3.5"})})]})]})}function tj(){const{t:l}=Ke(),{skills:c,loading:u,error:o,refetch:f}=Pv(),[x,g]=d.useState(!1),[v,y]=d.useState(!1),[h,w]=d.useState(""),[b,j]=d.useState({source:"",type:"local",name:"",trustLevel:"community"}),[A,z]=d.useState(null),N=async()=>{if(b.source.trim()){y(!0);try{await yc.install({source:b.source,type:b.type,name:b.name||void 0,trustLevel:b.trustLevel}),g(!1),j({source:"",type:"local",name:"",trustLevel:"community"}),f()}catch(U){console.error("Failed to install skill:",U)}finally{y(!1)}}},S=async U=>{if(window.confirm("Remove this skill?"))try{await yc.delete(U),f()}catch(E){console.error("Failed to delete skill:",E)}},k=async()=>{if(b.source.trim())try{const U=await yc.scan(b.source);z(U)}catch(U){console.error("Scan failed:",U)}},D=c.filter(U=>!h||U.name.toLowerCase().includes(h.toLowerCase())||U.description.toLowerCase().includes(h.toLowerCase())||U.tags.some(E=>E.toLowerCase().includes(h.toLowerCase())));return u?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:l("skills.title")}),a.jsxs("button",{onClick:()=>g(!0),className:"btn-primary",children:[a.jsx(Nt,{className:"h-4 w-4"}),l("skills.install")]})]}),c.length>0&&a.jsxs("div",{className:"relative max-w-md",children:[a.jsx(Ul,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),a.jsx("input",{type:"text",className:"input pl-9",placeholder:l("common.search"),value:h,onChange:U=>w(U.target.value)})]}),o&&a.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[o,a.jsx("button",{onClick:f,className:"ml-3 underline",children:"Retry"})]}),c.length===0&&!o?a.jsx(Tn,{icon:a.jsx(Rc,{className:"h-8 w-8"}),title:l("skills.empty"),description:l("skills.emptyDesc"),action:a.jsxs("button",{onClick:()=>g(!0),className:"btn-primary",children:[a.jsx(Nt,{className:"h-4 w-4"}),l("skills.install")]})}):D.length===0?a.jsx("div",{className:"py-8 text-center text-sm text-zinc-500",children:l("common.noResults")}):a.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:D.map(U=>a.jsx(ej,{skill:U,onDelete:S},U.id))}),x&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-5",children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:l("skills.install")}),a.jsx("button",{onClick:()=>{g(!1),z(null)},className:"btn-ghost btn-sm",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:l("skills.source")}),a.jsx("input",{className:"input",value:b.source,onChange:U=>j({...b,source:U.target.value}),placeholder:"/path/to/skill or https://..."})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:l("common.type")}),a.jsxs("select",{className:"input",value:b.type,onChange:U=>j({...b,type:U.target.value}),children:[a.jsx("option",{value:"local",children:"Local"}),a.jsx("option",{value:"npm",children:"NPM"}),a.jsx("option",{value:"git",children:"Git"}),a.jsx("option",{value:"url",children:"URL"})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"label",children:[l("common.name")," (optional)"]}),a.jsx("input",{className:"input",value:b.name,onChange:U=>j({...b,name:U.target.value}),placeholder:"my-skill"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Trust Level"}),a.jsxs("select",{className:"input",value:b.trustLevel,onChange:U=>j({...b,trustLevel:U.target.value}),children:[a.jsx("option",{value:"builtin",children:"Built-in"}),a.jsx("option",{value:"official",children:"Official"}),a.jsx("option",{value:"trusted",children:"Trusted"}),a.jsx("option",{value:"community",children:"Community"}),a.jsx("option",{value:"local",children:"Local"})]})]}),A&&a.jsxs("div",{className:"rounded-lg bg-[#0a0a0f] p-4",children:[a.jsx("h4",{className:"text-sm font-medium text-zinc-300 mb-2",children:"Scan Results"}),a.jsx("pre",{className:"text-xs text-zinc-400 overflow-auto max-h-40",children:JSON.stringify(A,null,2)})]})]}),a.jsxs("div",{className:"mt-6 flex justify-between",children:[a.jsxs("button",{onClick:k,disabled:!b.source.trim(),className:"btn-secondary",children:[a.jsx(Ob,{className:"h-4 w-4"}),l("skills.scan")]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("button",{onClick:()=>{g(!1),z(null)},className:"btn-secondary",children:l("common.cancel")}),a.jsx("button",{onClick:N,disabled:!b.source.trim()||v,className:"btn-primary",children:l(v?"common.loading":"skills.install")})]})]})]})})]})}function aj(){const{t:l}=Ke(),[c,u]=d.useState([]),[o,f]=d.useState(!0),[x,g]=d.useState(null),[v,y]=d.useState("all"),h=d.useCallback(async()=>{f(!0),g(null);try{const j={limit:100};v!=="all"&&(j.status=v);const A=await En.list(j);u(A.data)}catch(j){g(j instanceof Error?j.message:"Failed to fetch runs"),u([])}finally{f(!1)}},[v]);d.useEffect(()=>{h()},[h]);const w=async j=>{try{await En.abort(j),h()}catch(A){console.error("Abort failed:",A)}},b=async j=>{if(window.confirm("Delete this run record?"))try{await En.delete(j),u(A=>A.filter(z=>z.id!==j))}catch(A){console.error("Delete failed:",A)}};return o?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:l("runs.title")}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:h,className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-4 w-4"})}),a.jsx(Kh,{className:"h-4 w-4 text-zinc-500"}),a.jsxs("select",{className:"input w-auto",value:v,onChange:j=>y(j.target.value),children:[a.jsx("option",{value:"all",children:"All Status"}),a.jsx("option",{value:"running",children:l("status.running")}),a.jsx("option",{value:"completed",children:l("status.completed")}),a.jsx("option",{value:"failed",children:l("status.failed")}),a.jsx("option",{value:"pending",children:l("status.pending")}),a.jsx("option",{value:"paused",children:l("status.paused")}),a.jsx("option",{value:"cancelled",children:l("status.cancelled")})]})]})]}),x&&a.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[x,a.jsx("button",{onClick:h,className:"ml-3 underline",children:l("common.retry")})]}),c.length===0&&!x?a.jsx(Tn,{icon:a.jsx(dt,{className:"h-8 w-8"}),title:l("runs.empty"),description:l("runs.emptyDesc")}):c.length>0?a.jsx("div",{className:"card overflow-hidden p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface",children:[a.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:"Run ID"}),a.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:"Workflow"}),a.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:l("common.status")}),a.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:"Started"}),a.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:l("run.duration")}),a.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:l("common.actions")})]})}),a.jsx("tbody",{children:c.map(j=>{var z;const A=j.completedAt&&j.startedAt?Math.round((new Date(j.completedAt).getTime()-new Date(j.startedAt).getTime())/1e3):null;return a.jsxs("tr",{className:"border-b border-border hover:bg-surface-hover transition-colors",children:[a.jsx("td",{className:"px-5 py-3",children:a.jsxs(cn,{to:`/runs/${j.id}`,className:"text-indigo-400 hover:text-indigo-300 font-mono text-xs",children:[j.id.slice(0,8),"..."]})}),a.jsxs("td",{className:"px-5 py-3 text-zinc-300 font-mono text-xs",children:[((z=j.workflowId)==null?void 0:z.slice(0,8))??"—","..."]}),a.jsx("td",{className:"px-5 py-3",children:a.jsx(ql,{status:j.status,pulse:!0})}),a.jsx("td",{className:"px-5 py-3 text-zinc-400 text-xs",children:new Date(j.startedAt).toLocaleString()}),a.jsx("td",{className:"px-5 py-3 text-zinc-400 text-xs",children:A!==null?`${A}s`:"—"}),a.jsx("td",{className:"px-5 py-3",children:a.jsxs("div",{className:"flex gap-1",children:[(j.status==="running"||j.status==="pending")&&a.jsx("button",{onClick:()=>w(j.id),className:"btn-ghost btn-sm text-amber-400",title:"Abort run",children:a.jsx(Xh,{className:"h-3.5 w-3.5"})}),(j.status==="completed"||j.status==="failed"||j.status==="cancelled")&&a.jsx("button",{onClick:()=>b(j.id),className:"btn-ghost btn-sm text-zinc-400 hover:text-red-400",title:"Delete run",children:a.jsx(It,{className:"h-3.5 w-3.5"})})]})})]},j.id)})})]})})}):null]})}const e0="/api";async function nj(l){const c=localStorage.getItem("nestor_token"),u={"Content-Type":"application/json"};c&&(u.Authorization=`Bearer ${c}`);const o=localStorage.getItem("nestor_tenant_id");o&&(u["X-Tenant-ID"]=o);const f=await fetch(`${e0}/runs/${l}/feedback`,{headers:u});return f.ok?(await f.json()).data??[]:[]}async function mh(l,c,u,o){const f=localStorage.getItem("nestor_token"),x={"Content-Type":"application/json"};f&&(x.Authorization=`Bearer ${f}`);const g=localStorage.getItem("nestor_tenant_id");g&&(x["X-Tenant-ID"]=g),await fetch(`${e0}/runs/${l}/feedback`,{method:"POST",headers:x,body:JSON.stringify({rating:c,comment:u||void 0,agentId:o})})}function sj({runId:l,agentId:c}){const[u,o]=d.useState([]),[f,x]=d.useState(!1),[g,v]=d.useState(null),[y,h]=d.useState(""),[w,b]=d.useState(!1),j=d.useCallback(async()=>{const N=await nj(l);o(N),N.length>0&&(x(!0),v(N[0].rating))},[l]);d.useEffect(()=>{j()},[j]);const A=async N=>{f||(v(N),N===1?(await mh(l,N,void 0,c),x(!0),j()):b(!0))},z=async()=>{g!==null&&(await mh(l,g,y||void 0,c),x(!0),b(!1),j())};return a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-400",children:"Was this helpful?"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>A(1),disabled:f,className:`rounded-lg p-2 transition-colors ${g===1?"bg-green-500/20 text-green-400":f?"text-zinc-600 cursor-not-allowed":"text-zinc-400 hover:bg-green-500/10 hover:text-green-400"}`,title:"Helpful",children:a.jsx(Dl,{className:"h-5 w-5"})}),a.jsx("button",{onClick:()=>A(-1),disabled:f,className:`rounded-lg p-2 transition-colors ${g===-1?"bg-red-500/20 text-red-400":f?"text-zinc-600 cursor-not-allowed":"text-zinc-400 hover:bg-red-500/10 hover:text-red-400"}`,title:"Not helpful",children:a.jsx(ju,{className:"h-5 w-5"})})]})]}),w&&!f&&a.jsxs("div",{className:"mt-3 flex gap-2",children:[a.jsx("input",{type:"text",value:y,onChange:N=>h(N.target.value),placeholder:"What could be improved? (optional)",className:"flex-1 rounded-lg bg-zinc-800 px-3 py-2 text-sm text-zinc-200 placeholder-zinc-500 border border-zinc-700 focus:border-indigo-500 focus:outline-none",onKeyDown:N=>{N.key==="Enter"&&z()}}),a.jsx("button",{onClick:z,className:"rounded-lg bg-indigo-600 px-3 py-2 text-sm text-white hover:bg-indigo-500 transition-colors",children:a.jsx(Xb,{className:"h-4 w-4"})})]}),f&&a.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:[g===1?"Thanks for the positive feedback!":"Thanks for your feedback.",u.length>0&&u[0].comment&&a.jsxs("span",{className:"text-zinc-600",children:[" — “",u[0].comment,"”"]})]})]})}const lj={llm_request:{icon:ys,color:"text-purple-400",bgColor:"bg-purple-500/10",label:"LLM Request"},llm_response:{icon:wc,color:"text-blue-400",bgColor:"bg-blue-500/10",label:"LLM Response"},tool_call_requested:{icon:Oc,color:"text-amber-400",bgColor:"bg-amber-500/10",label:"Tool Call"},tool_call_completed:{icon:tt,color:"text-emerald-400",bgColor:"bg-emerald-500/10",label:"Tool Result"},tool_call_denied:{icon:Ot,color:"text-red-400",bgColor:"bg-red-500/10",label:"Tool Denied"},node_started:{icon:dt,color:"text-blue-400",bgColor:"bg-blue-500/10",label:"Step Started"},node_completed:{icon:tt,color:"text-green-400",bgColor:"bg-green-500/10",label:"Step Completed"},node_failed:{icon:Ot,color:"text-red-400",bgColor:"bg-red-500/10",label:"Step Failed"},thinking:{icon:bu,color:"text-yellow-400",bgColor:"bg-yellow-500/10",label:"Thinking"},reasoning:{icon:bu,color:"text-yellow-400",bgColor:"bg-yellow-500/10",label:"Reasoning"},approval_requested:{icon:ia,color:"text-amber-400",bgColor:"bg-amber-500/10",label:"Approval Requested"},budget_warning:{icon:ft,color:"text-amber-400",bgColor:"bg-amber-500/10",label:"Budget Warning"},budget_exceeded:{icon:Ra,color:"text-red-400",bgColor:"bg-red-500/10",label:"Budget Exceeded"},error:{icon:ft,color:"text-red-400",bgColor:"bg-red-500/10",label:"Error"}},ij={icon:dt,color:"text-zinc-400",bgColor:"bg-zinc-500/10",label:"Event"};function cj(l){try{return new Date(l).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}catch{return l}}function fh(l,c){try{return new Date(c).getTime()-new Date(l).getTime()}catch{return 0}}function rj(l){return l<1e3?`${l}ms`:l<6e4?`${(l/1e3).toFixed(1)}s`:`${Math.floor(l/6e4)}m ${Math.floor(l%6e4/1e3)}s`}function oj(l){const c=l.data;if(!c)return"";if(typeof c.reasoning=="string")return c.reasoning;if(typeof c.content=="string")return c.content;if(typeof c.text=="string")return c.text;if(typeof c.output=="string")return c.output;if(typeof c.prompt=="string")return c.prompt;if(typeof c.error=="string")return c.error;if(typeof c.tool=="string"){const o=c.args?` (${JSON.stringify(c.args).slice(0,120)})`:"";return`${c.tool}${o}`}const u=JSON.stringify(c,null,2);return u.length>300?u.slice(0,300)+"...":u}function uj(l,c){let u=0;for(let o=0;o<=c&&o<l.length;o++){const f=l[o].data;typeof f.estimatedCostUsd=="number"?u=f.estimatedCostUsd:typeof f.cost=="number"&&(u+=f.cost)}return u}function dj({runId:l}){const[c,u]=d.useState([]),[o,f]=d.useState(!0),[x,g]=d.useState(null),[v,y]=d.useState(-1),[h,w]=d.useState(!1),[b,j]=d.useState(1),A=d.useRef(null),z=d.useRef(null),N=d.useRef(new Map);d.useEffect(()=>{let W=!1;return f(!0),g(null),En.getEvents(l).then(Q=>{W||u(Q.data.sort((ae,K)=>new Date(ae.timestamp).getTime()-new Date(K.timestamp).getTime()))}).catch(Q=>{W||g(Q instanceof Error?Q.message:"Failed to load events")}).finally(()=>{W||f(!1)}),()=>{W=!0}},[l]);const S=d.useCallback(()=>{w(!1),A.current&&(clearTimeout(A.current),A.current=null)},[]),k=d.useCallback(()=>{y(W=>{const Q=W+1;if(Q>=c.length)return S(),W;const ae=c[W]??c[0],K=c[Q];if(ae&&K){const de=fh(ae.timestamp,K.timestamp),ye=Math.max(50,Math.min(de/b,2e3/b));A.current=setTimeout(k,ye)}return Q})},[c,b,S]),D=d.useCallback(()=>{c.length!==0&&(w(!0),y(W=>{const Q=W>=c.length-1?0:W,ae=300/b;return A.current=setTimeout(k,ae),Q}))},[c,b,k]),U=d.useCallback(()=>{h?S():D()},[h,S,D]),E=d.useCallback(()=>{S(),y(W=>Math.min(W+1,c.length-1))},[c.length,S]),F=d.useCallback(()=>{S(),y(W=>Math.max(W-1,0))},[S]),se=d.useCallback(W=>{S(),y(W)},[S]),B=d.useCallback(()=>{j(W=>{const Q=[1,2,4,8],ae=Q.indexOf(W);return Q[(ae+1)%Q.length]})},[]);if(d.useEffect(()=>{if(v>=0){const W=N.current.get(v);W==null||W.scrollIntoView({behavior:"smooth",block:"nearest"})}},[v]),d.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]),o)return a.jsxs("div",{className:"flex items-center justify-center py-12",children:[a.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"}),a.jsx("span",{className:"ml-3 text-sm text-zinc-400",children:"Loading events..."})]});if(x)return a.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4",children:a.jsx("p",{className:"text-sm text-red-400",children:x})});if(c.length===0)return a.jsx("div",{className:"rounded-lg border border-zinc-700 bg-zinc-800/50 p-6 text-center",children:a.jsx("p",{className:"text-sm text-zinc-500",children:"No events recorded for this run."})});const Z=c.length>0?(v+1)/c.length*100:0,ee=v>=0?uj(c,v):0;return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-zinc-700 bg-zinc-800/80 px-4 py-3",children:[a.jsx("button",{onClick:F,disabled:v<=0,className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-700 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Step backward",children:a.jsx(Qb,{className:"h-4 w-4"})}),a.jsx("button",{onClick:U,className:"flex h-9 w-9 items-center justify-center rounded-full bg-indigo-600 text-white transition-colors hover:bg-indigo-500",title:h?"Pause":"Play",children:h?a.jsx(Tc,{className:"h-4 w-4"}):a.jsx(dt,{className:"h-4 w-4 ml-0.5"})}),a.jsx("button",{onClick:E,disabled:v>=c.length-1,className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-700 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Step forward",children:a.jsx(Kb,{className:"h-4 w-4"})}),a.jsxs("button",{onClick:B,className:"rounded border border-zinc-600 px-2 py-1 text-xs font-mono text-zinc-300 transition-colors hover:bg-zinc-700",title:"Cycle playback speed",children:[b,"x"]}),a.jsx("div",{className:"flex-1 mx-2",children:a.jsxs("div",{className:"relative h-2 rounded-full bg-zinc-700 cursor-pointer",onClick:W=>{const Q=W.currentTarget.getBoundingClientRect(),ae=(W.clientX-Q.left)/Q.width,K=Math.round(ae*(c.length-1));se(Math.max(0,Math.min(K,c.length-1)))},children:[a.jsx("div",{className:"absolute top-0 left-0 h-full rounded-full bg-indigo-500 transition-all duration-150",style:{width:`${Z}%`}}),a.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 h-3.5 w-3.5 rounded-full border-2 border-indigo-400 bg-zinc-900 transition-all duration-150",style:{left:`calc(${Z}% - 7px)`}})]})}),a.jsxs("span",{className:"text-xs font-mono text-zinc-500 whitespace-nowrap",children:[v+1," / ",c.length]}),ee>0&&a.jsxs("span",{className:"flex items-center gap-1 text-xs font-mono text-amber-400 whitespace-nowrap",children:[a.jsx(Ra,{className:"h-3 w-3"}),ee.toFixed(4)]})]}),a.jsx("div",{ref:z,className:"max-h-[600px] overflow-y-auto rounded-lg border border-zinc-700 bg-zinc-900/50",children:a.jsx("div",{className:"divide-y divide-zinc-800",children:c.map((W,Q)=>{const ae=lj[W.type]??ij,K=ae.icon,de=Q===v,ye=v<0||Q<=v,$=oj(W),P=Q>0?fh(c[Q-1].timestamp,W.timestamp):0;return a.jsxs("div",{ref:oe=>{oe&&N.current.set(Q,oe)},className:`
|
|
526
|
+
flex items-start gap-3 px-4 py-3 cursor-pointer transition-all duration-200
|
|
527
|
+
${de?"bg-indigo-500/10 border-l-2 border-l-indigo-500":"border-l-2 border-l-transparent"}
|
|
528
|
+
${ye?"opacity-100":"opacity-30"}
|
|
529
|
+
hover:bg-zinc-800/50
|
|
530
|
+
`,onClick:()=>se(Q),children:[a.jsx("span",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded text-[10px] font-mono text-zinc-600",children:Q+1}),a.jsx("div",{className:`mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg ${ae.bgColor}`,children:a.jsx(K,{className:`h-3.5 w-3.5 ${ae.color}`})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`text-xs font-medium ${ae.color}`,children:ae.label}),a.jsx("span",{className:"text-[10px] font-mono text-zinc-600",children:cj(W.timestamp)}),P>0&&a.jsxs("span",{className:"text-[10px] text-zinc-600",children:["+",rj(P)]})]}),$&&ye&&a.jsx("pre",{className:`mt-1 text-xs whitespace-pre-wrap break-words ${de?"text-zinc-200":"text-zinc-500"} max-h-40 overflow-hidden`,children:$.length>500?$.slice(0,500)+"...":$})]}),de&&a.jsx(_l,{className:"mt-1.5 h-3.5 w-3.5 shrink-0 text-indigo-400"})]},W.id)})})})]})}function mj(){const{id:l}=ks(),c=ca(),{t:u}=Ke(),[o,f]=d.useState(null),[x,g]=d.useState([]),[v,y]=d.useState([]),[h,w]=d.useState([]),[b,j]=d.useState(!0),[A,z]=d.useState(null),[N,S]=d.useState(null),[k,D]=d.useState(""),[U,E]=d.useState("details"),F=d.useCallback(async()=>{if(l)try{const K=await En.get(l);f(K.data)}catch(K){z(K instanceof Error?K.message:"Failed to load run")}},[l]),se=d.useCallback(async()=>{if(l)try{const K=await En.getEvents(l);g(K.data)}catch{}},[l]),B=d.useCallback(async()=>{if(l)try{const K=await fu.forRun(l);y(K.data)}catch{}},[l]),Z=d.useCallback(async()=>{if(l)try{const K=await Sc.list();w(K.data.filter(de=>de.runId===l))}catch{}},[l]);d.useEffect(()=>{l&&(j(!0),z(null),Promise.all([F(),se(),B(),Z()]).finally(()=>{j(!1)}))},[l,F,se,B,Z]),d.useEffect(()=>{if(!o||o.status==="completed"||o.status==="failed"||o.status==="cancelled")return;const K=setInterval(()=>{F(),se()},3e3);return()=>clearInterval(K)},[o==null?void 0:o.status,F,se]);const ee=async()=>{if(l)try{await En.abort(l),F()}catch(K){console.error("Abort failed:",K)}};if(b)return a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});if(A||!o)return a.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[a.jsx("p",{className:"text-red-400",children:A??"Run not found"}),a.jsxs("button",{onClick:()=>c("/runs"),className:"btn-secondary mt-4",children:[a.jsx(bs,{className:"h-4 w-4"})," Back to Runs"]})]});const W=o.completedAt&&o.startedAt?Math.round((new Date(o.completedAt).getTime()-new Date(o.startedAt).getTime())/1e3):null,Q=o.status==="completed"?a.jsx(tt,{className:"h-5 w-5 text-green-400"}):o.status==="failed"?a.jsx(Ot,{className:"h-5 w-5 text-red-400"}):a.jsx(dt,{className:"h-5 w-5 text-blue-400"}),ae=o.status==="running"||o.status==="pending";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>c("/runs"),className:"btn-ghost btn-sm",children:a.jsx(bs,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex items-center gap-3",children:[Q,a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-semibold text-white",children:["Run ",a.jsxs("span",{className:"font-mono text-lg text-zinc-400",children:[o.id.slice(0,12),"..."]})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[a.jsx(ql,{status:o.status,pulse:!0}),a.jsxs("span",{className:"text-xs text-zinc-500",children:["Started: ",new Date(o.startedAt).toLocaleString()]})]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>{F(),se()},className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-3.5 w-3.5"})}),ae&&a.jsxs("button",{onClick:ee,className:"btn-danger btn-sm",children:[a.jsx(Xh,{className:"h-3.5 w-3.5"})," Abort"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[a.jsx("div",{className:"card",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/10",children:a.jsx(Wb,{className:"h-4 w-4 text-blue-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:u("run.duration")}),a.jsx("p",{className:"text-lg font-semibold text-white",children:W!==null?`${W}s`:"In progress..."})]})]})}),a.jsx("div",{className:"card",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-amber-500/10",children:a.jsx(Ra,{className:"h-4 w-4 text-amber-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:u("run.cost")}),a.jsx("p",{className:"text-lg font-semibold text-white",children:"$0.00"})]})]})}),a.jsx("div",{className:"card",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-violet-500/10",children:a.jsx(js,{className:"h-4 w-4 text-violet-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Events"}),a.jsx("p",{className:"text-lg font-semibold text-white",children:x.length})]})]})})]}),a.jsxs("div",{className:"flex items-center gap-1 border-b border-zinc-700",children:[a.jsx("button",{onClick:()=>E("details"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${U==="details"?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:"Details"}),a.jsxs("button",{onClick:()=>E("replay"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors flex items-center gap-1.5 ${U==="replay"?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:[a.jsx(dt,{className:"h-3.5 w-3.5"}),"Replay"]})]}),U==="replay"&&a.jsx(dj,{runId:l}),U==="details"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsx(sj,{runId:l}),a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:u("run.events")}),a.jsx(Hu,{events:x,maxHeight:"500px"})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:u("run.output")}),o.output?a.jsx("pre",{className:"overflow-auto rounded-lg bg-[#0a0a0f] p-4 text-sm text-zinc-300 max-h-64",children:JSON.stringify(o.output,null,2)}):a.jsx("p",{className:"text-sm text-zinc-500",children:"No output available yet."})]}),o.error&&a.jsxs("div",{className:"card border-red-500/20",children:[a.jsx("h2",{className:"mb-2 text-lg font-medium text-red-400",children:"Error"}),a.jsx("pre",{className:"overflow-auto rounded-lg bg-red-500/5 p-4 text-sm text-red-300",children:o.error})]}),a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:"Input"}),a.jsx("pre",{className:"overflow-auto rounded-lg bg-[#0a0a0f] p-4 text-sm text-zinc-300 max-h-40",children:JSON.stringify(o.input,null,2)})]})]})]}),h.filter(K=>K.status==="pending").map(K=>a.jsxs("div",{className:"card border-amber-500/30 bg-amber-500/5",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(jc,{className:"h-5 w-5 text-amber-400"}),a.jsx("h2",{className:"text-lg font-semibold text-amber-300",children:"Handoff Pending"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500 mb-1",children:"Accomplished"}),a.jsx("p",{className:"text-zinc-300",children:K.accomplished})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500 mb-1",children:"Blocking"}),a.jsx("p",{className:"text-red-400",children:K.blocking})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500 mb-1",children:"Suggestions"}),a.jsx("p",{className:"text-zinc-300",children:K.suggestions})]})]}),a.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[a.jsx("input",{type:"text",className:"flex-1 rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-200 placeholder-zinc-500 focus:border-indigo-500 focus:outline-none",placeholder:"Describe how you resolved the blocking issue...",value:k,onChange:de=>D(de.target.value)}),a.jsx("button",{className:"btn-primary btn-sm",disabled:!k.trim(),onClick:async()=>{try{await Sc.resume(K.id,k),D(""),Z()}catch(de){console.error("Resume failed:",de)}},children:"Resume"})]})]},K.id)),a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Annotations"}),a.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>S(N?null:{type:"note",content:""}),children:N?"Cancel":"+ Add"})]}),N&&a.jsxs("div",{className:"mb-4 rounded-lg border border-zinc-700 p-3 space-y-2",children:[a.jsx("div",{className:"flex gap-2",children:["good","bad","wrong_approach","note"].map(K=>{const de={good:a.jsx(Dl,{className:"h-3.5 w-3.5"}),bad:a.jsx(ju,{className:"h-3.5 w-3.5"}),wrong_approach:a.jsx(lh,{className:"h-3.5 w-3.5"}),note:a.jsx(wc,{className:"h-3.5 w-3.5"})},ye={good:"text-green-400 border-green-500/30",bad:"text-red-400 border-red-500/30",wrong_approach:"text-amber-400 border-amber-500/30",note:"text-blue-400 border-blue-500/30"};return a.jsxs("button",{className:`flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs ${N.type===K?ye[K]+" bg-zinc-800":"border-zinc-700 text-zinc-500 hover:text-zinc-300"}`,onClick:()=>S({...N,type:K}),children:[de[K]," ",K.replace("_"," ")]},K)})}),a.jsx("textarea",{className:"w-full rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-200 placeholder-zinc-500 focus:border-indigo-500 focus:outline-none",rows:2,placeholder:"Add your annotation...",value:N.content,onChange:K=>S({...N,content:K.target.value})}),a.jsx("button",{className:"btn-primary btn-sm",disabled:!N.content.trim(),onClick:async()=>{if(!(!l||!N.content.trim()))try{await fu.create(l,{type:N.type,content:N.content}),S(null),B()}catch(K){console.error("Failed to add annotation:",K)}},children:"Save Annotation"})]}),v.length===0?a.jsx("p",{className:"text-sm text-zinc-500",children:"No annotations yet."}):a.jsx("div",{className:"space-y-2",children:v.map(K=>{const de={good:"border-green-500/30 bg-green-500/5",bad:"border-red-500/30 bg-red-500/5",wrong_approach:"border-amber-500/30 bg-amber-500/5",note:"border-blue-500/30 bg-blue-500/5",handoff:"border-purple-500/30 bg-purple-500/5"},ye={good:a.jsx(Dl,{className:"h-3.5 w-3.5 text-green-400"}),bad:a.jsx(ju,{className:"h-3.5 w-3.5 text-red-400"}),wrong_approach:a.jsx(lh,{className:"h-3.5 w-3.5 text-amber-400"}),note:a.jsx(wc,{className:"h-3.5 w-3.5 text-blue-400"}),handoff:a.jsx(jc,{className:"h-3.5 w-3.5 text-purple-400"})};return a.jsxs("div",{className:`flex items-start gap-2 rounded-lg border p-2 text-sm ${de[K.type]??"border-zinc-700"}`,children:[a.jsx("span",{className:"mt-0.5",children:ye[K.type]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-zinc-300",children:K.content}),a.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[K.author," · ",new Date(K.createdAt).toLocaleString(),K.eventIndex!=null&&` · Event #${K.eventIndex}`]})]}),a.jsx("button",{className:"text-zinc-600 hover:text-red-400 transition-colors",title:"Delete annotation",onClick:async()=>{try{await fu.delete(K.id),B()}catch($){console.error("Delete failed:",$)}},children:a.jsx(Ot,{className:"h-3.5 w-3.5"})})]},K.id)})})]})]})]})}function fj(){const{t:l}=Ke(),[c,u]=d.useState("general"),[o,f]=d.useState(null),[x,g]=d.useState(!0),[v,y]=d.useState(!1),[h,w]=d.useState(!1),[b,j]=d.useState(null);d.useEffect(()=>{la.getConfig().then(k=>f(k.data)).catch(()=>{f({server:{host:"127.0.0.1",port:3100},security:{defaultTrustLevel:"community",approvalMode:"manual",maxConcurrentRuns:10},budget:{enabled:!1,defaultMaxCostPerRunUsd:1,defaultMaxTokensPerRun:1e5,warningThresholdPercent:80},logging:{level:"info",format:"pretty"}})}).finally(()=>g(!1))},[]);const A=async()=>{if(o){y(!0),w(!1),j(null);try{const k=await la.updateConfig(o);f(k.data),w(!0),setTimeout(()=>w(!1),3e3)}catch(k){j(k instanceof Error?k.message:"Failed to save")}finally{y(!1)}}},z=async()=>{g(!0);try{const k=await la.getConfig();f(k.data),j(null)}catch{j("Failed to refresh config")}finally{g(!1)}},N=(k,D,U)=>{o&&f({...o,[k]:{...o[k],[D]:U}})},S=[{key:"general",label:l("settings.general")},{key:"security",label:l("settings.security")},{key:"budget",label:l("settings.budget")},{key:"studio",label:"Studio"}];return x?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):o?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:l("settings.title")}),a.jsxs("div",{className:"flex items-center gap-3",children:[h&&a.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-green-400",children:[a.jsx(vs,{className:"h-4 w-4"}),l("settings.saved")]}),b&&a.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-red-400",children:[a.jsx(Vh,{className:"h-4 w-4"}),b]}),a.jsx("button",{onClick:z,className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-4 w-4"})}),a.jsxs("button",{onClick:A,disabled:v,className:"btn-primary",children:[a.jsx(Ou,{className:"h-4 w-4"}),l(v?"common.loading":"settings.save")]})]})]}),a.jsx("div",{className:"flex gap-1 border-b border-border",children:S.map(({key:k,label:D})=>a.jsx("button",{onClick:()=>u(k),className:`px-4 py-2.5 text-sm font-medium transition-colors border-b-2 ${c===k?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-200"}`,children:D},k))}),c==="general"&&a.jsxs("div",{className:"card space-y-6",children:[a.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Server Configuration"}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Host"}),a.jsx("input",{className:"input",value:o.server.host,onChange:k=>N("server","host",k.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Port"}),a.jsx("input",{className:"input",type:"number",value:o.server.port,onChange:k=>N("server","port",parseInt(k.target.value)||3100)})]})]}),a.jsx("h2",{className:"text-lg font-medium text-zinc-200 pt-4",children:"Logging"}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Level"}),a.jsxs("select",{className:"input",value:o.logging.level,onChange:k=>N("logging","level",k.target.value),children:[a.jsx("option",{value:"debug",children:"Debug"}),a.jsx("option",{value:"info",children:"Info"}),a.jsx("option",{value:"warn",children:"Warn"}),a.jsx("option",{value:"error",children:"Error"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Format"}),a.jsxs("select",{className:"input",value:o.logging.format,onChange:k=>N("logging","format",k.target.value),children:[a.jsx("option",{value:"json",children:"JSON"}),a.jsx("option",{value:"pretty",children:"Pretty"})]})]})]})]}),c==="security"&&a.jsxs("div",{className:"card space-y-6",children:[a.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Security Settings"}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Default Trust Level"}),a.jsxs("select",{className:"input",value:o.security.defaultTrustLevel,onChange:k=>N("security","defaultTrustLevel",k.target.value),children:[a.jsx("option",{value:"builtin",children:"Built-in"}),a.jsx("option",{value:"official",children:"Official"}),a.jsx("option",{value:"trusted",children:"Trusted"}),a.jsx("option",{value:"community",children:"Community"}),a.jsx("option",{value:"local",children:"Local"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Approval Mode"}),a.jsxs("select",{className:"input",value:o.security.approvalMode,onChange:k=>N("security","approvalMode",k.target.value),children:[a.jsx("option",{value:"manual",children:"Manual"}),a.jsx("option",{value:"smart",children:"Smart"}),a.jsx("option",{value:"off",children:"Off"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Max Concurrent Runs"}),a.jsx("input",{className:"input",type:"number",value:o.security.maxConcurrentRuns,onChange:k=>N("security","maxConcurrentRuns",parseInt(k.target.value)||10)})]})]})]}),c==="budget"&&a.jsxs("div",{className:"card space-y-6",children:[a.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Budget Configuration"}),a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:o.budget.enabled,onChange:k=>N("budget","enabled",k.target.checked),className:"peer sr-only"}),a.jsx("div",{className:"h-6 w-11 rounded-full bg-zinc-700 after:absolute after:left-[2px] after:top-0.5 after:h-5 after:w-5 after:rounded-full after:bg-white after:transition-all peer-checked:bg-indigo-600 peer-checked:after:translate-x-full"})]}),a.jsx("span",{className:"text-sm text-zinc-300",children:"Enable Budget Tracking"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Default Max Cost Per Run (USD)"}),a.jsx("input",{className:"input",type:"number",step:"0.01",value:o.budget.defaultMaxCostPerRunUsd,onChange:k=>N("budget","defaultMaxCostPerRunUsd",parseFloat(k.target.value)||1)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Default Max Tokens Per Run"}),a.jsx("input",{className:"input",type:"number",value:o.budget.defaultMaxTokensPerRun,onChange:k=>N("budget","defaultMaxTokensPerRun",parseInt(k.target.value)||1e5)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Warning Threshold (%)"}),a.jsx("input",{className:"input",type:"number",min:0,max:100,value:o.budget.warningThresholdPercent,onChange:k=>N("budget","warningThresholdPercent",parseInt(k.target.value)||80)})]})]})]}),c==="studio"&&a.jsxs("div",{className:"card space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Vb,{className:"h-5 w-5 text-indigo-400"}),a.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Studio Web UI"})]}),a.jsx("p",{className:"text-sm text-zinc-400",children:"The Studio web UI provides a browser-based dashboard for managing agents, workflows, and monitoring runs. You are currently viewing the Studio interface."}),a.jsxs("div",{className:"rounded-lg border border-border bg-zinc-900/50 p-4",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Current Configuration"}),a.jsx("pre",{className:"mt-2 text-xs text-zinc-400 overflow-auto max-h-40 rounded bg-[#0a0a0f] p-3",children:JSON.stringify(o,null,2)})]}),a.jsxs("div",{className:"text-xs text-zinc-500",children:["Changes are applied to the runtime config and take effect immediately. To persist changes across restarts, update the Nestor config file.",a.jsx("code",{className:"ml-1 rounded bg-zinc-800 px-1.5 py-0.5 text-zinc-300",children:"nestor config edit"})]})]})]}):null}const xh={low:{bg:"bg-green-500/10",text:"text-green-400",icon:Mc},medium:{bg:"bg-amber-500/10",text:"text-amber-400",icon:ft},high:{bg:"bg-orange-500/10",text:"text-orange-400",icon:ia},critical:{bg:"bg-red-500/10",text:"text-red-400",icon:Cb}},$u={command:"Command",budget:"Budget",config:"Config",hire:"Hire",strategy:"Strategy",deploy:"Deploy",custom:"Custom"},xj={pending:"bg-amber-500/10 text-amber-400",approved:"bg-green-500/10 text-green-400",rejected:"bg-red-500/10 text-red-400",expired:"bg-zinc-500/10 text-zinc-400"};function hh({approval:l,onApprove:c,onReject:u,actionLoading:o,showActions:f}){const[x,g]=d.useState(""),v=xh[l.riskLevel]??xh.medium,y=v.icon,h=o===l.id;return a.jsx("div",{className:"card hover:border-amber-500/20 transition-colors",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[a.jsx("div",{className:`flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg ${v.bg}`,children:a.jsx(y,{className:`h-5 w-5 ${v.text}`})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"font-medium text-zinc-200",children:l.title}),a.jsx("span",{className:`badge ${v.bg} ${v.text} uppercase text-[10px]`,children:l.riskLevel}),a.jsx("span",{className:"badge bg-zinc-700/50 text-zinc-400 text-[10px]",children:$u[l.type]??l.type}),l.status!=="pending"&&a.jsx("span",{className:`badge ${xj[l.status]} uppercase text-[10px]`,children:l.status})]}),l.description&&a.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:l.description}),a.jsxs("p",{className:"mt-1 text-sm text-zinc-500",children:["Agent: ",a.jsx("span",{className:"text-zinc-300",children:l.agentId})]}),Object.keys(l.payload).length>0&&a.jsx("pre",{className:"mt-2 max-h-24 overflow-auto rounded-lg bg-[#0a0a0f] p-3 text-xs text-zinc-400",children:JSON.stringify(l.payload,null,2)}),a.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-zinc-500",children:[a.jsx("span",{children:new Date(l.createdAt).toLocaleString()}),l.reviewerId&&a.jsxs("span",{children:["Reviewed by: ",a.jsx("span",{className:"text-zinc-400",children:l.reviewerId})]}),l.reviewComment&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(wc,{className:"h-3 w-3"}),l.reviewComment]})]})]})]}),f&&l.status==="pending"&&a.jsxs("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[a.jsx("input",{type:"text",placeholder:"Comment...",value:x,onChange:w=>g(w.target.value),className:"input text-xs w-40"}),a.jsxs("button",{onClick:()=>c==null?void 0:c(l.id,x),disabled:h,className:"btn-primary btn-sm",children:[a.jsx(vs,{className:"h-3.5 w-3.5"}),"Approve"]}),a.jsxs("button",{onClick:()=>u==null?void 0:u(l.id,x),disabled:h,className:"btn-danger btn-sm",children:[a.jsx(jt,{className:"h-3.5 w-3.5"}),"Reject"]})]})]})})}function hj({stats:l}){const u=l.pending+l.approved+l.rejected+l.expired>0?Math.round(l.approved/(l.approved+l.rejected||1)*100):0;return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsxs("div",{className:"card text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-amber-400",children:l.pending}),a.jsx("p",{className:"text-xs text-zinc-500",children:"Pending"})]}),a.jsxs("div",{className:"card text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-green-400",children:l.approved}),a.jsx("p",{className:"text-xs text-zinc-500",children:"Approved"})]}),a.jsxs("div",{className:"card text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-red-400",children:l.rejected}),a.jsx("p",{className:"text-xs text-zinc-500",children:"Rejected"})]}),a.jsxs("div",{className:"card text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-zinc-400",children:l.expired}),a.jsx("p",{className:"text-xs text-zinc-500",children:"Expired"})]})]}),a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-3",children:"Approval Rate"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex-1 h-2 rounded-full bg-zinc-800",children:a.jsx("div",{className:"h-full rounded-full bg-green-500",style:{width:`${u}%`}})}),a.jsxs("span",{className:"text-sm font-medium text-zinc-300",children:[u,"%"]})]})]}),Object.keys(l.byType).length>0&&a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-3",children:"By Type"}),a.jsx("div",{className:"space-y-2",children:Object.entries(l.byType).map(([o,f])=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"text-zinc-400",children:$u[o]??o}),a.jsx("span",{className:"font-medium text-zinc-200",children:f})]},o))})]})]})}function gj(){const{t:l}=Ke(),[c,u]=d.useState("pending"),[o,f]=d.useState([]),[x,g]=d.useState([]),[v,y]=d.useState(null),[h,w]=d.useState(!0),[b,j]=d.useState(null),[A,z]=d.useState(null),[N,S]=d.useState(""),[k,D]=d.useState(""),U=d.useCallback(async()=>{try{j(null);const Z={status:"pending"};N&&(Z.type=N);let W=(await El.list(Z)).data;k&&(W=W.filter(Q=>Q.riskLevel===k)),f(W)}catch(Z){j(Z instanceof Error?Z.message:"Failed to fetch approvals"),f([])}finally{w(!1)}},[N,k]),E=d.useCallback(async()=>{try{const Z=await El.history({limit:100});g(Z.data)}catch{g([])}},[]),F=d.useCallback(async()=>{try{const Z=await El.stats();y(Z.data)}catch{y(null)}},[]);d.useEffect(()=>{c==="pending"?U():c==="history"?E():c==="stats"&&F()},[c,U,E,F]),d.useEffect(()=>{if(c==="pending"){const Z=setInterval(U,5e3);return()=>clearInterval(Z)}},[c,U]);const se=async(Z,ee)=>{z(Z);try{await El.approve(Z,{comment:ee||void 0}),f(W=>W.filter(Q=>Q.id!==Z))}catch(W){console.error("Approve failed:",W)}finally{z(null)}},B=async(Z,ee)=>{z(Z);try{await El.reject(Z,{reason:ee||void 0}),f(W=>W.filter(Q=>Q.id!==Z))}catch(W){console.error("Reject failed:",W)}finally{z(null)}};return h&&c==="pending"?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:l("approvals.title")}),o.length>0&&c==="pending"&&a.jsxs("span",{className:"badge bg-amber-500/10 text-amber-400",children:[o.length," pending"]})]}),a.jsx("button",{onClick:()=>{c==="pending"?U():c==="history"?E():F()},className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"flex items-center gap-1 border-b border-border",children:[{key:"pending",label:"Pending",icon:ia},{key:"history",label:"History",icon:ih},{key:"stats",label:"Stats",icon:Aa}].map(({key:Z,label:ee,icon:W})=>a.jsxs("button",{onClick:()=>u(Z),className:`flex items-center gap-2 border-b-2 px-4 py-2.5 text-sm font-medium transition-colors ${c===Z?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:[a.jsx(W,{className:"h-4 w-4"}),ee]},Z))}),c==="pending"&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Kh,{className:"h-4 w-4 text-zinc-500"}),a.jsxs("select",{value:N,onChange:Z=>S(Z.target.value),className:"input text-sm w-40",children:[a.jsx("option",{value:"",children:"All Types"}),Object.entries($u).map(([Z,ee])=>a.jsx("option",{value:Z,children:ee},Z))]}),a.jsxs("select",{value:k,onChange:Z=>D(Z.target.value),className:"input text-sm w-40",children:[a.jsx("option",{value:"",children:"All Risk Levels"}),a.jsx("option",{value:"low",children:"Low"}),a.jsx("option",{value:"medium",children:"Medium"}),a.jsx("option",{value:"high",children:"High"}),a.jsx("option",{value:"critical",children:"Critical"})]})]}),b&&a.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[b,a.jsx("button",{onClick:U,className:"ml-3 underline",children:"Retry"})]}),c==="pending"&&(o.length===0&&!b?a.jsx(Tn,{icon:a.jsx(Mc,{className:"h-8 w-8"}),title:l("approvals.empty"),description:l("approvals.emptyDesc")}):a.jsx("div",{className:"space-y-3",children:o.map(Z=>a.jsx(hh,{approval:Z,onApprove:se,onReject:B,actionLoading:A,showActions:!0},Z.id))})),c==="history"&&(x.length===0?a.jsx(Tn,{icon:a.jsx(ih,{className:"h-8 w-8"}),title:"No history",description:"Approval history will appear here after decisions are made."}):a.jsx("div",{className:"space-y-3",children:x.map(Z=>a.jsx(hh,{approval:Z,actionLoading:null,showActions:!1},Z.id))})),c==="stats"&&v&&a.jsx(hj,{stats:v})]})}const pj="/api";async function yj(l=30){const c=localStorage.getItem("nestor_token"),u={"Content-Type":"application/json"};c&&(u.Authorization=`Bearer ${c}`);const o=localStorage.getItem("nestor_tenant_id");o&&(u["X-Tenant-ID"]=o);try{const f=await fetch(`${pj}/analytics/quality?days=${l}`,{headers:u});return f.ok?(await f.json()).data??null:null}catch{return null}}function _c(l){return`${(l*100).toFixed(0)}%`}function t0(l){return l>0?`+${(l*100).toFixed(0)}%`:`${(l*100).toFixed(0)}%`}function mc({label:l,value:c,icon:u,color:o,bgColor:f,subtitle:x}){return a.jsx("div",{className:"card",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-zinc-400",children:l}),a.jsx("p",{className:"mt-1 text-2xl font-semibold text-white",children:c}),x&&a.jsx("p",{className:"mt-0.5 text-xs text-zinc-500",children:x})]}),a.jsx("div",{className:`flex h-11 w-11 items-center justify-center rounded-xl ${f}`,children:a.jsx(u,{className:`h-5 w-5 ${o}`})})]})})}function bj({data:l}){return l.length===0?a.jsx("div",{className:"flex h-48 items-center justify-center text-zinc-500 text-sm",children:"No data available"}):a.jsx("div",{className:"flex items-end gap-1 h-48",children:l.map(c=>{const u=Math.max(c.successRate*100,2),o=c.successRate>=.8?"bg-emerald-500 hover:bg-emerald-400":c.successRate>=.5?"bg-amber-500 hover:bg-amber-400":"bg-red-500 hover:bg-red-400";return a.jsxs("div",{className:"flex-1 flex flex-col items-center min-w-0",children:[a.jsx("div",{className:`w-full rounded-t transition-all cursor-default min-h-[2px] ${o}`,style:{height:`${u}%`},title:`${c.date}: ${_c(c.successRate)} (${c.completedRuns}/${c.totalRuns} runs)`}),a.jsx("span",{className:"text-[10px] text-zinc-500 mt-1 truncate w-full text-center",children:c.date.slice(5)})]},c.date)})})}function vj({agents:l}){return l.length===0?a.jsx("p",{className:"text-zinc-500 text-sm",children:"No agent data available"}):a.jsx("div",{className:"space-y-2",children:l.map((c,u)=>{const o=c.score>=70?"text-emerald-400":c.score>=50?"text-amber-400":"text-red-400",f=c.score>=70?"bg-emerald-500":c.score>=50?"bg-amber-500":"bg-red-500";return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"w-6 text-xs text-zinc-500 text-right font-mono",children:["#",u+1]}),a.jsx("span",{className:"text-sm text-zinc-300 w-32 truncate",title:c.name,children:c.name}),a.jsx("div",{className:"flex-1 h-2 bg-zinc-800 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full transition-all ${f}`,style:{width:`${Math.min(c.score,100)}%`}})}),a.jsx("span",{className:`text-xs font-medium w-12 text-right ${o}`,children:c.score.toFixed(0)}),a.jsx("span",{className:"text-xs text-zinc-500 w-16 text-right",children:_c(c.successRate)})]},c.agentId)})})}function jj({items:l}){return l.length===0?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-500",children:[a.jsx(tt,{className:"h-4 w-4 text-emerald-500"}),"All agents performing well"]}):a.jsx("div",{className:"space-y-2",children:l.map(c=>a.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-red-500/5 border border-red-500/20",children:[a.jsx(ft,{className:"h-4 w-4 text-red-400 shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"text-sm text-zinc-300 truncate block",children:c.name}),a.jsx("span",{className:"text-xs text-zinc-500",children:c.issue})]}),a.jsx("span",{className:"text-xs text-red-400 font-mono",children:typeof c.metric=="number"&&c.metric<=1?_c(c.metric):t0(c.metric)})]},c.agentId))})}function Nj({tools:l}){if(l.length===0)return a.jsx("p",{className:"text-zinc-500 text-sm",children:"No tool usage data"});const c=Math.max(...l.map(u=>u.count),1);return a.jsx("div",{className:"space-y-2",children:l.slice(0,10).map(u=>{const o=u.failRate>=.3?"text-red-400":u.failRate>=.1?"text-amber-400":"text-zinc-500";return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Oc,{className:"h-3.5 w-3.5 text-zinc-500 shrink-0"}),a.jsx("span",{className:"text-xs text-zinc-300 w-32 truncate font-mono",title:u.name,children:u.name}),a.jsx("div",{className:"flex-1 h-1.5 bg-zinc-800 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-indigo-500 rounded-full",style:{width:`${u.count/c*100}%`}})}),a.jsx("span",{className:"text-xs text-zinc-500 w-10 text-right",children:u.count}),a.jsxs("span",{className:`text-xs w-12 text-right ${o}`,children:[(u.failRate*100).toFixed(0),"% fail"]})]},u.name)})})}function wj({errors:l}){return l.length===0?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-500",children:[a.jsx(tt,{className:"h-4 w-4 text-emerald-500"}),"No recurring errors detected"]}):a.jsx("div",{className:"space-y-2",children:l.slice(0,8).map((c,u)=>a.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-zinc-800/50",children:[a.jsx(Gh,{className:"h-3.5 w-3.5 text-red-400 shrink-0 mt-0.5"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-xs text-zinc-300 font-mono break-all line-clamp-2",children:c.pattern}),a.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[a.jsxs("span",{className:"text-[10px] text-zinc-500",children:[c.count," occurrences"]}),c.lastSeen&&a.jsxs("span",{className:"text-[10px] text-zinc-600",children:["Last: ",new Date(c.lastSeen).toLocaleDateString()]})]})]})]},u))})}function Sj(){const[l,c]=d.useState(null),[u,o]=d.useState(!0),[f,x]=d.useState(null),[g,v]=d.useState(30);if(d.useEffect(()=>{async function w(){o(!0),x(null);const b=await yj(g);b?c(b):x("Failed to load quality metrics"),o(!1)}w()},[g]),u)return a.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:a.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});if(f||!l)return a.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-3",children:[a.jsx(ft,{className:"h-8 w-8 text-amber-500"}),a.jsx("p",{className:"text-zinc-400",children:f??"No data available"})]});const y=l.overallFeedbackScore>=0?"text-emerald-400":"text-red-400",h=l.overallSuccessRate>=.8?"text-emerald-400":l.overallSuccessRate>=.5?"text-amber-400":"text-red-400";return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center gap-2",children:[7,14,30,90].map(w=>a.jsxs("button",{onClick:()=>v(w),className:`px-3 py-1 text-xs rounded-lg transition-colors ${g===w?"bg-indigo-500/20 text-indigo-400 border border-indigo-500/30":"bg-zinc-800/50 text-zinc-500 border border-zinc-700/50 hover:border-zinc-600"}`,children:[w,"d"]},w))}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsx(mc,{label:"Total Runs",value:String(l.totalRuns),icon:Dt,color:"text-blue-400",bgColor:"bg-blue-400/10",subtitle:`Last ${g} days`}),a.jsx(mc,{label:"Success Rate",value:_c(l.overallSuccessRate),icon:tt,color:h,bgColor:l.overallSuccessRate>=.8?"bg-emerald-400/10":"bg-amber-400/10"}),a.jsx(mc,{label:"Feedback Score",value:t0(l.overallFeedbackScore),icon:Dl,color:y,bgColor:l.overallFeedbackScore>=0?"bg-emerald-400/10":"bg-red-400/10"}),a.jsx(mc,{label:"Active Agents",value:`${l.activeAgents} / ${l.totalAgents}`,icon:Cs,color:"text-purple-400",bgColor:"bg-purple-400/10"})]}),a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Aa,{className:"h-4 w-4 text-zinc-400"}),a.jsx("h2",{className:"text-lg font-medium text-white",children:"Success Rate Trend"})]}),a.jsx(bj,{data:l.dailySuccessRates})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(_u,{className:"h-4 w-4 text-zinc-400"}),a.jsx("h2",{className:"text-lg font-medium text-white",children:"Top Performers"})]}),a.jsx(vj,{agents:l.topPerformers})]}),a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(ft,{className:"h-4 w-4 text-zinc-400"}),a.jsx("h2",{className:"text-lg font-medium text-white",children:"Needs Attention"})]}),a.jsx(jj,{items:l.needsAttention})]})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Oc,{className:"h-4 w-4 text-zinc-400"}),a.jsx("h2",{className:"text-lg font-medium text-white",children:"Tool Performance"})]}),a.jsx(Nj,{tools:l.toolPerformance})]}),a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Gh,{className:"h-4 w-4 text-zinc-400"}),a.jsx("h2",{className:"text-lg font-medium text-white",children:"Error Patterns"})]}),a.jsx(wj,{errors:l.errorPatterns})]})]})]})}function fc({label:l,value:c,icon:u,color:o,bgColor:f,subtitle:x}){return a.jsx("div",{className:"card",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-zinc-400",children:l}),a.jsx("p",{className:"mt-1 text-2xl font-semibold text-white",children:c}),x&&a.jsx("p",{className:"mt-0.5 text-xs text-zinc-500",children:x})]}),a.jsx("div",{className:`flex h-11 w-11 items-center justify-center rounded-xl ${f}`,children:a.jsx(u,{className:`h-5 w-5 ${o}`})})]})})}function zj({data:l}){if(l.length===0)return a.jsx("div",{className:"flex h-48 items-center justify-center text-zinc-500 text-sm",children:"No cost data available"});const c=Math.max(...l.map(u=>u.costUsd),1e-4);return a.jsx("div",{className:"flex items-end gap-1 h-48",children:l.map(u=>a.jsxs("div",{className:"flex-1 flex flex-col items-center min-w-0",children:[a.jsx("div",{className:"w-full bg-indigo-500 rounded-t transition-all hover:bg-indigo-400 cursor-default min-h-[2px]",style:{height:`${Math.max(u.costUsd/c*100,1)}%`},title:`${u.date}: $${u.costUsd.toFixed(4)} (${u.runs} runs)`}),a.jsx("span",{className:"text-[10px] text-zinc-500 mt-1 truncate w-full text-center",children:u.date.slice(5)})]},u.date))})}function nn(l){return l<.01?`$${l.toFixed(4)}`:l<1?`$${l.toFixed(3)}`:`$${l.toFixed(2)}`}function gh(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}function kj(){const{t:l}=Ke(),[c,u]=d.useState(null),[o,f]=d.useState([]),[x,g]=d.useState([]),[v,y]=d.useState(null),[h,w]=d.useState(!0),[b,j]=d.useState(null);if(d.useEffect(()=>{async function z(){try{w(!0),j(null);const[N,S,k,D]=await Promise.all([rc.summary(),rc.daily(30),rc.budget(),rc.estimate()]);u(N.data),f(S.data),g(k.data),y(D.data)}catch(N){j(N instanceof Error?N.message:"Failed to load analytics")}finally{w(!1)}}z()},[]),h)return a.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:a.jsx("p",{className:"text-zinc-400",children:l("common.loading")})});if(b)return a.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-3",children:[a.jsx(ft,{className:"h-8 w-8 text-amber-500"}),a.jsx("p",{className:"text-zinc-400",children:b})]});const A=c&&c.totalRuns>0?c.totalCostUsd/c.totalRuns:0;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsx(fc,{label:l("analytics.totalSpend"),value:nn((c==null?void 0:c.totalCostUsd)??0),icon:Ra,color:"text-emerald-400",bgColor:"bg-emerald-400/10"}),a.jsx(fc,{label:l("analytics.totalRuns"),value:String((c==null?void 0:c.totalRuns)??0),icon:Dt,color:"text-blue-400",bgColor:"bg-blue-400/10",subtitle:`${gh((c==null?void 0:c.totalTokens)??0)} tokens`}),a.jsx(fc,{label:l("analytics.avgCostPerRun"),value:nn(A),icon:Eb,color:"text-amber-400",bgColor:"bg-amber-400/10"}),a.jsx(fc,{label:l("analytics.monthlyEstimate"),value:nn((v==null?void 0:v.estimatedUsd)??0),icon:_u,color:"text-purple-400",bgColor:"bg-purple-400/10",subtitle:v?`${v.confidence} confidence`:void 0})]}),a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Aa,{className:"h-4 w-4 text-zinc-400"}),a.jsx("h2",{className:"text-lg font-medium text-white",children:l("analytics.dailyCosts")})]}),a.jsx(zj,{data:o})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"text-lg font-medium text-white mb-4",children:l("analytics.agentBreakdown")}),c&&c.byAgent.length>0?a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-zinc-400",children:[a.jsx("th",{className:"text-left pb-2 font-medium",children:l("common.name")}),a.jsx("th",{className:"text-right pb-2 font-medium",children:l("analytics.runs")}),a.jsx("th",{className:"text-right pb-2 font-medium",children:l("analytics.totalCost")}),a.jsx("th",{className:"text-right pb-2 font-medium",children:l("analytics.avgCost")})]})}),a.jsx("tbody",{children:c.byAgent.map(z=>a.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[a.jsx("td",{className:"py-2 text-white",children:z.agentName}),a.jsx("td",{className:"py-2 text-right text-zinc-300",children:z.runs}),a.jsx("td",{className:"py-2 text-right text-zinc-300",children:nn(z.costUsd)}),a.jsx("td",{className:"py-2 text-right text-zinc-300",children:nn(z.runs>0?z.costUsd/z.runs:0)})]},z.agentId))})]})}):a.jsx("p",{className:"text-zinc-500 text-sm",children:l("analytics.noAgentData")})]}),a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"text-lg font-medium text-white mb-4",children:l("analytics.modelBreakdown")}),c&&c.byModel.length>0?a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-zinc-400",children:[a.jsx("th",{className:"text-left pb-2 font-medium",children:l("analytics.model")}),a.jsx("th",{className:"text-right pb-2 font-medium",children:l("analytics.tokens")}),a.jsx("th",{className:"text-right pb-2 font-medium",children:l("analytics.cost")})]})}),a.jsx("tbody",{children:c.byModel.map(z=>a.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[a.jsx("td",{className:"py-2 text-white font-mono text-xs",children:z.model}),a.jsx("td",{className:"py-2 text-right text-zinc-300",children:gh(z.tokens)}),a.jsx("td",{className:"py-2 text-right text-zinc-300",children:nn(z.costUsd)})]},z.model))})]})}):a.jsx("p",{className:"text-zinc-500 text-sm",children:l("analytics.noModelData")})]})]}),x.length>0&&a.jsxs("div",{className:"card",children:[a.jsx("h2",{className:"text-lg font-medium text-white mb-4",children:l("analytics.budgetUtilization")}),a.jsx("div",{className:"space-y-3",children:x.map(z=>a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("span",{className:"text-sm text-zinc-300 w-32 truncate",children:z.name}),a.jsx("div",{className:"flex-1 h-2 bg-zinc-800 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full transition-all ${z.percent>=90?"bg-red-500":z.percent>=70?"bg-amber-500":"bg-indigo-500"}`,style:{width:`${Math.min(z.percent,100)}%`}})}),a.jsxs("span",{className:"text-xs text-zinc-400 w-24 text-right",children:[nn(z.spentUsd)," / ",nn(z.budgetUsd)]}),a.jsxs("span",{className:`text-xs font-medium w-12 text-right ${z.percent>=90?"text-red-400":z.percent>=70?"text-amber-400":"text-zinc-400"}`,children:[z.percent.toFixed(0),"%"]})]},z.agentId))})]})]})}function Cj(){const{t:l}=Ke(),[c,u]=d.useState("costs");return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:l("analytics.title")}),a.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:l("analytics.description")})]})}),a.jsxs("div",{className:"flex items-center gap-1 border-b border-border",children:[a.jsx("button",{onClick:()=>u("costs"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${c==="costs"?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-300 hover:border-zinc-600"}`,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Ra,{className:"h-4 w-4"}),"Costs"]})}),a.jsx("button",{onClick:()=>u("quality"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${c==="quality"?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-300 hover:border-zinc-600"}`,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(tt,{className:"h-4 w-4"}),"Quality"]})})]}),c==="costs"&&a.jsx(kj,{}),c==="quality"&&a.jsx(Sj,{})]})}function a0(l){return new Date(l).toLocaleString()}function Gu(l){return l===void 0?"--":l<1e3?`${l}ms`:l<6e4?`${(l/1e3).toFixed(1)}s`:`${(l/6e4).toFixed(1)}m`}function Vu(l){switch(l){case"ok":return a.jsx(tt,{className:"h-4 w-4 text-emerald-400"});case"error":return a.jsx(Ot,{className:"h-4 w-4 text-red-400"});default:return a.jsx(ft,{className:"h-4 w-4 text-zinc-500"})}}function n0(l){const c={ok:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",error:"bg-red-500/10 text-red-400 border-red-500/20",unset:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"};return a.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${c[l]??c.unset}`,children:[Vu(l),l]})}function Aj({span:l,traceStart:c,traceDuration:u}){if(u===0)return null;const o=(l.startTime-c)/u*100,f=Math.max((l.durationMs??0)/u*100,.5),x=l.status==="error"?"bg-red-500":l.kind==="server"?"bg-indigo-500":l.kind==="client"?"bg-cyan-500":"bg-emerald-500";return a.jsx("div",{className:"relative h-5 w-full rounded bg-zinc-800/50",children:a.jsx("div",{className:`absolute top-0.5 h-4 rounded ${x} opacity-80`,style:{left:`${Math.min(o,99)}%`,width:`${Math.min(f,100-o)}%`}})})}function Ej({span:l,depth:c,traceStart:u,traceDuration:o}){const[f,x]=d.useState(!1),g=Object.keys(l.attributes).length>0||l.events.length>0;return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:"border-b border-zinc-800/50 hover:bg-zinc-800/30 cursor-pointer transition-colors",onClick:()=>g&&x(!f),children:[a.jsx("td",{className:"py-2 px-3 text-sm font-mono text-zinc-300 whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center gap-1",style:{paddingLeft:`${c*16}px`},children:[g?f?a.jsx(Rl,{className:"h-3 w-3 text-zinc-500"}):a.jsx(_l,{className:"h-3 w-3 text-zinc-500"}):a.jsx("span",{className:"w-3"}),Vu(l.status),a.jsx("span",{className:"ml-1",children:l.name})]})}),a.jsx("td",{className:"py-2 px-3 text-xs text-zinc-500 whitespace-nowrap",children:l.kind}),a.jsx("td",{className:"py-2 px-3 text-xs text-zinc-400 font-mono whitespace-nowrap text-right",children:Gu(l.durationMs)}),a.jsx("td",{className:"py-2 px-3 w-1/3",children:a.jsx(Aj,{span:l,traceStart:u,traceDuration:o})})]}),f&&a.jsx("tr",{className:"border-b border-zinc-800/50",children:a.jsx("td",{colSpan:4,className:"px-6 py-3 bg-zinc-900/50",children:a.jsxs("div",{style:{paddingLeft:`${c*16+16}px`},children:[Object.keys(l.attributes).length>0&&a.jsxs("div",{className:"mb-2",children:[a.jsx("p",{className:"text-xs font-semibold text-zinc-500 uppercase mb-1",children:"Attributes"}),a.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-0.5",children:Object.entries(l.attributes).map(([v,y])=>a.jsxs("div",{className:"text-xs",children:[a.jsxs("span",{className:"text-zinc-500",children:[v,":"]})," ",a.jsx("span",{className:"text-zinc-300 font-mono",children:String(y)})]},v))})]}),l.events.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-zinc-500 uppercase mb-1",children:"Events"}),l.events.map((v,y)=>a.jsxs("div",{className:"text-xs mb-1",children:[a.jsx("span",{className:"text-amber-400",children:v.name}),a.jsxs("span",{className:"text-zinc-600 ml-2",children:["+",v.time-l.startTime,"ms"]}),v.attributes&&Object.entries(v.attributes).map(([h,w])=>a.jsxs("span",{className:"text-zinc-500 ml-2",children:[h,"=",String(w)]},h))]},y))]})]})})})]})}function Tj(l){const c=new Map,u=[];for(const o of l)c.set(o.spanId,{span:o,children:[]});for(const o of l){const f=c.get(o.spanId);o.parentSpanId&&c.has(o.parentSpanId)?c.get(o.parentSpanId).children.push(f):u.push(f)}return u}function s0(l,c=0){const u=[];for(const o of l)u.push({span:o.span,depth:c}),u.push(...s0(o.children,c+1));return u}function Rj({trace:l}){const c=l.startTime,u=l.durationMs??1,o=Tj(l.spans),f=s0(o);return a.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-zinc-800 px-4 py-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-white",children:l.rootSpanName}),a.jsxs("p",{className:"text-xs text-zinc-500 mt-0.5",children:[a0(l.startTime)," · ",l.spanCount," spans · ",Gu(l.durationMs)]})]}),n0(l.status)]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full min-w-[600px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zinc-800 text-xs text-zinc-500 uppercase",children:[a.jsx("th",{className:"py-2 px-3 text-left font-medium",children:"Span"}),a.jsx("th",{className:"py-2 px-3 text-left font-medium w-16",children:"Kind"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium w-20",children:"Duration"}),a.jsx("th",{className:"py-2 px-3 text-left font-medium w-1/3",children:"Timeline"})]})}),a.jsx("tbody",{children:f.map(({span:x,depth:g})=>a.jsx(Ej,{span:x,depth:g,traceStart:c,traceDuration:u},x.spanId))})]})}),a.jsx("div",{className:"border-t border-zinc-800 px-4 py-2",children:a.jsxs("p",{className:"text-xs text-zinc-600 font-mono",children:["traceId: ",l.traceId]})})]})}function Mj(){const[l,c]=d.useState([]),[u,o]=d.useState(null),[f,x]=d.useState(null),[g,v]=d.useState(!0),[y,h]=d.useState(!1),[w,b]=d.useState(null),j=d.useCallback(async()=>{v(!0),b(null);try{const N=await mu.list();c(N.data),h(N.meta.tracingEnabled)}catch(N){b(N instanceof Error?N.message:"Failed to load traces")}finally{v(!1)}},[]);d.useEffect(()=>{j()},[j]);const A=d.useCallback(async N=>{if(f===N){x(null),o(null);return}x(N);try{const S=await mu.get(N);o(S.data)}catch{o(null)}},[f]),z=async()=>{try{await mu.clear(),c([]),o(null),x(null)}catch{}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-white",children:"Traces"}),a.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Distributed tracing for agent runs, HTTP requests, and orchestrations."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!y&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-500/20 bg-amber-500/10 px-3 py-1 text-xs font-medium text-amber-400",children:[a.jsx(ft,{className:"h-3 w-3"}),"Tracing disabled"]}),a.jsxs("button",{onClick:j,className:"inline-flex items-center gap-1.5 rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-700 transition-colors",children:[a.jsx(Wt,{className:"h-3.5 w-3.5"}),"Refresh"]}),a.jsxs("button",{onClick:z,className:"inline-flex items-center gap-1.5 rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-1.5 text-sm text-red-400 hover:bg-zinc-700 transition-colors",children:[a.jsx(It,{className:"h-3.5 w-3.5"}),"Clear"]})]})]}),w&&a.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 p-4",children:a.jsx("p",{className:"text-sm text-red-400",children:w})}),g&&a.jsx("div",{className:"flex items-center justify-center py-12",children:a.jsx("div",{className:"animate-spin h-6 w-6 border-2 border-indigo-500 border-t-transparent rounded-full"})}),!g&&l.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx(Dt,{className:"h-12 w-12 text-zinc-700 mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-zinc-400",children:"No traces recorded"}),a.jsx("p",{className:"mt-1 text-sm text-zinc-600 max-w-md",children:y?"Traces will appear here as agents run and HTTP requests are processed.":"Enable tracing in your nestor.config.json to start recording traces."}),!y&&a.jsx("pre",{className:"mt-4 rounded-lg bg-zinc-900 border border-zinc-800 p-3 text-xs text-zinc-400 font-mono text-left",children:`{
|
|
531
|
+
"observability": {
|
|
532
|
+
"tracing": {
|
|
533
|
+
"enabled": true
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}`})]}),!g&&l.length>0&&a.jsx("div",{className:"space-y-2",children:l.map(N=>a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>A(N.traceId),className:`w-full flex items-center justify-between rounded-lg border px-4 py-3 text-left transition-colors ${f===N.traceId?"border-indigo-500/30 bg-indigo-500/5":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50"}`,children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[f===N.traceId?a.jsx(Rl,{className:"h-4 w-4 text-zinc-500 flex-shrink-0"}):a.jsx(_l,{className:"h-4 w-4 text-zinc-500 flex-shrink-0"}),Vu(N.status),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-white truncate",children:N.rootSpanName}),a.jsx("p",{className:"text-xs text-zinc-500",children:a0(N.startTime)})]})]}),a.jsxs("div",{className:"flex items-center gap-4 flex-shrink-0",children:[a.jsxs("span",{className:"text-xs text-zinc-500",children:[N.spanCount," span",N.spanCount!==1?"s":""]}),a.jsx("span",{className:"text-xs font-mono text-zinc-400 w-16 text-right",children:Gu(N.durationMs)}),n0(N.status)]})]}),f===N.traceId&&u&&a.jsx("div",{className:"mt-2 ml-4",children:a.jsx(Rj,{trace:u})})]},N.traceId))})]})}function l0(){const{login:l,register:c}=Hl(),u=ca(),[o,f]=d.useState("login"),[x,g]=d.useState(""),[v,y]=d.useState(""),[h,w]=d.useState(""),[b,j]=d.useState(""),[A,z]=d.useState(!1),N=async S=>{S.preventDefault(),j(""),z(!0);try{o==="register"?(await c(x,v,h),await l(x,v)):await l(x,v),u("/",{replace:!0})}catch(k){j(k.message||"An error occurred.")}finally{z(!1)}};return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:a.jsxs("div",{className:"w-full max-w-sm",children:[a.jsxs("div",{className:"mb-8 flex flex-col items-center gap-3",children:[a.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-indigo-600 text-white",children:a.jsx(Lc,{className:"h-6 w-6"})}),a.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Nestor Studio"}),a.jsx("p",{className:"text-sm text-zinc-400",children:o==="login"?"Sign in to your account":"Create a new account"})]}),a.jsxs("form",{onSubmit:N,className:"space-y-4",children:[b&&a.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-400",children:[a.jsx(Vh,{className:"h-4 w-4 flex-shrink-0"}),b]}),o==="register"&&a.jsxs("div",{children:[a.jsx("label",{className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Name"}),a.jsx("input",{type:"text",value:h,onChange:S=>w(S.target.value),required:!0,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:"Your name"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Email"}),a.jsx("input",{type:"email",value:x,onChange:S=>g(S.target.value),required:!0,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:"you@example.com"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Password"}),a.jsx("input",{type:"password",value:v,onChange:S=>y(S.target.value),required:!0,minLength:o==="register"?6:1,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:o==="register"?"At least 6 characters":"Your password"})]}),a.jsx("button",{type:"submit",disabled:A,className:"flex w-full items-center justify-center gap-2 rounded-lg bg-indigo-600 px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-indigo-700 disabled:opacity-50",children:A?"Please wait...":o==="login"?a.jsxs(a.Fragment,{children:[a.jsx(Hb,{className:"h-4 w-4"})," Sign In"]}):a.jsxs(a.Fragment,{children:[a.jsx(tv,{className:"h-4 w-4"})," Create Account"]})})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsx("button",{type:"button",onClick:()=>{f(o==="login"?"register":"login"),j("")},className:"text-sm text-zinc-400 transition-colors hover:text-indigo-400",children:o==="login"?"Don't have an account? Register":"Already have an account? Sign in"})})]})})}function Dj(){const{isAdmin:l}=Hl(),[c,u]=d.useState([]),[o,f]=d.useState([]),[x,g]=d.useState("users"),[v,y]=d.useState(!0),[h,w]=d.useState(""),b=d.useCallback(async()=>{try{const N=await fetch("/api/users",{credentials:"include"}),S=await N.json();N.ok&&u(S.data||[])}catch{}},[]),j=d.useCallback(async()=>{try{const N=await fetch("/api/users/audit?limit=50",{credentials:"include"}),S=await N.json();N.ok&&f(S.data||[])}catch{}},[]);d.useEffect(()=>{y(!0),Promise.all([b(),j()]).finally(()=>y(!1))},[b,j]);const A=async(N,S)=>{var k;w("");try{const D=await fetch(`/api/users/${N}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:S})});if(!D.ok){const U=await D.json();throw new Error(((k=U.error)==null?void 0:k.message)||"Failed to update role.")}await b()}catch(D){w(D.message)}},z=async N=>{var S;if(confirm("Are you sure you want to delete this user?")){w("");try{const k=await fetch(`/api/users/${N}`,{method:"DELETE",credentials:"include"});if(!k.ok){const D=await k.json();throw new Error(((S=D.error)==null?void 0:S.message)||"Failed to delete user.")}await b()}catch(k){w(k.message)}}};return l?a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:"User Management"}),a.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Manage users, roles, and view audit log."})]})}),h&&a.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-sm text-red-400",children:h}),a.jsxs("div",{className:"flex gap-1 border-b border-border",children:[a.jsxs("button",{onClick:()=>g("users"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors ${x==="users"?"border-b-2 border-indigo-500 text-indigo-400":"text-zinc-400 hover:text-zinc-200"}`,children:[a.jsx(Cs,{className:"h-4 w-4"})," Users (",c.length,")"]}),a.jsxs("button",{onClick:()=>g("audit"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors ${x==="audit"?"border-b-2 border-indigo-500 text-indigo-400":"text-zinc-400 hover:text-zinc-200"}`,children:[a.jsx(Ac,{className:"h-4 w-4"})," Audit Log"]})]}),v?a.jsx("div",{className:"text-center text-zinc-400 py-8",children:"Loading..."}):x==="users"?a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface",children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Name"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Email"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Role"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Provider"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Last Login"}),a.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium uppercase text-zinc-400",children:"Actions"})]})}),a.jsxs("tbody",{children:[c.map(N=>a.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[a.jsx("td",{className:"px-4 py-3 font-medium text-white",children:N.name}),a.jsx("td",{className:"px-4 py-3 text-zinc-300",children:N.email}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("select",{value:N.role,onChange:S=>A(N.id,S.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs text-white focus:outline-none",children:[a.jsx("option",{value:"admin",children:"Admin"}),a.jsx("option",{value:"member",children:"Member"}),a.jsx("option",{value:"viewer",children:"Viewer"})]})}),a.jsx("td",{className:"px-4 py-3 text-zinc-400",children:N.authProvider}),a.jsx("td",{className:"px-4 py-3 text-zinc-400",children:N.lastLoginAt?new Date(N.lastLoginAt*1e3).toLocaleString():"Never"}),a.jsx("td",{className:"px-4 py-3 text-right",children:a.jsx("button",{onClick:()=>z(N.id),className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-red-500/10 hover:text-red-400",title:"Delete user",children:a.jsx(It,{className:"h-4 w-4"})})})]},N.id)),c.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-zinc-500",children:"No users found."})})]})]})}):a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface",children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Time"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Action"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Resource"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"User"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Details"})]})}),a.jsxs("tbody",{children:[o.map(N=>{var S;return a.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[a.jsx("td",{className:"px-4 py-3 text-zinc-400 whitespace-nowrap",children:new Date(N.createdAt*1e3).toLocaleString()}),a.jsx("td",{className:"px-4 py-3 font-mono text-xs text-indigo-400",children:N.action}),a.jsx("td",{className:"px-4 py-3 text-zinc-300",children:N.resourceType&&a.jsxs("span",{children:[N.resourceType,N.resourceId?`/${N.resourceId.slice(0,8)}`:""]})}),a.jsx("td",{className:"px-4 py-3 text-zinc-400",children:((S=N.userId)==null?void 0:S.slice(0,8))||"-"}),a.jsx("td",{className:"px-4 py-3 text-xs text-zinc-500 max-w-xs truncate",children:N.details?JSON.stringify(N.details):"-"})]},N.id)}),o.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-zinc-500",children:"No audit entries."})})]})]})})]}):a.jsxs("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:[a.jsx(Dc,{className:"mr-2 h-5 w-5"})," Admin access required."]})}function xu({label:l,valueA:c,valueB:u,format:o}){const f=Math.max(c,u,.001);return a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs text-zinc-400",children:l}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-12 text-right text-xs text-indigo-400",children:o(c)}),a.jsxs("div",{className:"flex-1 flex gap-0.5",children:[a.jsx("div",{className:"h-4 rounded-l bg-indigo-500/40",style:{width:`${c/f*50}%`}}),a.jsx("div",{className:"h-4 rounded-r bg-emerald-500/40",style:{width:`${u/f*50}%`}})]}),a.jsx("span",{className:"w-12 text-left text-xs text-emerald-400",children:o(u)})]})]})}function Oj(){const{id:l}=ks(),[c,u]=d.useState([]),[o,f]=d.useState([]),[x,g]=d.useState(!0),[v,y]=d.useState(""),[h,w]=d.useState(!1),[b,j]=d.useState(""),[A,z]=d.useState(""),[N,S]=d.useState(""),[k,D]=d.useState(""),[U,E]=d.useState(null),[F,se]=d.useState(!1),[B,Z]=d.useState(""),[ee,W]=d.useState(""),[Q,ae]=d.useState(""),[K,de]=d.useState(50),[ye,$]=d.useState([]),[P,oe]=d.useState({}),[Ce,Ae]=d.useState(!1),[R,X]=d.useState(""),[te,le]=d.useState(""),[me,pe]=d.useState(""),[we,at]=d.useState(.5),Te=d.useCallback(async()=>{if(l){try{const[H,ne,xe]=await Promise.all([fetch(`/api/agents/${l}/prompts`,{credentials:"include"}),fetch(`/api/agents/${l}/prompts/ab-tests`,{credentials:"include"}),fetch(`/api/agents/${l}/experiments`,{credentials:"include"})]),wt=await H.json(),qc=await ne.json(),$c=await xe.json();if(H.ok&&u(wt.data||[]),ne.ok&&f(qc.data||[]),xe.ok){const rt=$c.data||[];$(rt);for(const Vl of rt)try{const Rs=await fetch(`/api/experiments/${Vl.id}`,{credentials:"include"});if(Rs.ok){const Yl=await Rs.json();oe(Mn=>({...Mn,[Vl.id]:Yl.data}))}}catch{}}}catch{}g(!1)}},[l]);d.useEffect(()=>{Te()},[Te]);const rn=async()=>{var H;if(!(!l||!b.trim())){y("");try{const ne=await fetch(`/api/agents/${l}/prompts`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({systemPrompt:b,name:A||void 0})});if(!ne.ok){const xe=await ne.json();throw new Error(((H=xe.error)==null?void 0:H.message)||"Failed")}w(!1),j(""),z(""),await Te()}catch(ne){y(ne.message)}}},on=async H=>{var ne;if(l){y("");try{const xe=await fetch(`/api/agents/${l}/prompts/${H}/activate`,{method:"PATCH",credentials:"include"});if(!xe.ok){const wt=await xe.json();throw new Error(((ne=wt.error)==null?void 0:ne.message)||"Failed")}await Te()}catch(xe){y(xe.message)}}},As=async()=>{if(!(!l||!N||!k))try{const H=await fetch(`/api/agents/${l}/prompts/compare?a=${N}&b=${k}`,{credentials:"include"}),ne=await H.json();H.ok&&E(ne.data)}catch{}},$l=async()=>{var H;if(!(!l||!B||!ee)){y("");try{const ne=await fetch(`/api/agents/${l}/prompts/ab-tests`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantAId:B,variantBId:ee,name:Q||void 0,splitPercent:K})});if(!ne.ok){const xe=await ne.json();throw new Error(((H=xe.error)==null?void 0:H.message)||"Failed")}se(!1),await Te()}catch(ne){y(ne.message)}}},Pt=async(H,ne)=>{if(l)try{(await fetch(`/api/agents/${l}/prompts/ab-tests/${H}/complete`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({winnerId:ne})})).ok&&await Te()}catch{}},Es=async()=>{if(l){y("");try{const H=c.find(wt=>wt.isActive);if(!H){y("No active version to rollback from.");return}const ne=c.indexOf(H),xe=c[ne+1];if(!xe){y("No previous version to rollback to.");return}await on(xe.id)}catch(H){y(H.message)}}},Ts=async()=>{var H;if(!(!l||!R||!te)){y("");try{const ne=await fetch(`/api/agents/${l}/experiments`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:me||`Experiment ${new Date().toISOString().slice(0,10)}`,variantAId:R,variantBId:te,trafficSplit:we})});if(!ne.ok){const xe=await ne.json();throw new Error(((H=xe.error)==null?void 0:H.message)||"Failed")}Ae(!1),pe(""),X(""),le(""),await Te()}catch(ne){y(ne.message)}}},Gl=async(H,ne)=>{try{(await fetch(`/api/experiments/${H}/complete`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({winnerId:ne})})).ok&&await Te()}catch{}};return x?a.jsx("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Prompt Versions"}),a.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Manage, compare, and A/B test prompt versions for this agent."})]}),a.jsxs("div",{className:"flex gap-2",children:[c.length>=2&&a.jsxs("button",{onClick:Es,className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2 text-sm text-zinc-300 hover:bg-surface-hover",children:[a.jsx(Fh,{className:"h-4 w-4"})," Rollback"]}),a.jsxs("button",{onClick:()=>Ae(!0),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2 text-sm text-zinc-300 hover:bg-surface-hover",children:[a.jsx(Dt,{className:"h-4 w-4"})," New Experiment"]}),a.jsxs("button",{onClick:()=>se(!0),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2 text-sm text-zinc-300 hover:bg-surface-hover",children:[a.jsx(du,{className:"h-4 w-4"})," New A/B Test"]}),a.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-3 py-2 text-sm font-medium text-white hover:bg-indigo-700",children:[a.jsx(Nt,{className:"h-4 w-4"})," New Version"]})]})]}),v&&a.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-sm text-red-400",children:v}),h&&a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium text-white",children:"Create New Version"}),a.jsx("button",{onClick:()=>w(!1),className:"text-zinc-400 hover:text-white",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsx("input",{type:"text",value:A,onChange:H=>z(H.target.value),placeholder:"Version name (optional)",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),a.jsx("textarea",{value:b,onChange:H=>j(H.target.value),placeholder:"System prompt...",rows:8,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white font-mono"}),a.jsx("button",{onClick:rn,disabled:!b.trim(),className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:"Create Version"})]}),a.jsxs("div",{className:"space-y-2",children:[c.map(H=>a.jsxs("div",{className:`rounded-lg border p-4 ${H.isActive?"border-indigo-500/50 bg-indigo-500/5":"border-border bg-surface"}`,children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-surface text-sm font-bold text-zinc-300",children:["v",H.version]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium text-white",children:H.name||`Version ${H.version}`}),H.isActive&&a.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-green-500/20 px-2 py-0.5 text-xs text-green-400",children:[a.jsx(tt,{className:"h-3 w-3"})," Active"]})]}),a.jsxs("div",{className:"mt-1 flex items-center gap-4 text-xs text-zinc-400",children:[a.jsxs("span",{children:[H.totalRuns," runs"]}),a.jsxs("span",{children:["Score: ",H.performanceScore!=null?`${(H.performanceScore*100).toFixed(0)}%`:"N/A"]}),a.jsxs("span",{children:["Avg cost: $",H.avgCostUsd.toFixed(4)]}),a.jsxs("span",{children:["Avg duration: ",H.avgDurationMs.toFixed(0),"ms"]})]})]})]}),a.jsx("div",{className:"flex items-center gap-2",children:!H.isActive&&a.jsx("button",{onClick:()=>on(H.id),className:"rounded-lg border border-border px-3 py-1.5 text-xs text-zinc-300 hover:bg-surface-hover",children:"Activate"})})]}),a.jsx("div",{className:"mt-3 rounded-lg bg-background p-3",children:a.jsxs("pre",{className:"max-h-24 overflow-y-auto text-xs text-zinc-400 font-mono whitespace-pre-wrap",children:[H.systemPrompt.slice(0,500),H.systemPrompt.length>500?"...":""]})})]},H.id)),c.length===0&&a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-8 text-center text-zinc-400",children:[a.jsx(Ac,{className:"mx-auto mb-2 h-8 w-8"}),"No prompt versions yet. Create your first version."]})]}),c.length>=2&&a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[a.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium text-white",children:[a.jsx(Aa,{className:"h-4 w-4"})," Compare Versions"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("select",{value:N,onChange:H=>S(H.target.value),className:"flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"",children:"Select version A"}),c.map(H=>a.jsxs("option",{value:H.id,children:["v",H.version," - ",H.name||`Version ${H.version}`]},H.id))]}),a.jsx(kb,{className:"h-4 w-4 text-zinc-400 flex-shrink-0"}),a.jsxs("select",{value:k,onChange:H=>D(H.target.value),className:"flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"",children:"Select version B"}),c.map(H=>a.jsxs("option",{value:H.id,children:["v",H.version," - ",H.name||`Version ${H.version}`]},H.id))]}),a.jsx("button",{onClick:As,disabled:!N||!k||N===k,className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm text-white hover:bg-indigo-700 disabled:opacity-50",children:"Compare"})]}),U&&a.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[a.jsxs("div",{className:"rounded-lg border border-border bg-background p-3",children:[a.jsxs("h4",{className:"text-sm font-medium text-indigo-400 mb-2",children:["Variant A (v",U.variantA.version,")"]}),a.jsxs("div",{className:"space-y-1 text-xs",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Success Rate"}),a.jsxs("span",{className:"text-white",children:[(U.aSuccessRate*100).toFixed(1),"%"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Cost"}),a.jsxs("span",{className:"text-white",children:["$",U.aCostAvg.toFixed(4)]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Duration"}),a.jsxs("span",{className:"text-white",children:[U.aDurationAvg.toFixed(0),"ms"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Total Runs"}),a.jsx("span",{className:"text-white",children:U.variantA.totalRuns})]})]})]}),a.jsxs("div",{className:"rounded-lg border border-border bg-background p-3",children:[a.jsxs("h4",{className:"text-sm font-medium text-emerald-400 mb-2",children:["Variant B (v",U.variantB.version,")"]}),a.jsxs("div",{className:"space-y-1 text-xs",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Success Rate"}),a.jsxs("span",{className:"text-white",children:[(U.bSuccessRate*100).toFixed(1),"%"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Cost"}),a.jsxs("span",{className:"text-white",children:["$",U.bCostAvg.toFixed(4)]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Duration"}),a.jsxs("span",{className:"text-white",children:[U.bDurationAvg.toFixed(0),"ms"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Total Runs"}),a.jsx("span",{className:"text-white",children:U.variantB.totalRuns})]})]})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("h3",{className:"flex items-center gap-2 text-lg font-medium text-white",children:[a.jsx(du,{className:"h-5 w-5"})," A/B Tests"]}),F&&a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h4",{className:"text-sm font-medium text-white",children:"New A/B Test"}),a.jsx("button",{onClick:()=>se(!1),className:"text-zinc-400 hover:text-white",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsx("input",{type:"text",value:Q,onChange:H=>ae(H.target.value),placeholder:"Test name (optional)",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("select",{value:B,onChange:H=>Z(H.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"",children:"Variant A"}),c.map(H=>a.jsxs("option",{value:H.id,children:["v",H.version," - ",H.name||`Version ${H.version}`]},H.id))]}),a.jsxs("select",{value:ee,onChange:H=>W(H.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"",children:"Variant B"}),c.map(H=>a.jsxs("option",{value:H.id,children:["v",H.version," - ",H.name||`Version ${H.version}`]},H.id))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs text-zinc-400",children:["Traffic split: ",K,"% A / ",100-K,"% B"]}),a.jsx("input",{type:"range",min:10,max:90,value:K,onChange:H=>de(Number(H.target.value)),className:"w-full"})]}),a.jsx("button",{onClick:$l,disabled:!B||!ee||B===ee,className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:"Start Test"})]}),o.map(H=>{const ne=c.find(wt=>wt.id===H.variantAId),xe=c.find(wt=>wt.id===H.variantBId);return a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(du,{className:"h-4 w-4 text-indigo-400"}),a.jsx("span",{className:"font-medium text-white",children:H.name}),a.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs ${H.status==="running"?"bg-green-500/20 text-green-400":H.status==="completed"?"bg-blue-500/20 text-blue-400":"bg-zinc-500/20 text-zinc-400"}`,children:H.status})]}),a.jsxs("span",{className:"text-xs text-zinc-400",children:[H.totalRuns," runs"]})]}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 text-xs",children:[a.jsxs("div",{className:"rounded bg-background p-2",children:[a.jsxs("div",{className:"text-zinc-400",children:["Variant A (",H.splitPercent,"%)"]}),a.jsxs("div",{className:"text-white mt-1",children:["v",(ne==null?void 0:ne.version)??"?"," - ",(ne==null?void 0:ne.name)||"unnamed"]}),ne&&a.jsxs("div",{className:"text-zinc-400 mt-1",children:["Score: ",ne.performanceScore!=null?`${(ne.performanceScore*100).toFixed(0)}%`:"N/A"]})]}),a.jsxs("div",{className:"rounded bg-background p-2",children:[a.jsxs("div",{className:"text-zinc-400",children:["Variant B (",100-H.splitPercent,"%)"]}),a.jsxs("div",{className:"text-white mt-1",children:["v",(xe==null?void 0:xe.version)??"?"," - ",(xe==null?void 0:xe.name)||"unnamed"]}),xe&&a.jsxs("div",{className:"text-zinc-400 mt-1",children:["Score: ",xe.performanceScore!=null?`${(xe.performanceScore*100).toFixed(0)}%`:"N/A"]})]})]}),H.status==="running"&&ne&&xe&&a.jsxs("div",{className:"mt-3 flex gap-2",children:[a.jsxs("button",{onClick:()=>Pt(H.id,H.variantAId),className:"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs text-indigo-400 hover:bg-surface-hover",children:[a.jsx(ps,{className:"h-3 w-3"})," A wins"]}),a.jsxs("button",{onClick:()=>Pt(H.id,H.variantBId),className:"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs text-emerald-400 hover:bg-surface-hover",children:[a.jsx(ps,{className:"h-3 w-3"})," B wins"]})]}),H.winnerId&&a.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-yellow-400",children:[a.jsx(ps,{className:"h-3 w-3"}),"Winner: v",H.winnerId===H.variantAId?ne==null?void 0:ne.version:xe==null?void 0:xe.version]})]},H.id)}),o.length===0&&!F&&a.jsx("div",{className:"rounded-lg border border-border bg-surface p-6 text-center text-zinc-400 text-sm",children:"No A/B tests yet. Create one to compare prompt performance."})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("h3",{className:"flex items-center gap-2 text-lg font-medium text-white",children:[a.jsx(Dt,{className:"h-5 w-5"})," Experiments"]}),Ce&&a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h4",{className:"text-sm font-medium text-white",children:"New Experiment"}),a.jsx("button",{onClick:()=>Ae(!1),className:"text-zinc-400 hover:text-white",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsx("input",{type:"text",value:me,onChange:H=>pe(H.target.value),placeholder:"Experiment name",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("select",{value:R,onChange:H=>X(H.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"",children:"Variant A"}),c.map(H=>a.jsxs("option",{value:H.id,children:["v",H.version," - ",H.name||`Version ${H.version}`]},H.id))]}),a.jsxs("select",{value:te,onChange:H=>le(H.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"",children:"Variant B"}),c.map(H=>a.jsxs("option",{value:H.id,children:["v",H.version," - ",H.name||`Version ${H.version}`]},H.id))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs text-zinc-400",children:["Traffic split: ",Math.round(we*100),"% A / ",Math.round((1-we)*100),"% B"]}),a.jsx("input",{type:"range",min:10,max:90,value:we*100,onChange:H=>at(Number(H.target.value)/100),className:"w-full"})]}),a.jsx("button",{onClick:Ts,disabled:!R||!te||R===te,className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:"Start Experiment"})]}),ye.map(H=>{const ne=P[H.id];return a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Dt,{className:"h-4 w-4 text-indigo-400"}),a.jsx("span",{className:"font-medium text-white",children:H.name}),a.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs ${H.status==="running"?"bg-green-500/20 text-green-400":H.status==="completed"?"bg-blue-500/20 text-blue-400":H.status==="paused"?"bg-yellow-500/20 text-yellow-400":"bg-zinc-500/20 text-zinc-400"}`,children:H.status})]}),a.jsxs("span",{className:"text-xs text-zinc-400",children:["Split: ",Math.round(H.trafficSplit*100),"% / ",Math.round((1-H.trafficSplit)*100),"%"]})]}),ne&&a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"rounded-lg border border-indigo-500/20 bg-background p-3",children:[a.jsxs("h5",{className:"text-xs font-medium text-indigo-400 mb-2",children:["Variant A (v",ne.variantA.version.version,")"]}),a.jsxs("div",{className:"space-y-1 text-xs",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Runs"}),a.jsx("span",{className:"text-white",children:ne.variantA.runs})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Success Rate"}),a.jsxs("span",{className:"text-white",children:[(ne.variantA.successRate*100).toFixed(1),"%"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Cost"}),a.jsxs("span",{className:"text-white",children:["$",ne.variantA.avgCostUsd.toFixed(4)]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Duration"}),a.jsxs("span",{className:"text-white",children:[ne.variantA.avgDurationMs.toFixed(0),"ms"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Feedback"}),a.jsx("span",{className:"text-white",children:ne.variantA.avgFeedbackScore.toFixed(2)})]})]})]}),a.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-background p-3",children:[a.jsxs("h5",{className:"text-xs font-medium text-emerald-400 mb-2",children:["Variant B (v",ne.variantB.version.version,")"]}),a.jsxs("div",{className:"space-y-1 text-xs",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Runs"}),a.jsx("span",{className:"text-white",children:ne.variantB.runs})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Success Rate"}),a.jsxs("span",{className:"text-white",children:[(ne.variantB.successRate*100).toFixed(1),"%"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Cost"}),a.jsxs("span",{className:"text-white",children:["$",ne.variantB.avgCostUsd.toFixed(4)]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Duration"}),a.jsxs("span",{className:"text-white",children:[ne.variantB.avgDurationMs.toFixed(0),"ms"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-zinc-400",children:"Avg Feedback"}),a.jsx("span",{className:"text-white",children:ne.variantB.avgFeedbackScore.toFixed(2)})]})]})]})]}),a.jsxs("div",{className:"space-y-2 rounded-lg bg-background p-3",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[a.jsx("span",{className:"text-indigo-400",children:"Variant A"}),a.jsx("span",{className:"text-emerald-400",children:"Variant B"})]}),a.jsx(xu,{label:"Success Rate",valueA:ne.variantA.successRate,valueB:ne.variantB.successRate,format:xe=>`${(xe*100).toFixed(0)}%`}),a.jsx(xu,{label:"Avg Cost",valueA:ne.variantA.avgCostUsd,valueB:ne.variantB.avgCostUsd,format:xe=>`$${xe.toFixed(3)}`}),a.jsx(xu,{label:"Duration",valueA:ne.variantA.avgDurationMs,valueB:ne.variantB.avgDurationMs,format:xe=>`${xe.toFixed(0)}ms`})]}),a.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-background p-3 text-xs",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Aa,{className:"h-3.5 w-3.5 text-zinc-400"}),a.jsxs("span",{className:"text-zinc-400",children:["p-value: ",ne.statisticalSignificance.toFixed(4)]}),ne.statisticalSignificance<.05&&a.jsx("span",{className:"rounded-full bg-green-500/20 px-2 py-0.5 text-green-400",children:"Significant"})]}),a.jsx("span",{className:`font-medium ${ne.recommendation==="A"?"text-indigo-400":ne.recommendation==="B"?"text-emerald-400":"text-zinc-400"}`,children:ne.recommendation==="insufficient_data"?"Need more data":`Recommendation: Variant ${ne.recommendation}`})]}),H.status==="running"&&ne.variantA.runs>0&&ne.variantB.runs>0&&a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("button",{onClick:()=>Gl(H.id,H.variantAId),className:"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs text-indigo-400 hover:bg-surface-hover",children:[a.jsx(ps,{className:"h-3 w-3"})," A wins"]}),a.jsxs("button",{onClick:()=>Gl(H.id,H.variantBId),className:"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs text-emerald-400 hover:bg-surface-hover",children:[a.jsx(ps,{className:"h-3 w-3"})," B wins"]})]}),H.winnerId&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-yellow-400",children:[a.jsx(ps,{className:"h-3 w-3"}),"Winner: ",H.winnerId===H.variantAId?"Variant A":"Variant B"]})]}),!ne&&a.jsx("div",{className:"mt-3 text-xs text-zinc-500",children:"No runs yet. Run the agent to start collecting data."})]},H.id)}),ye.length===0&&!Ce&&a.jsx("div",{className:"rounded-lg border border-border bg-surface p-6 text-center text-zinc-400 text-sm",children:"No experiments yet. Create one to A/B test prompts with per-run metrics and statistical analysis."})]})]})}const i0="/api";async function xc(l){const c=localStorage.getItem("nestor_token"),u={"Content-Type":"application/json"};c&&(u.Authorization=`Bearer ${c}`);const o=await fetch(`${i0}${l}`,{headers:u});if(!o.ok)throw new Error(`API error: ${o.status}`);return o.json()}async function Lj(l){const c=localStorage.getItem("nestor_token"),u={"Content-Type":"application/json"};c&&(u.Authorization=`Bearer ${c}`);const o=await fetch(`${i0}${l}`,{method:"DELETE",headers:u});if(!o.ok)throw new Error(`API error: ${o.status}`)}const _j={observation:"bg-blue-500/20 text-blue-400",fact:"bg-green-500/20 text-green-400",instruction:"bg-purple-500/20 text-purple-400",reflection:"bg-amber-500/20 text-amber-400"};function ph({type:l}){return a.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${_j[l]??"bg-zinc-500/20 text-zinc-400"}`,children:l})}function Uj({value:l}){const c=Math.round(l*100),u=c>=80?"bg-red-500":c>=50?"bg-amber-500":"bg-green-500";return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"h-1.5 w-16 rounded-full bg-zinc-700",children:a.jsx("div",{className:`h-full rounded-full ${u}`,style:{width:`${c}%`}})}),a.jsxs("span",{className:"text-xs text-zinc-500",children:[c,"%"]})]})}function hc({label:l,value:c,icon:u}){return a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-zinc-400",children:[a.jsx(u,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs font-medium uppercase tracking-wider",children:l})]}),a.jsx("p",{className:"mt-2 text-2xl font-semibold text-white",children:c})]})}function Bj(){const{t:l}=Ke(),[c,u]=d.useState([]),[o,f]=d.useState([]),[x,g]=d.useState(null),[v,y]=d.useState(!0),[h,w]=d.useState(""),[b,j]=d.useState(""),[A,z]=d.useState(""),[N,S]=d.useState(null);d.useEffect(()=>{xc("/agents").then(E=>f(E.data)).catch(console.error)},[]);const k=d.useCallback(async()=>{y(!0);try{const E=new URLSearchParams;h&&E.set("q",h),b&&E.set("agentId",b),A&&E.set("type",A),E.set("limit","100");const F=E.toString(),se=await xc(`/memory?${F}`);if(u(se.data),b){const B=await xc(`/memory/stats/${b}`);g(B.data)}else if(o.length>0){let B=0,Z=0;const ee={};let W=!1;for(const Q of o)try{const ae=await xc(`/memory/stats/${Q.id}`);B+=ae.data.total,Z+=ae.data.avgImportance*ae.data.total;for(const[K,de]of Object.entries(ae.data.byType))ee[K]=(ee[K]??0)+de;ae.data.fts5Available&&(W=!0)}catch{}g({total:B,byType:ee,avgImportance:B>0?Z/B:0,fts5Available:W})}}catch(E){console.error("Failed to load memories:",E)}finally{y(!1)}},[h,b,A,o]);d.useEffect(()=>{(o.length>0||b)&&k()},[k,o.length,b]);const D=async E=>{S(E);try{await Lj(`/memory/${E}`),u(F=>F.filter(se=>se.id!==E))}catch(F){console.error("Failed to delete memory:",F)}finally{S(null)}},U=E=>{E.preventDefault(),k()};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ys,{className:"h-6 w-6 text-indigo-400"}),a.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Memory"})]}),(x==null?void 0:x.fts5Available)&&a.jsx("span",{className:"rounded-full bg-green-500/10 px-3 py-1 text-xs font-medium text-green-400",children:"FTS5 Active"})]}),x&&a.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[a.jsx(hc,{label:"Total Memories",value:x.total,icon:ys}),a.jsx(hc,{label:"Avg Importance",value:`${Math.round(x.avgImportance*100)}%`,icon:Aa}),a.jsx(hc,{label:"Types",value:Object.keys(x.byType).length,icon:Jb}),a.jsx(hc,{label:"Observations",value:x.byType.observation??0,icon:js})]}),x&&Object.keys(x.byType).length>0&&a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[a.jsx("h3",{className:"mb-3 text-sm font-medium text-zinc-400",children:"Distribution by Type"}),a.jsx("div",{className:"flex gap-4",children:Object.entries(x.byType).map(([E,F])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ph,{type:E}),a.jsx("span",{className:"text-sm text-white",children:F})]},E))})]}),a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[a.jsxs("form",{onSubmit:U,className:"flex flex-1 gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Ul,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),a.jsx("input",{type:"text",value:h,onChange:E=>w(E.target.value),placeholder:"Search memories...",className:"w-full rounded-lg border border-border bg-surface py-2 pl-10 pr-4 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none"})]}),a.jsx("button",{type:"submit",className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:"Search"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("select",{value:b,onChange:E=>j(E.target.value),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white focus:border-indigo-500 focus:outline-none",children:[a.jsx("option",{value:"",children:"All Agents"}),o.map(E=>a.jsx("option",{value:E.id,children:E.name},E.id))]}),a.jsxs("select",{value:A,onChange:E=>z(E.target.value),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white focus:border-indigo-500 focus:outline-none",children:[a.jsx("option",{value:"",children:"All Types"}),a.jsx("option",{value:"observation",children:"Observation"}),a.jsx("option",{value:"fact",children:"Fact"}),a.jsx("option",{value:"instruction",children:"Instruction"}),a.jsx("option",{value:"reflection",children:"Reflection"})]})]})]}),v?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):c.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-border bg-surface py-16",children:[a.jsx(ys,{className:"h-12 w-12 text-zinc-600"}),a.jsx("p",{className:"mt-4 text-sm text-zinc-400",children:"No memories found"}),a.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Memories are created when agents store observations, facts, and reflections."})]}):a.jsx("div",{className:"space-y-2",children:c.map(E=>a.jsx("div",{className:"group rounded-lg border border-border bg-surface p-4 transition-colors hover:border-border/80",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ph,{type:E.memoryType}),a.jsx(Uj,{value:E.importance}),a.jsxs("span",{className:"text-xs text-zinc-500",children:[new Date(E.createdAt*1e3).toLocaleDateString()," ",new Date(E.createdAt*1e3).toLocaleTimeString()]}),E.accessCount>0&&a.jsxs("span",{className:"text-xs text-zinc-600",children:["accessed ",E.accessCount,"x"]})]}),a.jsx("p",{className:"mt-2 text-sm text-zinc-200 leading-relaxed",children:E.content}),E.tags.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:E.tags.map(F=>a.jsxs("span",{className:"inline-flex items-center rounded bg-zinc-800 px-1.5 py-0.5 text-[10px] text-zinc-400",children:["#",F]},F))})]}),a.jsx("button",{onClick:()=>D(E.id),disabled:N===E.id,className:"rounded p-1.5 text-zinc-500 opacity-0 transition-all hover:bg-red-500/10 hover:text-red-400 group-hover:opacity-100 disabled:opacity-50",title:"Delete memory",children:N===E.id?a.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border border-red-400 border-t-transparent"}):a.jsx(It,{className:"h-4 w-4"})})]})},E.id))})]})}const Hj="/api/budget";function qj(){const l={"Content-Type":"application/json"},c=localStorage.getItem("nestor_token");return c&&(l.Authorization=`Bearer ${c}`),l}async function sn(l,c){const u=await fetch(`${Hj}${l}`,{...c,headers:qj()});if(!u.ok)throw new Error(`API error: ${u.status}`);if(u.status!==204)return u.json()}const An={listPolicies:()=>sn("/policies"),createPolicy:l=>sn("/policies",{method:"POST",body:JSON.stringify(l)}),updatePolicy:(l,c)=>sn(`/policies/${l}`,{method:"PUT",body:JSON.stringify(c)}),deletePolicy:l=>sn(`/policies/${l}`,{method:"DELETE"}),utilization:()=>sn("/utilization"),incidents:(l=50)=>sn(`/incidents?limit=${l}`),pauseAgent:l=>sn(`/agents/${l}/pause`,{method:"POST",body:"{}"}),resumeAgent:l=>sn(`/agents/${l}/resume`,{method:"POST",body:"{}"})};function Su(l){return l<.01?`$${l.toFixed(4)}`:l<1?`$${l.toFixed(3)}`:`$${l.toFixed(2)}`}function c0(l){return new Date(l*1e3).toLocaleString()}function r0(l){switch(l){case"warning":return"text-amber-400";case"breach":return"text-red-400";case"pause":return"text-orange-400";case"resume":return"text-emerald-400";default:return"text-zinc-400"}}function $j(l){return l>=90?"bg-red-500":l>=70?"bg-amber-500":"bg-emerald-500"}function yh({initial:l,onSave:c,onCancel:u}){const[o,f]=d.useState((l==null?void 0:l.name)??""),[x,g]=d.useState((l==null?void 0:l.scope)??"global"),[v,y]=d.useState((l==null?void 0:l.scopeId)??""),[h,w]=d.useState((l==null?void 0:l.window)??"monthly"),[b,j]=d.useState(String((l==null?void 0:l.limitUsd)??10)),[A,z]=d.useState(String((l==null?void 0:l.warningThresholdPercent)??80)),[N,S]=d.useState((l==null?void 0:l.action)??"stop"),[k,D]=d.useState((l==null?void 0:l.enabled)!==!1),U=E=>{E.preventDefault(),c({name:o,scope:x,scopeId:v||null,window:h,limitUsd:parseFloat(b)||10,warningThresholdPercent:parseFloat(A)||80,action:N,enabled:k})};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:a.jsxs("div",{className:"w-full max-w-md rounded-xl border border-border bg-surface p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:l!=null&&l.id?"Edit Policy":"New Budget Policy"}),a.jsx("button",{onClick:u,className:"text-zinc-400 hover:text-white",children:a.jsx(jt,{className:"h-5 w-5"})})]}),a.jsxs("form",{onSubmit:U,className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Name"}),a.jsx("input",{value:o,onChange:E=>f(E.target.value),required:!0,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Scope"}),a.jsxs("select",{value:x,onChange:E=>g(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"global",children:"Global"}),a.jsx("option",{value:"agent",children:"Agent"}),a.jsx("option",{value:"workflow",children:"Workflow"}),a.jsx("option",{value:"tenant",children:"Tenant"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Scope ID"}),a.jsx("input",{value:v,onChange:E=>y(E.target.value),placeholder:"(optional)",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Window"}),a.jsxs("select",{value:h,onChange:E=>w(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"per_run",children:"Per Run"}),a.jsx("option",{value:"hourly",children:"Hourly"}),a.jsx("option",{value:"daily",children:"Daily"}),a.jsx("option",{value:"weekly",children:"Weekly"}),a.jsx("option",{value:"monthly",children:"Monthly"}),a.jsx("option",{value:"lifetime",children:"Lifetime"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Limit (USD)"}),a.jsx("input",{type:"number",step:"0.01",min:"0",value:b,onChange:E=>j(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Warning at (%)"}),a.jsx("input",{type:"number",step:"1",min:"0",max:"100",value:A,onChange:E=>z(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Action"}),a.jsxs("select",{value:N,onChange:E=>S(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"stop",children:"Stop"}),a.jsx("option",{value:"pause",children:"Pause"}),a.jsx("option",{value:"warn",children:"Warn"}),a.jsx("option",{value:"notify",children:"Notify"})]})]})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm text-zinc-300",children:[a.jsx("input",{type:"checkbox",checked:k,onChange:E=>D(E.target.checked),className:"rounded border-border"}),"Enabled"]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[a.jsx("button",{type:"button",onClick:u,className:"px-4 py-2 text-sm text-zinc-400 hover:text-white",children:"Cancel"}),a.jsx("button",{type:"submit",className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:"Save"})]})]})]})})}function Gj({report:l}){const c=l.policy;return a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-white",children:c.name}),a.jsxs("p",{className:"text-xs text-zinc-500",children:[c.scope,c.scopeId?` / ${c.scopeId}`:""," · ",c.window," · ",c.action]})]}),a.jsx("span",{className:`text-xs font-medium ${c.enabled?"text-emerald-400":"text-zinc-500"}`,children:c.enabled?"Active":"Disabled"})]}),a.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs text-zinc-400",children:[a.jsxs("span",{children:[Su(l.spentUsd)," / ",Su(c.limitUsd)]}),a.jsxs("span",{children:[l.utilizationPercent.toFixed(1),"%"]})]}),a.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-zinc-800",children:a.jsx("div",{className:`h-full rounded-full transition-all ${$j(l.utilizationPercent)}`,style:{width:`${Math.min(100,l.utilizationPercent)}%`}})}),l.incidents.length>0&&a.jsxs("div",{className:"mt-2 text-xs text-zinc-500",children:["Last incident: ",a.jsx("span",{className:r0(l.incidents[0].type),children:l.incidents[0].type})," ",c0(l.incidents[0].createdAt)]})]})}function Vj(){const{t:l}=Ke(),[c,u]=d.useState([]),[o,f]=d.useState([]),[x,g]=d.useState([]),[v,y]=d.useState(!0),[h,w]=d.useState(null),[b,j]=d.useState(!1),[A,z]=d.useState(null),N=d.useCallback(async()=>{try{y(!0),w(null);const[E,F,se]=await Promise.all([An.listPolicies(),An.utilization(),An.incidents(50)]);u(E.data),f(F.data),g(se.data)}catch(E){w(E instanceof Error?E.message:"Failed to load budget data")}finally{y(!1)}},[]);d.useEffect(()=>{N()},[N]);const S=async E=>{try{await An.createPolicy(E),j(!1),await N()}catch(F){w(F instanceof Error?F.message:"Failed to create policy")}},k=async E=>{if(A)try{await An.updatePolicy(A.id,E),z(null),await N()}catch(F){w(F instanceof Error?F.message:"Failed to update policy")}},D=async E=>{if(confirm("Delete this budget policy?"))try{await An.deletePolicy(E),await N()}catch(F){w(F instanceof Error?F.message:"Failed to delete policy")}},U=async E=>{try{await An.resumeAgent(E),await N()}catch(F){w(F instanceof Error?F.message:"Failed to resume agent")}};return v?a.jsx("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:"Loading budget data..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-white",children:"Budget Management"}),a.jsx("p",{className:"text-sm text-zinc-400",children:"Scoped budget policies, utilization tracking, and cost control."})]}),a.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:[a.jsx(Nt,{className:"h-4 w-4"})," New Policy"]})]}),h&&a.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-400",children:h}),o.length>0&&a.jsxs("section",{children:[a.jsx("h2",{className:"mb-3 text-lg font-semibold text-white",children:"Utilization"}),a.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:o.map(E=>a.jsx(Gj,{report:E},E.policy.id))})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-3 text-lg font-semibold text-white",children:"Policies"}),c.length===0?a.jsx("div",{className:"card text-center text-sm text-zinc-500 py-8",children:'No budget policies configured. Click "New Policy" to create one.'}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-zinc-500",children:[a.jsx("th",{className:"py-2 px-3 font-medium",children:"Name"}),a.jsx("th",{className:"py-2 px-3 font-medium",children:"Scope"}),a.jsx("th",{className:"py-2 px-3 font-medium",children:"Window"}),a.jsx("th",{className:"py-2 px-3 font-medium",children:"Limit"}),a.jsx("th",{className:"py-2 px-3 font-medium",children:"Action"}),a.jsx("th",{className:"py-2 px-3 font-medium",children:"Status"}),a.jsx("th",{className:"py-2 px-3 font-medium text-right",children:"Actions"})]})}),a.jsx("tbody",{children:c.map(E=>a.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover transition-colors",children:[a.jsx("td",{className:"py-2.5 px-3 text-white font-medium",children:E.name}),a.jsxs("td",{className:"py-2.5 px-3 text-zinc-300",children:[E.scope,E.scopeId?a.jsxs("span",{className:"text-zinc-500",children:[" / ",E.scopeId]}):""]}),a.jsx("td",{className:"py-2.5 px-3 text-zinc-300",children:E.window}),a.jsx("td",{className:"py-2.5 px-3 text-zinc-300",children:Su(E.limitUsd)}),a.jsx("td",{className:"py-2.5 px-3",children:a.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${E.action==="stop"?"bg-red-500/10 text-red-400":E.action==="pause"?"bg-orange-500/10 text-orange-400":E.action==="warn"?"bg-amber-500/10 text-amber-400":"bg-blue-500/10 text-blue-400"}`,children:E.action})}),a.jsx("td",{className:"py-2.5 px-3",children:a.jsx("span",{className:`text-xs ${E.enabled?"text-emerald-400":"text-zinc-500"}`,children:E.enabled?"Enabled":"Disabled"})}),a.jsx("td",{className:"py-2.5 px-3 text-right",children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[a.jsx("button",{onClick:()=>z(E),className:"p-1 text-zinc-400 hover:text-white",title:"Edit",children:a.jsx(Yb,{className:"h-3.5 w-3.5"})}),a.jsx("button",{onClick:()=>D(E.id),className:"p-1 text-zinc-400 hover:text-red-400",title:"Delete",children:a.jsx(It,{className:"h-3.5 w-3.5"})})]})})]},E.id))})]})})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-3 text-lg font-semibold text-white",children:"Recent Incidents"}),x.length===0?a.jsx("div",{className:"card text-center text-sm text-zinc-500 py-6",children:"No budget incidents recorded."}):a.jsx("div",{className:"space-y-1",children:x.map(E=>a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border/30 bg-surface px-4 py-2.5 text-sm",children:[a.jsx("span",{className:`font-medium ${r0(E.type)}`,children:E.type.toUpperCase()}),a.jsx("span",{className:"flex-1 text-zinc-300 truncate",children:E.message}),E.agentId&&a.jsxs("span",{className:"text-xs text-zinc-500",children:["Agent: ",E.agentId.slice(0,8)]}),a.jsx("span",{className:"text-xs text-zinc-500",children:c0(E.createdAt)}),E.type==="pause"&&E.agentId&&a.jsxs("button",{onClick:()=>U(E.agentId),className:"flex items-center gap-1 rounded bg-emerald-600/20 px-2 py-1 text-xs text-emerald-400 hover:bg-emerald-600/30",children:[a.jsx(Rb,{className:"h-3 w-3"})," Resume"]})]},E.id))})]}),b&&a.jsx(yh,{onSave:S,onCancel:()=>j(!1)}),A&&a.jsx(yh,{initial:A,onSave:k,onCancel:()=>z(null)})]})}const o0={mission:"Mission",objective:"Objective",key_result:"Key Result",task:"Task"},Yj={mission:"bg-purple-500/10 text-purple-400 border-purple-500/20",objective:"bg-blue-500/10 text-blue-400 border-blue-500/20",key_result:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",task:"bg-green-500/10 text-green-400 border-green-500/20"},Xj={active:Ml,completed:vs,paused:Tc,cancelled:jt},Qj={active:"text-indigo-400",completed:"text-green-400",paused:"text-amber-400",cancelled:"text-zinc-500"};function u0({goal:l,depth:c,agents:u,onEdit:o,onDelete:f,onStatusChange:x}){const[g,v]=d.useState(c<2),y=l.children&&l.children.length>0,h=Xj[l.status]??Ml,w=u.find(b=>b.id===l.ownerAgentId);return a.jsxs("div",{className:"group",children:[a.jsxs("div",{className:`flex items-center gap-2 rounded-lg px-3 py-2.5 transition-colors hover:bg-surface-hover ${c===0?"bg-surface border border-border":""}`,style:{paddingLeft:`${c*24+12}px`},children:[a.jsx("button",{onClick:()=>v(!g),className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded transition-colors ${y?"text-zinc-400 hover:text-zinc-200":"text-transparent"}`,disabled:!y,children:y&&(g?a.jsx(Rl,{className:"h-3.5 w-3.5"}):a.jsx(_l,{className:"h-3.5 w-3.5"}))}),a.jsx(h,{className:`h-4 w-4 flex-shrink-0 ${Qj[l.status]}`}),a.jsx("span",{className:`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium uppercase ${Yj[l.type]}`,children:o0[l.type]}),a.jsx("span",{className:"flex-1 truncate text-sm font-medium text-zinc-200",children:l.title}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"h-1.5 w-20 rounded-full bg-zinc-800",children:a.jsx("div",{className:"h-full rounded-full bg-indigo-500 transition-all",style:{width:`${l.progressPercent}%`}})}),a.jsxs("span",{className:"w-8 text-right text-xs text-zinc-500",children:[l.progressPercent,"%"]})]}),w&&a.jsxs("span",{className:"flex items-center gap-1 text-xs text-zinc-500",children:[a.jsx(Ca,{className:"h-3 w-3"}),w.name]}),l.dueDate&&a.jsxs("span",{className:"flex items-center gap-1 text-xs text-zinc-500",children:[a.jsx(Tb,{className:"h-3 w-3"}),new Date(l.dueDate).toLocaleDateString()]}),a.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[l.status==="active"&&a.jsx("button",{onClick:()=>x(l.id,"completed"),className:"rounded p-1 text-zinc-500 hover:bg-green-500/10 hover:text-green-400",title:"Mark completed",children:a.jsx(vs,{className:"h-3.5 w-3.5"})}),l.status==="active"&&a.jsx("button",{onClick:()=>x(l.id,"paused"),className:"rounded p-1 text-zinc-500 hover:bg-amber-500/10 hover:text-amber-400",title:"Pause",children:a.jsx(Tc,{className:"h-3.5 w-3.5"})}),l.status==="paused"&&a.jsx("button",{onClick:()=>x(l.id,"active"),className:"rounded p-1 text-zinc-500 hover:bg-indigo-500/10 hover:text-indigo-400",title:"Resume",children:a.jsx(Ml,{className:"h-3.5 w-3.5"})}),a.jsx("button",{onClick:()=>o(l),className:"rounded p-1 text-zinc-500 hover:bg-surface-hover hover:text-zinc-200",title:"Edit",children:a.jsx(Du,{className:"h-3.5 w-3.5"})}),a.jsx("button",{onClick:()=>f(l.id),className:"rounded p-1 text-zinc-500 hover:bg-red-500/10 hover:text-red-400",title:"Delete",children:a.jsx(It,{className:"h-3.5 w-3.5"})})]})]}),g&&y&&a.jsx("div",{children:l.children.map(b=>a.jsx(u0,{goal:b,depth:c+1,agents:u,onEdit:o,onDelete:f,onStatusChange:x},b.id))})]})}function Kj({goal:l,parentGoals:c,agents:u,onSave:o,onClose:f}){const[x,g]=d.useState((l==null?void 0:l.title)??""),[v,y]=d.useState((l==null?void 0:l.description)??""),[h,w]=d.useState((l==null?void 0:l.type)??"task"),[b,j]=d.useState((l==null?void 0:l.parentId)??""),[A,z]=d.useState((l==null?void 0:l.ownerAgentId)??""),[N,S]=d.useState((l==null?void 0:l.priority)??5),[k,D]=d.useState((l==null?void 0:l.dueDate)??""),U=E=>{E.preventDefault(),o({title:x,description:v||void 0,type:h,parentId:b||null,ownerAgentId:A||void 0,priority:N,dueDate:k||void 0})};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-border bg-surface p-6 shadow-xl",children:[a.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:l?"Edit Goal":"Create Goal"}),a.jsxs("form",{onSubmit:U,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Title"}),a.jsx("input",{type:"text",value:x,onChange:E=>g(E.target.value),className:"input w-full",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Description"}),a.jsx("textarea",{value:v,onChange:E=>y(E.target.value),className:"input w-full h-20 resize-none"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Type"}),a.jsxs("select",{value:h,onChange:E=>w(E.target.value),className:"input w-full",children:[a.jsx("option",{value:"mission",children:"Mission"}),a.jsx("option",{value:"objective",children:"Objective"}),a.jsx("option",{value:"key_result",children:"Key Result"}),a.jsx("option",{value:"task",children:"Task"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Parent"}),a.jsxs("select",{value:b,onChange:E=>j(E.target.value),className:"input w-full",children:[a.jsx("option",{value:"",children:"None (root)"}),c.map(E=>a.jsxs("option",{value:E.id,children:["[",o0[E.type],"] ",E.title]},E.id))]})]})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Priority (1-10)"}),a.jsx("input",{type:"number",min:1,max:10,value:N,onChange:E=>S(Number(E.target.value)),className:"input w-full"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Assign Agent"}),a.jsxs("select",{value:A,onChange:E=>z(E.target.value),className:"input w-full",children:[a.jsx("option",{value:"",children:"Unassigned"}),u.map(E=>a.jsx("option",{value:E.id,children:E.name},E.id))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Due Date"}),a.jsx("input",{type:"date",value:k,onChange:E=>D(E.target.value),className:"input w-full"})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[a.jsx("button",{type:"button",onClick:f,className:"btn-ghost",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:l?"Update":"Create"})]})]})]})})}function d0(l,c=[]){for(const u of l)c.push(u),u.children&&d0(u.children,c);return c}function Zj(){const{t:l}=Ke(),[c,u]=d.useState([]),[o,f]=d.useState([]),[x,g]=d.useState(!0),[v,y]=d.useState(null),[h,w]=d.useState(null),b=d.useCallback(async()=>{try{y(null);const[S,k]=await Promise.all([Al.tree(),Ns.list()]);u(S.data),f(k.data)}catch(S){y(S instanceof Error?S.message:"Failed to fetch goals")}finally{g(!1)}},[]);d.useEffect(()=>{b()},[b]);const j=async S=>{try{h&&h!=="new"?await Al.update(h.id,S):await Al.create(S),w(null),b()}catch(k){console.error("Save failed:",k)}},A=async S=>{if(confirm("Delete this goal and all its children?"))try{await Al.delete(S),b()}catch(k){console.error("Delete failed:",k)}},z=async(S,k)=>{try{await Al.update(S,{status:k}),b()}catch(D){console.error("Status change failed:",D)}};if(x)return a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});const N=d0(c);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Goals"}),c.length>0&&a.jsxs("span",{className:"badge bg-indigo-500/10 text-indigo-400",children:[N.length," total"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:b,className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-4 w-4"})}),a.jsxs("button",{onClick:()=>w("new"),className:"btn-primary btn-sm",children:[a.jsx(Nt,{className:"h-4 w-4"}),"New Goal"]})]})]}),v&&a.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[v,a.jsx("button",{onClick:b,className:"ml-3 underline",children:"Retry"})]}),c.length===0&&!v?a.jsx(Tn,{icon:a.jsx(Ml,{className:"h-8 w-8"}),title:"No goals yet",description:"Create a mission to get started with goal-driven AI agents."}):a.jsx("div",{className:"space-y-1",children:c.map(S=>a.jsx(u0,{goal:S,depth:0,agents:o,onEdit:k=>w(k),onDelete:A,onStatusChange:z},S.id))}),h!==null&&a.jsx(Kj,{goal:h==="new"?null:h,parentGoals:N,agents:o,onSave:j,onClose:()=>w(null)})]})}function Jj(){const l=ca(),{t:c}=Ke(),[u,o]=d.useState([]),[f,x]=d.useState(!0),[g,v]=d.useState("pending"),[y,h]=d.useState({}),[w,b]=d.useState(null),j=d.useCallback(async()=>{try{const S=g==="all"?void 0:{status:g},k=await Sc.list(S);o(k.data)}catch{}finally{x(!1)}},[g]);d.useEffect(()=>{x(!0),j()},[j]);const A=async S=>{var D;const k=(D=y[S.id])==null?void 0:D.trim();if(k){b(S.id);try{await Sc.resume(S.id,k),h(U=>{const E={...U};return delete E[S.id],E}),j()}catch(U){console.error("Resume failed:",U)}finally{b(null)}}},z=S=>{switch(S){case"pending":return a.jsx(js,{className:"h-4 w-4 text-amber-400"});case"resumed":return a.jsx(tt,{className:"h-4 w-4 text-green-400"});case"expired":return a.jsx(Ot,{className:"h-4 w-4 text-zinc-500"});default:return a.jsx(js,{className:"h-4 w-4 text-zinc-500"})}},N=S=>{const k={pending:"bg-amber-500/10 text-amber-400 border-amber-500/30",resumed:"bg-green-500/10 text-green-400 border-green-500/30",expired:"bg-zinc-500/10 text-zinc-400 border-zinc-500/30"};return a.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${k[S]??k.expired}`,children:[z(S),S]})};return f?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(jc,{className:"h-6 w-6 text-amber-400"}),a.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Handoffs"})]}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("button",{onClick:j,className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-3.5 w-3.5"})})})]}),a.jsx("div",{className:"flex gap-2",children:["pending","resumed","expired","all"].map(S=>a.jsx("button",{className:`rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${g===S?"bg-indigo-500/10 text-indigo-400 border border-indigo-500/30":"text-zinc-400 hover:text-zinc-200 border border-transparent"}`,onClick:()=>v(S),children:S.charAt(0).toUpperCase()+S.slice(1)},S))}),u.length===0?a.jsx("div",{className:"card",children:a.jsxs("p",{className:"text-sm text-zinc-500 text-center py-8",children:["No ",g==="all"?"":g+" ","handoffs found."]})}):a.jsx("div",{className:"space-y-4",children:u.map(S=>{var k;return a.jsxs("div",{className:`card ${S.status==="pending"?"border-amber-500/20":""}`,children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[N(S.status),a.jsxs("span",{className:"text-xs text-zinc-500 font-mono",children:[S.id.slice(0,12),"..."]})]}),a.jsx("button",{className:"text-xs text-indigo-400 hover:text-indigo-300",onClick:()=>l(`/runs/${S.runId}`),children:"View Run"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500 mb-1 font-medium",children:"Accomplished"}),a.jsx("p",{className:"text-sm text-zinc-300",children:S.accomplished})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500 mb-1 font-medium",children:"Blocking"}),a.jsx("p",{className:"text-sm text-red-400",children:S.blocking})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500 mb-1 font-medium",children:"Suggestions"}),a.jsx("p",{className:"text-sm text-zinc-300",children:S.suggestions})]})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-3 text-xs text-zinc-500",children:[a.jsxs("span",{children:["Agent: ",S.agentId.slice(0,12),"..."]}),a.jsxs("span",{children:["Created: ",new Date(S.createdAt).toLocaleString()]}),S.resumedAt&&a.jsxs("span",{children:["Resumed: ",new Date(S.resumedAt).toLocaleString()]})]}),S.status==="pending"&&a.jsxs("div",{className:"mt-4 flex items-center gap-2 border-t border-zinc-800 pt-3",children:[a.jsx("input",{type:"text",className:"flex-1 rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-200 placeholder-zinc-500 focus:border-indigo-500 focus:outline-none",placeholder:"Describe how you resolved the blocking issue...",value:y[S.id]??"",onChange:D=>h(U=>({...U,[S.id]:D.target.value}))}),a.jsx("button",{className:"btn-primary btn-sm",disabled:!((k=y[S.id])!=null&&k.trim())||w===S.id,onClick:()=>A(S),children:w===S.id?"Resuming...":"Resume"})]})]},S.id)})})]})}const bh={low:"bg-green-500/10 text-green-400 border-green-500/20",medium:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",high:"bg-orange-500/10 text-orange-400 border-orange-500/20",critical:"bg-red-500/10 text-red-400 border-red-500/20"};function Fj({level:l}){return a.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${bh[l]??bh.low}`,children:[l==="critical"&&a.jsx(ft,{className:"h-3 w-3"}),l==="high"&&a.jsx(ft,{className:"h-3 w-3"}),l.toUpperCase()]})}const Uc="/api";async function hu(l){const c=localStorage.getItem("nestor_token"),u={"Content-Type":"application/json"};c&&(u.Authorization=`Bearer ${c}`);const o=await fetch(`${Uc}/plans/${l}`,{headers:u});if(!o.ok)throw new Error(`Failed to fetch plan: ${o.statusText}`);return(await o.json()).data}async function Wj(l){const c=localStorage.getItem("nestor_token"),u={"Content-Type":"application/json"};c&&(u.Authorization=`Bearer ${c}`);const o=await fetch(`${Uc}/plans/${l}/execute`,{method:"POST",headers:u});if(!o.ok)throw new Error(`Failed to execute plan: ${o.statusText}`)}async function Ij(l){const c=localStorage.getItem("nestor_token"),u={"Content-Type":"application/json"};c&&(u.Authorization=`Bearer ${c}`);const o=await fetch(`${Uc}/plans/${l}/cancel`,{method:"POST",headers:u});if(!o.ok)throw new Error(`Failed to cancel plan: ${o.statusText}`)}async function Pj(){const l=localStorage.getItem("nestor_token"),c={"Content-Type":"application/json"};l&&(c.Authorization=`Bearer ${l}`);const u=await fetch(`${Uc}/plans?limit=50`,{headers:c});if(!u.ok)throw new Error(`Failed to fetch plans: ${u.statusText}`);return(await u.json()).data}function e1(){const[l,c]=d.useState([]),[u,o]=d.useState(!0),f=ca();return d.useEffect(()=>{Pj().then(c).catch(console.error).finally(()=>o(!1))},[]),u?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx("h1",{className:"text-2xl font-bold text-white",children:"Dry-Run Plans"})}),l.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-border bg-surface p-12 text-center",children:[a.jsx(Dc,{className:"mb-4 h-12 w-12 text-zinc-600"}),a.jsxs("p",{className:"text-zinc-400",children:["No plans yet. Use the ",a.jsx("code",{className:"text-indigo-400",children:"/plan"})," command in the CLI or the API to create a dry-run plan."]})]}):a.jsx("div",{className:"space-y-3",children:l.map(x=>a.jsxs("button",{onClick:()=>f(`/plans/${x.id}`),className:"flex w-full items-center justify-between rounded-lg border border-border bg-surface p-4 text-left transition-colors hover:bg-surface-hover",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-sm font-medium text-white",children:[x.prompt.slice(0,80),x.prompt.length>80?"...":""]}),a.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${x.status==="completed"?"bg-green-500/10 text-green-400":x.status==="executing"?"bg-blue-500/10 text-blue-400":x.status==="cancelled"?"bg-zinc-500/10 text-zinc-400":"bg-yellow-500/10 text-yellow-400"}`,children:x.status})]}),a.jsxs("div",{className:"mt-1 flex items-center gap-4 text-xs text-zinc-500",children:[a.jsxs("span",{children:[x.steps.length," step(s)"]}),a.jsxs("span",{children:["$",x.estimatedCostUsd.toFixed(4)]}),a.jsx("span",{children:new Date(x.createdAt).toLocaleString()})]})]}),a.jsx(_l,{className:"h-4 w-4 text-zinc-600"})]},x.id))})]})}function t1(){const{id:l}=ks(),c=ca(),[u,o]=d.useState(null),[f,x]=d.useState(!0),[g,v]=d.useState(!1),[y,h]=d.useState(-1);d.useEffect(()=>{l&&hu(l).then(o).catch(console.error).finally(()=>x(!1))},[l]);const w=async()=>{if(u){v(!0);try{await Wj(u.id);for(let z=0;z<u.steps.length;z++)h(z),await new Promise(N=>setTimeout(N,500));h(u.steps.length);const A=await hu(u.id);o(A)}catch(A){console.error("Execute failed:",A)}finally{v(!1)}}},b=async()=>{if(u)try{await Ij(u.id);const A=await hu(u.id);o(A)}catch(A){console.error("Cancel failed:",A)}};if(f)return a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});if(!u)return a.jsx("div",{className:"py-20 text-center text-zinc-400",children:"Plan not found."});const j=u.status==="pending"||u.status==="approved";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("button",{onClick:()=>c("/plans"),className:"text-sm text-zinc-500 hover:text-zinc-300",children:"← Back to Plans"}),a.jsxs("h1",{className:"mt-1 text-2xl font-bold text-white",children:["Plan: ",u.id]}),a.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:u.prompt})]}),a.jsx("div",{className:"flex gap-2",children:j&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:w,disabled:g,className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500 disabled:opacity-50",children:[a.jsx(dt,{className:"h-4 w-4"}),"Execute All"]}),a.jsxs("button",{onClick:b,className:"flex items-center gap-2 rounded-lg border border-border px-4 py-2 text-sm font-medium text-zinc-400 hover:text-white hover:border-zinc-600",children:[a.jsx(Ot,{className:"h-4 w-4"}),"Cancel"]})]})})]}),a.jsxs("div",{className:"flex gap-4 rounded-lg border border-border bg-surface p-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-zinc-500",children:"Status:"})," ",a.jsx("span",{className:"font-medium text-white",children:u.status})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-zinc-500",children:"Steps:"})," ",a.jsx("span",{className:"font-medium text-white",children:u.steps.length})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-zinc-500",children:"Est. Cost:"})," ",a.jsxs("span",{className:"font-medium text-white",children:["$",u.estimatedCostUsd.toFixed(4)]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-zinc-500",children:"Iterations:"})," ",a.jsx("span",{className:"font-medium text-white",children:u.estimatedIterations})]})]}),a.jsx("div",{className:"space-y-2",children:u.steps.map((A,z)=>{const N=y===z,S=y>z,k=Object.entries(A.args).map(([D,U])=>`${D}: ${typeof U=="string"?U.slice(0,80):JSON.stringify(U).slice(0,80)}`).join(" | ");return a.jsxs("div",{className:`rounded-lg border p-4 transition-colors ${N?"border-indigo-500 bg-indigo-500/5":S?"border-green-500/30 bg-green-500/5":"border-border bg-surface"}`,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-full text-xs font-bold ${S?"bg-green-500/20 text-green-400":N?"bg-indigo-500/20 text-indigo-400":"bg-zinc-800 text-zinc-400"}`,children:S?a.jsx(tt,{className:"h-4 w-4"}):z+1}),a.jsx("span",{className:"font-mono text-sm font-medium text-white",children:A.toolName}),a.jsx(Fj,{level:A.riskLevel}),N&&a.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})]}),a.jsx("div",{className:"mt-2 pl-10 text-xs text-zinc-500 font-mono",children:k}),a.jsx("div",{className:"mt-1 pl-10 text-xs text-zinc-600 italic",children:A.mockResult})]},A.index)})})]})}const a1={file_pattern:"File Pattern",command_pattern:"Command Pattern",url_pattern:"URL Pattern",limit:"Limit"},n1={block:"bg-red-500/10 text-red-400 border-red-500/20",warn:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",approve:"bg-blue-500/10 text-blue-400 border-blue-500/20"},Bc="/api";function Hc(){const l={"Content-Type":"application/json"},c=localStorage.getItem("nestor_token");c&&(l.Authorization=`Bearer ${c}`);const u=localStorage.getItem("nestor_tenant_id");return u&&(l["X-Tenant-ID"]=u),l}async function s1(){const l=await fetch(`${Bc}/guardrails`,{headers:Hc()});if(!l.ok)throw new Error(`Failed to fetch guardrails: ${l.statusText}`);return(await l.json()).data}async function l1(l){const c=await fetch(`${Bc}/guardrails`,{method:"POST",headers:Hc(),body:JSON.stringify(l)});if(!c.ok)throw new Error(`Failed to create guardrail: ${c.statusText}`);return(await c.json()).data}async function vh(l,c){const u=await fetch(`${Bc}/guardrails/${l}`,{method:"PUT",headers:Hc(),body:JSON.stringify(c)});if(!u.ok)throw new Error(`Failed to update guardrail: ${u.statusText}`)}async function i1(l){const c=await fetch(`${Bc}/guardrails/${l}`,{method:"DELETE",headers:Hc()});if(!c.ok)throw new Error(`Failed to delete guardrail: ${c.statusText}`)}function c1(){const[l,c]=d.useState([]),[u,o]=d.useState(!0),[f,x]=d.useState(!1),[g,v]=d.useState(null),[y,h]=d.useState({name:"",type:"command_pattern",pattern:"",action:"block",config:"{}",enabled:!0}),w=d.useCallback(()=>{o(!0),s1().then(c).catch(console.error).finally(()=>o(!1))},[]);d.useEffect(()=>{w()},[w]);const b=()=>{h({name:"",type:"command_pattern",pattern:"",action:"block",config:"{}",enabled:!0}),v(null),x(!1)},j=async()=>{if(!y.name.trim()||!y.pattern.trim())return;let S={};try{S=JSON.parse(y.config)}catch{}try{g?await vh(g,{...y,config:S}):await l1({...y,config:S}),b(),w()}catch(k){console.error("Save failed:",k)}},A=async S=>{try{await vh(S.id,{enabled:!S.enabled}),w()}catch(k){console.error("Toggle failed:",k)}},z=async S=>{try{await i1(S),w()}catch(k){console.error("Delete failed:",k)}},N=S=>{h({name:S.name,type:S.type,pattern:S.pattern,action:S.action,config:JSON.stringify(S.config,null,2),enabled:S.enabled}),v(S.id),x(!0)};return u?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-2xl font-bold text-white",children:"Guardrails"}),a.jsxs("button",{onClick:()=>{b(),x(!0)},className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:[a.jsx(Nt,{className:"h-4 w-4"}),"Add Rule"]})]}),f&&a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-5 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:g?"Edit Guardrail":"New Guardrail"}),a.jsx("button",{onClick:b,className:"text-zinc-500 hover:text-white",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Name"}),a.jsx("input",{value:y.name,onChange:S=>h(k=>({...k,name:S.target.value})),placeholder:"e.g., Block production DB access",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white placeholder:text-zinc-600 focus:border-indigo-500 focus:outline-none"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Type"}),a.jsxs("select",{value:y.type,onChange:S=>h(k=>({...k,type:S.target.value})),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white focus:border-indigo-500 focus:outline-none",children:[a.jsx("option",{value:"command_pattern",children:"Command Pattern"}),a.jsx("option",{value:"file_pattern",children:"File Pattern"}),a.jsx("option",{value:"url_pattern",children:"URL Pattern"}),a.jsx("option",{value:"limit",children:"Limit"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Pattern (regex or substring)"}),a.jsx("input",{value:y.pattern,onChange:S=>h(k=>({...k,pattern:S.target.value})),placeholder:y.type==="limit"?"shell_exec":"e.g., rm\\s+-rf|DROP\\s+TABLE",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white font-mono placeholder:text-zinc-600 focus:border-indigo-500 focus:outline-none"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Action"}),a.jsxs("select",{value:y.action,onChange:S=>h(k=>({...k,action:S.target.value})),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white focus:border-indigo-500 focus:outline-none",children:[a.jsx("option",{value:"block",children:"Block"}),a.jsx("option",{value:"warn",children:"Warn"}),a.jsx("option",{value:"approve",children:"Require Approval"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Config (JSON)"}),a.jsx("input",{value:y.config,onChange:S=>h(k=>({...k,config:S.target.value})),placeholder:'e.g., {"maxPerRun": 5}',className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white font-mono placeholder:text-zinc-600 focus:border-indigo-500 focus:outline-none"})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2",children:[a.jsxs("label",{className:"flex items-center gap-2 text-sm text-zinc-400",children:[a.jsx("input",{type:"checkbox",checked:y.enabled,onChange:S=>h(k=>({...k,enabled:S.target.checked})),className:"rounded border-border"}),"Enabled"]}),a.jsx("button",{onClick:j,className:"rounded-lg bg-indigo-600 px-6 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:g?"Update":"Create"})]})]}),l.length===0&&!f?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-border bg-surface p-12 text-center",children:[a.jsx(Dc,{className:"mb-4 h-12 w-12 text-zinc-600"}),a.jsx("p",{className:"text-zinc-400",children:"No guardrails configured."}),a.jsx("p",{className:"mt-1 text-sm text-zinc-600",children:"Add rules to control what tools can do -- block dangerous patterns, enforce limits, or require approval."})]}):a.jsx("div",{className:"space-y-2",children:l.map(S=>a.jsxs("div",{className:`flex items-center justify-between rounded-lg border p-4 transition-colors ${S.enabled?"border-border bg-surface":"border-border/50 bg-surface/50 opacity-60"}`,children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm font-medium text-white",children:S.name}),a.jsx("span",{className:"rounded-full bg-zinc-800 px-2 py-0.5 text-[10px] font-medium text-zinc-400",children:a1[S.type]??S.type}),a.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${n1[S.action]??""}`,children:S.action})]}),a.jsx("div",{className:"mt-1 font-mono text-xs text-zinc-500",children:S.pattern})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>A(S),className:"text-zinc-500 hover:text-white",title:S.enabled?"Disable":"Enable",children:S.enabled?a.jsx(Pb,{className:"h-5 w-5 text-green-400"}):a.jsx(Ib,{className:"h-5 w-5"})}),a.jsx("button",{onClick:()=>N(S),className:"text-zinc-500 hover:text-white",title:"Edit",children:a.jsx(Du,{className:"h-4 w-4"})}),a.jsx("button",{onClick:()=>z(S.id),className:"text-zinc-500 hover:text-red-400",title:"Delete",children:a.jsx(It,{className:"h-4 w-4"})})]})]},S.id))})]})}const jh={agent:a.jsx(Ab,{className:"h-3 w-3"}),project:a.jsx(Qh,{className:"h-3 w-3"}),global:a.jsx(Zh,{className:"h-3 w-3"})},Nh={agent:"bg-blue-500/20 text-blue-400",project:"bg-purple-500/20 text-purple-400",global:"bg-amber-500/20 text-amber-400"};function r1(){const{id:l}=ks(),[c,u]=d.useState([]),[o,f]=d.useState(null),[x,g]=d.useState(!0),[v,y]=d.useState(""),[h,w]=d.useState(""),[b,j]=d.useState(""),[A,z]=d.useState(!1),[N,S]=d.useState(""),[k,D]=d.useState(""),[U,E]=d.useState("agent"),[F,se]=d.useState(.5),B=d.useCallback(async()=>{if(l){g(!0);try{const Q=new URLSearchParams;v&&Q.set("q",v),h&&Q.set("scope",h),Q.set("limit","100");const[ae,K]=await Promise.all([fetch(`/api/agents/${l}/memory?${Q}`,{credentials:"include"}),fetch(`/api/agents/${l}/memory/stats`,{credentials:"include"})]);if(ae.ok){const de=await ae.json();u(de.data||[])}if(K.ok){const de=await K.json();f(de.data)}}catch{}g(!1)}},[l,v,h]);d.useEffect(()=>{B()},[B]);const Z=Q=>{Q.preventDefault(),B()},ee=async()=>{var Q;if(!(!l||!N.trim()||!k.trim())){j("");try{const ae=await fetch(`/api/agents/${l}/memory`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:N,value:k,scope:U,importance:F})});if(!ae.ok){const K=await ae.json();throw new Error(((Q=K.error)==null?void 0:Q.message)||"Failed")}z(!1),S(""),D(""),se(.5),await B()}catch(ae){j(ae.message)}}},W=async Q=>{if(l)try{(await fetch(`/api/agents/${l}/memory/${encodeURIComponent(Q)}`,{method:"DELETE",credentials:"include"})).ok&&u(K=>K.filter(de=>de.key!==Q))}catch{}};return x?a.jsx("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ys,{className:"h-6 w-6 text-indigo-400"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Agent Memory Store"}),a.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Key-value memory entries with scope, importance, and FTS5 search."})]})]}),a.jsxs("button",{onClick:()=>z(!0),className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-3 py-2 text-sm font-medium text-white hover:bg-indigo-700",children:[a.jsx(Nt,{className:"h-4 w-4"})," Add Memory"]})]}),b&&a.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-sm text-red-400",children:b}),o&&a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[a.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-zinc-400",children:"Total Entries"}),a.jsx("p",{className:"mt-2 text-2xl font-semibold text-white",children:o.total})]}),a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[a.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-zinc-400",children:"Total Size"}),a.jsx("p",{className:"mt-2 text-2xl font-semibold text-white",children:o.totalSize>1024?`${(o.totalSize/1024).toFixed(1)} KB`:`${o.totalSize} B`})]}),a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[a.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-zinc-400",children:"By Scope"}),a.jsx("div",{className:"mt-2 flex gap-2",children:Object.entries(o.byScope).map(([Q,ae])=>a.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${Nh[Q]??"bg-zinc-500/20 text-zinc-400"}`,children:[jh[Q]," ",Q,": ",ae]},Q))})]})]}),A&&a.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium text-white",children:"Add Memory Entry"}),a.jsx("button",{onClick:()=>z(!1),className:"text-zinc-400 hover:text-white",children:a.jsx(jt,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsx("input",{type:"text",value:N,onChange:Q=>S(Q.target.value),placeholder:"Key (e.g. user_preference_language)",className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),a.jsxs("select",{value:U,onChange:Q=>E(Q.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"agent",children:"agent"}),a.jsx("option",{value:"project",children:"project"}),a.jsx("option",{value:"global",children:"global"})]})]}),a.jsx("textarea",{value:k,onChange:Q=>D(Q.target.value),placeholder:"Value...",rows:3,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs text-zinc-400",children:["Importance: ",F.toFixed(1)]}),a.jsx("input",{type:"range",min:0,max:100,value:F*100,onChange:Q=>se(Number(Q.target.value)/100),className:"w-full"})]}),a.jsx("button",{onClick:ee,disabled:!N.trim()||!k.trim(),className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:"Store Memory"})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("form",{onSubmit:Z,className:"flex flex-1 gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Ul,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),a.jsx("input",{type:"text",value:v,onChange:Q=>y(Q.target.value),placeholder:"Search by key or value...",className:"w-full rounded-lg border border-border bg-surface py-2 pl-10 pr-4 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none"})]}),a.jsx("button",{type:"submit",className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:"Search"})]}),a.jsxs("select",{value:h,onChange:Q=>w(Q.target.value),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white",children:[a.jsx("option",{value:"",children:"All Scopes"}),a.jsx("option",{value:"agent",children:"Agent"}),a.jsx("option",{value:"project",children:"Project"}),a.jsx("option",{value:"global",children:"Global"})]})]}),c.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-border bg-surface py-16",children:[a.jsx(_b,{className:"h-12 w-12 text-zinc-600"}),a.jsx("p",{className:"mt-4 text-sm text-zinc-400",children:"No memory entries found"}),a.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Memory entries are key-value pairs that persist across agent runs."})]}):a.jsx("div",{className:"space-y-2",children:c.map(Q=>a.jsx("div",{className:"group rounded-lg border border-border bg-surface p-4 hover:border-border/80",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${Nh[Q.scope]??"bg-zinc-500/20 text-zinc-400"}`,children:[jh[Q.scope]," ",Q.scope]}),a.jsx("span",{className:"font-mono text-sm font-medium text-indigo-400",children:Q.key}),a.jsxs("span",{className:"text-xs text-zinc-600",children:["importance: ",(Q.importance*100).toFixed(0),"%"]}),Q.accessCount>0&&a.jsxs("span",{className:"text-xs text-zinc-600",children:["accessed ",Q.accessCount,"x"]})]}),a.jsx("p",{className:"mt-2 text-sm text-zinc-200 leading-relaxed",children:Q.value}),a.jsxs("div",{className:"mt-1 flex items-center gap-3 text-xs text-zinc-500",children:[a.jsxs("span",{children:["Created: ",new Date(Q.createdAt).toLocaleString()]}),Q.expiresAt&&a.jsxs("span",{className:"text-yellow-500",children:["Expires: ",new Date(Q.expiresAt).toLocaleString()]})]})]}),a.jsx("button",{onClick:()=>W(Q.key),className:"rounded p-1.5 text-zinc-500 opacity-0 transition-all hover:bg-red-500/10 hover:text-red-400 group-hover:opacity-100",title:"Delete memory entry",children:a.jsx(It,{className:"h-4 w-4"})})]})},Q.id))})]})}function o1(l){return l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(1)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function m0(l){const c=Math.floor(l/86400),u=Math.floor(l%86400/3600),o=Math.floor(l%3600/60);return c>0?`${c}d ${u}h ${o}m`:u>0?`${u}h ${o}m`:`${o}m`}function ln({label:l,value:c,icon:u,color:o="indigo"}){const f={indigo:"bg-indigo-500/10 text-indigo-400",green:"bg-green-500/10 text-green-400",amber:"bg-amber-500/10 text-amber-400",red:"bg-red-500/10 text-red-400",blue:"bg-blue-500/10 text-blue-400",zinc:"bg-zinc-500/10 text-zinc-400"};return a.jsxs("div",{className:"card flex items-center gap-4 p-4",children:[a.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${f[o]??f.indigo}`,children:a.jsx(u,{className:"h-5 w-5"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-zinc-400",children:l}),a.jsx("p",{className:"text-xl font-semibold text-white",children:c})]})]})}function u1(){const[l,c]=d.useState(null),[u,o]=d.useState(null),[f,x]=d.useState(null),[g,v]=d.useState(!0),[y,h]=d.useState(""),w=d.useCallback(async()=>{v(!0),h("");try{const[b,j,A]=await Promise.allSettled([ut.overview(),la.health(),la.stats()]);b.status==="fulfilled"&&c(b.value.data),j.status==="fulfilled"&&o(j.value),A.status==="fulfilled"&&x(A.value.data)}catch(b){h(b.message||"Failed to load overview")}finally{v(!1)}},[]);return d.useEffect(()=>{w()},[w]),g?a.jsx(Rn,{}):y?a.jsx(Ea,{message:y,onRetry:w}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[a.jsx(ln,{label:"Tenants",value:(l==null?void 0:l.tenants)??0,icon:Mu,color:"indigo"}),a.jsx(ln,{label:"Users",value:(l==null?void 0:l.users)??0,icon:Cs,color:"blue"}),a.jsx(ln,{label:"Agents",value:(l==null?void 0:l.agents)??0,icon:Dt,color:"green"}),a.jsx(ln,{label:"Total Runs",value:(l==null?void 0:l.runs)??0,icon:Ec,color:"amber"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-300",children:"System Health"}),a.jsxs("div",{className:"flex items-center gap-2",children:[(u==null?void 0:u.status)==="healthy"?a.jsx(Yh,{className:"h-5 w-5 text-green-400"}):a.jsx(ft,{className:"h-5 w-5 text-amber-400"}),a.jsx("span",{className:"text-sm text-zinc-200 capitalize",children:(u==null?void 0:u.status)??"Unknown"}),(u==null?void 0:u.uptime)!=null&&a.jsxs("span",{className:"ml-auto text-xs text-zinc-500",children:["Uptime: ",m0(u.uptime)]})]})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-300",children:"Cost Summary"}),a.jsxs("p",{className:"text-2xl font-semibold text-white",children:["$",((l==null?void 0:l.totalCostUsd)??0).toFixed(4)]}),a.jsx("p",{className:"text-xs text-zinc-500",children:"Total cost across all tenants"})]})]}),f&&a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-300",children:"Run Statistics"}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-5",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Running"}),a.jsx("p",{className:"text-lg font-semibold text-indigo-400",children:f.runs.running})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Completed"}),a.jsx("p",{className:"text-lg font-semibold text-green-400",children:f.runs.completed})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Failed"}),a.jsx("p",{className:"text-lg font-semibold text-red-400",children:f.runs.failed})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Today"}),a.jsx("p",{className:"text-lg font-semibold text-amber-400",children:f.runs.today})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Pending Approvals"}),a.jsx("p",{className:"text-lg font-semibold text-zinc-300",children:f.approvals.pending})]})]})]})]})}function d1(){const[l,c]=d.useState([]),[u,o]=d.useState(!0),[f,x]=d.useState(""),[g,v]=d.useState(!1),[y,h]=d.useState({name:"",slug:"",description:""}),[w,b]=d.useState(!1),j=d.useCallback(async()=>{o(!0),x("");try{const z=await ut.tenants.list();c(z.data)}catch(z){x(z.message||"Failed to load tenants")}finally{o(!1)}},[]);d.useEffect(()=>{j()},[j]);const A=async()=>{if(!(!y.name||!y.slug)){b(!0);try{await ut.tenants.create(y),v(!1),h({name:"",slug:"",description:""}),await j()}catch(z){x(z.message||"Failed to create tenant")}finally{b(!1)}}};return u?a.jsx(Rn,{}):f&&l.length===0?a.jsx(Ea,{message:f,onRetry:j}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("p",{className:"text-sm text-zinc-400",children:[l.length," tenants"]}),a.jsxs("button",{onClick:()=>v(!0),className:"btn-primary btn-sm",children:[a.jsx(Nt,{className:"h-4 w-4"})," Create Tenant"]})]}),f&&a.jsx(Ea,{message:f}),g&&a.jsxs("div",{className:"card p-4 space-y-3 border-indigo-500/30",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"New Tenant"}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[a.jsx("input",{className:"input",placeholder:"Tenant Name",value:y.name,onChange:z=>h({...y,name:z.target.value})}),a.jsx("input",{className:"input",placeholder:"slug (lowercase-with-dashes)",value:y.slug,onChange:z=>h({...y,slug:z.target.value})})]}),a.jsx("input",{className:"input",placeholder:"Description (optional)",value:y.description,onChange:z=>h({...y,description:z.target.value})}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:A,disabled:w,className:"btn-primary btn-sm",children:w?"Creating...":"Create"}),a.jsx("button",{onClick:()=>v(!1),className:"btn-ghost btn-sm",children:"Cancel"})]})]}),a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface",children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Name"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Slug"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Description"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Created"})]})}),a.jsxs("tbody",{children:[l.map(z=>a.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[a.jsx("td",{className:"px-4 py-3 font-medium text-white",children:z.name}),a.jsx("td",{className:"px-4 py-3 font-mono text-xs text-indigo-400",children:z.slug}),a.jsx("td",{className:"px-4 py-3 text-zinc-400 max-w-xs truncate",children:z.description||"-"}),a.jsx("td",{className:"px-4 py-3 text-zinc-500 text-xs",children:new Date(z.createdAt).toLocaleDateString()})]},z.id)),l.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-8 text-center text-zinc-500",children:"No tenants found."})})]})]})})]})}function m1(){const[l,c]=d.useState([]),[u,o]=d.useState(!0),[f,x]=d.useState(""),[g,v]=d.useState(""),[y,h]=d.useState(""),w=d.useCallback(async()=>{o(!0),x("");try{const z=await ut.users.list(g?{role:g}:void 0);c(z.data)}catch(z){x(z.message||"Failed to load users")}finally{o(!1)}},[g]);d.useEffect(()=>{w()},[w]);const b=async(z,N)=>{x("");try{await ut.users.updateRole(z,N),await w()}catch(S){x(S.message||"Failed to update role")}},j=async(z,N)=>{x("");try{N?await ut.users.lock(z):await ut.users.unlock(z),await w()}catch(S){x(S.message||"Failed to toggle lock status")}},A=l.filter(z=>{if(!y)return!0;const N=y.toLowerCase();return z.name.toLowerCase().includes(N)||z.email.toLowerCase().includes(N)});return u?a.jsx(Rn,{}):a.jsxs("div",{className:"space-y-4",children:[f&&a.jsx(Ea,{message:f}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[a.jsx(Ul,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),a.jsx("input",{className:"input pl-9",placeholder:"Search by name or email...",value:y,onChange:z=>h(z.target.value)})]}),a.jsxs("select",{className:"input w-auto",value:g,onChange:z=>v(z.target.value),children:[a.jsx("option",{value:"",children:"All Roles"}),a.jsx("option",{value:"admin",children:"Admin"}),a.jsx("option",{value:"manager",children:"Manager"}),a.jsx("option",{value:"member",children:"Member"}),a.jsx("option",{value:"viewer",children:"Viewer"})]}),a.jsx("button",{onClick:w,className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface",children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Name"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Email"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Role"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Status"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Last Login"}),a.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium uppercase text-zinc-400",children:"Actions"})]})}),a.jsxs("tbody",{children:[A.map(z=>a.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[a.jsx("td",{className:"px-4 py-3 font-medium text-white",children:z.name}),a.jsx("td",{className:"px-4 py-3 text-zinc-300",children:z.email}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("select",{value:z.role,onChange:N=>b(z.id,N.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs text-white focus:outline-none",children:[a.jsx("option",{value:"admin",children:"Admin"}),a.jsx("option",{value:"manager",children:"Manager"}),a.jsx("option",{value:"member",children:"Member"}),a.jsx("option",{value:"viewer",children:"Viewer"})]})}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${z.isActive?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:z.isActive?"Active":"Locked"})}),a.jsx("td",{className:"px-4 py-3 text-zinc-400 text-xs",children:z.lastLoginAt?new Date(z.lastLoginAt*1e3).toLocaleString():"Never"}),a.jsx("td",{className:"px-4 py-3 text-right",children:a.jsx("div",{className:"flex items-center justify-end gap-1",children:a.jsx("button",{onClick:()=>j(z.id,z.isActive),className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-700",title:z.isActive?"Lock account":"Unlock account",children:z.isActive?a.jsx(vu,{className:"h-3.5 w-3.5"}):a.jsx(Bb,{className:"h-3.5 w-3.5"})})})})]},z.id)),A.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-zinc-500",children:"No users found."})})]})]})})]})}function f1(){const[l,c]=d.useState(null),[u,o]=d.useState(null),[f,x]=d.useState(null),[g,v]=d.useState(!0),[y,h]=d.useState(""),w=d.useCallback(async()=>{v(!0),h("");try{const[b,j,A]=await Promise.allSettled([ut.system.info(),ut.system.dbStats(),ut.system.rateLimitStats()]);b.status==="fulfilled"&&c(b.value.data),j.status==="fulfilled"&&o(j.value.data),A.status==="fulfilled"&&x(A.value.data)}catch(b){h(b.message||"Failed to load system info")}finally{v(!1)}},[]);return d.useEffect(()=>{w()},[w]),g?a.jsx(Rn,{}):y?a.jsx(Ea,{message:y,onRetry:w}):a.jsxs("div",{className:"space-y-6",children:[l&&a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Lu,{className:"h-4 w-4 text-indigo-400"}),a.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Server Information"}),a.jsx("button",{onClick:w,className:"ml-auto btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-3.5 w-3.5"})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Version"}),a.jsx("p",{className:"text-sm font-medium text-zinc-200",children:l.version})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Node.js"}),a.jsx("p",{className:"text-sm font-medium text-zinc-200",children:l.nodeVersion})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Platform"}),a.jsxs("p",{className:"text-sm font-medium text-zinc-200",children:[l.platform," / ",l.arch]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Uptime"}),a.jsx("p",{className:"text-sm font-medium text-zinc-200",children:m0(l.uptime)})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 pt-2",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"RSS Memory"}),a.jsxs("p",{className:"text-sm font-medium text-zinc-200",children:[l.memory.rss," MB"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Heap Used"}),a.jsxs("p",{className:"text-sm font-medium text-zinc-200",children:[l.memory.heapUsed," MB"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"Heap Total"}),a.jsxs("p",{className:"text-sm font-medium text-zinc-200",children:[l.memory.heapTotal," MB"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-zinc-500",children:"PID"}),a.jsx("p",{className:"text-sm font-medium text-zinc-200",children:l.pid})]})]})]}),u&&a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Qh,{className:"h-4 w-4 text-green-400"}),a.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Database Statistics"}),a.jsx("span",{className:"ml-auto text-xs text-zinc-500",children:o1(u.totalSize)})]}),a.jsx("div",{className:"overflow-x-auto rounded border border-border/50",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/50 bg-background",children:[a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Table"}),a.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Rows"})]})}),a.jsx("tbody",{children:u.tables.map(b=>a.jsxs("tr",{className:"border-b border-border/30",children:[a.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-300",children:b.name}),a.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-400",children:b.rowCount.toLocaleString()})]},b.name))})]})})]}),f&&a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Dt,{className:"h-4 w-4 text-amber-400"}),a.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Rate Limit Counters"}),a.jsxs("span",{className:"ml-auto text-xs text-zinc-500",children:[f.totalKeys," active keys"]})]}),f.entries.length>0?a.jsx("div",{className:"overflow-x-auto rounded border border-border/50 max-h-60 overflow-y-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/50 bg-background sticky top-0",children:[a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Key"}),a.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Count"}),a.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Reset"})]})}),a.jsx("tbody",{children:f.entries.slice(0,50).map((b,j)=>a.jsxs("tr",{className:"border-b border-border/30",children:[a.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-300 max-w-xs truncate",children:b.key}),a.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-400",children:b.count}),a.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(b.resetAt).toLocaleTimeString()})]},j))})]})}):a.jsx("p",{className:"text-xs text-zinc-500",children:"No active rate limit counters."})]})]})}function x1(){const[l,c]=d.useState([]),[u,o]=d.useState(!0),[f,x]=d.useState(""),[g,v]=d.useState(""),[y,h]=d.useState(""),w=d.useCallback(async()=>{o(!0),x("");try{const j=await ut.audit.query({action:g||void 0,userId:y||void 0,limit:200});c(j.data)}catch(j){x(j.message||"Failed to load audit log")}finally{o(!1)}},[g,y]);d.useEffect(()=>{w()},[w]);const b=async j=>{try{const A=await ut.audit.export(j),z=j==="json"?JSON.stringify(A.data,null,2):h1(A.data),N=new Blob([z],{type:j==="json"?"application/json":"text/csv"}),S=URL.createObjectURL(N),k=document.createElement("a");k.href=S,k.download=`audit-log.${j}`,k.click(),URL.revokeObjectURL(S)}catch(A){x(A.message||"Export failed")}};return u?a.jsx(Rn,{}):a.jsxs("div",{className:"space-y-4",children:[f&&a.jsx(Ea,{message:f}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx("input",{className:"input flex-1 min-w-[150px]",placeholder:"Filter by action...",value:g,onChange:j=>v(j.target.value)}),a.jsx("input",{className:"input flex-1 min-w-[150px]",placeholder:"Filter by actor ID...",value:y,onChange:j=>h(j.target.value)}),a.jsx("button",{onClick:w,className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-4 w-4"})}),a.jsxs("button",{onClick:()=>b("json"),className:"btn-ghost btn-sm",children:[a.jsx(yu,{className:"h-4 w-4"})," JSON"]}),a.jsxs("button",{onClick:()=>b("csv"),className:"btn-ghost btn-sm",children:[a.jsx(yu,{className:"h-4 w-4"})," CSV"]})]}),a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface",children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Time"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Actor"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Action"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Resource"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"IP"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Details"})]})}),a.jsxs("tbody",{children:[l.map(j=>{var A;return a.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[a.jsx("td",{className:"px-4 py-2.5 text-zinc-400 text-xs whitespace-nowrap",children:new Date(j.createdAt*1e3).toLocaleString()}),a.jsx("td",{className:"px-4 py-2.5 text-zinc-300 text-xs font-mono",children:((A=j.userId)==null?void 0:A.slice(0,8))||"-"}),a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs text-indigo-400",children:j.action}),a.jsx("td",{className:"px-4 py-2.5 text-zinc-300 text-xs",children:j.resourceType?`${j.resourceType}${j.resourceId?`/${j.resourceId.slice(0,8)}`:""}`:"-"}),a.jsx("td",{className:"px-4 py-2.5 text-zinc-500 text-xs",children:j.ipAddress||"-"}),a.jsx("td",{className:"px-4 py-2.5 text-xs text-zinc-500 max-w-[200px] truncate",children:j.details?JSON.stringify(j.details):"-"})]},j.id)}),l.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-zinc-500",children:"No audit entries found."})})]})]})})]})}function h1(l){const c="id,userId,action,resourceType,resourceId,ipAddress,createdAt,details",u=l.map(o=>[o.id,o.userId??"",o.action,o.resourceType??"",o.resourceId??"",o.ipAddress??"",new Date(o.createdAt*1e3).toISOString(),o.details?JSON.stringify(o.details).replace(/"/g,'""'):""].map(f=>`"${f}"`).join(","));return[c,...u].join(`
|
|
537
|
+
`)}function g1(){const[l,c]=d.useState([]),[u,o]=d.useState([]),[f,x]=d.useState([]),[g,v]=d.useState([]),[y,h]=d.useState(!0),[w,b]=d.useState(""),j=d.useCallback(async()=>{h(!0),b("");try{const[A,z,N,S]=await Promise.allSettled([ut.security.failedLogins(24),ut.security.lockedAccounts(),ut.security.activeSessions(),ut.security.rateLimitViolations(50)]);A.status==="fulfilled"&&c(A.value.data),z.status==="fulfilled"&&o(z.value.data),N.status==="fulfilled"&&x(N.value.data),S.status==="fulfilled"&&v(S.value.data)}catch(A){b(A.message||"Failed to load security data")}finally{h(!1)}},[]);return d.useEffect(()=>{j()},[j]),y?a.jsx(Rn,{}):w?a.jsx(Ea,{message:w,onRetry:j}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[a.jsx(ln,{label:"Failed Logins (24h)",value:l.reduce((A,z)=>A+z.count,0),icon:Ot,color:"red"}),a.jsx(ln,{label:"Locked Accounts",value:u.length,icon:vu,color:"amber"}),a.jsx(ln,{label:"Active Sessions",value:f.length,icon:Cs,color:"green"}),a.jsx(ln,{label:"Rate Violations",value:g.length,icon:ia,color:"red"})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[a.jsx(Ot,{className:"h-4 w-4 text-red-400"})," Failed Login Attempts (Last 24h)"]}),l.length>0?a.jsx("div",{className:"overflow-x-auto rounded border border-border/50",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/50 bg-background",children:[a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Email"}),a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"IP"}),a.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Attempts"}),a.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"First Seen"})]})}),a.jsx("tbody",{children:l.map((A,z)=>a.jsxs("tr",{className:"border-b border-border/30",children:[a.jsx("td",{className:"px-3 py-1.5 text-zinc-300",children:A.email}),a.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-400",children:A.ip}),a.jsx("td",{className:"px-3 py-1.5 text-right font-semibold text-red-400",children:A.count}),a.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(A.timestamp).toLocaleString()})]},z))})]})}):a.jsx("p",{className:"text-xs text-zinc-500",children:"No failed login attempts in the last 24 hours."})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[a.jsx(vu,{className:"h-4 w-4 text-amber-400"})," Locked Accounts"]}),u.length>0?a.jsx("div",{className:"overflow-x-auto rounded border border-border/50",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/50 bg-background",children:[a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Email"}),a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Reason"}),a.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Locked At"})]})}),a.jsx("tbody",{children:u.map((A,z)=>a.jsxs("tr",{className:"border-b border-border/30",children:[a.jsx("td",{className:"px-3 py-1.5 text-zinc-300",children:A.email}),a.jsx("td",{className:"px-3 py-1.5 text-zinc-400",children:A.reason}),a.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(A.lockedAt).toLocaleString()})]},z))})]})}):a.jsx("p",{className:"text-xs text-zinc-500",children:"No locked accounts."})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[a.jsx(js,{className:"h-4 w-4 text-green-400"})," Active Sessions (",f.length,")"]}),f.length>0?a.jsx("div",{className:"overflow-x-auto rounded border border-border/50 max-h-60 overflow-y-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/50 bg-background sticky top-0",children:[a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Email"}),a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"IP"}),a.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Created"}),a.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Expires"})]})}),a.jsx("tbody",{children:f.map((A,z)=>a.jsxs("tr",{className:"border-b border-border/30",children:[a.jsx("td",{className:"px-3 py-1.5 text-zinc-300",children:A.email}),a.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-400",children:A.ip}),a.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(A.createdAt).toLocaleString()}),a.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(A.expiresAt).toLocaleString()})]},z))})]})}):a.jsx("p",{className:"text-xs text-zinc-500",children:"No active sessions."})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[a.jsx(ia,{className:"h-4 w-4 text-red-400"})," Recent Rate Limit Violations"]}),g.length>0?a.jsx("div",{className:"overflow-x-auto rounded border border-border/50 max-h-60 overflow-y-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/50 bg-background sticky top-0",children:[a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Time"}),a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Tier"}),a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"IP"}),a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"User"}),a.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Endpoint"})]})}),a.jsx("tbody",{children:g.map((A,z)=>{var N;return a.jsxs("tr",{className:"border-b border-border/30",children:[a.jsx("td",{className:"px-3 py-1.5 text-zinc-400 whitespace-nowrap",children:new Date(A.timestamp).toLocaleString()}),a.jsx("td",{className:"px-3 py-1.5",children:a.jsx("span",{className:"rounded-full bg-red-500/10 px-1.5 py-0.5 text-red-400",children:A.tier})}),a.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-400",children:A.ip}),a.jsx("td",{className:"px-3 py-1.5 text-zinc-400",children:((N=A.userId)==null?void 0:N.slice(0,8))||"-"}),a.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-300 max-w-[200px] truncate",children:A.endpoint})]},z)})})]})}):a.jsx("p",{className:"text-xs text-zinc-500",children:"No rate limit violations recorded."})]})]})}function p1(){const[l,c]=d.useState(null),[u,o]=d.useState(null),[f,x]=d.useState(!0),[g,v]=d.useState(!1),[y,h]=d.useState(""),[w,b]=d.useState(""),[j,A]=d.useState(!1),z=d.useCallback(async()=>{x(!0),h(""),b("");try{const D=await la.getConfig();c(D.data),o(D.data),A(!1)}catch(D){h(D.message||"Failed to load configuration")}finally{x(!1)}},[]);d.useEffect(()=>{z()},[z]);const N=(D,U,E)=>{u&&(o({...u,[D]:{...u[D],[U]:E}}),A(!0),b(""))},S=async()=>{if(u){v(!0),h(""),b("");try{const D=await la.updateConfig(u);c(D.data),o(D.data),A(!1),b("Configuration saved successfully.")}catch(D){h(D.message||"Failed to save configuration")}finally{v(!1)}}},k=()=>{l&&(o({...l}),A(!1),b(""))};return f?a.jsx(Rn,{}):y&&!u?a.jsx(Ea,{message:y,onRetry:z}):a.jsxs("div",{className:"space-y-6",children:[y&&a.jsx(Ea,{message:y}),w&&a.jsxs("div",{className:"rounded-lg border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-400 flex items-center gap-2",children:[a.jsx(Yh,{className:"h-4 w-4 flex-shrink-0"}),w]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-sm text-zinc-400",children:"Runtime configuration (changes apply immediately)"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:z,className:"btn-ghost btn-sm",children:a.jsx(Wt,{className:"h-4 w-4"})}),a.jsx("button",{onClick:k,disabled:!j,className:"btn-secondary btn-sm",children:"Reset"}),a.jsxs("button",{onClick:S,disabled:!j||g,className:"btn-primary btn-sm",children:[a.jsx(Ou,{className:"h-4 w-4"})," ",g?"Saving...":"Save"]})]})]}),u&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[a.jsx(Lu,{className:"h-4 w-4 text-indigo-400"})," Server"]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Host"}),a.jsx("input",{className:"input",value:u.server.host,onChange:D=>N("server","host",D.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Port"}),a.jsx("input",{className:"input",type:"number",value:u.server.port,onChange:D=>N("server","port",parseInt(D.target.value)||0)})]})]})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[a.jsx(ia,{className:"h-4 w-4 text-amber-400"})," Security"]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Default Trust Level"}),a.jsxs("select",{className:"input",value:u.security.defaultTrustLevel,onChange:D=>N("security","defaultTrustLevel",D.target.value),children:[a.jsx("option",{value:"builtin",children:"Builtin"}),a.jsx("option",{value:"official",children:"Official"}),a.jsx("option",{value:"trusted",children:"Trusted"}),a.jsx("option",{value:"community",children:"Community"}),a.jsx("option",{value:"local",children:"Local"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Approval Mode"}),a.jsxs("select",{className:"input",value:u.security.approvalMode,onChange:D=>N("security","approvalMode",D.target.value),children:[a.jsx("option",{value:"manual",children:"Manual"}),a.jsx("option",{value:"smart",children:"Smart"}),a.jsx("option",{value:"off",children:"Off"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Max Concurrent Runs"}),a.jsx("input",{className:"input",type:"number",min:1,max:100,value:u.security.maxConcurrentRuns,onChange:D=>N("security","maxConcurrentRuns",parseInt(D.target.value)||1)})]})]})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[a.jsx(Dt,{className:"h-4 w-4 text-green-400"})," Budget"]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Enabled"}),a.jsxs("select",{className:"input",value:u.budget.enabled?"true":"false",onChange:D=>N("budget","enabled",D.target.value==="true"),children:[a.jsx("option",{value:"true",children:"Yes"}),a.jsx("option",{value:"false",children:"No"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Max Cost/Run (USD)"}),a.jsx("input",{className:"input",type:"number",step:"0.01",min:0,value:u.budget.defaultMaxCostPerRunUsd,onChange:D=>N("budget","defaultMaxCostPerRunUsd",parseFloat(D.target.value)||0)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Max Tokens/Run"}),a.jsx("input",{className:"input",type:"number",min:0,value:u.budget.defaultMaxTokensPerRun,onChange:D=>N("budget","defaultMaxTokensPerRun",parseInt(D.target.value)||0)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Warning Threshold %"}),a.jsx("input",{className:"input",type:"number",min:0,max:100,value:u.budget.warningThresholdPercent,onChange:D=>N("budget","warningThresholdPercent",parseInt(D.target.value)||0)})]})]})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[a.jsx(Ac,{className:"h-4 w-4 text-blue-400"})," Logging"]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Level"}),a.jsxs("select",{className:"input",value:u.logging.level,onChange:D=>N("logging","level",D.target.value),children:[a.jsx("option",{value:"debug",children:"Debug"}),a.jsx("option",{value:"info",children:"Info"}),a.jsx("option",{value:"warn",children:"Warn"}),a.jsx("option",{value:"error",children:"Error"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"label",children:"Format"}),a.jsxs("select",{className:"input",value:u.logging.format,onChange:D=>N("logging","format",D.target.value),children:[a.jsx("option",{value:"json",children:"JSON"}),a.jsx("option",{value:"pretty",children:"Pretty"})]})]})]})]}),a.jsxs("div",{className:"card p-4 space-y-3",children:[a.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Current Configuration (JSON)"}),a.jsx("pre",{className:"overflow-x-auto rounded border border-border/50 bg-background p-3 text-xs text-zinc-400 max-h-60 overflow-y-auto",children:JSON.stringify(u,null,2)})]})]})]})}function Rn(){return a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})})}function Ea({message:l,onRetry:c}){return a.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-400",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ft,{className:"h-4 w-4 flex-shrink-0"}),a.jsx("span",{children:l}),c&&a.jsx("button",{onClick:c,className:"ml-auto text-xs underline hover:text-red-300",children:"Retry"})]})})}const y1=[{key:"overview",label:"Overview",icon:Ec},{key:"tenants",label:"Tenants",icon:Mu},{key:"users",label:"Users",icon:Cs},{key:"system",label:"System",icon:Lu},{key:"audit",label:"Audit Log",icon:Ac},{key:"security",label:"Security",icon:ia},{key:"config",label:"Config",icon:Bl}];function b1(){const{isAdmin:l}=Hl(),[c,u]=d.useState("overview");return l?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Admin Dashboard"}),a.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Multi-tenant administration and system monitoring."})]}),a.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:y1.map(({key:o,label:f,icon:x})=>a.jsxs("button",{onClick:()=>u(o),className:`flex items-center gap-2 whitespace-nowrap px-4 py-2.5 text-sm font-medium transition-colors border-b-2 ${c===o?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-200"}`,children:[a.jsx(x,{className:"h-4 w-4"}),f]},o))}),c==="overview"&&a.jsx(u1,{}),c==="tenants"&&a.jsx(d1,{}),c==="users"&&a.jsx(m1,{}),c==="system"&&a.jsx(f1,{}),c==="audit"&&a.jsx(x1,{}),c==="security"&&a.jsx(g1,{}),c==="config"&&a.jsx(p1,{})]}):a.jsxs("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:[a.jsx(ia,{className:"mr-2 h-5 w-5"})," Admin access required."]})}function Ge(l){return a.jsx(Tv,{fallback:a.jsx(Rv,{}),children:l})}function v1(){const{user:l,loading:c}=Hl();return c?a.jsx("div",{className:"flex h-screen items-center justify-center bg-background text-zinc-400",children:"Loading..."}):l?a.jsx(_h,{children:a.jsxs(_e,{element:a.jsx(Ev,{}),children:[a.jsx(_e,{path:"/",element:Ge(a.jsx(Lv,{}))}),a.jsx(_e,{path:"/agents",element:Ge(a.jsx($v,{}))}),a.jsx(_e,{path:"/agents/:id",element:Ge(a.jsx(Kv,{}))}),a.jsx(_e,{path:"/agents/:id/prompts",element:Ge(a.jsx(Oj,{}))}),a.jsx(_e,{path:"/agents/:id/memory-store",element:Ge(a.jsx(r1,{}))}),a.jsx(_e,{path:"/workflows",element:Ge(a.jsx(Fv,{}))}),a.jsx(_e,{path:"/workflows/:id/edit",element:Ge(a.jsx(Iv,{}))}),a.jsx(_e,{path:"/skills",element:Ge(a.jsx(tj,{}))}),a.jsx(_e,{path:"/runs",element:Ge(a.jsx(aj,{}))}),a.jsx(_e,{path:"/runs/:id",element:Ge(a.jsx(mj,{}))}),a.jsx(_e,{path:"/goals",element:Ge(a.jsx(Zj,{}))}),a.jsx(_e,{path:"/approvals",element:Ge(a.jsx(gj,{}))}),a.jsx(_e,{path:"/handoffs",element:Ge(a.jsx(Jj,{}))}),a.jsx(_e,{path:"/analytics",element:Ge(a.jsx(Cj,{}))}),a.jsx(_e,{path:"/budget",element:Ge(a.jsx(Vj,{}))}),a.jsx(_e,{path:"/traces",element:Ge(a.jsx(Mj,{}))}),a.jsx(_e,{path:"/memory",element:Ge(a.jsx(Bj,{}))}),a.jsx(_e,{path:"/users",element:Ge(a.jsx(Dj,{}))}),a.jsx(_e,{path:"/plans",element:Ge(a.jsx(e1,{}))}),a.jsx(_e,{path:"/plans/:id",element:Ge(a.jsx(t1,{}))}),a.jsx(_e,{path:"/guardrails",element:Ge(a.jsx(c1,{}))}),a.jsx(_e,{path:"/admin",element:Ge(a.jsx(b1,{}))}),a.jsx(_e,{path:"/settings",element:Ge(a.jsx(fj,{}))}),a.jsx(_e,{path:"*",element:a.jsx(Gy,{to:"/",replace:!0})})]})}):a.jsx(l0,{})}function j1(){return a.jsx(cv,{children:a.jsx(dv,{children:a.jsxs(_h,{children:[a.jsx(_e,{path:"/login",element:a.jsx(l0,{})}),a.jsx(_e,{path:"/*",element:a.jsx(v1,{})})]})})})}const f0=document.getElementById("root");if(!f0)throw new Error("Root element not found");Yp.createRoot(f0).render(a.jsx(d.StrictMode,{children:a.jsx(xb,{children:a.jsx(j1,{})})}));
|
|
538
|
+
//# sourceMappingURL=index-BfcUmUAy.js.map
|