@samanhappy/mcphub 0.8.6 → 0.8.7

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,202 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function l(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(d){if(d.ep)return;d.ep=!0;const f=l(d);fetch(d.href,f)}})();function Zh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Lc={exports:{}},Tr={};/**
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 lh;function cx(){if(lh)return Tr;lh=1;var s=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(c,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:s,type:c,key:m,ref:d!==void 0?d:null,props:f}}return Tr.Fragment=i,Tr.jsx=l,Tr.jsxs=l,Tr}var ih;function ux(){return ih||(ih=1,Lc.exports=cx()),Lc.exports}var r=ux(),_c={exports:{}},je={};/**
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 oh;function dx(){if(oh)return je;oh=1;var s=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.iterator;function v(T){return T===null||typeof T!="object"?null:(T=S&&T[S]||T["@@iterator"],typeof T=="function"?T:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,M={};function R(T,P,re){this.props=T,this.context=P,this.refs=M,this.updater=re||A}R.prototype.isReactComponent={},R.prototype.setState=function(T,P){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,P,"setState")},R.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function j(){}j.prototype=R.prototype;function C(T,P,re){this.props=T,this.context=P,this.refs=M,this.updater=re||A}var O=C.prototype=new j;O.constructor=C,N(O,R.prototype),O.isPureReactComponent=!0;var F=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function Q(T,P,re,ne,ue,ve){return re=ve.ref,{$$typeof:s,type:T,key:P,ref:re!==void 0?re:null,props:ve}}function B(T,P){return Q(T.type,P,void 0,void 0,void 0,T.props)}function W(T){return typeof T=="object"&&T!==null&&T.$$typeof===s}function le(T){var P={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(re){return P[re]})}var U=/\/+/g;function L(T,P){return typeof T=="object"&&T!==null&&T.key!=null?le(""+T.key):P.toString(36)}function Z(){}function _(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(Z,Z):(T.status="pending",T.then(function(P){T.status==="pending"&&(T.status="fulfilled",T.value=P)},function(P){T.status==="pending"&&(T.status="rejected",T.reason=P)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function $(T,P,re,ne,ue){var ve=typeof T;(ve==="undefined"||ve==="boolean")&&(T=null);var I=!1;if(T===null)I=!0;else switch(ve){case"bigint":case"string":case"number":I=!0;break;case"object":switch(T.$$typeof){case s:case i:I=!0;break;case y:return I=T._init,$(I(T._payload),P,re,ne,ue)}}if(I)return ue=ue(T),I=ne===""?"."+L(T,0):ne,F(ue)?(re="",I!=null&&(re=I.replace(U,"$&/")+"/"),$(ue,P,re,"",function(Ke){return Ke})):ue!=null&&(W(ue)&&(ue=B(ue,re+(ue.key==null||T&&T.key===ue.key?"":(""+ue.key).replace(U,"$&/")+"/")+I)),P.push(ue)),1;I=0;var se=ne===""?".":ne+":";if(F(T))for(var Se=0;Se<T.length;Se++)ne=T[Se],ve=se+L(ne,Se),I+=$(ne,P,re,ve,ue);else if(Se=v(T),typeof Se=="function")for(T=Se.call(T),Se=0;!(ne=T.next()).done;)ne=ne.value,ve=se+L(ne,Se++),I+=$(ne,P,re,ve,ue);else if(ve==="object"){if(typeof T.then=="function")return $(_(T),P,re,ne,ue);throw P=String(T),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return I}function E(T,P,re){if(T==null)return T;var ne=[],ue=0;return $(T,ne,"","",function(ve){return P.call(re,ve,ue++)}),ne}function G(T){if(T._status===-1){var P=T._result;P=P(),P.then(function(re){(T._status===0||T._status===-1)&&(T._status=1,T._result=re)},function(re){(T._status===0||T._status===-1)&&(T._status=2,T._result=re)}),T._status===-1&&(T._status=0,T._result=P)}if(T._status===1)return T._result.default;throw T._result}var X=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function oe(){}return je.Children={map:E,forEach:function(T,P,re){E(T,function(){P.apply(this,arguments)},re)},count:function(T){var P=0;return E(T,function(){P++}),P},toArray:function(T){return E(T,function(P){return P})||[]},only:function(T){if(!W(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},je.Component=R,je.Fragment=l,je.Profiler=d,je.PureComponent=C,je.StrictMode=c,je.Suspense=g,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,je.__COMPILER_RUNTIME={__proto__:null,c:function(T){return D.H.useMemoCache(T)}},je.cache=function(T){return function(){return T.apply(null,arguments)}},je.cloneElement=function(T,P,re){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var ne=N({},T.props),ue=T.key,ve=void 0;if(P!=null)for(I in P.ref!==void 0&&(ve=void 0),P.key!==void 0&&(ue=""+P.key),P)!ee.call(P,I)||I==="key"||I==="__self"||I==="__source"||I==="ref"&&P.ref===void 0||(ne[I]=P[I]);var I=arguments.length-2;if(I===1)ne.children=re;else if(1<I){for(var se=Array(I),Se=0;Se<I;Se++)se[Se]=arguments[Se+2];ne.children=se}return Q(T.type,ue,void 0,void 0,ve,ne)},je.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:f,_context:T},T},je.createElement=function(T,P,re){var ne,ue={},ve=null;if(P!=null)for(ne in P.key!==void 0&&(ve=""+P.key),P)ee.call(P,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(ue[ne]=P[ne]);var I=arguments.length-2;if(I===1)ue.children=re;else if(1<I){for(var se=Array(I),Se=0;Se<I;Se++)se[Se]=arguments[Se+2];ue.children=se}if(T&&T.defaultProps)for(ne in I=T.defaultProps,I)ue[ne]===void 0&&(ue[ne]=I[ne]);return Q(T,ve,void 0,void 0,null,ue)},je.createRef=function(){return{current:null}},je.forwardRef=function(T){return{$$typeof:p,render:T}},je.isValidElement=W,je.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:G}},je.memo=function(T,P){return{$$typeof:h,type:T,compare:P===void 0?null:P}},je.startTransition=function(T){var P=D.T,re={};D.T=re;try{var ne=T(),ue=D.S;ue!==null&&ue(re,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(oe,X)}catch(ve){X(ve)}finally{D.T=P}},je.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},je.use=function(T){return D.H.use(T)},je.useActionState=function(T,P,re){return D.H.useActionState(T,P,re)},je.useCallback=function(T,P){return D.H.useCallback(T,P)},je.useContext=function(T){return D.H.useContext(T)},je.useDebugValue=function(){},je.useDeferredValue=function(T,P){return D.H.useDeferredValue(T,P)},je.useEffect=function(T,P,re){var ne=D.H;if(typeof re=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ne.useEffect(T,P)},je.useId=function(){return D.H.useId()},je.useImperativeHandle=function(T,P,re){return D.H.useImperativeHandle(T,P,re)},je.useInsertionEffect=function(T,P){return D.H.useInsertionEffect(T,P)},je.useLayoutEffect=function(T,P){return D.H.useLayoutEffect(T,P)},je.useMemo=function(T,P){return D.H.useMemo(T,P)},je.useOptimistic=function(T,P){return D.H.useOptimistic(T,P)},je.useReducer=function(T,P,re){return D.H.useReducer(T,P,re)},je.useRef=function(T){return D.H.useRef(T)},je.useState=function(T){return D.H.useState(T)},je.useSyncExternalStore=function(T,P,re){return D.H.useSyncExternalStore(T,P,re)},je.useTransition=function(){return D.H.useTransition()},je.version="19.1.0",je}var ch;function ru(){return ch||(ch=1,_c.exports=dx()),_c.exports}var w=ru();const Cs=Zh(w);var Hc={exports:{}},kr={},Bc={exports:{}},qc={};/**
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 uh;function fx(){return uh||(uh=1,function(s){function i(E,G){var X=E.length;E.push(G);e:for(;0<X;){var oe=X-1>>>1,T=E[oe];if(0<d(T,G))E[oe]=G,E[X]=T,X=oe;else break e}}function l(E){return E.length===0?null:E[0]}function c(E){if(E.length===0)return null;var G=E[0],X=E.pop();if(X!==G){E[0]=X;e:for(var oe=0,T=E.length,P=T>>>1;oe<P;){var re=2*(oe+1)-1,ne=E[re],ue=re+1,ve=E[ue];if(0>d(ne,X))ue<T&&0>d(ve,ne)?(E[oe]=ve,E[ue]=X,oe=ue):(E[oe]=ne,E[re]=X,oe=re);else if(ue<T&&0>d(ve,X))E[oe]=ve,E[ue]=X,oe=ue;else break e}}return G}function d(E,G){var X=E.sortIndex-G.sortIndex;return X!==0?X:E.id-G.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();s.unstable_now=function(){return m.now()-p}}var g=[],h=[],y=1,S=null,v=3,A=!1,N=!1,M=!1,R=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function F(E){for(var G=l(h);G!==null;){if(G.callback===null)c(h);else if(G.startTime<=E)c(h),G.sortIndex=G.expirationTime,i(g,G);else break;G=l(h)}}function D(E){if(M=!1,F(E),!N)if(l(g)!==null)N=!0,ee||(ee=!0,L());else{var G=l(h);G!==null&&$(D,G.startTime-E)}}var ee=!1,Q=-1,B=5,W=-1;function le(){return R?!0:!(s.unstable_now()-W<B)}function U(){if(R=!1,ee){var E=s.unstable_now();W=E;var G=!0;try{e:{N=!1,M&&(M=!1,C(Q),Q=-1),A=!0;var X=v;try{t:{for(F(E),S=l(g);S!==null&&!(S.expirationTime>E&&le());){var oe=S.callback;if(typeof oe=="function"){S.callback=null,v=S.priorityLevel;var T=oe(S.expirationTime<=E);if(E=s.unstable_now(),typeof T=="function"){S.callback=T,F(E),G=!0;break t}S===l(g)&&c(g),F(E)}else c(g);S=l(g)}if(S!==null)G=!0;else{var P=l(h);P!==null&&$(D,P.startTime-E),G=!1}}break e}finally{S=null,v=X,A=!1}G=void 0}}finally{G?L():ee=!1}}}var L;if(typeof O=="function")L=function(){O(U)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,_=Z.port2;Z.port1.onmessage=U,L=function(){_.postMessage(null)}}else L=function(){j(U,0)};function $(E,G){Q=j(function(){E(s.unstable_now())},G)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(E){E.callback=null},s.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<E?Math.floor(1e3/E):5},s.unstable_getCurrentPriorityLevel=function(){return v},s.unstable_next=function(E){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var X=v;v=G;try{return E()}finally{v=X}},s.unstable_requestPaint=function(){R=!0},s.unstable_runWithPriority=function(E,G){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var X=v;v=E;try{return G()}finally{v=X}},s.unstable_scheduleCallback=function(E,G,X){var oe=s.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?oe+X:oe):X=oe,E){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=X+T,E={id:y++,callback:G,priorityLevel:E,startTime:X,expirationTime:T,sortIndex:-1},X>oe?(E.sortIndex=X,i(h,E),l(g)===null&&E===l(h)&&(M?(C(Q),Q=-1):M=!0,$(D,X-oe))):(E.sortIndex=T,i(g,E),N||A||(N=!0,ee||(ee=!0,L()))),E},s.unstable_shouldYield=le,s.unstable_wrapCallback=function(E){var G=v;return function(){var X=v;v=G;try{return E.apply(this,arguments)}finally{v=X}}}}(qc)),qc}var dh;function mx(){return dh||(dh=1,Bc.exports=fx()),Bc.exports}var Vc={exports:{}},gt={};/**
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 fh;function hx(){if(fh)return gt;fh=1;var s=ru();function i(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var c={d:{f:l,r:function(){throw Error(i(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,h,y){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:S==null?null:""+S,children:g,containerInfo:h,implementation:y}}var m=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return gt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,gt.createPortal=function(g,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(i(299));return f(g,h,null,y)},gt.flushSync=function(g){var h=m.T,y=c.p;try{if(m.T=null,c.p=2,g)return g()}finally{m.T=h,c.p=y,c.d.f()}},gt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,c.d.C(g,h))},gt.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},gt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,S=p(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,A=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?c.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:S,integrity:v,fetchPriority:A}):y==="script"&&c.d.X(g,{crossOrigin:S,integrity:v,fetchPriority:A,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},gt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=p(h.as,h.crossOrigin);c.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&c.d.M(g)},gt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,S=p(y,h.crossOrigin);c.d.L(g,y,{crossOrigin:S,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})}},gt.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=p(h.as,h.crossOrigin);c.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else c.d.m(g)},gt.requestFormReset=function(g){c.d.r(g)},gt.unstable_batchedUpdates=function(g,h){return g(h)},gt.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},gt.useFormStatus=function(){return m.H.useHostTransitionStatus()},gt.version="19.1.0",gt}var mh;function gx(){if(mh)return Vc.exports;mh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(i){console.error(i)}}return s(),Vc.exports=hx(),Vc.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 hh;function px(){if(hh)return kr;hh=1;var s=mx(),i=ru(),l=gx();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(c(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var o=a.return;if(o===null)break;var u=o.alternate;if(u===null){if(n=o.return,n!==null){a=n;continue}break}if(o.child===u.child){for(u=o.child;u;){if(u===a)return p(o),e;if(u===n)return p(o),t;u=u.sibling}throw Error(c(188))}if(a.return!==n.return)a=o,n=u;else{for(var x=!1,b=o.child;b;){if(b===a){x=!0,a=o,n=u;break}if(b===n){x=!0,n=o,a=u;break}b=b.sibling}if(!x){for(b=u.child;b;){if(b===a){x=!0,a=u,n=o;break}if(b===n){x=!0,n=u,a=o;break}b=b.sibling}if(!x)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function h(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=h(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,S=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),O=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function L(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function _(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case R:return"Profiler";case M:return"StrictMode";case D:return"Suspense";case ee:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case O:return(e.displayName||"Context")+".Provider";case C:return(e._context.displayName||"Context")+".Consumer";case F:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:_(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return _(e(t))}catch{}}return null}var $=Array.isArray,E=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},oe=[],T=-1;function P(e){return{current:e}}function re(e){0>T||(e.current=oe[T],oe[T]=null,T--)}function ne(e,t){T++,oe[T]=e.current,e.current=t}var ue=P(null),ve=P(null),I=P(null),se=P(null);function Se(e,t){switch(ne(I,t),ne(ve,e),ne(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dm(t),e=Um(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}re(ue),ne(ue,e)}function Ke(){re(ue),re(ve),re(I)}function Ve(e){e.memoizedState!==null&&ne(se,e);var t=ue.current,a=Um(t,e.type);t!==a&&(ne(ve,e),ne(ue,a))}function be(e){ve.current===e&&(re(ue),re(ve)),se.current===e&&(re(se),Sr._currentValue=X)}var Me=Object.prototype.hasOwnProperty,Fe=s.unstable_scheduleCallback,da=s.unstable_cancelCallback,ln=s.unstable_shouldYield,on=s.unstable_requestPaint,De=s.unstable_now,vt=s.unstable_getCurrentPriorityLevel,Ma=s.unstable_ImmediatePriority,za=s.unstable_UserBlockingPriority,fa=s.unstable_NormalPriority,Da=s.unstable_LowPriority,Os=s.unstable_IdlePriority,Kr=s.log,$r=s.unstable_setDisableYieldValue,Ua=null,ft=null;function $t(e){if(typeof Kr=="function"&&$r(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Ua,e)}catch{}}var mt=Math.clz32?Math.clz32:Fr,Yr=Math.log,Pr=Math.LN2;function Fr(e){return e>>>=0,e===0?32:31-(Yr(e)/Pr|0)|0}var cn=256,un=4194304;function ta(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;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 dn(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var o=0,u=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var b=n&134217727;return b!==0?(n=b&~u,n!==0?o=ta(n):(x&=b,x!==0?o=ta(x):a||(a=b&~e,a!==0&&(o=ta(a))))):(b=n&~u,b!==0?o=ta(b):x!==0?o=ta(x):a||(a=n&~e,a!==0&&(o=ta(a)))),o===0?0:t!==0&&t!==o&&(t&u)===0&&(u=o&-o,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:o}function ce(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ie(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 ge(){var e=cn;return cn<<=1,(cn&4194048)===0&&(cn=256),e}function Yt(){var e=un;return un<<=1,(un&62914560)===0&&(un=4194304),e}function Pt(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function fn(e,t,a,n,o,u){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,k=e.expirationTimes,V=e.hiddenUpdates;for(a=x&~a;0<a;){var J=31-mt(a),ae=1<<J;b[J]=0,k[J]=-1;var K=V[J];if(K!==null)for(V[J]=null,J=0;J<K.length;J++){var Y=K[J];Y!==null&&(Y.lane&=-536870913)}a&=~ae}n!==0&&Xr(e,n,0),u!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=u&~(x&~t))}function Xr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-mt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&4194090}function Ct(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-mt(a),o=1<<n;o&t|e[n]&t&&(e[n]|=t),a&=~o}}function aa(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 zn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ms(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:eh(e.type))}function Qr(e,t){var a=G.p;try{return G.p=e,t()}finally{G.p=a}}var Xt=Math.random().toString(36).slice(2),tt="__reactFiber$"+Xt,xt="__reactProps$"+Xt,Dn="__reactContainer$"+Xt,Ti="__reactEvents$"+Xt,Wg="__reactListeners$"+Xt,ep="__reactHandles$"+Xt,wu="__reactResources$"+Xt,zs="__reactMarker$"+Xt;function ki(e){delete e[tt],delete e[xt],delete e[Ti],delete e[Wg],delete e[ep]}function Un(e){var t=e[tt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Dn]||a[tt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Bm(e);e!==null;){if(a=e[tt])return a;e=Bm(e)}return t}e=a,a=e.parentNode}return null}function Ln(e){if(e=e[tt]||e[Dn]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Ds(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function _n(e){var t=e[wu];return t||(t=e[wu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function rt(e){e[zs]=!0}var Su=new Set,ju={};function mn(e,t){Hn(e,t),Hn(e+"Capture",t)}function Hn(e,t){for(ju[e]=t,e=0;e<t.length;e++)Su.add(t[e])}var tp=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]*$"),Nu={},Cu={};function ap(e){return Me.call(Cu,e)?!0:Me.call(Nu,e)?!1:tp.test(e)?Cu[e]=!0:(Nu[e]=!0,!1)}function Zr(e,t,a){if(ap(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Jr(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function ma(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}var Ai,Eu;function Bn(e){if(Ai===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ai=t&&t[1]||"",Eu=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ai+e+Eu}var Ri=!1;function Oi(e,t){if(!e||Ri)return"";Ri=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(Y){var K=Y}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(Y){K=Y}e.call(ae.prototype)}}else{try{throw Error()}catch(Y){K=Y}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(Y){if(Y&&K&&typeof Y.stack=="string")return[Y.stack,K.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=n.DetermineComponentFrameRoot(),x=u[0],b=u[1];if(x&&b){var k=x.split(`
44
+ `),V=b.split(`
45
+ `);for(o=n=0;n<k.length&&!k[n].includes("DetermineComponentFrameRoot");)n++;for(;o<V.length&&!V[o].includes("DetermineComponentFrameRoot");)o++;if(n===k.length||o===V.length)for(n=k.length-1,o=V.length-1;1<=n&&0<=o&&k[n]!==V[o];)o--;for(;1<=n&&0<=o;n--,o--)if(k[n]!==V[o]){if(n!==1||o!==1)do if(n--,o--,0>o||k[n]!==V[o]){var J=`
46
+ `+k[n].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=n&&0<=o);break}}}finally{Ri=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Bn(a):""}function np(e){switch(e.tag){case 26:case 27:case 5:return Bn(e.type);case 16:return Bn("Lazy");case 13:return Bn("Suspense");case 19:return Bn("SuspenseList");case 0:case 15:return Oi(e.type,!1);case 11:return Oi(e.type.render,!1);case 1:return Oi(e.type,!0);case 31:return Bn("Activity");default:return""}}function Tu(e){try{var t="";do t+=np(e),e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}function Dt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ku(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sp(e){var t=ku(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(x){n=""+x,u.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(x){n=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ir(e){e._valueTracker||(e._valueTracker=sp(e))}function Au(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=ku(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Wr(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 rp=/[\n"\\]/g;function Ut(e){return e.replace(rp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mi(e,t,a,n,o,u,x,b){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Dt(t)):e.value!==""+Dt(t)&&(e.value=""+Dt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?zi(e,x,Dt(t)):a!=null?zi(e,x,Dt(a)):n!=null&&e.removeAttribute("value"),o==null&&u!=null&&(e.defaultChecked=!!u),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Dt(b):e.removeAttribute("name")}function Ru(e,t,a,n,o,u,x,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null))return;a=a!=null?""+Dt(a):"",t=t!=null?""+Dt(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}n=n??o,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=b?e.checked:!!n,e.defaultChecked=!!n,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x)}function zi(e,t,a){t==="number"&&Wr(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function qn(e,t,a,n){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Dt(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ou(e,t,a){if(t!=null&&(t=""+Dt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Dt(a):""}function Mu(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if($(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Dt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n)}function Vn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var lp=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 zu(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||lp.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Du(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var o in t)n=t[o],t.hasOwnProperty(o)&&a[o]!==n&&zu(e,o,n)}else for(var u in t)t.hasOwnProperty(u)&&zu(e,u,t[u])}function Di(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 ip=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"]]),op=/^[\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 el(e){return op.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ui=null;function Li(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gn=null,Kn=null;function Uu(e){var t=Ln(e);if(t&&(e=t.stateNode)){var a=e[xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mi(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Ut(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var o=n[xt]||null;if(!o)throw Error(c(90));Mi(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Au(n)}break e;case"textarea":Ou(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&qn(e,!!a.multiple,t,!1)}}}var _i=!1;function Lu(e,t,a){if(_i)return e(t,a);_i=!0;try{var n=e(t);return n}finally{if(_i=!1,(Gn!==null||Kn!==null)&&(Bl(),Gn&&(t=Gn,e=Kn,Kn=Gn=null,Uu(t),e)))for(t=0;t<e.length;t++)Uu(e[t])}}function Us(e,t){var a=e.stateNode;if(a===null)return null;var n=a[xt]||null;if(n===null)return null;a=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hi=!1;if(ha)try{var Ls={};Object.defineProperty(Ls,"passive",{get:function(){Hi=!0}}),window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{Hi=!1}var La=null,Bi=null,tl=null;function _u(){if(tl)return tl;var e,t=Bi,a=t.length,n,o="value"in La?La.value:La.textContent,u=o.length;for(e=0;e<a&&t[e]===o[e];e++);var x=a-e;for(n=1;n<=x&&t[a-n]===o[u-n];n++);return tl=o.slice(e,1<n?1-n:void 0)}function al(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 nl(){return!0}function Hu(){return!1}function wt(e){function t(a,n,o,u,x){this._reactName=a,this._targetInst=o,this.type=n,this.nativeEvent=u,this.target=x,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?nl:Hu,this.isPropagationStopped=Hu,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=nl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=nl)},persist:function(){},isPersistent:nl}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sl=wt(hn),_s=y({},hn,{view:0,detail:0}),cp=wt(_s),qi,Vi,Hs,rl=y({},_s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ki,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!==Hs&&(Hs&&e.type==="mousemove"?(qi=e.screenX-Hs.screenX,Vi=e.screenY-Hs.screenY):Vi=qi=0,Hs=e),qi)},movementY:function(e){return"movementY"in e?e.movementY:Vi}}),Bu=wt(rl),up=y({},rl,{dataTransfer:0}),dp=wt(up),fp=y({},_s,{relatedTarget:0}),Gi=wt(fp),mp=y({},hn,{animationName:0,elapsedTime:0,pseudoElement:0}),hp=wt(mp),gp=y({},hn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pp=wt(gp),xp=y({},hn,{data:0}),qu=wt(xp),yp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bp={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"},vp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vp[e])?!!t[e]:!1}function Ki(){return wp}var Sp=y({},_s,{key:function(e){if(e.key){var t=yp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=al(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ki,charCode:function(e){return e.type==="keypress"?al(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?al(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jp=wt(Sp),Np=y({},rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vu=wt(Np),Cp=y({},_s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ki}),Ep=wt(Cp),Tp=y({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0}),kp=wt(Tp),Ap=y({},rl,{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}),Rp=wt(Ap),Op=y({},hn,{newState:0,oldState:0}),Mp=wt(Op),zp=[9,13,27,32],$i=ha&&"CompositionEvent"in window,Bs=null;ha&&"documentMode"in document&&(Bs=document.documentMode);var Dp=ha&&"TextEvent"in window&&!Bs,Gu=ha&&(!$i||Bs&&8<Bs&&11>=Bs),Ku=" ",$u=!1;function Yu(e,t){switch(e){case"keyup":return zp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $n=!1;function Up(e,t){switch(e){case"compositionend":return Pu(t);case"keypress":return t.which!==32?null:($u=!0,Ku);case"textInput":return e=t.data,e===Ku&&$u?null:e;default:return null}}function Lp(e,t){if($n)return e==="compositionend"||!$i&&Yu(e,t)?(e=_u(),tl=Bi=La=null,$n=!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 Gu&&t.locale!=="ko"?null:t.data;default:return null}}var _p={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 Fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_p[e.type]:t==="textarea"}function Xu(e,t,a,n){Gn?Kn?Kn.push(n):Kn=[n]:Gn=n,t=Yl(t,"onChange"),0<t.length&&(a=new sl("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var qs=null,Vs=null;function Hp(e){Am(e,0)}function ll(e){var t=Ds(e);if(Au(t))return e}function Qu(e,t){if(e==="change")return t}var Zu=!1;if(ha){var Yi;if(ha){var Pi="oninput"in document;if(!Pi){var Ju=document.createElement("div");Ju.setAttribute("oninput","return;"),Pi=typeof Ju.oninput=="function"}Yi=Pi}else Yi=!1;Zu=Yi&&(!document.documentMode||9<document.documentMode)}function Iu(){qs&&(qs.detachEvent("onpropertychange",Wu),Vs=qs=null)}function Wu(e){if(e.propertyName==="value"&&ll(Vs)){var t=[];Xu(t,Vs,e,Li(e)),Lu(Hp,t)}}function Bp(e,t,a){e==="focusin"?(Iu(),qs=t,Vs=a,qs.attachEvent("onpropertychange",Wu)):e==="focusout"&&Iu()}function qp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ll(Vs)}function Vp(e,t){if(e==="click")return ll(t)}function Gp(e,t){if(e==="input"||e==="change")return ll(t)}function Kp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:Kp;function Gs(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var o=a[n];if(!Me.call(t,o)||!Et(e[o],t[o]))return!1}return!0}function ed(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function td(e,t){var a=ed(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ed(a)}}function ad(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ad(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Fi(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 $p=ha&&"documentMode"in document&&11>=document.documentMode,Yn=null,Xi=null,Ks=null,Qi=!1;function sd(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Qi||Yn==null||Yn!==Wr(n)||(n=Yn,"selectionStart"in n&&Fi(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ks&&Gs(Ks,n)||(Ks=n,n=Yl(Xi,"onSelect"),0<n.length&&(t=new sl("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Yn)))}function gn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pn={animationend:gn("Animation","AnimationEnd"),animationiteration:gn("Animation","AnimationIteration"),animationstart:gn("Animation","AnimationStart"),transitionrun:gn("Transition","TransitionRun"),transitionstart:gn("Transition","TransitionStart"),transitioncancel:gn("Transition","TransitionCancel"),transitionend:gn("Transition","TransitionEnd")},Zi={},rd={};ha&&(rd=document.createElement("div").style,"AnimationEvent"in window||(delete Pn.animationend.animation,delete Pn.animationiteration.animation,delete Pn.animationstart.animation),"TransitionEvent"in window||delete Pn.transitionend.transition);function pn(e){if(Zi[e])return Zi[e];if(!Pn[e])return e;var t=Pn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in rd)return Zi[e]=t[a];return e}var ld=pn("animationend"),id=pn("animationiteration"),od=pn("animationstart"),Yp=pn("transitionrun"),Pp=pn("transitionstart"),Fp=pn("transitioncancel"),cd=pn("transitionend"),ud=new Map,Ji="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(" ");Ji.push("scrollEnd");function Qt(e,t){ud.set(e,t),mn(t,[e])}var dd=new WeakMap;function Lt(e,t){if(typeof e=="object"&&e!==null){var a=dd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Tu(t)},dd.set(e,t),t)}return{value:e,source:t,stack:Tu(t)}}var _t=[],Fn=0,Ii=0;function il(){for(var e=Fn,t=Ii=Fn=0;t<e;){var a=_t[t];_t[t++]=null;var n=_t[t];_t[t++]=null;var o=_t[t];_t[t++]=null;var u=_t[t];if(_t[t++]=null,n!==null&&o!==null){var x=n.pending;x===null?o.next=o:(o.next=x.next,x.next=o),n.pending=o}u!==0&&fd(a,o,u)}}function ol(e,t,a,n){_t[Fn++]=e,_t[Fn++]=t,_t[Fn++]=a,_t[Fn++]=n,Ii|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Wi(e,t,a,n){return ol(e,t,a,n),cl(e)}function Xn(e,t){return ol(e,null,null,t),cl(e)}function fd(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var o=!1,u=e.return;u!==null;)u.childLanes|=a,n=u.alternate,n!==null&&(n.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(o=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,o&&t!==null&&(o=31-mt(a),e=u.hiddenUpdates,n=e[o],n===null?e[o]=[t]:n.push(t),t.lane=a|536870912),u):null}function cl(e){if(50<hr)throw hr=0,lc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qn={};function Xp(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,a,n){return new Xp(e,t,a,n)}function eo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ga(e,t){var a=e.alternate;return a===null?(a=Tt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function md(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ul(e,t,a,n,o,u){var x=0;if(n=e,typeof e=="function")eo(e)&&(x=1);else if(typeof e=="string")x=Z0(e,a,ue.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=Tt(31,a,t,o),e.elementType=W,e.lanes=u,e;case N:return xn(a.children,o,u,t);case M:x=8,o|=24;break;case R:return e=Tt(12,a,t,o|2),e.elementType=R,e.lanes=u,e;case D:return e=Tt(13,a,t,o),e.elementType=D,e.lanes=u,e;case ee:return e=Tt(19,a,t,o),e.elementType=ee,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case j:case O:x=10;break e;case C:x=9;break e;case F:x=11;break e;case Q:x=14;break e;case B:x=16,n=null;break e}x=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=Tt(x,a,t,o),t.elementType=e,t.type=n,t.lanes=u,t}function xn(e,t,a,n){return e=Tt(7,e,n,t),e.lanes=a,e}function to(e,t,a){return e=Tt(6,e,null,t),e.lanes=a,e}function ao(e,t,a){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zn=[],Jn=0,dl=null,fl=0,Ht=[],Bt=0,yn=null,pa=1,xa="";function bn(e,t){Zn[Jn++]=fl,Zn[Jn++]=dl,dl=e,fl=t}function hd(e,t,a){Ht[Bt++]=pa,Ht[Bt++]=xa,Ht[Bt++]=yn,yn=e;var n=pa;e=xa;var o=32-mt(n)-1;n&=~(1<<o),a+=1;var u=32-mt(t)+o;if(30<u){var x=o-o%5;u=(n&(1<<x)-1).toString(32),n>>=x,o-=x,pa=1<<32-mt(t)+o|a<<o|n,xa=u+e}else pa=1<<u|a<<o|n,xa=e}function no(e){e.return!==null&&(bn(e,1),hd(e,1,0))}function so(e){for(;e===dl;)dl=Zn[--Jn],Zn[Jn]=null,fl=Zn[--Jn],Zn[Jn]=null;for(;e===yn;)yn=Ht[--Bt],Ht[Bt]=null,xa=Ht[--Bt],Ht[Bt]=null,pa=Ht[--Bt],Ht[Bt]=null}var yt=null,Xe=null,ze=!1,vn=null,na=!1,ro=Error(c(519));function wn(e){var t=Error(c(418,""));throw Ps(Lt(t,e)),ro}function gd(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[tt]=e,t[xt]=n,a){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(a=0;a<pr.length;a++)Ae(pr[a],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),Ru(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),Ir(t);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),Mu(t,n.value,n.defaultValue,n.children),Ir(t)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||zm(t.textContent,a)?(n.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),n.onScroll!=null&&Ae("scroll",t),n.onScrollEnd!=null&&Ae("scrollend",t),n.onClick!=null&&(t.onclick=Pl),t=!0):t=!1,t||wn(e)}function pd(e){for(yt=e.return;yt;)switch(yt.tag){case 5:case 13:na=!1;return;case 27:case 3:na=!0;return;default:yt=yt.return}}function $s(e){if(e!==yt)return!1;if(!ze)return pd(e),ze=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Sc(e.type,e.memoizedProps)),a=!a),a&&Xe&&wn(e),pd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){Xe=Jt(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}Xe=null}}else t===27?(t=Xe,Ia(e.type)?(e=Ec,Ec=null,Xe=e):Xe=t):Xe=yt?Jt(e.stateNode.nextSibling):null;return!0}function Ys(){Xe=yt=null,ze=!1}function xd(){var e=vn;return e!==null&&(Nt===null?Nt=e:Nt.push.apply(Nt,e),vn=null),e}function Ps(e){vn===null?vn=[e]:vn.push(e)}var lo=P(null),Sn=null,ya=null;function _a(e,t,a){ne(lo,t._currentValue),t._currentValue=a}function ba(e){e._currentValue=lo.current,re(lo)}function io(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function oo(e,t,a,n){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){var x=o.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=o;for(var k=0;k<t.length;k++)if(b.context===t[k]){u.lanes|=a,b=u.alternate,b!==null&&(b.lanes|=a),io(u.return,a,e),n||(x=null);break e}u=b.next}}else if(o.tag===18){if(x=o.return,x===null)throw Error(c(341));x.lanes|=a,u=x.alternate,u!==null&&(u.lanes|=a),io(x,a,e),x=null}else x=o.child;if(x!==null)x.return=o;else for(x=o;x!==null;){if(x===e){x=null;break}if(o=x.sibling,o!==null){o.return=x.return,x=o;break}x=x.return}o=x}}function Fs(e,t,a,n){e=null;for(var o=t,u=!1;o!==null;){if(!u){if((o.flags&524288)!==0)u=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var x=o.alternate;if(x===null)throw Error(c(387));if(x=x.memoizedProps,x!==null){var b=o.type;Et(o.pendingProps.value,x.value)||(e!==null?e.push(b):e=[b])}}else if(o===se.current){if(x=o.alternate,x===null)throw Error(c(387));x.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Sr):e=[Sr])}o=o.return}e!==null&&oo(t,e,a,n),t.flags|=262144}function ml(e){for(e=e.firstContext;e!==null;){if(!Et(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function jn(e){Sn=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ht(e){return yd(Sn,e)}function hl(e,t){return Sn===null&&jn(e),yd(e,t)}function yd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ya===null){if(e===null)throw Error(c(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return a}var Qp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Zp=s.unstable_scheduleCallback,Jp=s.unstable_NormalPriority,at={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function co(){return{controller:new Qp,data:new Map,refCount:0}}function Xs(e){e.refCount--,e.refCount===0&&Zp(Jp,function(){e.controller.abort()})}var Qs=null,uo=0,In=0,Wn=null;function Ip(e,t){if(Qs===null){var a=Qs=[];uo=0,In=mc(),Wn={status:"pending",value:void 0,then:function(n){a.push(n)}}}return uo++,t.then(bd,bd),t}function bd(){if(--uo===0&&Qs!==null){Wn!==null&&(Wn.status="fulfilled");var e=Qs;Qs=null,In=0,Wn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wp(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(o){a.push(o)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var o=0;o<a.length;o++)(0,a[o])(t)},function(o){for(n.status="rejected",n.reason=o,o=0;o<a.length;o++)(0,a[o])(void 0)}),n}var vd=E.S;E.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ip(e,t),vd!==null&&vd(e,t)};var Nn=P(null);function fo(){var e=Nn.current;return e!==null?e:Ge.pooledCache}function gl(e,t){t===null?ne(Nn,Nn.current):ne(Nn,t.pool)}function wd(){var e=fo();return e===null?null:{parent:at._currentValue,pool:e}}var Zs=Error(c(460)),Sd=Error(c(474)),pl=Error(c(542)),mo={then:function(){}};function jd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xl(){}function Nd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(xl,xl),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ed(e),e;default:if(typeof t.status=="string")t.then(xl,xl);else{if(e=Ge,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=n}},function(n){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ed(e),e}throw Js=t,Zs}}var Js=null;function Cd(){if(Js===null)throw Error(c(459));var e=Js;return Js=null,e}function Ed(e){if(e===Zs||e===pl)throw Error(c(483))}var Ha=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(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 Ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ue&2)!==0){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,t=cl(e),fd(e,null,a),t}return ol(e,n,t,a),cl(e)}function Is(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ct(e,a)}}function po(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var o=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?o=u=x:u=u.next=x,a=a.next}while(a!==null);u===null?o=u=t:u=u.next=t}else o=u=t;a={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:u,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var xo=!1;function Ws(){if(xo){var e=Wn;if(e!==null)throw e}}function er(e,t,a,n){xo=!1;var o=e.updateQueue;Ha=!1;var u=o.firstBaseUpdate,x=o.lastBaseUpdate,b=o.shared.pending;if(b!==null){o.shared.pending=null;var k=b,V=k.next;k.next=null,x===null?u=V:x.next=V,x=k;var J=e.alternate;J!==null&&(J=J.updateQueue,b=J.lastBaseUpdate,b!==x&&(b===null?J.firstBaseUpdate=V:b.next=V,J.lastBaseUpdate=k))}if(u!==null){var ae=o.baseState;x=0,J=V=k=null,b=u;do{var K=b.lane&-536870913,Y=K!==b.lane;if(Y?(Re&K)===K:(n&K)===K){K!==0&&K===In&&(xo=!0),J!==null&&(J=J.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ye=e,pe=b;K=t;var Be=a;switch(pe.tag){case 1:if(ye=pe.payload,typeof ye=="function"){ae=ye.call(Be,ae,K);break e}ae=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=pe.payload,K=typeof ye=="function"?ye.call(Be,ae,K):ye,K==null)break e;ae=y({},ae,K);break e;case 2:Ha=!0}}K=b.callback,K!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=o.callbacks,Y===null?o.callbacks=[K]:Y.push(K))}else Y={lane:K,tag:b.tag,payload:b.payload,callback:b.callback,next:null},J===null?(V=J=Y,k=ae):J=J.next=Y,x|=K;if(b=b.next,b===null){if(b=o.shared.pending,b===null)break;Y=b,b=Y.next,Y.next=null,o.lastBaseUpdate=Y,o.shared.pending=null}}while(!0);J===null&&(k=ae),o.baseState=k,o.firstBaseUpdate=V,o.lastBaseUpdate=J,u===null&&(o.shared.lanes=0),Xa|=x,e.lanes=x,e.memoizedState=ae}}function Td(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function kd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Td(a[e],t)}var es=P(null),yl=P(0);function Ad(e,t){e=Ea,ne(yl,e),ne(es,t),Ea=e|t.baseLanes}function yo(){ne(yl,Ea),ne(es,es.current)}function bo(){Ea=yl.current,re(es),re(yl)}var Va=0,Ce=null,_e=null,We=null,bl=!1,ts=!1,Cn=!1,vl=0,tr=0,as=null,e0=0;function Je(){throw Error(c(321))}function vo(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Et(e[a],t[a]))return!1;return!0}function wo(e,t,a,n,o,u){return Va=u,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?mf:hf,Cn=!1,u=a(n,o),Cn=!1,ts&&(u=Od(t,a,n,o)),Rd(e),u}function Rd(e){E.H=El;var t=_e!==null&&_e.next!==null;if(Va=0,We=_e=Ce=null,bl=!1,tr=0,as=null,t)throw Error(c(300));e===null||lt||(e=e.dependencies,e!==null&&ml(e)&&(lt=!0))}function Od(e,t,a,n){Ce=e;var o=0;do{if(ts&&(as=null),tr=0,ts=!1,25<=o)throw Error(c(301));if(o+=1,We=_e=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}E.H=i0,u=t(a,n)}while(ts);return u}function t0(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?ar(t):t,e=e.useState()[0],(_e!==null?_e.memoizedState:null)!==e&&(Ce.flags|=1024),t}function So(){var e=vl!==0;return vl=0,e}function jo(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function No(e){if(bl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bl=!1}Va=0,We=_e=Ce=null,ts=!1,tr=vl=0,as=null}function St(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Ce.memoizedState=We=e:We=We.next=e,We}function et(){if(_e===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=_e.next;var t=We===null?Ce.memoizedState:We.next;if(t!==null)We=t,_e=e;else{if(e===null)throw Ce.alternate===null?Error(c(467)):Error(c(310));_e=e,e={memoizedState:_e.memoizedState,baseState:_e.baseState,baseQueue:_e.baseQueue,queue:_e.queue,next:null},We===null?Ce.memoizedState=We=e:We=We.next=e}return We}function Co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ar(e){var t=tr;return tr+=1,as===null&&(as=[]),e=Nd(as,e,t),t=Ce,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?mf:hf),e}function wl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ar(e);if(e.$$typeof===O)return ht(e)}throw Error(c(438,String(e)))}function Eo(e){var t=null,a=Ce.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Ce.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Co(),Ce.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=le;return t.index++,a}function va(e,t){return typeof t=="function"?t(e):t}function Sl(e){var t=et();return To(t,_e,e)}function To(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var o=e.baseQueue,u=n.pending;if(u!==null){if(o!==null){var x=o.next;o.next=u.next,u.next=x}t.baseQueue=o=u,n.pending=null}if(u=e.baseState,o===null)e.memoizedState=u;else{t=o.next;var b=x=null,k=null,V=t,J=!1;do{var ae=V.lane&-536870913;if(ae!==V.lane?(Re&ae)===ae:(Va&ae)===ae){var K=V.revertLane;if(K===0)k!==null&&(k=k.next={lane:0,revertLane:0,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ae===In&&(J=!0);else if((Va&K)===K){V=V.next,K===In&&(J=!0);continue}else ae={lane:0,revertLane:V.revertLane,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},k===null?(b=k=ae,x=u):k=k.next=ae,Ce.lanes|=K,Xa|=K;ae=V.action,Cn&&a(u,ae),u=V.hasEagerState?V.eagerState:a(u,ae)}else K={lane:ae,revertLane:V.revertLane,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},k===null?(b=k=K,x=u):k=k.next=K,Ce.lanes|=ae,Xa|=ae;V=V.next}while(V!==null&&V!==t);if(k===null?x=u:k.next=b,!Et(u,e.memoizedState)&&(lt=!0,J&&(a=Wn,a!==null)))throw a;e.memoizedState=u,e.baseState=x,e.baseQueue=k,n.lastRenderedState=u}return o===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function ko(e){var t=et(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,o=a.pending,u=t.memoizedState;if(o!==null){a.pending=null;var x=o=o.next;do u=e(u,x.action),x=x.next;while(x!==o);Et(u,t.memoizedState)||(lt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,n]}function Md(e,t,a){var n=Ce,o=et(),u=ze;if(u){if(a===void 0)throw Error(c(407));a=a()}else a=t();var x=!Et((_e||o).memoizedState,a);x&&(o.memoizedState=a,lt=!0),o=o.queue;var b=Ud.bind(null,n,o,e);if(nr(2048,8,b,[e]),o.getSnapshot!==t||x||We!==null&&We.memoizedState.tag&1){if(n.flags|=2048,ns(9,jl(),Dd.bind(null,n,o,a,t),null),Ge===null)throw Error(c(349));u||(Va&124)!==0||zd(n,t,a)}return a}function zd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ce.updateQueue,t===null?(t=Co(),Ce.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Dd(e,t,a,n){t.value=a,t.getSnapshot=n,Ld(t)&&_d(e)}function Ud(e,t,a){return a(function(){Ld(t)&&_d(e)})}function Ld(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Et(e,a)}catch{return!0}}function _d(e){var t=Xn(e,2);t!==null&&Mt(t,e,2)}function Ao(e){var t=St();if(typeof e=="function"){var a=e;if(e=a(),Cn){$t(!0);try{a()}finally{$t(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:e},t}function Hd(e,t,a,n){return e.baseState=a,To(e,_e,typeof n=="function"?n:va)}function a0(e,t,a,n,o){if(Cl(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){u.listeners.push(x)}};E.T!==null?a(!0):u.isTransition=!1,n(u),a=t.pending,a===null?(u.next=t.pending=u,Bd(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Bd(e,t){var a=t.action,n=t.payload,o=e.state;if(t.isTransition){var u=E.T,x={};E.T=x;try{var b=a(o,n),k=E.S;k!==null&&k(x,b),qd(e,t,b)}catch(V){Ro(e,t,V)}finally{E.T=u}}else try{u=a(o,n),qd(e,t,u)}catch(V){Ro(e,t,V)}}function qd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Vd(e,t,n)},function(n){return Ro(e,t,n)}):Vd(e,t,a)}function Vd(e,t,a){t.status="fulfilled",t.value=a,Gd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Bd(e,a)))}function Ro(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Gd(t),t=t.next;while(t!==n)}e.action=null}function Gd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kd(e,t){return t}function $d(e,t){if(ze){var a=Ge.formState;if(a!==null){e:{var n=Ce;if(ze){if(Xe){t:{for(var o=Xe,u=na;o.nodeType!==8;){if(!u){o=null;break t}if(o=Jt(o.nextSibling),o===null){o=null;break t}}u=o.data,o=u==="F!"||u==="F"?o:null}if(o){Xe=Jt(o.nextSibling),n=o.data==="F!";break e}}wn(n)}n=!1}n&&(t=a[0])}}return a=St(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kd,lastRenderedState:t},a.queue=n,a=uf.bind(null,Ce,n),n.dispatch=a,n=Ao(!1),u=Uo.bind(null,Ce,!1,n.queue),n=St(),o={state:t,dispatch:null,action:e,pending:null},n.queue=o,a=a0.bind(null,Ce,o,u,a),o.dispatch=a,n.memoizedState=e,[t,a,!1]}function Yd(e){var t=et();return Pd(t,_e,e)}function Pd(e,t,a){if(t=To(e,t,Kd)[0],e=Sl(va)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=ar(t)}catch(x){throw x===Zs?pl:x}else n=t;t=et();var o=t.queue,u=o.dispatch;return a!==t.memoizedState&&(Ce.flags|=2048,ns(9,jl(),n0.bind(null,o,a),null)),[n,u,e]}function n0(e,t){e.action=t}function Fd(e){var t=et(),a=_e;if(a!==null)return Pd(t,a,e);et(),t=t.memoizedState,a=et();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function ns(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=Co(),Ce.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function jl(){return{destroy:void 0,resource:void 0}}function Xd(){return et().memoizedState}function Nl(e,t,a,n){var o=St();n=n===void 0?null:n,Ce.flags|=e,o.memoizedState=ns(1|t,jl(),a,n)}function nr(e,t,a,n){var o=et();n=n===void 0?null:n;var u=o.memoizedState.inst;_e!==null&&n!==null&&vo(n,_e.memoizedState.deps)?o.memoizedState=ns(t,u,a,n):(Ce.flags|=e,o.memoizedState=ns(1|t,u,a,n))}function Qd(e,t){Nl(8390656,8,e,t)}function Zd(e,t){nr(2048,8,e,t)}function Jd(e,t){return nr(4,2,e,t)}function Id(e,t){return nr(4,4,e,t)}function Wd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ef(e,t,a){a=a!=null?a.concat([e]):null,nr(4,4,Wd.bind(null,t,e),a)}function Oo(){}function tf(e,t){var a=et();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&vo(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function af(e,t){var a=et();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&vo(t,n[1]))return n[0];if(n=e(),Cn){$t(!0);try{e()}finally{$t(!1)}}return a.memoizedState=[n,t],n}function Mo(e,t,a){return a===void 0||(Va&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=lm(),Ce.lanes|=e,Xa|=e,a)}function nf(e,t,a,n){return Et(a,t)?a:es.current!==null?(e=Mo(e,a,n),Et(e,t)||(lt=!0),e):(Va&42)===0?(lt=!0,e.memoizedState=a):(e=lm(),Ce.lanes|=e,Xa|=e,t)}function sf(e,t,a,n,o){var u=G.p;G.p=u!==0&&8>u?u:8;var x=E.T,b={};E.T=b,Uo(e,!1,t,a);try{var k=o(),V=E.S;if(V!==null&&V(b,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var J=Wp(k,n);sr(e,t,J,Ot(e))}else sr(e,t,n,Ot(e))}catch(ae){sr(e,t,{then:function(){},status:"rejected",reason:ae},Ot())}finally{G.p=u,E.T=x}}function s0(){}function zo(e,t,a,n){if(e.tag!==5)throw Error(c(476));var o=rf(e).queue;sf(e,o,t,X,a===null?s0:function(){return lf(e),a(n)})}function rf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:X},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lf(e){var t=rf(e).next.queue;sr(e,t,{},Ot())}function Do(){return ht(Sr)}function of(){return et().memoizedState}function cf(){return et().memoizedState}function r0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ot();e=Ba(a);var n=qa(t,e,a);n!==null&&(Mt(n,t,a),Is(n,t,a)),t={cache:co()},e.payload=t;return}t=t.return}}function l0(e,t,a){var n=Ot();a={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Cl(e)?df(t,a):(a=Wi(e,t,a,n),a!==null&&(Mt(a,e,n),ff(a,t,n)))}function uf(e,t,a){var n=Ot();sr(e,t,a,n)}function sr(e,t,a,n){var o={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Cl(e))df(t,o);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var x=t.lastRenderedState,b=u(x,a);if(o.hasEagerState=!0,o.eagerState=b,Et(b,x))return ol(e,t,o,0),Ge===null&&il(),!1}catch{}finally{}if(a=Wi(e,t,o,n),a!==null)return Mt(a,e,n),ff(a,t,n),!0}return!1}function Uo(e,t,a,n){if(n={lane:2,revertLane:mc(),action:n,hasEagerState:!1,eagerState:null,next:null},Cl(e)){if(t)throw Error(c(479))}else t=Wi(e,a,n,2),t!==null&&Mt(t,e,2)}function Cl(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function df(e,t){ts=bl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function ff(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ct(e,a)}}var El={readContext:ht,use:wl,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je},mf={readContext:ht,use:wl,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:Qd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Nl(4194308,4,Wd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Nl(4194308,4,e,t)},useInsertionEffect:function(e,t){Nl(4,2,e,t)},useMemo:function(e,t){var a=St();t=t===void 0?null:t;var n=e();if(Cn){$t(!0);try{e()}finally{$t(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=St();if(a!==void 0){var o=a(t);if(Cn){$t(!0);try{a(t)}finally{$t(!1)}}}else o=t;return n.memoizedState=n.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},n.queue=e,e=e.dispatch=l0.bind(null,Ce,e),[n.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:function(e){e=Ao(e);var t=e.queue,a=uf.bind(null,Ce,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Oo,useDeferredValue:function(e,t){var a=St();return Mo(a,e,t)},useTransition:function(){var e=Ao(!1);return e=sf.bind(null,Ce,e.queue,!0,!1),St().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Ce,o=St();if(ze){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),Ge===null)throw Error(c(349));(Re&124)!==0||zd(n,t,a)}o.memoizedState=a;var u={value:a,getSnapshot:t};return o.queue=u,Qd(Ud.bind(null,n,u,e),[e]),n.flags|=2048,ns(9,jl(),Dd.bind(null,n,u,a,t),null),a},useId:function(){var e=St(),t=Ge.identifierPrefix;if(ze){var a=xa,n=pa;a=(n&~(1<<32-mt(n)-1)).toString(32)+a,t="«"+t+"R"+a,a=vl++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=e0++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Do,useFormState:$d,useActionState:$d,useOptimistic:function(e){var t=St();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Uo.bind(null,Ce,!0,a),a.dispatch=t,[e,t]},useMemoCache:Eo,useCacheRefresh:function(){return St().memoizedState=r0.bind(null,Ce)}},hf={readContext:ht,use:wl,useCallback:tf,useContext:ht,useEffect:Zd,useImperativeHandle:ef,useInsertionEffect:Jd,useLayoutEffect:Id,useMemo:af,useReducer:Sl,useRef:Xd,useState:function(){return Sl(va)},useDebugValue:Oo,useDeferredValue:function(e,t){var a=et();return nf(a,_e.memoizedState,e,t)},useTransition:function(){var e=Sl(va)[0],t=et().memoizedState;return[typeof e=="boolean"?e:ar(e),t]},useSyncExternalStore:Md,useId:of,useHostTransitionStatus:Do,useFormState:Yd,useActionState:Yd,useOptimistic:function(e,t){var a=et();return Hd(a,_e,e,t)},useMemoCache:Eo,useCacheRefresh:cf},i0={readContext:ht,use:wl,useCallback:tf,useContext:ht,useEffect:Zd,useImperativeHandle:ef,useInsertionEffect:Jd,useLayoutEffect:Id,useMemo:af,useReducer:ko,useRef:Xd,useState:function(){return ko(va)},useDebugValue:Oo,useDeferredValue:function(e,t){var a=et();return _e===null?Mo(a,e,t):nf(a,_e.memoizedState,e,t)},useTransition:function(){var e=ko(va)[0],t=et().memoizedState;return[typeof e=="boolean"?e:ar(e),t]},useSyncExternalStore:Md,useId:of,useHostTransitionStatus:Do,useFormState:Fd,useActionState:Fd,useOptimistic:function(e,t){var a=et();return _e!==null?Hd(a,_e,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Eo,useCacheRefresh:cf},ss=null,rr=0;function Tl(e){var t=rr;return rr+=1,ss===null&&(ss=[]),Nd(ss,e,t)}function lr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function kl(e,t){throw t.$$typeof===S?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function gf(e){var t=e._init;return t(e._payload)}function pf(e){function t(H,z){if(e){var q=H.deletions;q===null?(H.deletions=[z],H.flags|=16):q.push(z)}}function a(H,z){if(!e)return null;for(;z!==null;)t(H,z),z=z.sibling;return null}function n(H){for(var z=new Map;H!==null;)H.key!==null?z.set(H.key,H):z.set(H.index,H),H=H.sibling;return z}function o(H,z){return H=ga(H,z),H.index=0,H.sibling=null,H}function u(H,z,q){return H.index=q,e?(q=H.alternate,q!==null?(q=q.index,q<z?(H.flags|=67108866,z):q):(H.flags|=67108866,z)):(H.flags|=1048576,z)}function x(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function b(H,z,q,te){return z===null||z.tag!==6?(z=to(q,H.mode,te),z.return=H,z):(z=o(z,q),z.return=H,z)}function k(H,z,q,te){var de=q.type;return de===N?J(H,z,q.props.children,te,q.key):z!==null&&(z.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===B&&gf(de)===z.type)?(z=o(z,q.props),lr(z,q),z.return=H,z):(z=ul(q.type,q.key,q.props,null,H.mode,te),lr(z,q),z.return=H,z)}function V(H,z,q,te){return z===null||z.tag!==4||z.stateNode.containerInfo!==q.containerInfo||z.stateNode.implementation!==q.implementation?(z=ao(q,H.mode,te),z.return=H,z):(z=o(z,q.children||[]),z.return=H,z)}function J(H,z,q,te,de){return z===null||z.tag!==7?(z=xn(q,H.mode,te,de),z.return=H,z):(z=o(z,q),z.return=H,z)}function ae(H,z,q){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=to(""+z,H.mode,q),z.return=H,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case v:return q=ul(z.type,z.key,z.props,null,H.mode,q),lr(q,z),q.return=H,q;case A:return z=ao(z,H.mode,q),z.return=H,z;case B:var te=z._init;return z=te(z._payload),ae(H,z,q)}if($(z)||L(z))return z=xn(z,H.mode,q,null),z.return=H,z;if(typeof z.then=="function")return ae(H,Tl(z),q);if(z.$$typeof===O)return ae(H,hl(H,z),q);kl(H,z)}return null}function K(H,z,q,te){var de=z!==null?z.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return de!==null?null:b(H,z,""+q,te);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return q.key===de?k(H,z,q,te):null;case A:return q.key===de?V(H,z,q,te):null;case B:return de=q._init,q=de(q._payload),K(H,z,q,te)}if($(q)||L(q))return de!==null?null:J(H,z,q,te,null);if(typeof q.then=="function")return K(H,z,Tl(q),te);if(q.$$typeof===O)return K(H,z,hl(H,q),te);kl(H,q)}return null}function Y(H,z,q,te,de){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return H=H.get(q)||null,b(z,H,""+te,de);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return H=H.get(te.key===null?q:te.key)||null,k(z,H,te,de);case A:return H=H.get(te.key===null?q:te.key)||null,V(z,H,te,de);case B:var Te=te._init;return te=Te(te._payload),Y(H,z,q,te,de)}if($(te)||L(te))return H=H.get(q)||null,J(z,H,te,de,null);if(typeof te.then=="function")return Y(H,z,q,Tl(te),de);if(te.$$typeof===O)return Y(H,z,q,hl(z,te),de);kl(z,te)}return null}function ye(H,z,q,te){for(var de=null,Te=null,he=z,xe=z=0,ot=null;he!==null&&xe<q.length;xe++){he.index>xe?(ot=he,he=null):ot=he.sibling;var Oe=K(H,he,q[xe],te);if(Oe===null){he===null&&(he=ot);break}e&&he&&Oe.alternate===null&&t(H,he),z=u(Oe,z,xe),Te===null?de=Oe:Te.sibling=Oe,Te=Oe,he=ot}if(xe===q.length)return a(H,he),ze&&bn(H,xe),de;if(he===null){for(;xe<q.length;xe++)he=ae(H,q[xe],te),he!==null&&(z=u(he,z,xe),Te===null?de=he:Te.sibling=he,Te=he);return ze&&bn(H,xe),de}for(he=n(he);xe<q.length;xe++)ot=Y(he,H,xe,q[xe],te),ot!==null&&(e&&ot.alternate!==null&&he.delete(ot.key===null?xe:ot.key),z=u(ot,z,xe),Te===null?de=ot:Te.sibling=ot,Te=ot);return e&&he.forEach(function(nn){return t(H,nn)}),ze&&bn(H,xe),de}function pe(H,z,q,te){if(q==null)throw Error(c(151));for(var de=null,Te=null,he=z,xe=z=0,ot=null,Oe=q.next();he!==null&&!Oe.done;xe++,Oe=q.next()){he.index>xe?(ot=he,he=null):ot=he.sibling;var nn=K(H,he,Oe.value,te);if(nn===null){he===null&&(he=ot);break}e&&he&&nn.alternate===null&&t(H,he),z=u(nn,z,xe),Te===null?de=nn:Te.sibling=nn,Te=nn,he=ot}if(Oe.done)return a(H,he),ze&&bn(H,xe),de;if(he===null){for(;!Oe.done;xe++,Oe=q.next())Oe=ae(H,Oe.value,te),Oe!==null&&(z=u(Oe,z,xe),Te===null?de=Oe:Te.sibling=Oe,Te=Oe);return ze&&bn(H,xe),de}for(he=n(he);!Oe.done;xe++,Oe=q.next())Oe=Y(he,H,xe,Oe.value,te),Oe!==null&&(e&&Oe.alternate!==null&&he.delete(Oe.key===null?xe:Oe.key),z=u(Oe,z,xe),Te===null?de=Oe:Te.sibling=Oe,Te=Oe);return e&&he.forEach(function(ox){return t(H,ox)}),ze&&bn(H,xe),de}function Be(H,z,q,te){if(typeof q=="object"&&q!==null&&q.type===N&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case v:e:{for(var de=q.key;z!==null;){if(z.key===de){if(de=q.type,de===N){if(z.tag===7){a(H,z.sibling),te=o(z,q.props.children),te.return=H,H=te;break e}}else if(z.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===B&&gf(de)===z.type){a(H,z.sibling),te=o(z,q.props),lr(te,q),te.return=H,H=te;break e}a(H,z);break}else t(H,z);z=z.sibling}q.type===N?(te=xn(q.props.children,H.mode,te,q.key),te.return=H,H=te):(te=ul(q.type,q.key,q.props,null,H.mode,te),lr(te,q),te.return=H,H=te)}return x(H);case A:e:{for(de=q.key;z!==null;){if(z.key===de)if(z.tag===4&&z.stateNode.containerInfo===q.containerInfo&&z.stateNode.implementation===q.implementation){a(H,z.sibling),te=o(z,q.children||[]),te.return=H,H=te;break e}else{a(H,z);break}else t(H,z);z=z.sibling}te=ao(q,H.mode,te),te.return=H,H=te}return x(H);case B:return de=q._init,q=de(q._payload),Be(H,z,q,te)}if($(q))return ye(H,z,q,te);if(L(q)){if(de=L(q),typeof de!="function")throw Error(c(150));return q=de.call(q),pe(H,z,q,te)}if(typeof q.then=="function")return Be(H,z,Tl(q),te);if(q.$$typeof===O)return Be(H,z,hl(H,q),te);kl(H,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,z!==null&&z.tag===6?(a(H,z.sibling),te=o(z,q),te.return=H,H=te):(a(H,z),te=to(q,H.mode,te),te.return=H,H=te),x(H)):a(H,z)}return function(H,z,q,te){try{rr=0;var de=Be(H,z,q,te);return ss=null,de}catch(he){if(he===Zs||he===pl)throw he;var Te=Tt(29,he,null,H.mode);return Te.lanes=te,Te.return=H,Te}finally{}}}var rs=pf(!0),xf=pf(!1),qt=P(null),sa=null;function Ga(e){var t=e.alternate;ne(nt,nt.current&1),ne(qt,e),sa===null&&(t===null||es.current!==null||t.memoizedState!==null)&&(sa=e)}function yf(e){if(e.tag===22){if(ne(nt,nt.current),ne(qt,e),sa===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(sa=e)}}else Ka()}function Ka(){ne(nt,nt.current),ne(qt,qt.current)}function wa(e){re(qt),sa===e&&(sa=null),re(nt)}var nt=P(0);function Al(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Cc(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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}function Lo(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var _o={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ot(),o=Ba(n);o.payload=t,a!=null&&(o.callback=a),t=qa(e,o,n),t!==null&&(Mt(t,e,n),Is(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ot(),o=Ba(n);o.tag=1,o.payload=t,a!=null&&(o.callback=a),t=qa(e,o,n),t!==null&&(Mt(t,e,n),Is(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ot(),n=Ba(a);n.tag=2,t!=null&&(n.callback=t),t=qa(e,n,a),t!==null&&(Mt(t,e,a),Is(t,e,a))}};function bf(e,t,a,n,o,u,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,u,x):t.prototype&&t.prototype.isPureReactComponent?!Gs(a,n)||!Gs(o,u):!0}function vf(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&_o.enqueueReplaceState(t,t.state,null)}function En(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var o in e)a[o]===void 0&&(a[o]=e[o])}return a}var Rl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function wf(e){Rl(e)}function Sf(e){console.error(e)}function jf(e){Rl(e)}function Ol(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Nf(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Ho(e,t,a){return a=Ba(a),a.tag=3,a.payload={element:null},a.callback=function(){Ol(e,t)},a}function Cf(e){return e=Ba(e),e.tag=3,e}function Ef(e,t,a,n){var o=a.type.getDerivedStateFromError;if(typeof o=="function"){var u=n.value;e.payload=function(){return o(u)},e.callback=function(){Nf(t,a,n)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Nf(t,a,n),typeof o!="function"&&(Qa===null?Qa=new Set([this]):Qa.add(this));var b=n.stack;this.componentDidCatch(n.value,{componentStack:b!==null?b:""})})}function o0(e,t,a,n,o){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Fs(t,a,o,!0),a=qt.current,a!==null){switch(a.tag){case 13:return sa===null?oc():a.alternate===null&&Qe===0&&(Qe=3),a.flags&=-257,a.flags|=65536,a.lanes=o,n===mo?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),uc(e,n,o)),!1;case 22:return a.flags|=65536,n===mo?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),uc(e,n,o)),!1}throw Error(c(435,a.tag))}return uc(e,n,o),oc(),!1}if(ze)return t=qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,n!==ro&&(e=Error(c(422),{cause:n}),Ps(Lt(e,a)))):(n!==ro&&(t=Error(c(423),{cause:n}),Ps(Lt(t,a))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,n=Lt(n,a),o=Ho(e.stateNode,n,o),po(e,o),Qe!==4&&(Qe=2)),!1;var u=Error(c(520),{cause:n});if(u=Lt(u,a),mr===null?mr=[u]:mr.push(u),Qe!==4&&(Qe=2),t===null)return!0;n=Lt(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=o&-o,a.lanes|=e,e=Ho(a.stateNode,n,e),po(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Qa===null||!Qa.has(u))))return a.flags|=65536,o&=-o,a.lanes|=o,o=Cf(o),Ef(o,e,a,n),po(a,o),!1}a=a.return}while(a!==null);return!1}var Tf=Error(c(461)),lt=!1;function ct(e,t,a,n){t.child=e===null?xf(t,null,a,n):rs(t,e.child,a,n)}function kf(e,t,a,n,o){a=a.render;var u=t.ref;if("ref"in n){var x={};for(var b in n)b!=="ref"&&(x[b]=n[b])}else x=n;return jn(t),n=wo(e,t,a,x,u,o),b=So(),e!==null&&!lt?(jo(e,t,o),Sa(e,t,o)):(ze&&b&&no(t),t.flags|=1,ct(e,t,n,o),t.child)}function Af(e,t,a,n,o){if(e===null){var u=a.type;return typeof u=="function"&&!eo(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,Rf(e,t,u,n,o)):(e=ul(a.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Po(e,o)){var x=u.memoizedProps;if(a=a.compare,a=a!==null?a:Gs,a(x,n)&&e.ref===t.ref)return Sa(e,t,o)}return t.flags|=1,e=ga(u,n),e.ref=t.ref,e.return=t,t.child=e}function Rf(e,t,a,n,o){if(e!==null){var u=e.memoizedProps;if(Gs(u,n)&&e.ref===t.ref)if(lt=!1,t.pendingProps=n=u,Po(e,o))(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,Sa(e,t,o)}return Bo(e,t,a,n,o)}function Of(e,t,a){var n=t.pendingProps,o=n.children,u=e!==null?e.memoizedState:null;if(n.mode==="hidden"){if((t.flags&128)!==0){if(n=u!==null?u.baseLanes|a:a,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;t.childLanes=u&~n}else t.childLanes=0,t.child=null;return Mf(e,t,n,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gl(t,u!==null?u.cachePool:null),u!==null?Ad(t,u):yo(),yf(t);else return t.lanes=t.childLanes=536870912,Mf(e,t,u!==null?u.baseLanes|a:a,a)}else u!==null?(gl(t,u.cachePool),Ad(t,u),Ka(),t.memoizedState=null):(e!==null&&gl(t,null),yo(),Ka());return ct(e,t,o,a),t.child}function Mf(e,t,a,n){var o=fo();return o=o===null?null:{parent:at._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&gl(t,null),yo(),yf(t),e!==null&&Fs(e,t,n,!0),null}function Ml(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Bo(e,t,a,n,o){return jn(t),a=wo(e,t,a,n,void 0,o),n=So(),e!==null&&!lt?(jo(e,t,o),Sa(e,t,o)):(ze&&n&&no(t),t.flags|=1,ct(e,t,a,o),t.child)}function zf(e,t,a,n,o,u){return jn(t),t.updateQueue=null,a=Od(t,n,a,o),Rd(e),n=So(),e!==null&&!lt?(jo(e,t,u),Sa(e,t,u)):(ze&&n&&no(t),t.flags|=1,ct(e,t,a,u),t.child)}function Df(e,t,a,n,o){if(jn(t),t.stateNode===null){var u=Qn,x=a.contextType;typeof x=="object"&&x!==null&&(u=ht(x)),u=new a(n,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=_o,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=n,u.state=t.memoizedState,u.refs={},ho(t),x=a.contextType,u.context=typeof x=="object"&&x!==null?ht(x):Qn,u.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Lo(t,a,x,n),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(x=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),x!==u.state&&_o.enqueueReplaceState(u,u.state,null),er(t,n,u,o),Ws(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,k=En(a,b);u.props=k;var V=u.context,J=a.contextType;x=Qn,typeof J=="object"&&J!==null&&(x=ht(J));var ae=a.getDerivedStateFromProps;J=typeof ae=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,J||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||V!==x)&&vf(t,u,n,x),Ha=!1;var K=t.memoizedState;u.state=K,er(t,n,u,o),Ws(),V=t.memoizedState,b||K!==V||Ha?(typeof ae=="function"&&(Lo(t,a,ae,n),V=t.memoizedState),(k=Ha||bf(t,a,k,n,K,V,x))?(J||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=V),u.props=n,u.state=V,u.context=x,n=k):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{u=t.stateNode,go(e,t),x=t.memoizedProps,J=En(a,x),u.props=J,ae=t.pendingProps,K=u.context,V=a.contextType,k=Qn,typeof V=="object"&&V!==null&&(k=ht(V)),b=a.getDerivedStateFromProps,(V=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(x!==ae||K!==k)&&vf(t,u,n,k),Ha=!1,K=t.memoizedState,u.state=K,er(t,n,u,o),Ws();var Y=t.memoizedState;x!==ae||K!==Y||Ha||e!==null&&e.dependencies!==null&&ml(e.dependencies)?(typeof b=="function"&&(Lo(t,a,b,n),Y=t.memoizedState),(J=Ha||bf(t,a,J,n,K,Y,k)||e!==null&&e.dependencies!==null&&ml(e.dependencies))?(V||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,Y,k),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,Y,k)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=Y),u.props=n,u.state=Y,u.context=k,n=J):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),n=!1)}return u=n,Ml(e,t),n=(t.flags&128)!==0,u||n?(u=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&n?(t.child=rs(t,e.child,null,o),t.child=rs(t,null,a,o)):ct(e,t,a,o),t.memoizedState=u.state,e=t.child):e=Sa(e,t,o),e}function Uf(e,t,a,n){return Ys(),t.flags|=256,ct(e,t,a,n),t.child}var qo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vo(e){return{baseLanes:e,cachePool:wd()}}function Go(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Vt),e}function Lf(e,t,a){var n=t.pendingProps,o=!1,u=(t.flags&128)!==0,x;if((x=u)||(x=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),x&&(o=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(o?Ga(t):Ka(),ze){var b=Xe,k;if(k=b){e:{for(k=b,b=na;k.nodeType!==8;){if(!b){b=null;break e}if(k=Jt(k.nextSibling),k===null){b=null;break e}}b=k}b!==null?(t.memoizedState={dehydrated:b,treeContext:yn!==null?{id:pa,overflow:xa}:null,retryLane:536870912,hydrationErrors:null},k=Tt(18,null,null,0),k.stateNode=b,k.return=t,t.child=k,yt=t,Xe=null,k=!0):k=!1}k||wn(t)}if(b=t.memoizedState,b!==null&&(b=b.dehydrated,b!==null))return Cc(b)?t.lanes=32:t.lanes=536870912,null;wa(t)}return b=n.children,n=n.fallback,o?(Ka(),o=t.mode,b=zl({mode:"hidden",children:b},o),n=xn(n,o,a,null),b.return=t,n.return=t,b.sibling=n,t.child=b,o=t.child,o.memoizedState=Vo(a),o.childLanes=Go(e,x,a),t.memoizedState=qo,n):(Ga(t),Ko(t,b))}if(k=e.memoizedState,k!==null&&(b=k.dehydrated,b!==null)){if(u)t.flags&256?(Ga(t),t.flags&=-257,t=$o(e,t,a)):t.memoizedState!==null?(Ka(),t.child=e.child,t.flags|=128,t=null):(Ka(),o=n.fallback,b=t.mode,n=zl({mode:"visible",children:n.children},b),o=xn(o,b,a,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,rs(t,e.child,null,a),n=t.child,n.memoizedState=Vo(a),n.childLanes=Go(e,x,a),t.memoizedState=qo,t=o);else if(Ga(t),Cc(b)){if(x=b.nextSibling&&b.nextSibling.dataset,x)var V=x.dgst;x=V,n=Error(c(419)),n.stack="",n.digest=x,Ps({value:n,source:null,stack:null}),t=$o(e,t,a)}else if(lt||Fs(e,t,a,!1),x=(a&e.childLanes)!==0,lt||x){if(x=Ge,x!==null&&(n=a&-a,n=(n&42)!==0?1:aa(n),n=(n&(x.suspendedLanes|a))!==0?0:n,n!==0&&n!==k.retryLane))throw k.retryLane=n,Xn(e,n),Mt(x,e,n),Tf;b.data==="$?"||oc(),t=$o(e,t,a)}else b.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,Xe=Jt(b.nextSibling),yt=t,ze=!0,vn=null,na=!1,e!==null&&(Ht[Bt++]=pa,Ht[Bt++]=xa,Ht[Bt++]=yn,pa=e.id,xa=e.overflow,yn=t),t=Ko(t,n.children),t.flags|=4096);return t}return o?(Ka(),o=n.fallback,b=t.mode,k=e.child,V=k.sibling,n=ga(k,{mode:"hidden",children:n.children}),n.subtreeFlags=k.subtreeFlags&65011712,V!==null?o=ga(V,o):(o=xn(o,b,a,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,b=e.child.memoizedState,b===null?b=Vo(a):(k=b.cachePool,k!==null?(V=at._currentValue,k=k.parent!==V?{parent:V,pool:V}:k):k=wd(),b={baseLanes:b.baseLanes|a,cachePool:k}),o.memoizedState=b,o.childLanes=Go(e,x,a),t.memoizedState=qo,n):(Ga(t),a=e.child,e=a.sibling,a=ga(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Ko(e,t){return t=zl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function zl(e,t){return e=Tt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function $o(e,t,a){return rs(t,e.child,null,a),e=Ko(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _f(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),io(e.return,t,a)}function Yo(e,t,a,n,o){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:o}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=n,u.tail=a,u.tailMode=o)}function Hf(e,t,a){var n=t.pendingProps,o=n.revealOrder,u=n.tail;if(ct(e,t,n.children,a),n=nt.current,(n&2)!==0)n=n&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_f(e,a,t);else if(e.tag===19)_f(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}switch(ne(nt,n),o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Al(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),Yo(t,!1,o,a,u);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Al(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}Yo(t,!0,a,null,u);break;case"together":Yo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Sa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Xa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Fs(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=ga(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ga(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Po(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ml(e)))}function c0(e,t,a){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),_a(t,at,e.memoizedState.cache),Ys();break;case 27:case 5:Ve(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Ga(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Lf(e,t,a):(Ga(t),e=Sa(e,t,a),e!==null?e.sibling:null);Ga(t);break;case 19:var o=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Fs(e,t,a,!1),n=(a&t.childLanes)!==0),o){if(n)return Hf(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ne(nt,nt.current),n)break;return null;case 22:case 23:return t.lanes=0,Of(e,t,a);case 24:_a(t,at,e.memoizedState.cache)}return Sa(e,t,a)}function Bf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)lt=!0;else{if(!Po(e,a)&&(t.flags&128)===0)return lt=!1,c0(e,t,a);lt=(e.flags&131072)!==0}else lt=!1,ze&&(t.flags&1048576)!==0&&hd(t,fl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var n=t.elementType,o=n._init;if(n=o(n._payload),t.type=n,typeof n=="function")eo(n)?(e=En(n,e),t.tag=1,t=Df(null,t,n,e,a)):(t.tag=0,t=Bo(null,t,n,e,a));else{if(n!=null){if(o=n.$$typeof,o===F){t.tag=11,t=kf(null,t,n,e,a);break e}else if(o===Q){t.tag=14,t=Af(null,t,n,e,a);break e}}throw t=_(n)||n,Error(c(306,t,""))}}return t;case 0:return Bo(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,o=En(n,t.pendingProps),Df(e,t,n,o,a);case 3:e:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var u=t.memoizedState;o=u.element,go(e,t),er(t,n,null,a);var x=t.memoizedState;if(n=x.cache,_a(t,at,n),n!==u.cache&&oo(t,[at],a,!0),Ws(),n=x.element,u.isDehydrated)if(u={element:n,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Uf(e,t,n,a);break e}else if(n!==o){o=Lt(Error(c(424)),t),Ps(o),t=Uf(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Xe=Jt(e.firstChild),yt=t,ze=!0,vn=null,na=!0,a=xf(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Ys(),n===o){t=Sa(e,t,a);break e}ct(e,t,n,a)}t=t.child}return t;case 26:return Ml(e,t),e===null?(a=Km(t.type,null,t.pendingProps,null))?t.memoizedState=a:ze||(a=t.type,e=t.pendingProps,n=Fl(I.current).createElement(a),n[tt]=t,n[xt]=e,dt(n,a,e),rt(n),t.stateNode=n):t.memoizedState=Km(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ve(t),e===null&&ze&&(n=t.stateNode=qm(t.type,t.pendingProps,I.current),yt=t,na=!0,o=Xe,Ia(t.type)?(Ec=o,Xe=Jt(n.firstChild)):Xe=o),ct(e,t,t.pendingProps.children,a),Ml(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((o=n=Xe)&&(n=_0(n,t.type,t.pendingProps,na),n!==null?(t.stateNode=n,yt=t,Xe=Jt(n.firstChild),na=!1,o=!0):o=!1),o||wn(t)),Ve(t),o=t.type,u=t.pendingProps,x=e!==null?e.memoizedProps:null,n=u.children,Sc(o,u)?n=null:x!==null&&Sc(o,x)&&(t.flags|=32),t.memoizedState!==null&&(o=wo(e,t,t0,null,null,a),Sr._currentValue=o),Ml(e,t),ct(e,t,n,a),t.child;case 6:return e===null&&ze&&((e=a=Xe)&&(a=H0(a,t.pendingProps,na),a!==null?(t.stateNode=a,yt=t,Xe=null,e=!0):e=!1),e||wn(t)),null;case 13:return Lf(e,t,a);case 4:return Se(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=rs(t,null,n,a):ct(e,t,n,a),t.child;case 11:return kf(e,t,t.type,t.pendingProps,a);case 7:return ct(e,t,t.pendingProps,a),t.child;case 8:return ct(e,t,t.pendingProps.children,a),t.child;case 12:return ct(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,_a(t,t.type,n.value),ct(e,t,n.children,a),t.child;case 9:return o=t.type._context,n=t.pendingProps.children,jn(t),o=ht(o),n=n(o),t.flags|=1,ct(e,t,n,a),t.child;case 14:return Af(e,t,t.type,t.pendingProps,a);case 15:return Rf(e,t,t.type,t.pendingProps,a);case 19:return Hf(e,t,a);case 31:return n=t.pendingProps,a=t.mode,n={mode:n.mode,children:n.children},e===null?(a=zl(n,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=ga(e.child,n),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Of(e,t,a);case 24:return jn(t),n=ht(at),e===null?(o=fo(),o===null&&(o=Ge,u=co(),o.pooledCache=u,u.refCount++,u!==null&&(o.pooledCacheLanes|=a),o=u),t.memoizedState={parent:n,cache:o},ho(t),_a(t,at,o)):((e.lanes&a)!==0&&(go(e,t),er(t,null,null,a),Ws()),o=e.memoizedState,u=t.memoizedState,o.parent!==n?(o={parent:n,cache:n},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),_a(t,at,n)):(n=u.cache,_a(t,at,n),n!==o.cache&&oo(t,[at],a,!0))),ct(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function ja(e){e.flags|=4}function qf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(t=qt.current,t!==null&&((Re&4194048)===Re?sa!==null:(Re&62914560)!==Re&&(Re&536870912)===0||t!==sa))throw Js=mo,Sd;e.flags|=8192}}function Dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yt():536870912,e.lanes|=t,cs|=t)}function ir(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,n|=o.subtreeFlags&65011712,n|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function u0(e,t,a){var n=t.pendingProps;switch(so(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(at),Ke(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&($s(t)?ja(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,xd())),Pe(t),null;case 26:return a=t.memoizedState,e===null?(ja(t),a!==null?(Pe(t),qf(t,a)):(Pe(t),t.flags&=-16777217)):a?a!==e.memoizedState?(ja(t),Pe(t),qf(t,a)):(Pe(t),t.flags&=-16777217):(e.memoizedProps!==n&&ja(t),Pe(t),t.flags&=-16777217),null;case 27:be(t),a=I.current;var o=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Pe(t),null}e=ue.current,$s(t)?gd(t):(e=qm(o,n,a),t.stateNode=e,ja(t))}return Pe(t),null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Pe(t),null}if(e=ue.current,$s(t))gd(t);else{switch(o=Fl(I.current),e){case 1:e=o.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=o.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof n.is=="string"?o.createElement("select",{is:n.is}):o.createElement("select"),n.multiple?e.multiple=!0:n.size&&(e.size=n.size);break;default:e=typeof n.is=="string"?o.createElement(a,{is:n.is}):o.createElement(a)}}e[tt]=t,e[xt]=n;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=e;e:switch(dt(e,a,n),a){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&ja(t)}}return Pe(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=I.current,$s(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,o=yt,o!==null)switch(o.tag){case 27:case 5:n=o.memoizedProps}e[tt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||zm(e.nodeValue,a)),e||wn(t)}else e=Fl(e).createTextNode(n),e[tt]=t,t.stateNode=e}return Pe(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=$s(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[tt]=t}else Ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),o=!1}else o=xd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(wa(t),t):(wa(t),null)}if(wa(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=n!==null,e=e!==null&&e.memoizedState!==null,a){n=t.child,o=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(o=n.alternate.memoizedState.cachePool.pool);var u=null;n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==o&&(n.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),Dl(t,t.updateQueue),Pe(t),null;case 4:return Ke(),e===null&&xc(t.stateNode.containerInfo),Pe(t),null;case 10:return ba(t.type),Pe(t),null;case 19:if(re(nt),o=t.memoizedState,o===null)return Pe(t),null;if(n=(t.flags&128)!==0,u=o.rendering,u===null)if(n)ir(o,!1);else{if(Qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Al(e),u!==null){for(t.flags|=128,ir(o,!1),e=u.updateQueue,t.updateQueue=e,Dl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)md(a,e),a=a.sibling;return ne(nt,nt.current&1|2),t.child}e=e.sibling}o.tail!==null&&De()>_l&&(t.flags|=128,n=!0,ir(o,!1),t.lanes=4194304)}else{if(!n)if(e=Al(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Dl(t,e),ir(o,!0),o.tail===null&&o.tailMode==="hidden"&&!u.alternate&&!ze)return Pe(t),null}else 2*De()-o.renderingStartTime>_l&&a!==536870912&&(t.flags|=128,n=!0,ir(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(e=o.last,e!==null?e.sibling=u:t.child=u,o.last=u)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=De(),t.sibling=null,e=nt.current,ne(nt,n?e&1|2:e&1),t):(Pe(t),null);case 22:case 23:return wa(t),bo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),a=t.updateQueue,a!==null&&Dl(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&re(Nn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ba(at),Pe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function d0(e,t){switch(so(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(at),Ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 13:if(wa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(nt),null;case 4:return Ke(),null;case 10:return ba(t.type),null;case 22:case 23:return wa(t),bo(),e!==null&&re(Nn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(at),null;case 25:return null;default:return null}}function Vf(e,t){switch(so(t),t.tag){case 3:ba(at),Ke();break;case 26:case 27:case 5:be(t);break;case 4:Ke();break;case 13:wa(t);break;case 19:re(nt);break;case 10:ba(t.type);break;case 22:case 23:wa(t),bo(),e!==null&&re(Nn);break;case 24:ba(at)}}function or(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var o=n.next;a=o;do{if((a.tag&e)===e){n=void 0;var u=a.create,x=a.inst;n=u(),x.destroy=n}a=a.next}while(a!==o)}}catch(b){qe(t,t.return,b)}}function $a(e,t,a){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var u=o.next;n=u;do{if((n.tag&e)===e){var x=n.inst,b=x.destroy;if(b!==void 0){x.destroy=void 0,o=t;var k=a,V=b;try{V()}catch(J){qe(o,k,J)}}}n=n.next}while(n!==u)}}catch(J){qe(t,t.return,J)}}function Gf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{kd(t,a)}catch(n){qe(e,e.return,n)}}}function Kf(e,t,a){a.props=En(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){qe(e,t,n)}}function cr(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(o){qe(e,t,o)}}function ra(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(o){qe(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){qe(e,t,o)}else a.current=null}function $f(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(o){qe(e,e.return,o)}}function Fo(e,t,a){try{var n=e.stateNode;M0(n,e.type,a,t),n[xt]=t}catch(o){qe(e,e.return,o)}}function Yf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ia(e.type)||e.tag===4}function Xo(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&&Ia(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 Qo(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Pl));else if(n!==4&&(n===27&&Ia(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Qo(e,t,a),e=e.sibling;e!==null;)Qo(e,t,a),e=e.sibling}function Ul(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Ia(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ul(e,t,a),e=e.sibling;e!==null;)Ul(e,t,a),e=e.sibling}function Pf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);dt(t,n,a),t[tt]=e,t[xt]=a}catch(u){qe(e,e.return,u)}}var Na=!1,Ie=!1,Zo=!1,Ff=typeof WeakSet=="function"?WeakSet:Set,it=null;function f0(e,t){if(e=e.containerInfo,vc=Wl,e=nd(e),Fi(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var o=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var x=0,b=-1,k=-1,V=0,J=0,ae=e,K=null;t:for(;;){for(var Y;ae!==a||o!==0&&ae.nodeType!==3||(b=x+o),ae!==u||n!==0&&ae.nodeType!==3||(k=x+n),ae.nodeType===3&&(x+=ae.nodeValue.length),(Y=ae.firstChild)!==null;)K=ae,ae=Y;for(;;){if(ae===e)break t;if(K===a&&++V===o&&(b=x),K===u&&++J===n&&(k=x),(Y=ae.nextSibling)!==null)break;ae=K,K=ae.parentNode}ae=Y}a=b===-1||k===-1?null:{start:b,end:k}}else a=null}a=a||{start:0,end:0}}else a=null;for(wc={focusedElem:e,selectionRange:a},Wl=!1,it=t;it!==null;)if(t=it,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,it=e;else for(;it!==null;){switch(t=it,u=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,o=u.memoizedProps,u=u.memoizedState,n=a.stateNode;try{var ye=En(a.type,o,a.elementType===a.type);e=n.getSnapshotBeforeUpdate(ye,u),n.__reactInternalSnapshotBeforeUpdate=e}catch(pe){qe(a,a.return,pe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Nc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nc(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,it=e;break}it=t.return}}function Xf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Ya(e,a),n&4&&or(5,a);break;case 1:if(Ya(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){qe(a,a.return,x)}else{var o=En(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){qe(a,a.return,x)}}n&64&&Gf(a),n&512&&cr(a,a.return);break;case 3:if(Ya(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{kd(e,t)}catch(x){qe(a,a.return,x)}}break;case 27:t===null&&n&4&&Pf(a);case 26:case 5:Ya(e,a),t===null&&n&4&&$f(a),n&512&&cr(a,a.return);break;case 12:Ya(e,a);break;case 13:Ya(e,a),n&4&&Jf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=w0.bind(null,a),B0(e,a))));break;case 22:if(n=a.memoizedState!==null||Na,!n){t=t!==null&&t.memoizedState!==null||Ie,o=Na;var u=Ie;Na=n,(Ie=t)&&!u?Pa(e,a,(a.subtreeFlags&8772)!==0):Ya(e,a),Na=o,Ie=u}break;case 30:break;default:Ya(e,a)}}function Qf(e){var t=e.alternate;t!==null&&(e.alternate=null,Qf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ki(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 $e=null,jt=!1;function Ca(e,t,a){for(a=a.child;a!==null;)Zf(e,t,a),a=a.sibling}function Zf(e,t,a){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Ua,a)}catch{}switch(a.tag){case 26:Ie||ra(a,t),Ca(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ie||ra(a,t);var n=$e,o=jt;Ia(a.type)&&($e=a.stateNode,jt=!1),Ca(e,t,a),yr(a.stateNode),$e=n,jt=o;break;case 5:Ie||ra(a,t);case 6:if(n=$e,o=jt,$e=null,Ca(e,t,a),$e=n,jt=o,$e!==null)if(jt)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(a.stateNode)}catch(u){qe(a,t,u)}else try{$e.removeChild(a.stateNode)}catch(u){qe(a,t,u)}break;case 18:$e!==null&&(jt?(e=$e,Hm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Er(e)):Hm($e,a.stateNode));break;case 4:n=$e,o=jt,$e=a.stateNode.containerInfo,jt=!0,Ca(e,t,a),$e=n,jt=o;break;case 0:case 11:case 14:case 15:Ie||$a(2,a,t),Ie||$a(4,a,t),Ca(e,t,a);break;case 1:Ie||(ra(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&Kf(a,t,n)),Ca(e,t,a);break;case 21:Ca(e,t,a);break;case 22:Ie=(n=Ie)||a.memoizedState!==null,Ca(e,t,a),Ie=n;break;default:Ca(e,t,a)}}function Jf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Er(e)}catch(a){qe(t,t.return,a)}}function m0(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ff),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ff),t;default:throw Error(c(435,e.tag))}}function Jo(e,t){var a=m0(e);t.forEach(function(n){var o=S0.bind(null,e,n);a.has(n)||(a.add(n),n.then(o,o))})}function kt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var o=a[n],u=e,x=t,b=x;e:for(;b!==null;){switch(b.tag){case 27:if(Ia(b.type)){$e=b.stateNode,jt=!1;break e}break;case 5:$e=b.stateNode,jt=!1;break e;case 3:case 4:$e=b.stateNode.containerInfo,jt=!0;break e}b=b.return}if($e===null)throw Error(c(160));Zf(u,x,o),$e=null,jt=!1,u=o.alternate,u!==null&&(u.return=null),o.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)If(t,e),t=t.sibling}var Zt=null;function If(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:kt(t,e),At(e),n&4&&($a(3,e,e.return),or(3,e),$a(5,e,e.return));break;case 1:kt(t,e),At(e),n&512&&(Ie||a===null||ra(a,a.return)),n&64&&Na&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var o=Zt;if(kt(t,e),At(e),n&512&&(Ie||a===null||ra(a,a.return)),n&4){var u=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,o=o.ownerDocument||o;t:switch(n){case"title":u=o.getElementsByTagName("title")[0],(!u||u[zs]||u[tt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=o.createElement(n),o.head.insertBefore(u,o.querySelector("head > title"))),dt(u,n,a),u[tt]=e,rt(u),n=u;break e;case"link":var x=Pm("link","href",o).get(n+(a.href||""));if(x){for(var b=0;b<x.length;b++)if(u=x[b],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(b,1);break t}}u=o.createElement(n),dt(u,n,a),o.head.appendChild(u);break;case"meta":if(x=Pm("meta","content",o).get(n+(a.content||""))){for(b=0;b<x.length;b++)if(u=x[b],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(b,1);break t}}u=o.createElement(n),dt(u,n,a),o.head.appendChild(u);break;default:throw Error(c(468,n))}u[tt]=e,rt(u),n=u}e.stateNode=n}else Fm(o,e.type,e.stateNode);else e.stateNode=Ym(o,n,e.memoizedProps);else u!==n?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,n===null?Fm(o,e.type,e.stateNode):Ym(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Fo(e,e.memoizedProps,a.memoizedProps)}break;case 27:kt(t,e),At(e),n&512&&(Ie||a===null||ra(a,a.return)),a!==null&&n&4&&Fo(e,e.memoizedProps,a.memoizedProps);break;case 5:if(kt(t,e),At(e),n&512&&(Ie||a===null||ra(a,a.return)),e.flags&32){o=e.stateNode;try{Vn(o,"")}catch(Y){qe(e,e.return,Y)}}n&4&&e.stateNode!=null&&(o=e.memoizedProps,Fo(e,o,a!==null?a.memoizedProps:o)),n&1024&&(Zo=!0);break;case 6:if(kt(t,e),At(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(Y){qe(e,e.return,Y)}}break;case 3:if(Zl=null,o=Zt,Zt=Xl(t.containerInfo),kt(t,e),Zt=o,At(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Er(t.containerInfo)}catch(Y){qe(e,e.return,Y)}Zo&&(Zo=!1,Wf(e));break;case 4:n=Zt,Zt=Xl(e.stateNode.containerInfo),kt(t,e),At(e),Zt=n;break;case 12:kt(t,e),At(e);break;case 13:kt(t,e),At(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(nc=De()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Jo(e,n)));break;case 22:o=e.memoizedState!==null;var k=a!==null&&a.memoizedState!==null,V=Na,J=Ie;if(Na=V||o,Ie=J||k,kt(t,e),Ie=J,Na=V,At(e),n&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(a===null||k||Na||Ie||Tn(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){k=a=t;try{if(u=k.stateNode,o)x=u.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{b=k.stateNode;var ae=k.memoizedProps.style,K=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;b.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(Y){qe(k,k.return,Y)}}}else if(t.tag===6){if(a===null){k=t;try{k.stateNode.nodeValue=o?"":k.memoizedProps}catch(Y){qe(k,k.return,Y)}}}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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Jo(e,a))));break;case 19:kt(t,e),At(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Jo(e,n)));break;case 30:break;case 21:break;default:kt(t,e),At(e)}}function At(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(Yf(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var o=a.stateNode,u=Xo(e);Ul(e,u,o);break;case 5:var x=a.stateNode;a.flags&32&&(Vn(x,""),a.flags&=-33);var b=Xo(e);Ul(e,b,x);break;case 3:case 4:var k=a.stateNode.containerInfo,V=Xo(e);Qo(e,V,k);break;default:throw Error(c(161))}}catch(J){qe(e,e.return,J)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ya(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xf(e,t.alternate,t),t=t.sibling}function Tn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$a(4,t,t.return),Tn(t);break;case 1:ra(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Kf(t,t.return,a),Tn(t);break;case 27:yr(t.stateNode);case 26:case 5:ra(t,t.return),Tn(t);break;case 22:t.memoizedState===null&&Tn(t);break;case 30:Tn(t);break;default:Tn(t)}e=e.sibling}}function Pa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,o=e,u=t,x=u.flags;switch(u.tag){case 0:case 11:case 15:Pa(o,u,a),or(4,u);break;case 1:if(Pa(o,u,a),n=u,o=n.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(V){qe(n,n.return,V)}if(n=u,o=n.updateQueue,o!==null){var b=n.stateNode;try{var k=o.shared.hiddenCallbacks;if(k!==null)for(o.shared.hiddenCallbacks=null,o=0;o<k.length;o++)Td(k[o],b)}catch(V){qe(n,n.return,V)}}a&&x&64&&Gf(u),cr(u,u.return);break;case 27:Pf(u);case 26:case 5:Pa(o,u,a),a&&n===null&&x&4&&$f(u),cr(u,u.return);break;case 12:Pa(o,u,a);break;case 13:Pa(o,u,a),a&&x&4&&Jf(o,u);break;case 22:u.memoizedState===null&&Pa(o,u,a),cr(u,u.return);break;case 30:break;default:Pa(o,u,a)}t=t.sibling}}function Io(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Xs(a))}function Wo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xs(e))}function la(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)em(e,t,a,n),t=t.sibling}function em(e,t,a,n){var o=t.flags;switch(t.tag){case 0:case 11:case 15:la(e,t,a,n),o&2048&&or(9,t);break;case 1:la(e,t,a,n);break;case 3:la(e,t,a,n),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xs(e)));break;case 12:if(o&2048){la(e,t,a,n),e=t.stateNode;try{var u=t.memoizedProps,x=u.id,b=u.onPostCommit;typeof b=="function"&&b(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){qe(t,t.return,k)}}else la(e,t,a,n);break;case 13:la(e,t,a,n);break;case 23:break;case 22:u=t.stateNode,x=t.alternate,t.memoizedState!==null?u._visibility&2?la(e,t,a,n):ur(e,t):u._visibility&2?la(e,t,a,n):(u._visibility|=2,ls(e,t,a,n,(t.subtreeFlags&10256)!==0)),o&2048&&Io(x,t);break;case 24:la(e,t,a,n),o&2048&&Wo(t.alternate,t);break;default:la(e,t,a,n)}}function ls(e,t,a,n,o){for(o=o&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var u=e,x=t,b=a,k=n,V=x.flags;switch(x.tag){case 0:case 11:case 15:ls(u,x,b,k,o),or(8,x);break;case 23:break;case 22:var J=x.stateNode;x.memoizedState!==null?J._visibility&2?ls(u,x,b,k,o):ur(u,x):(J._visibility|=2,ls(u,x,b,k,o)),o&&V&2048&&Io(x.alternate,x);break;case 24:ls(u,x,b,k,o),o&&V&2048&&Wo(x.alternate,x);break;default:ls(u,x,b,k,o)}t=t.sibling}}function ur(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,o=n.flags;switch(n.tag){case 22:ur(a,n),o&2048&&Io(n.alternate,n);break;case 24:ur(a,n),o&2048&&Wo(n.alternate,n);break;default:ur(a,n)}t=t.sibling}}var dr=8192;function is(e){if(e.subtreeFlags&dr)for(e=e.child;e!==null;)tm(e),e=e.sibling}function tm(e){switch(e.tag){case 26:is(e),e.flags&dr&&e.memoizedState!==null&&I0(Zt,e.memoizedState,e.memoizedProps);break;case 5:is(e);break;case 3:case 4:var t=Zt;Zt=Xl(e.stateNode.containerInfo),is(e),Zt=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=dr,dr=16777216,is(e),dr=t):is(e));break;default:is(e)}}function am(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 fr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];it=n,sm(n,e)}am(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)nm(e),e=e.sibling}function nm(e){switch(e.tag){case 0:case 11:case 15:fr(e),e.flags&2048&&$a(9,e,e.return);break;case 3:fr(e);break;case 12:fr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):fr(e);break;default:fr(e)}}function Ll(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];it=n,sm(n,e)}am(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$a(8,t,t.return),Ll(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function sm(e,t){for(;it!==null;){var a=it;switch(a.tag){case 0:case 11:case 15:$a(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Xs(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,it=n;else e:for(a=e;it!==null;){n=it;var o=n.sibling,u=n.return;if(Qf(n),n===a){it=null;break e}if(o!==null){o.return=u,it=o;break e}it=u}}}var h0={getCacheForType:function(e){var t=ht(at),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},g0=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ge=null,ke=null,Re=0,Le=0,Rt=null,Fa=!1,os=!1,ec=!1,Ea=0,Qe=0,Xa=0,kn=0,tc=0,Vt=0,cs=0,mr=null,Nt=null,ac=!1,nc=0,_l=1/0,Hl=null,Qa=null,ut=0,Za=null,us=null,ds=0,sc=0,rc=null,rm=null,hr=0,lc=null;function Ot(){if((Ue&2)!==0&&Re!==0)return Re&-Re;if(E.T!==null){var e=In;return e!==0?e:mc()}return Ms()}function lm(){Vt===0&&(Vt=(Re&536870912)===0||ze?ge():536870912);var e=qt.current;return e!==null&&(e.flags|=32),Vt}function Mt(e,t,a){(e===Ge&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(fs(e,0),Ja(e,Re,Vt,!1)),Ft(e,a),((Ue&2)===0||e!==Ge)&&(e===Ge&&((Ue&2)===0&&(kn|=a),Qe===4&&Ja(e,Re,Vt,!1)),ia(e))}function im(e,t,a){if((Ue&6)!==0)throw Error(c(327));var n=!a&&(t&124)===0&&(t&e.expiredLanes)===0||ce(e,t),o=n?y0(e,t):cc(e,t,!0),u=n;do{if(o===0){os&&!n&&Ja(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!p0(a)){o=cc(e,t,!1),u=!1;continue}if(o===2){if(u=t,e.errorRecoveryDisabledLanes&u)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var b=e;o=mr;var k=b.current.memoizedState.isDehydrated;if(k&&(fs(b,x).flags|=256),x=cc(b,x,!1),x!==2){if(ec&&!k){b.errorRecoveryDisabledLanes|=u,kn|=u,o=4;break e}u=Nt,Nt=o,u!==null&&(Nt===null?Nt=u:Nt.push.apply(Nt,u))}o=x}if(u=!1,o!==2)continue}}if(o===1){fs(e,0),Ja(e,t,0,!0);break}e:{switch(n=e,u=o,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ja(n,t,Vt,!Fa);break e;case 2:Nt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=nc+300-De(),10<o)){if(Ja(n,t,Vt,!Fa),dn(n,0,!0)!==0)break e;n.timeoutHandle=Lm(om.bind(null,n,a,Nt,Hl,ac,t,Vt,kn,cs,Fa,u,2,-0,0),o);break e}om(n,a,Nt,Hl,ac,t,Vt,kn,cs,Fa,u,0,-0,0)}}break}while(!0);ia(e)}function om(e,t,a,n,o,u,x,b,k,V,J,ae,K,Y){if(e.timeoutHandle=-1,ae=t.subtreeFlags,(ae&8192||(ae&16785408)===16785408)&&(wr={stylesheets:null,count:0,unsuspend:J0},tm(t),ae=W0(),ae!==null)){e.cancelPendingCommit=ae(gm.bind(null,e,t,u,a,n,o,x,b,k,J,1,K,Y)),Ja(e,u,x,!V);return}gm(e,t,u,a,n,o,x,b,k)}function p0(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var o=a[n],u=o.getSnapshot;o=o.value;try{if(!Et(u(),o))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ja(e,t,a,n){t&=~tc,t&=~kn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var o=t;0<o;){var u=31-mt(o),x=1<<u;n[u]=-1,o&=~x}a!==0&&Xr(e,a,t)}function Bl(){return(Ue&6)===0?(gr(0),!1):!0}function ic(){if(ke!==null){if(Le===0)var e=ke.return;else e=ke,ya=Sn=null,No(e),ss=null,rr=0,e=ke;for(;e!==null;)Vf(e.alternate,e),e=e.return;ke=null}}function fs(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,D0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ic(),Ge=e,ke=a=ga(e.current,null),Re=t,Le=0,Rt=null,Fa=!1,os=ce(e,t),ec=!1,cs=Vt=tc=kn=Xa=Qe=0,Nt=mr=null,ac=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var o=31-mt(n),u=1<<o;t|=e[o],n&=~u}return Ea=t,il(),a}function cm(e,t){Ce=null,E.H=El,t===Zs||t===pl?(t=Cd(),Le=3):t===Sd?(t=Cd(),Le=4):Le=t===Tf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Rt=t,ke===null&&(Qe=1,Ol(e,Lt(t,e.current)))}function um(){var e=E.H;return E.H=El,e===null?El:e}function dm(){var e=E.A;return E.A=h0,e}function oc(){Qe=4,Fa||(Re&4194048)!==Re&&qt.current!==null||(os=!0),(Xa&134217727)===0&&(kn&134217727)===0||Ge===null||Ja(Ge,Re,Vt,!1)}function cc(e,t,a){var n=Ue;Ue|=2;var o=um(),u=dm();(Ge!==e||Re!==t)&&(Hl=null,fs(e,t)),t=!1;var x=Qe;e:do try{if(Le!==0&&ke!==null){var b=ke,k=Rt;switch(Le){case 8:ic(),x=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(t=!0);var V=Le;if(Le=0,Rt=null,ms(e,b,k,V),a&&os){x=0;break e}break;default:V=Le,Le=0,Rt=null,ms(e,b,k,V)}}x0(),x=Qe;break}catch(J){cm(e,J)}while(!0);return t&&e.shellSuspendCounter++,ya=Sn=null,Ue=n,E.H=o,E.A=u,ke===null&&(Ge=null,Re=0,il()),x}function x0(){for(;ke!==null;)fm(ke)}function y0(e,t){var a=Ue;Ue|=2;var n=um(),o=dm();Ge!==e||Re!==t?(Hl=null,_l=De()+500,fs(e,t)):os=ce(e,t);e:do try{if(Le!==0&&ke!==null){t=ke;var u=Rt;t:switch(Le){case 1:Le=0,Rt=null,ms(e,t,u,1);break;case 2:case 9:if(jd(u)){Le=0,Rt=null,mm(t);break}t=function(){Le!==2&&Le!==9||Ge!==e||(Le=7),ia(e)},u.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:jd(u)?(Le=0,Rt=null,mm(t)):(Le=0,Rt=null,ms(e,t,u,7));break;case 5:var x=null;switch(ke.tag){case 26:x=ke.memoizedState;case 5:case 27:var b=ke;if(!x||Xm(x)){Le=0,Rt=null;var k=b.sibling;if(k!==null)ke=k;else{var V=b.return;V!==null?(ke=V,ql(V)):ke=null}break t}}Le=0,Rt=null,ms(e,t,u,5);break;case 6:Le=0,Rt=null,ms(e,t,u,6);break;case 8:ic(),Qe=6;break e;default:throw Error(c(462))}}b0();break}catch(J){cm(e,J)}while(!0);return ya=Sn=null,E.H=n,E.A=o,Ue=a,ke!==null?0:(Ge=null,Re=0,il(),Qe)}function b0(){for(;ke!==null&&!ln();)fm(ke)}function fm(e){var t=Bf(e.alternate,e,Ea);e.memoizedProps=e.pendingProps,t===null?ql(e):ke=t}function mm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=zf(a,t,t.pendingProps,t.type,void 0,Re);break;case 11:t=zf(a,t,t.pendingProps,t.type.render,t.ref,Re);break;case 5:No(t);default:Vf(a,t),t=ke=md(t,Ea),t=Bf(a,t,Ea)}e.memoizedProps=e.pendingProps,t===null?ql(e):ke=t}function ms(e,t,a,n){ya=Sn=null,No(t),ss=null,rr=0;var o=t.return;try{if(o0(e,o,t,a,Re)){Qe=1,Ol(e,Lt(a,e.current)),ke=null;return}}catch(u){if(o!==null)throw ke=o,u;Qe=1,Ol(e,Lt(a,e.current)),ke=null;return}t.flags&32768?(ze||n===1?e=!0:os||(Re&536870912)!==0?e=!1:(Fa=e=!0,(n===2||n===9||n===3||n===6)&&(n=qt.current,n!==null&&n.tag===13&&(n.flags|=16384))),hm(t,e)):ql(t)}function ql(e){var t=e;do{if((t.flags&32768)!==0){hm(t,Fa);return}e=t.return;var a=u0(t.alternate,t,Ea);if(a!==null){ke=a;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);Qe===0&&(Qe=5)}function hm(e,t){do{var a=d0(e.alternate,e);if(a!==null){a.flags&=32767,ke=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=a}while(e!==null);Qe=6,ke=null}function gm(e,t,a,n,o,u,x,b,k){e.cancelPendingCommit=null;do Vl();while(ut!==0);if((Ue&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(u=t.lanes|t.childLanes,u|=Ii,fn(e,a,u,x,b,k),e===Ge&&(ke=Ge=null,Re=0),us=t,Za=e,ds=a,sc=u,rc=o,rm=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,j0(fa,function(){return vm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null,o=G.p,G.p=2,x=Ue,Ue|=4;try{f0(e,t,a)}finally{Ue=x,G.p=o,E.T=n}}ut=1,pm(),xm(),ym()}}function pm(){if(ut===1){ut=0;var e=Za,t=us,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=E.T,E.T=null;var n=G.p;G.p=2;var o=Ue;Ue|=4;try{If(t,e);var u=wc,x=nd(e.containerInfo),b=u.focusedElem,k=u.selectionRange;if(x!==b&&b&&b.ownerDocument&&ad(b.ownerDocument.documentElement,b)){if(k!==null&&Fi(b)){var V=k.start,J=k.end;if(J===void 0&&(J=V),"selectionStart"in b)b.selectionStart=V,b.selectionEnd=Math.min(J,b.value.length);else{var ae=b.ownerDocument||document,K=ae&&ae.defaultView||window;if(K.getSelection){var Y=K.getSelection(),ye=b.textContent.length,pe=Math.min(k.start,ye),Be=k.end===void 0?pe:Math.min(k.end,ye);!Y.extend&&pe>Be&&(x=Be,Be=pe,pe=x);var H=td(b,pe),z=td(b,Be);if(H&&z&&(Y.rangeCount!==1||Y.anchorNode!==H.node||Y.anchorOffset!==H.offset||Y.focusNode!==z.node||Y.focusOffset!==z.offset)){var q=ae.createRange();q.setStart(H.node,H.offset),Y.removeAllRanges(),pe>Be?(Y.addRange(q),Y.extend(z.node,z.offset)):(q.setEnd(z.node,z.offset),Y.addRange(q))}}}}for(ae=[],Y=b;Y=Y.parentNode;)Y.nodeType===1&&ae.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<ae.length;b++){var te=ae[b];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Wl=!!vc,wc=vc=null}finally{Ue=o,G.p=n,E.T=a}}e.current=t,ut=2}}function xm(){if(ut===2){ut=0;var e=Za,t=us,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=E.T,E.T=null;var n=G.p;G.p=2;var o=Ue;Ue|=4;try{Xf(e,t.alternate,t)}finally{Ue=o,G.p=n,E.T=a}}ut=3}}function ym(){if(ut===4||ut===3){ut=0,on();var e=Za,t=us,a=ds,n=rm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ut=5:(ut=0,us=Za=null,bm(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Qa=null),zn(a),t=t.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Ua,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=E.T,o=G.p,G.p=2,E.T=null;try{for(var u=e.onRecoverableError,x=0;x<n.length;x++){var b=n[x];u(b.value,{componentStack:b.stack})}}finally{E.T=t,G.p=o}}(ds&3)!==0&&Vl(),ia(e),o=e.pendingLanes,(a&4194090)!==0&&(o&42)!==0?e===lc?hr++:(hr=0,lc=e):hr=0,gr(0)}}function bm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xs(t)))}function Vl(e){return pm(),xm(),ym(),vm()}function vm(){if(ut!==5)return!1;var e=Za,t=sc;sc=0;var a=zn(ds),n=E.T,o=G.p;try{G.p=32>a?32:a,E.T=null,a=rc,rc=null;var u=Za,x=ds;if(ut=0,us=Za=null,ds=0,(Ue&6)!==0)throw Error(c(331));var b=Ue;if(Ue|=4,nm(u.current),em(u,u.current,x,a),Ue=b,gr(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Ua,u)}catch{}return!0}finally{G.p=o,E.T=n,bm(e,t)}}function wm(e,t,a){t=Lt(a,t),t=Ho(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(Ft(e,2),ia(e))}function qe(e,t,a){if(e.tag===3)wm(e,e,a);else for(;t!==null;){if(t.tag===3){wm(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Qa===null||!Qa.has(n))){e=Lt(a,e),a=Cf(2),n=qa(t,a,2),n!==null&&(Ef(a,n,t,e),Ft(n,2),ia(n));break}}t=t.return}}function uc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new g0;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(a)||(ec=!0,o.add(a),e=v0.bind(null,e,t,a),t.then(e,e))}function v0(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ge===e&&(Re&a)===a&&(Qe===4||Qe===3&&(Re&62914560)===Re&&300>De()-nc?(Ue&2)===0&&fs(e,0):tc|=a,cs===Re&&(cs=0)),ia(e)}function Sm(e,t){t===0&&(t=Yt()),e=Xn(e,t),e!==null&&(Ft(e,t),ia(e))}function w0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Sm(e,a)}function S0(e,t){var a=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(t),Sm(e,a)}function j0(e,t){return Fe(e,t)}var Gl=null,hs=null,dc=!1,Kl=!1,fc=!1,An=0;function ia(e){e!==hs&&e.next===null&&(hs===null?Gl=hs=e:hs=hs.next=e),Kl=!0,dc||(dc=!0,C0())}function gr(e,t){if(!fc&&Kl){fc=!0;do for(var a=!1,n=Gl;n!==null;){if(e!==0){var o=n.pendingLanes;if(o===0)var u=0;else{var x=n.suspendedLanes,b=n.pingedLanes;u=(1<<31-mt(42|e)+1)-1,u&=o&~(x&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Em(n,u))}else u=Re,u=dn(n,n===Ge?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||ce(n,u)||(a=!0,Em(n,u));n=n.next}while(a);fc=!1}}function N0(){jm()}function jm(){Kl=dc=!1;var e=0;An!==0&&(z0()&&(e=An),An=0);for(var t=De(),a=null,n=Gl;n!==null;){var o=n.next,u=Nm(n,t);u===0?(n.next=null,a===null?Gl=o:a.next=o,o===null&&(hs=a)):(a=n,(e!==0||(u&3)!==0)&&(Kl=!0)),n=o}gr(e)}function Nm(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var x=31-mt(u),b=1<<x,k=o[x];k===-1?((b&a)===0||(b&n)!==0)&&(o[x]=ie(b,t)):k<=t&&(e.expiredLanes|=b),u&=~b}if(t=Ge,a=Re,a=dn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&da(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ce(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&da(n),zn(a)){case 2:case 8:a=za;break;case 32:a=fa;break;case 268435456:a=Os;break;default:a=fa}return n=Cm.bind(null,e),a=Fe(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&da(n),e.callbackPriority=2,e.callbackNode=null,2}function Cm(e,t){if(ut!==0&&ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Vl()&&e.callbackNode!==a)return null;var n=Re;return n=dn(e,e===Ge?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(im(e,n,t),Nm(e,De()),e.callbackNode!=null&&e.callbackNode===a?Cm.bind(null,e):null)}function Em(e,t){if(Vl())return null;im(e,t,!0)}function C0(){U0(function(){(Ue&6)!==0?Fe(Ma,N0):jm()})}function mc(){return An===0&&(An=ge()),An}function Tm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:el(""+e)}function km(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function E0(e,t,a,n,o){if(t==="submit"&&a&&a.stateNode===o){var u=Tm((o[xt]||null).action),x=n.submitter;x&&(t=(t=x[xt]||null)?Tm(t.formAction):x.getAttribute("formAction"),t!==null&&(u=t,x=null));var b=new sl("action","action",null,n,o);e.push({event:b,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(An!==0){var k=x?km(o,x):new FormData(o);zo(a,{pending:!0,data:k,method:o.method,action:u},null,k)}}else typeof u=="function"&&(b.preventDefault(),k=x?km(o,x):new FormData(o),zo(a,{pending:!0,data:k,method:o.method,action:u},u,k))},currentTarget:o}]})}}for(var hc=0;hc<Ji.length;hc++){var gc=Ji[hc],T0=gc.toLowerCase(),k0=gc[0].toUpperCase()+gc.slice(1);Qt(T0,"on"+k0)}Qt(ld,"onAnimationEnd"),Qt(id,"onAnimationIteration"),Qt(od,"onAnimationStart"),Qt("dblclick","onDoubleClick"),Qt("focusin","onFocus"),Qt("focusout","onBlur"),Qt(Yp,"onTransitionRun"),Qt(Pp,"onTransitionStart"),Qt(Fp,"onTransitionCancel"),Qt(cd,"onTransitionEnd"),Hn("onMouseEnter",["mouseout","mouseover"]),Hn("onMouseLeave",["mouseout","mouseover"]),Hn("onPointerEnter",["pointerout","pointerover"]),Hn("onPointerLeave",["pointerout","pointerover"]),mn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),mn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),mn("onBeforeInput",["compositionend","keypress","textInput","paste"]),mn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),mn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),mn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pr="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(" "),A0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pr));function Am(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],o=n.event;n=n.listeners;e:{var u=void 0;if(t)for(var x=n.length-1;0<=x;x--){var b=n[x],k=b.instance,V=b.currentTarget;if(b=b.listener,k!==u&&o.isPropagationStopped())break e;u=b,o.currentTarget=V;try{u(o)}catch(J){Rl(J)}o.currentTarget=null,u=k}else for(x=0;x<n.length;x++){if(b=n[x],k=b.instance,V=b.currentTarget,b=b.listener,k!==u&&o.isPropagationStopped())break e;u=b,o.currentTarget=V;try{u(o)}catch(J){Rl(J)}o.currentTarget=null,u=k}}}}function Ae(e,t){var a=t[Ti];a===void 0&&(a=t[Ti]=new Set);var n=e+"__bubble";a.has(n)||(Rm(t,e,2,!1),a.add(n))}function pc(e,t,a){var n=0;t&&(n|=4),Rm(a,e,n,t)}var $l="_reactListening"+Math.random().toString(36).slice(2);function xc(e){if(!e[$l]){e[$l]=!0,Su.forEach(function(a){a!=="selectionchange"&&(A0.has(a)||pc(a,!1,e),pc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$l]||(t[$l]=!0,pc("selectionchange",!1,t))}}function Rm(e,t,a,n){switch(eh(t)){case 2:var o=ax;break;case 8:o=nx;break;default:o=Oc}a=o.bind(null,t,a,e),o=void 0,!Hi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function yc(e,t,a,n,o){var u=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var x=n.tag;if(x===3||x===4){var b=n.stateNode.containerInfo;if(b===o)break;if(x===4)for(x=n.return;x!==null;){var k=x.tag;if((k===3||k===4)&&x.stateNode.containerInfo===o)return;x=x.return}for(;b!==null;){if(x=Un(b),x===null)return;if(k=x.tag,k===5||k===6||k===26||k===27){n=u=x;continue e}b=b.parentNode}}n=n.return}Lu(function(){var V=u,J=Li(a),ae=[];e:{var K=ud.get(e);if(K!==void 0){var Y=sl,ye=e;switch(e){case"keypress":if(al(a)===0)break e;case"keydown":case"keyup":Y=jp;break;case"focusin":ye="focus",Y=Gi;break;case"focusout":ye="blur",Y=Gi;break;case"beforeblur":case"afterblur":Y=Gi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Bu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=dp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Ep;break;case ld:case id:case od:Y=hp;break;case cd:Y=kp;break;case"scroll":case"scrollend":Y=cp;break;case"wheel":Y=Rp;break;case"copy":case"cut":case"paste":Y=pp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Vu;break;case"toggle":case"beforetoggle":Y=Mp}var pe=(t&4)!==0,Be=!pe&&(e==="scroll"||e==="scrollend"),H=pe?K!==null?K+"Capture":null:K;pe=[];for(var z=V,q;z!==null;){var te=z;if(q=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||q===null||H===null||(te=Us(z,H),te!=null&&pe.push(xr(z,te,q))),Be)break;z=z.return}0<pe.length&&(K=new Y(K,ye,null,a,J),ae.push({event:K,listeners:pe}))}}if((t&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",K&&a!==Ui&&(ye=a.relatedTarget||a.fromElement)&&(Un(ye)||ye[Dn]))break e;if((Y||K)&&(K=J.window===J?J:(K=J.ownerDocument)?K.defaultView||K.parentWindow:window,Y?(ye=a.relatedTarget||a.toElement,Y=V,ye=ye?Un(ye):null,ye!==null&&(Be=f(ye),pe=ye.tag,ye!==Be||pe!==5&&pe!==27&&pe!==6)&&(ye=null)):(Y=null,ye=V),Y!==ye)){if(pe=Bu,te="onMouseLeave",H="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(pe=Vu,te="onPointerLeave",H="onPointerEnter",z="pointer"),Be=Y==null?K:Ds(Y),q=ye==null?K:Ds(ye),K=new pe(te,z+"leave",Y,a,J),K.target=Be,K.relatedTarget=q,te=null,Un(J)===V&&(pe=new pe(H,z+"enter",ye,a,J),pe.target=q,pe.relatedTarget=Be,te=pe),Be=te,Y&&ye)t:{for(pe=Y,H=ye,z=0,q=pe;q;q=gs(q))z++;for(q=0,te=H;te;te=gs(te))q++;for(;0<z-q;)pe=gs(pe),z--;for(;0<q-z;)H=gs(H),q--;for(;z--;){if(pe===H||H!==null&&pe===H.alternate)break t;pe=gs(pe),H=gs(H)}pe=null}else pe=null;Y!==null&&Om(ae,K,Y,pe,!1),ye!==null&&Be!==null&&Om(ae,Be,ye,pe,!0)}}e:{if(K=V?Ds(V):window,Y=K.nodeName&&K.nodeName.toLowerCase(),Y==="select"||Y==="input"&&K.type==="file")var de=Qu;else if(Fu(K))if(Zu)de=Gp;else{de=qp;var Te=Bp}else Y=K.nodeName,!Y||Y.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?V&&Di(V.elementType)&&(de=Qu):de=Vp;if(de&&(de=de(e,V))){Xu(ae,de,a,J);break e}Te&&Te(e,K,V),e==="focusout"&&V&&K.type==="number"&&V.memoizedProps.value!=null&&zi(K,"number",K.value)}switch(Te=V?Ds(V):window,e){case"focusin":(Fu(Te)||Te.contentEditable==="true")&&(Yn=Te,Xi=V,Ks=null);break;case"focusout":Ks=Xi=Yn=null;break;case"mousedown":Qi=!0;break;case"contextmenu":case"mouseup":case"dragend":Qi=!1,sd(ae,a,J);break;case"selectionchange":if($p)break;case"keydown":case"keyup":sd(ae,a,J)}var he;if($i)e:{switch(e){case"compositionstart":var xe="onCompositionStart";break e;case"compositionend":xe="onCompositionEnd";break e;case"compositionupdate":xe="onCompositionUpdate";break e}xe=void 0}else $n?Yu(e,a)&&(xe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(xe="onCompositionStart");xe&&(Gu&&a.locale!=="ko"&&($n||xe!=="onCompositionStart"?xe==="onCompositionEnd"&&$n&&(he=_u()):(La=J,Bi="value"in La?La.value:La.textContent,$n=!0)),Te=Yl(V,xe),0<Te.length&&(xe=new qu(xe,e,null,a,J),ae.push({event:xe,listeners:Te}),he?xe.data=he:(he=Pu(a),he!==null&&(xe.data=he)))),(he=Dp?Up(e,a):Lp(e,a))&&(xe=Yl(V,"onBeforeInput"),0<xe.length&&(Te=new qu("onBeforeInput","beforeinput",null,a,J),ae.push({event:Te,listeners:xe}),Te.data=he)),E0(ae,e,V,a,J)}Am(ae,t)})}function xr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Yl(e,t){for(var a=t+"Capture",n=[];e!==null;){var o=e,u=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||u===null||(o=Us(e,a),o!=null&&n.unshift(xr(e,o,u)),o=Us(e,t),o!=null&&n.push(xr(e,o,u))),e.tag===3)return n;e=e.return}return[]}function gs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Om(e,t,a,n,o){for(var u=t._reactName,x=[];a!==null&&a!==n;){var b=a,k=b.alternate,V=b.stateNode;if(b=b.tag,k!==null&&k===n)break;b!==5&&b!==26&&b!==27||V===null||(k=V,o?(V=Us(a,u),V!=null&&x.unshift(xr(a,V,k))):o||(V=Us(a,u),V!=null&&x.push(xr(a,V,k)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var R0=/\r\n?/g,O0=/\u0000|\uFFFD/g;function Mm(e){return(typeof e=="string"?e:""+e).replace(R0,`
49
+ `).replace(O0,"")}function zm(e,t){return t=Mm(t),Mm(e)===t}function Pl(){}function He(e,t,a,n,o,u){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Vn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Vn(e,""+n);break;case"className":Jr(e,"class",n);break;case"tabIndex":Jr(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Jr(e,a,n);break;case"style":Du(e,n,u);break;case"data":if(t!=="object"){Jr(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=el(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(a==="formAction"?(t!=="input"&&He(e,t,"name",o.name,o,null),He(e,t,"formEncType",o.formEncType,o,null),He(e,t,"formMethod",o.formMethod,o,null),He(e,t,"formTarget",o.formTarget,o,null)):(He(e,t,"encType",o.encType,o,null),He(e,t,"method",o.method,o,null),He(e,t,"target",o.target,o,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=el(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Pl);break;case"onScroll":n!=null&&Ae("scroll",e);break;case"onScrollEnd":n!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=el(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),Zr(e,"popover",n);break;case"xlinkActuate":ma(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ma(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ma(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ma(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ma(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ma(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ma(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ma(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ma(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Zr(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ip.get(a)||a,Zr(e,a,n))}}function bc(e,t,a,n,o,u){switch(a){case"style":Du(e,n,u);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Vn(e,n):(typeof n=="number"||typeof n=="bigint")&&Vn(e,""+n);break;case"onScroll":n!=null&&Ae("scroll",e);break;case"onScrollEnd":n!=null&&Ae("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Pl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ju.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(o=a.endsWith("Capture"),t=a.slice(2,o?a.length-7:void 0),u=e[xt]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,o),typeof n=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,o);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Zr(e,a,n)}}}function dt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var n=!1,o=!1,u;for(u in a)if(a.hasOwnProperty(u)){var x=a[u];if(x!=null)switch(u){case"src":n=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:He(e,t,u,x,a,null)}}o&&He(e,t,"srcSet",a.srcSet,a,null),n&&He(e,t,"src",a.src,a,null);return;case"input":Ae("invalid",e);var b=u=x=o=null,k=null,V=null;for(n in a)if(a.hasOwnProperty(n)){var J=a[n];if(J!=null)switch(n){case"name":o=J;break;case"type":x=J;break;case"checked":k=J;break;case"defaultChecked":V=J;break;case"value":u=J;break;case"defaultValue":b=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(c(137,t));break;default:He(e,t,n,J,a,null)}}Ru(e,u,b,k,V,x,o,!1),Ir(e);return;case"select":Ae("invalid",e),n=x=u=null;for(o in a)if(a.hasOwnProperty(o)&&(b=a[o],b!=null))switch(o){case"value":u=b;break;case"defaultValue":x=b;break;case"multiple":n=b;default:He(e,t,o,b,a,null)}t=u,a=x,e.multiple=!!n,t!=null?qn(e,!!n,t,!1):a!=null&&qn(e,!!n,a,!0);return;case"textarea":Ae("invalid",e),u=o=n=null;for(x in a)if(a.hasOwnProperty(x)&&(b=a[x],b!=null))switch(x){case"value":n=b;break;case"defaultValue":o=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(c(91));break;default:He(e,t,x,b,a,null)}Mu(e,n,o,u),Ir(e);return;case"option":for(k in a)if(a.hasOwnProperty(k)&&(n=a[k],n!=null))switch(k){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:He(e,t,k,n,a,null)}return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(n=0;n<pr.length;n++)Ae(pr[n],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("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(V in a)if(a.hasOwnProperty(V)&&(n=a[V],n!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:He(e,t,V,n,a,null)}return;default:if(Di(t)){for(J in a)a.hasOwnProperty(J)&&(n=a[J],n!==void 0&&bc(e,t,J,n,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(n=a[b],n!=null&&He(e,t,b,n,a,null))}function M0(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,u=null,x=null,b=null,k=null,V=null,J=null;for(Y in a){var ae=a[Y];if(a.hasOwnProperty(Y)&&ae!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":k=ae;default:n.hasOwnProperty(Y)||He(e,t,Y,null,n,ae)}}for(var K in n){var Y=n[K];if(ae=a[K],n.hasOwnProperty(K)&&(Y!=null||ae!=null))switch(K){case"type":u=Y;break;case"name":o=Y;break;case"checked":V=Y;break;case"defaultChecked":J=Y;break;case"value":x=Y;break;case"defaultValue":b=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(c(137,t));break;default:Y!==ae&&He(e,t,K,Y,n,ae)}}Mi(e,x,b,k,V,J,u,o);return;case"select":Y=x=b=K=null;for(u in a)if(k=a[u],a.hasOwnProperty(u)&&k!=null)switch(u){case"value":break;case"multiple":Y=k;default:n.hasOwnProperty(u)||He(e,t,u,null,n,k)}for(o in n)if(u=n[o],k=a[o],n.hasOwnProperty(o)&&(u!=null||k!=null))switch(o){case"value":K=u;break;case"defaultValue":b=u;break;case"multiple":x=u;default:u!==k&&He(e,t,o,u,n,k)}t=b,a=x,n=Y,K!=null?qn(e,!!a,K,!1):!!n!=!!a&&(t!=null?qn(e,!!a,t,!0):qn(e,!!a,a?[]:"",!1));return;case"textarea":Y=K=null;for(b in a)if(o=a[b],a.hasOwnProperty(b)&&o!=null&&!n.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:He(e,t,b,null,n,o)}for(x in n)if(o=n[x],u=a[x],n.hasOwnProperty(x)&&(o!=null||u!=null))switch(x){case"value":K=o;break;case"defaultValue":Y=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==u&&He(e,t,x,o,n,u)}Ou(e,K,Y);return;case"option":for(var ye in a)if(K=a[ye],a.hasOwnProperty(ye)&&K!=null&&!n.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:He(e,t,ye,null,n,K)}for(k in n)if(K=n[k],Y=a[k],n.hasOwnProperty(k)&&K!==Y&&(K!=null||Y!=null))switch(k){case"selected":e.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:He(e,t,k,K,n,Y)}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 pe in a)K=a[pe],a.hasOwnProperty(pe)&&K!=null&&!n.hasOwnProperty(pe)&&He(e,t,pe,null,n,K);for(V in n)if(K=n[V],Y=a[V],n.hasOwnProperty(V)&&K!==Y&&(K!=null||Y!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(c(137,t));break;default:He(e,t,V,K,n,Y)}return;default:if(Di(t)){for(var Be in a)K=a[Be],a.hasOwnProperty(Be)&&K!==void 0&&!n.hasOwnProperty(Be)&&bc(e,t,Be,void 0,n,K);for(J in n)K=n[J],Y=a[J],!n.hasOwnProperty(J)||K===Y||K===void 0&&Y===void 0||bc(e,t,J,K,n,Y);return}}for(var H in a)K=a[H],a.hasOwnProperty(H)&&K!=null&&!n.hasOwnProperty(H)&&He(e,t,H,null,n,K);for(ae in n)K=n[ae],Y=a[ae],!n.hasOwnProperty(ae)||K===Y||K==null&&Y==null||He(e,t,ae,K,n,Y)}var vc=null,wc=null;function Fl(e){return e.nodeType===9?e:e.ownerDocument}function Dm(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 Um(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 Sc(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 jc=null;function z0(){var e=window.event;return e&&e.type==="popstate"?e===jc?!1:(jc=e,!0):(jc=null,!1)}var Lm=typeof setTimeout=="function"?setTimeout:void 0,D0=typeof clearTimeout=="function"?clearTimeout:void 0,_m=typeof Promise=="function"?Promise:void 0,U0=typeof queueMicrotask=="function"?queueMicrotask:typeof _m<"u"?function(e){return _m.resolve(null).then(e).catch(L0)}:Lm;function L0(e){setTimeout(function(){throw e})}function Ia(e){return e==="head"}function Hm(e,t){var a=t,n=0,o=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(0<n&&8>n){a=n;var x=e.ownerDocument;if(a&1&&yr(x.documentElement),a&2&&yr(x.body),a&4)for(a=x.head,yr(a),x=a.firstChild;x;){var b=x.nextSibling,k=x.nodeName;x[zs]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&x.rel.toLowerCase()==="stylesheet"||a.removeChild(x),x=b}}if(o===0){e.removeChild(u),Er(t);return}o--}else a==="$"||a==="$?"||a==="$!"?o++:n=a.charCodeAt(0)-48;else n=0;a=u}while(a);Er(t)}function Nc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Nc(a),ki(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function _0(e,t,a,n){for(;e.nodeType===1;){var o=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[zs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Jt(e.nextSibling),e===null)break}return null}function H0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Jt(e.nextSibling),e===null))return null;return e}function Cc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function B0(e,t){var a=e.ownerDocument;if(e.data!=="$?"||a.readyState==="complete")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Jt(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==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Ec=null;function Bm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}function qm(e,t,a){switch(t=Fl(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function yr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ki(e)}var Gt=new Map,Vm=new Set;function Xl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ta=G.d;G.d={f:q0,r:V0,D:G0,C:K0,L:$0,m:Y0,X:F0,S:P0,M:X0};function q0(){var e=Ta.f(),t=Bl();return e||t}function V0(e){var t=Ln(e);t!==null&&t.tag===5&&t.type==="form"?lf(t):Ta.r(e)}var ps=typeof document>"u"?null:document;function Gm(e,t,a){var n=ps;if(n&&typeof t=="string"&&t){var o=Ut(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Vm.has(o)||(Vm.add(o),e={rel:e,crossOrigin:a,href:t},n.querySelector(o)===null&&(t=n.createElement("link"),dt(t,"link",e),rt(t),n.head.appendChild(t)))}}function G0(e){Ta.D(e),Gm("dns-prefetch",e,null)}function K0(e,t){Ta.C(e,t),Gm("preconnect",e,t)}function $0(e,t,a){Ta.L(e,t,a);var n=ps;if(n&&e&&t){var o='link[rel="preload"][as="'+Ut(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+Ut(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+Ut(a.imageSizes)+'"]')):o+='[href="'+Ut(e)+'"]';var u=o;switch(t){case"style":u=xs(e);break;case"script":u=ys(e)}Gt.has(u)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Gt.set(u,e),n.querySelector(o)!==null||t==="style"&&n.querySelector(br(u))||t==="script"&&n.querySelector(vr(u))||(t=n.createElement("link"),dt(t,"link",e),rt(t),n.head.appendChild(t)))}}function Y0(e,t){Ta.m(e,t);var a=ps;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Ut(n)+'"][href="'+Ut(e)+'"]',u=o;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ys(e)}if(!Gt.has(u)&&(e=y({rel:"modulepreload",href:e},t),Gt.set(u,e),a.querySelector(o)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(vr(u)))return}n=a.createElement("link"),dt(n,"link",e),rt(n),a.head.appendChild(n)}}}function P0(e,t,a){Ta.S(e,t,a);var n=ps;if(n&&e){var o=_n(n).hoistableStyles,u=xs(e);t=t||"default";var x=o.get(u);if(!x){var b={loading:0,preload:null};if(x=n.querySelector(br(u)))b.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Gt.get(u))&&Tc(e,a);var k=x=n.createElement("link");rt(k),dt(k,"link",e),k._p=new Promise(function(V,J){k.onload=V,k.onerror=J}),k.addEventListener("load",function(){b.loading|=1}),k.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Ql(x,t,n)}x={type:"stylesheet",instance:x,count:1,state:b},o.set(u,x)}}}function F0(e,t){Ta.X(e,t);var a=ps;if(a&&e){var n=_n(a).hoistableScripts,o=ys(e),u=n.get(o);u||(u=a.querySelector(vr(o)),u||(e=y({src:e,async:!0},t),(t=Gt.get(o))&&kc(e,t),u=a.createElement("script"),rt(u),dt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(o,u))}}function X0(e,t){Ta.M(e,t);var a=ps;if(a&&e){var n=_n(a).hoistableScripts,o=ys(e),u=n.get(o);u||(u=a.querySelector(vr(o)),u||(e=y({src:e,async:!0,type:"module"},t),(t=Gt.get(o))&&kc(e,t),u=a.createElement("script"),rt(u),dt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(o,u))}}function Km(e,t,a,n){var o=(o=I.current)?Xl(o):null;if(!o)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=xs(a.href),a=_n(o).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=xs(a.href);var u=_n(o).hoistableStyles,x=u.get(e);if(x||(o=o.ownerDocument||o,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,x),(u=o.querySelector(br(e)))&&!u._p&&(x.instance=u,x.state.loading=5),Gt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Gt.set(e,a),u||Q0(o,e,a,x.state))),t&&n===null)throw Error(c(528,""));return x}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ys(a),a=_n(o).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function xs(e){return'href="'+Ut(e)+'"'}function br(e){return'link[rel="stylesheet"]['+e+"]"}function $m(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Q0(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),dt(t,"link",a),rt(t),e.head.appendChild(t))}function ys(e){return'[src="'+Ut(e)+'"]'}function vr(e){return"script[async]"+e}function Ym(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Ut(a.href)+'"]');if(n)return t.instance=n,rt(n),n;var o=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),rt(n),dt(n,"style",o),Ql(n,a.precedence,e),t.instance=n;case"stylesheet":o=xs(a.href);var u=e.querySelector(br(o));if(u)return t.state.loading|=4,t.instance=u,rt(u),u;n=$m(a),(o=Gt.get(o))&&Tc(n,o),u=(e.ownerDocument||e).createElement("link"),rt(u);var x=u;return x._p=new Promise(function(b,k){x.onload=b,x.onerror=k}),dt(u,"link",n),t.state.loading|=4,Ql(u,a.precedence,e),t.instance=u;case"script":return u=ys(a.src),(o=e.querySelector(vr(u)))?(t.instance=o,rt(o),o):(n=a,(o=Gt.get(u))&&(n=y({},a),kc(n,o)),e=e.ownerDocument||e,o=e.createElement("script"),rt(o),dt(o,"link",n),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Ql(n,a.precedence,e));return t.instance}function Ql(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=n.length?n[n.length-1]:null,u=o,x=0;x<n.length;x++){var b=n[x];if(b.dataset.precedence===t)u=b;else if(u!==o)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Tc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function kc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zl=null;function Pm(e,t,a){if(Zl===null){var n=new Map,o=Zl=new Map;o.set(a,n)}else o=Zl,n=o.get(a),n||(n=new Map,o.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),o=0;o<a.length;o++){var u=a[o];if(!(u[zs]||u[tt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var x=u.getAttribute(t)||"";x=e+x;var b=n.get(x);b?b.push(u):n.set(x,[u])}}return n}function Fm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Z0(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Xm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var wr=null;function J0(){}function I0(e,t,a){if(wr===null)throw Error(c(475));var n=wr;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var o=xs(a.href),u=e.querySelector(br(o));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=Jl.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=u,rt(u);return}u=e.ownerDocument||e,a=$m(a),(o=Gt.get(o))&&Tc(a,o),u=u.createElement("link"),rt(u);var x=u;x._p=new Promise(function(b,k){x.onload=b,x.onerror=k}),dt(u,"link",a),t.instance=u}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(n.count++,t=Jl.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}function W0(){if(wr===null)throw Error(c(475));var e=wr;return e.stylesheets&&e.count===0&&Ac(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function Jl(){if(this.count--,this.count===0){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Il=null;function Ac(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Il=new Map,t.forEach(ex,e),Il=null,Jl.call(e))}function ex(e,t){if(!(t.state.loading&4)){var a=Il.get(e);if(a)var n=a.get(null);else{a=new Map,Il.set(e,a);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<o.length;u++){var x=o[u];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),n=x)}n&&a.set(null,n)}o=t.instance,x=o.getAttribute("data-precedence"),u=a.get(x)||n,u===n&&a.set(null,o),a.set(x,o),this.count++,n=Jl.bind(this),o.addEventListener("load",n),o.addEventListener("error",n),u?u.parentNode.insertBefore(o,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Sr={$$typeof:O,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function tx(e,t,a,n,o,u,x,b){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pt(0),this.hiddenUpdates=Pt(null),this.identifierPrefix=n,this.onUncaughtError=o,this.onCaughtError=u,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function Qm(e,t,a,n,o,u,x,b,k,V,J,ae){return e=new tx(e,t,a,x,b,k,V,ae),t=1,u===!0&&(t|=24),u=Tt(3,null,null,t),e.current=u,u.stateNode=e,t=co(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:n,isDehydrated:a,cache:t},ho(u),e}function Zm(e){return e?(e=Qn,e):Qn}function Jm(e,t,a,n,o,u){o=Zm(o),n.context===null?n.context=o:n.pendingContext=o,n=Ba(t),n.payload={element:a},u=u===void 0?null:u,u!==null&&(n.callback=u),a=qa(e,n,t),a!==null&&(Mt(a,e,t),Is(a,e,t))}function Im(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Rc(e,t){Im(e,t),(e=e.alternate)&&Im(e,t)}function Wm(e){if(e.tag===13){var t=Xn(e,67108864);t!==null&&Mt(t,e,67108864),Rc(e,67108864)}}var Wl=!0;function ax(e,t,a,n){var o=E.T;E.T=null;var u=G.p;try{G.p=2,Oc(e,t,a,n)}finally{G.p=u,E.T=o}}function nx(e,t,a,n){var o=E.T;E.T=null;var u=G.p;try{G.p=8,Oc(e,t,a,n)}finally{G.p=u,E.T=o}}function Oc(e,t,a,n){if(Wl){var o=Mc(n);if(o===null)yc(e,t,n,ei,a),th(e,n);else if(rx(o,e,t,a,n))n.stopPropagation();else if(th(e,n),t&4&&-1<sx.indexOf(e)){for(;o!==null;){var u=Ln(o);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var x=ta(u.pendingLanes);if(x!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;x;){var k=1<<31-mt(x);b.entanglements[1]|=k,x&=~k}ia(u),(Ue&6)===0&&(_l=De()+500,gr(0))}}break;case 13:b=Xn(u,2),b!==null&&Mt(b,u,2),Bl(),Rc(u,2)}if(u=Mc(n),u===null&&yc(e,t,n,ei,a),u===o)break;o=u}o!==null&&n.stopPropagation()}else yc(e,t,n,null,a)}}function Mc(e){return e=Li(e),zc(e)}var ei=null;function zc(e){if(ei=null,e=Un(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ei=e,null}function eh(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(vt()){case Ma:return 2;case za:return 8;case fa:case Da:return 32;case Os:return 268435456;default:return 32}default:return 32}}var Dc=!1,Wa=null,en=null,tn=null,jr=new Map,Nr=new Map,an=[],sx="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 th(e,t){switch(e){case"focusin":case"focusout":Wa=null;break;case"dragenter":case"dragleave":en=null;break;case"mouseover":case"mouseout":tn=null;break;case"pointerover":case"pointerout":jr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nr.delete(t.pointerId)}}function Cr(e,t,a,n,o,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:u,targetContainers:[o]},t!==null&&(t=Ln(t),t!==null&&Wm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function rx(e,t,a,n,o){switch(t){case"focusin":return Wa=Cr(Wa,e,t,a,n,o),!0;case"dragenter":return en=Cr(en,e,t,a,n,o),!0;case"mouseover":return tn=Cr(tn,e,t,a,n,o),!0;case"pointerover":var u=o.pointerId;return jr.set(u,Cr(jr.get(u)||null,e,t,a,n,o)),!0;case"gotpointercapture":return u=o.pointerId,Nr.set(u,Cr(Nr.get(u)||null,e,t,a,n,o)),!0}return!1}function ah(e){var t=Un(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,Qr(e.priority,function(){if(a.tag===13){var n=Ot();n=aa(n);var o=Xn(a,n);o!==null&&Mt(o,a,n),Rc(a,n)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ti(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Mc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Ui=n,a.target.dispatchEvent(n),Ui=null}else return t=Ln(a),t!==null&&Wm(t),e.blockedOn=a,!1;t.shift()}return!0}function nh(e,t,a){ti(e)&&a.delete(t)}function lx(){Dc=!1,Wa!==null&&ti(Wa)&&(Wa=null),en!==null&&ti(en)&&(en=null),tn!==null&&ti(tn)&&(tn=null),jr.forEach(nh),Nr.forEach(nh)}function ai(e,t){e.blockedOn===t&&(e.blockedOn=null,Dc||(Dc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,lx)))}var ni=null;function sh(e){ni!==e&&(ni=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){ni===e&&(ni=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],o=e[t+2];if(typeof n!="function"){if(zc(n||a)===null)continue;break}var u=Ln(a);u!==null&&(e.splice(t,3),t-=3,zo(u,{pending:!0,data:o,method:a.method,action:n},n,o))}}))}function Er(e){function t(k){return ai(k,e)}Wa!==null&&ai(Wa,e),en!==null&&ai(en,e),tn!==null&&ai(tn,e),jr.forEach(t),Nr.forEach(t);for(var a=0;a<an.length;a++){var n=an[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<an.length&&(a=an[0],a.blockedOn===null);)ah(a),a.blockedOn===null&&an.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var o=a[n],u=a[n+1],x=o[xt]||null;if(typeof u=="function")x||sh(a);else if(x){var b=null;if(u&&u.hasAttribute("formAction")){if(o=u,x=u[xt]||null)b=x.formAction;else if(zc(o)!==null)continue}else b=x.action;typeof b=="function"?a[n+1]=b:(a.splice(n,3),n-=3),sh(a)}}}function Uc(e){this._internalRoot=e}si.prototype.render=Uc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=Ot();Jm(a,n,e,t,null,null)},si.prototype.unmount=Uc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jm(e.current,2,null,e,null,null),Bl(),t[Dn]=null}};function si(e){this._internalRoot=e}si.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ms();e={blockedOn:null,target:e,priority:t};for(var a=0;a<an.length&&t!==0&&t<an[a].priority;a++);an.splice(a,0,e),a===0&&ah(e)}};var rh=i.version;if(rh!=="19.1.0")throw Error(c(527,rh,"19.1.0"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=g(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var ix={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ri=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ri.isDisabled&&ri.supportsFiber)try{Ua=ri.inject(ix),ft=ri}catch{}}return kr.createRoot=function(e,t){if(!d(e))throw Error(c(299));var a=!1,n="",o=wf,u=Sf,x=jf,b=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(b=t.unstable_transitionCallbacks)),t=Qm(e,1,!1,null,null,a,n,o,u,x,b,null),e[Dn]=t.current,xc(e),new Uc(t)},kr.hydrateRoot=function(e,t,a){if(!d(e))throw Error(c(299));var n=!1,o="",u=wf,x=Sf,b=jf,k=null,V=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(k=a.unstable_transitionCallbacks),a.formState!==void 0&&(V=a.formState)),t=Qm(e,1,!0,t,a??null,n,o,u,x,b,k,V),t.context=Zm(null),a=t.current,n=Ot(),n=aa(n),o=Ba(n),o.callback=null,qa(a,o,n),a=n,t.current.lanes=a,Ft(t,a),ia(t),e[Dn]=t.current,xc(e),new si(t)},kr.version="19.1.0",kr}var gh;function xx(){if(gh)return Hc.exports;gh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(i){console.error(i)}}return s(),Hc.exports=px(),Hc.exports}var yx=xx();const ph=Zh(yx);var Ar={},xh;function bx(){if(xh)return Ar;xh=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.parse=m,Ar.serialize=h;const s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,l=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,c=/^[\u0020-\u003A\u003D-\u007E]*$/,d=Object.prototype.toString,f=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function m(v,A){const N=new f,M=v.length;if(M<2)return N;const R=(A==null?void 0:A.decode)||y;let j=0;do{const C=v.indexOf("=",j);if(C===-1)break;const O=v.indexOf(";",j),F=O===-1?M:O;if(C>F){j=v.lastIndexOf(";",C-1)+1;continue}const D=p(v,j,C),ee=g(v,C,D),Q=v.slice(D,ee);if(N[Q]===void 0){let B=p(v,C+1,F),W=g(v,F,B);const le=R(v.slice(B,W));N[Q]=le}j=F+1}while(j<M);return N}function p(v,A,N){do{const M=v.charCodeAt(A);if(M!==32&&M!==9)return A}while(++A<N);return N}function g(v,A,N){for(;A>N;){const M=v.charCodeAt(--A);if(M!==32&&M!==9)return A+1}return N}function h(v,A,N){const M=(N==null?void 0:N.encode)||encodeURIComponent;if(!s.test(v))throw new TypeError(`argument name is invalid: ${v}`);const R=M(A);if(!i.test(R))throw new TypeError(`argument val is invalid: ${A}`);let j=v+"="+R;if(!N)return j;if(N.maxAge!==void 0){if(!Number.isInteger(N.maxAge))throw new TypeError(`option maxAge is invalid: ${N.maxAge}`);j+="; Max-Age="+N.maxAge}if(N.domain){if(!l.test(N.domain))throw new TypeError(`option domain is invalid: ${N.domain}`);j+="; Domain="+N.domain}if(N.path){if(!c.test(N.path))throw new TypeError(`option path is invalid: ${N.path}`);j+="; Path="+N.path}if(N.expires){if(!S(N.expires)||!Number.isFinite(N.expires.valueOf()))throw new TypeError(`option expires is invalid: ${N.expires}`);j+="; Expires="+N.expires.toUTCString()}if(N.httpOnly&&(j+="; HttpOnly"),N.secure&&(j+="; Secure"),N.partitioned&&(j+="; Partitioned"),N.priority)switch(typeof N.priority=="string"?N.priority.toLowerCase():void 0){case"low":j+="; Priority=Low";break;case"medium":j+="; Priority=Medium";break;case"high":j+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${N.priority}`)}if(N.sameSite)switch(typeof N.sameSite=="string"?N.sameSite.toLowerCase():N.sameSite){case!0:case"strict":j+="; SameSite=Strict";break;case"lax":j+="; SameSite=Lax";break;case"none":j+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${N.sameSite}`)}return j}function y(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function S(v){return d.call(v)==="[object Date]"}return Ar}bx();var yh="popstate";function vx(s={}){function i(c,d){let{pathname:f,search:m,hash:p}=c.location;return Qc("",{pathname:f,search:m,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function l(c,d){return typeof d=="string"?d:Dr(d)}return Sx(i,l,null,s)}function Ye(s,i){if(s===!1||s===null||typeof s>"u")throw new Error(i)}function It(s,i){if(!s){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function wx(){return Math.random().toString(36).substring(2,10)}function bh(s,i){return{usr:s.state,key:s.key,idx:i}}function Qc(s,i,l=null,c){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof i=="string"?Es(i):i,state:l,key:i&&i.key||c||wx()}}function Dr({pathname:s="/",search:i="",hash:l=""}){return i&&i!=="?"&&(s+=i.charAt(0)==="?"?i:"?"+i),l&&l!=="#"&&(s+=l.charAt(0)==="#"?l:"#"+l),s}function Es(s){let i={};if(s){let l=s.indexOf("#");l>=0&&(i.hash=s.substring(l),s=s.substring(0,l));let c=s.indexOf("?");c>=0&&(i.search=s.substring(c),s=s.substring(0,c)),s&&(i.pathname=s)}return i}function Sx(s,i,l,c={}){let{window:d=document.defaultView,v5Compat:f=!1}=c,m=d.history,p="POP",g=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function S(){p="POP";let R=y(),j=R==null?null:R-h;h=R,g&&g({action:p,location:M.location,delta:j})}function v(R,j){p="PUSH";let C=Qc(M.location,R,j);h=y()+1;let O=bh(C,h),F=M.createHref(C);try{m.pushState(O,"",F)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;d.location.assign(F)}f&&g&&g({action:p,location:M.location,delta:1})}function A(R,j){p="REPLACE";let C=Qc(M.location,R,j);h=y();let O=bh(C,h),F=M.createHref(C);m.replaceState(O,"",F),f&&g&&g({action:p,location:M.location,delta:0})}function N(R){return jx(R)}let M={get action(){return p},get location(){return s(d,m)},listen(R){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(yh,S),g=R,()=>{d.removeEventListener(yh,S),g=null}},createHref(R){return i(d,R)},createURL:N,encodeLocation(R){let j=N(R);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:v,replace:A,go(R){return m.go(R)}};return M}function jx(s,i=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),Ye(l,"No window.location.(origin|href) available to create URL");let c=typeof s=="string"?s:Dr(s);return c=c.replace(/ $/,"%20"),!i&&c.startsWith("//")&&(c=l+c),new URL(c,l)}function Jh(s,i,l="/"){return Nx(s,i,l,!1)}function Nx(s,i,l,c){let d=typeof i=="string"?Es(i):i,f=Oa(d.pathname||"/",l);if(f==null)return null;let m=Ih(s);Cx(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Lx(f);p=Dx(m[g],h,c)}return p}function Ih(s,i=[],l=[],c=""){let d=(f,m,p)=>{let g={relativePath:p===void 0?f.path||"":p,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};g.relativePath.startsWith("/")&&(Ye(g.relativePath.startsWith(c),`Absolute route path "${g.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(c.length));let h=Aa([c,g.relativePath]),y=l.concat(g);f.children&&f.children.length>0&&(Ye(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Ih(f.children,i,y,h)),!(f.path==null&&!f.index)&&i.push({path:h,score:Mx(h,f.index),routesMeta:y})};return s.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))d(f,m);else for(let g of Wh(f.path))d(f,m,g)}),i}function Wh(s){let i=s.split("/");if(i.length===0)return[];let[l,...c]=i,d=l.endsWith("?"),f=l.replace(/\?$/,"");if(c.length===0)return d?[f,""]:[f];let m=Wh(c.join("/")),p=[];return p.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&p.push(...m),p.map(g=>s.startsWith("/")&&g===""?"/":g)}function Cx(s){s.sort((i,l)=>i.score!==l.score?l.score-i.score:zx(i.routesMeta.map(c=>c.childrenIndex),l.routesMeta.map(c=>c.childrenIndex)))}var Ex=/^:[\w-]+$/,Tx=3,kx=2,Ax=1,Rx=10,Ox=-2,vh=s=>s==="*";function Mx(s,i){let l=s.split("/"),c=l.length;return l.some(vh)&&(c+=Ox),i&&(c+=kx),l.filter(d=>!vh(d)).reduce((d,f)=>d+(Ex.test(f)?Tx:f===""?Ax:Rx),c)}function zx(s,i){return s.length===i.length&&s.slice(0,-1).every((c,d)=>c===i[d])?s[s.length-1]-i[i.length-1]:0}function Dx(s,i,l=!1){let{routesMeta:c}=s,d={},f="/",m=[];for(let p=0;p<c.length;++p){let g=c[p],h=p===c.length-1,y=f==="/"?i:i.slice(f.length)||"/",S=gi({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),v=g.route;if(!S&&h&&l&&!c[c.length-1].route.index&&(S=gi({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!S)return null;Object.assign(d,S.params),m.push({params:d,pathname:Aa([f,S.pathname]),pathnameBase:qx(Aa([f,S.pathnameBase])),route:v}),S.pathnameBase!=="/"&&(f=Aa([f,S.pathnameBase]))}return m}function gi(s,i){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[l,c]=Ux(s.path,s.caseSensitive,s.end),d=i.match(l);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),p=d.slice(1);return{params:c.reduce((h,{paramName:y,isOptional:S},v)=>{if(y==="*"){let N=p[v]||"";m=f.slice(0,f.length-N.length).replace(/(.)\/+$/,"$1")}const A=p[v];return S&&!A?h[y]=void 0:h[y]=(A||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:s}}function Ux(s,i=!1,l=!0){It(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let c=[],d="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g)=>(c.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(c.push({paramName:"*"}),d+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?d+="\\/*$":s!==""&&s!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),c]}function Lx(s){try{return s.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return It(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),s}}function Oa(s,i){if(i==="/")return s;if(!s.toLowerCase().startsWith(i.toLowerCase()))return null;let l=i.endsWith("/")?i.length-1:i.length,c=s.charAt(l);return c&&c!=="/"?null:s.slice(l)||"/"}function _x(s,i="/"){let{pathname:l,search:c="",hash:d=""}=typeof s=="string"?Es(s):s;return{pathname:l?l.startsWith("/")?l:Hx(l,i):i,search:Vx(c),hash:Gx(d)}}function Hx(s,i){let l=i.replace(/\/+$/,"").split("/");return s.split("/").forEach(d=>{d===".."?l.length>1&&l.pop():d!=="."&&l.push(d)}),l.length>1?l.join("/"):"/"}function Gc(s,i,l,c){return`Cannot include a '${s}' character in a manually specified \`to.${i}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Bx(s){return s.filter((i,l)=>l===0||i.route.path&&i.route.path.length>0)}function lu(s){let i=Bx(s);return i.map((l,c)=>c===i.length-1?l.pathname:l.pathnameBase)}function iu(s,i,l,c=!1){let d;typeof s=="string"?d=Es(s):(d={...s},Ye(!d.pathname||!d.pathname.includes("?"),Gc("?","pathname","search",d)),Ye(!d.pathname||!d.pathname.includes("#"),Gc("#","pathname","hash",d)),Ye(!d.search||!d.search.includes("#"),Gc("#","search","hash",d)));let f=s===""||d.pathname==="",m=f?"/":d.pathname,p;if(m==null)p=l;else{let S=i.length-1;if(!c&&m.startsWith("..")){let v=m.split("/");for(;v[0]==="..";)v.shift(),S-=1;d.pathname=v.join("/")}p=S>=0?i[S]:"/"}let g=_x(d,p),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var Aa=s=>s.join("/").replace(/\/\/+/g,"/"),qx=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Vx=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Gx=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function Kx(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}var eg=["POST","PUT","PATCH","DELETE"];new Set(eg);var $x=["GET",...eg];new Set($x);var Ts=w.createContext(null);Ts.displayName="DataRouter";var Si=w.createContext(null);Si.displayName="DataRouterState";var tg=w.createContext({isTransitioning:!1});tg.displayName="ViewTransition";var Yx=w.createContext(new Map);Yx.displayName="Fetchers";var Px=w.createContext(null);Px.displayName="Await";var ea=w.createContext(null);ea.displayName="Navigation";var _r=w.createContext(null);_r.displayName="Location";var Kt=w.createContext({outlet:null,matches:[],isDataRoute:!1});Kt.displayName="Route";var ou=w.createContext(null);ou.displayName="RouteError";function Fx(s,{relative:i}={}){Ye(ks(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:c}=w.useContext(ea),{hash:d,pathname:f,search:m}=Hr(s,{relative:i}),p=f;return l!=="/"&&(p=f==="/"?l:Aa([l,f])),c.createHref({pathname:p,search:m,hash:d})}function ks(){return w.useContext(_r)!=null}function rn(){return Ye(ks(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(_r).location}var ag="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ng(s){w.useContext(ea).static||w.useLayoutEffect(s)}function Mn(){let{isDataRoute:s}=w.useContext(Kt);return s?cy():Xx()}function Xx(){Ye(ks(),"useNavigate() may be used only in the context of a <Router> component.");let s=w.useContext(Ts),{basename:i,navigator:l}=w.useContext(ea),{matches:c}=w.useContext(Kt),{pathname:d}=rn(),f=JSON.stringify(lu(c)),m=w.useRef(!1);return ng(()=>{m.current=!0}),w.useCallback((g,h={})=>{if(It(m.current,ag),!m.current)return;if(typeof g=="number"){l.go(g);return}let y=iu(g,JSON.parse(f),d,h.relative==="path");s==null&&i!=="/"&&(y.pathname=y.pathname==="/"?i:Aa([i,y.pathname])),(h.replace?l.replace:l.push)(y,h.state,h)},[i,l,f,d,s])}var Qx=w.createContext(null);function Zx(s){let i=w.useContext(Kt).outlet;return i&&w.createElement(Qx.Provider,{value:s},i)}function Jx(){let{matches:s}=w.useContext(Kt),i=s[s.length-1];return i?i.params:{}}function Hr(s,{relative:i}={}){let{matches:l}=w.useContext(Kt),{pathname:c}=rn(),d=JSON.stringify(lu(l));return w.useMemo(()=>iu(s,JSON.parse(d),c,i==="path"),[s,d,c,i])}function Ix(s,i){return sg(s,i)}function sg(s,i,l,c){var j;Ye(ks(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=w.useContext(ea),{matches:f}=w.useContext(Kt),m=f[f.length-1],p=m?m.params:{},g=m?m.pathname:"/",h=m?m.pathnameBase:"/",y=m&&m.route;{let C=y&&y.path||"";rg(g,!y||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${C}">) 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.
50
+
51
+ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let S=rn(),v;if(i){let C=typeof i=="string"?Es(i):i;Ye(h==="/"||((j=C.pathname)==null?void 0:j.startsWith(h)),`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 "${h}" but pathname "${C.pathname}" was given in the \`location\` prop.`),v=C}else v=S;let A=v.pathname||"/",N=A;if(h!=="/"){let C=h.replace(/^\//,"").split("/");N="/"+A.replace(/^\//,"").split("/").slice(C.length).join("/")}let M=Jh(s,{pathname:N});It(y||M!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),It(M==null||M[M.length-1].route.element!==void 0||M[M.length-1].route.Component!==void 0||M[M.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 R=ny(M&&M.map(C=>Object.assign({},C,{params:Object.assign({},p,C.params),pathname:Aa([h,d.encodeLocation?d.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?h:Aa([h,d.encodeLocation?d.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),f,l,c);return i&&R?w.createElement(_r.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},R):R}function Wx(){let s=oy(),i=Kx(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),l=s instanceof Error?s.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},f={padding:"2px 4px",backgroundColor:c},m=null;return console.error("Error handled by React Router default ErrorBoundary:",s),m=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:f},"ErrorBoundary")," or"," ",w.createElement("code",{style:f},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},i),l?w.createElement("pre",{style:d},l):null,m)}var ey=w.createElement(Wx,null),ty=class extends w.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,i){return i.location!==s.location||i.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:i.error,location:i.location,revalidation:s.revalidation||i.revalidation}}componentDidCatch(s,i){console.error("React Router caught the following error during render",s,i)}render(){return this.state.error!==void 0?w.createElement(Kt.Provider,{value:this.props.routeContext},w.createElement(ou.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ay({routeContext:s,match:i,children:l}){let c=w.useContext(Ts);return c&&c.static&&c.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=i.route.id),w.createElement(Kt.Provider,{value:s},l)}function ny(s,i=[],l=null,c=null){if(s==null){if(!l)return null;if(l.errors)s=l.matches;else if(i.length===0&&!l.initialized&&l.matches.length>0)s=l.matches;else return null}let d=s,f=l==null?void 0:l.errors;if(f!=null){let g=d.findIndex(h=>h.route.id&&(f==null?void 0:f[h.route.id])!==void 0);Ye(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,g+1))}let m=!1,p=-1;if(l)for(let g=0;g<d.length;g++){let h=d[g];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(p=g),h.route.id){let{loaderData:y,errors:S}=l,v=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!S||S[h.route.id]===void 0);if(h.route.lazy||v){m=!0,p>=0?d=d.slice(0,p+1):d=[d[0]];break}}}return d.reduceRight((g,h,y)=>{let S,v=!1,A=null,N=null;l&&(S=f&&h.route.id?f[h.route.id]:void 0,A=h.route.errorElement||ey,m&&(p<0&&y===0?(rg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,N=null):p===y&&(v=!0,N=h.route.hydrateFallbackElement||null)));let M=i.concat(d.slice(0,y+1)),R=()=>{let j;return S?j=A:v?j=N:h.route.Component?j=w.createElement(h.route.Component,null):h.route.element?j=h.route.element:j=g,w.createElement(ay,{match:h,routeContext:{outlet:g,matches:M,isDataRoute:l!=null},children:j})};return l&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?w.createElement(ty,{location:l.location,revalidation:l.revalidation,component:A,error:S,children:R(),routeContext:{outlet:null,matches:M,isDataRoute:!0}}):R()},null)}function cu(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sy(s){let i=w.useContext(Ts);return Ye(i,cu(s)),i}function ry(s){let i=w.useContext(Si);return Ye(i,cu(s)),i}function ly(s){let i=w.useContext(Kt);return Ye(i,cu(s)),i}function uu(s){let i=ly(s),l=i.matches[i.matches.length-1];return Ye(l.route.id,`${s} can only be used on routes that contain a unique "id"`),l.route.id}function iy(){return uu("useRouteId")}function oy(){var c;let s=w.useContext(ou),i=ry("useRouteError"),l=uu("useRouteError");return s!==void 0?s:(c=i.errors)==null?void 0:c[l]}function cy(){let{router:s}=sy("useNavigate"),i=uu("useNavigate"),l=w.useRef(!1);return ng(()=>{l.current=!0}),w.useCallback(async(d,f={})=>{It(l.current,ag),l.current&&(typeof d=="number"?s.navigate(d):await s.navigate(d,{fromRouteId:i,...f}))},[s,i])}var wh={};function rg(s,i,l){!i&&!wh[s]&&(wh[s]=!0,It(!1,l))}w.memo(uy);function uy({routes:s,future:i,state:l}){return sg(s,void 0,l,i)}function lg({to:s,replace:i,state:l,relative:c}){Ye(ks(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=w.useContext(ea);It(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=w.useContext(Kt),{pathname:m}=rn(),p=Mn(),g=iu(s,lu(f),m,c==="path"),h=JSON.stringify(g);return w.useEffect(()=>{p(JSON.parse(h),{replace:i,state:l,relative:c})},[p,h,c,i,l]),null}function ig(s){return Zx(s.context)}function zt(s){Ye(!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 dy({basename:s="/",children:i=null,location:l,navigationType:c="POP",navigator:d,static:f=!1}){Ye(!ks(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=s.replace(/^\/*/,"/"),p=w.useMemo(()=>({basename:m,navigator:d,static:f,future:{}}),[m,d,f]);typeof l=="string"&&(l=Es(l));let{pathname:g="/",search:h="",hash:y="",state:S=null,key:v="default"}=l,A=w.useMemo(()=>{let N=Oa(g,m);return N==null?null:{location:{pathname:N,search:h,hash:y,state:S,key:v},navigationType:c}},[m,g,h,y,S,v,c]);return It(A!=null,`<Router basename="${m}"> is not able to match the URL "${g}${h}${y}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:w.createElement(ea.Provider,{value:p},w.createElement(_r.Provider,{children:i,value:A}))}function fy({children:s,location:i}){return Ix(Zc(s),i)}function Zc(s,i=[]){let l=[];return w.Children.forEach(s,(c,d)=>{if(!w.isValidElement(c))return;let f=[...i,d];if(c.type===w.Fragment){l.push.apply(l,Zc(c.props.children,f));return}Ye(c.type===zt,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ye(!c.props.index||!c.props.children,"An index route cannot have child routes.");let m={id:c.props.id||f.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(m.children=Zc(c.props.children,f)),l.push(m)}),l}var fi="get",mi="application/x-www-form-urlencoded";function ji(s){return s!=null&&typeof s.tagName=="string"}function my(s){return ji(s)&&s.tagName.toLowerCase()==="button"}function hy(s){return ji(s)&&s.tagName.toLowerCase()==="form"}function gy(s){return ji(s)&&s.tagName.toLowerCase()==="input"}function py(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function xy(s,i){return s.button===0&&(!i||i==="_self")&&!py(s)}var li=null;function yy(){if(li===null)try{new FormData(document.createElement("form"),0),li=!1}catch{li=!0}return li}var by=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kc(s){return s!=null&&!by.has(s)?(It(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mi}"`),null):s}function vy(s,i){let l,c,d,f,m;if(hy(s)){let p=s.getAttribute("action");c=p?Oa(p,i):null,l=s.getAttribute("method")||fi,d=Kc(s.getAttribute("enctype"))||mi,f=new FormData(s)}else if(my(s)||gy(s)&&(s.type==="submit"||s.type==="image")){let p=s.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=s.getAttribute("formaction")||p.getAttribute("action");if(c=g?Oa(g,i):null,l=s.getAttribute("formmethod")||p.getAttribute("method")||fi,d=Kc(s.getAttribute("formenctype"))||Kc(p.getAttribute("enctype"))||mi,f=new FormData(p,s),!yy()){let{name:h,type:y,value:S}=s;if(y==="image"){let v=h?`${h}.`:"";f.append(`${v}x`,"0"),f.append(`${v}y`,"0")}else h&&f.append(h,S)}}else{if(ji(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=fi,c=null,d=mi,m=s}return f&&d==="text/plain"&&(m=f,f=void 0),{action:c,method:l.toLowerCase(),encType:d,formData:f,body:m}}function du(s,i){if(s===!1||s===null||typeof s>"u")throw new Error(i)}async function wy(s,i){if(s.id in i)return i[s.id];try{let l=await import(s.module);return i[s.id]=l,l}catch(l){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Sy(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function jy(s,i,l){let c=await Promise.all(s.map(async d=>{let f=i.routes[d.route.id];if(f){let m=await wy(f,l);return m.links?m.links():[]}return[]}));return Ty(c.flat(1).filter(Sy).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Sh(s,i,l,c,d,f){let m=(g,h)=>l[h]?g.route.id!==l[h].route.id:!0,p=(g,h)=>{var y;return l[h].pathname!==g.pathname||((y=l[h].route.path)==null?void 0:y.endsWith("*"))&&l[h].params["*"]!==g.params["*"]};return f==="assets"?i.filter((g,h)=>m(g,h)||p(g,h)):f==="data"?i.filter((g,h)=>{var S;let y=c.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let v=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((S=l[0])==null?void 0:S.params)||{},nextUrl:new URL(s,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function Ny(s,i,{includeHydrateFallback:l}={}){return Cy(s.map(c=>{let d=i.routes[c.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),l&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function Cy(s){return[...new Set(s)]}function Ey(s){let i={},l=Object.keys(s).sort();for(let c of l)i[c]=s[c];return i}function Ty(s,i){let l=new Set;return new Set(i),s.reduce((c,d)=>{let f=JSON.stringify(Ey(d));return l.has(f)||(l.add(f),c.push({key:f,link:d})),c},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ky=new Set([100,101,204,205]);function Ay(s,i){let l=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return l.pathname==="/"?l.pathname="_root.data":i&&Oa(l.pathname,i)==="/"?l.pathname=`${i.replace(/\/$/,"")}/_root.data`:l.pathname=`${l.pathname.replace(/\/$/,"")}.data`,l}function og(){let s=w.useContext(Ts);return du(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function Ry(){let s=w.useContext(Si);return du(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var fu=w.createContext(void 0);fu.displayName="FrameworkContext";function cg(){let s=w.useContext(fu);return du(s,"You must render this element inside a <HydratedRouter> element"),s}function Oy(s,i){let l=w.useContext(fu),[c,d]=w.useState(!1),[f,m]=w.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:S}=i,v=w.useRef(null);w.useEffect(()=>{if(s==="render"&&m(!0),s==="viewport"){let M=j=>{j.forEach(C=>{m(C.isIntersecting)})},R=new IntersectionObserver(M,{threshold:.5});return v.current&&R.observe(v.current),()=>{R.disconnect()}}},[s]),w.useEffect(()=>{if(c){let M=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(M)}}},[c]);let A=()=>{d(!0)},N=()=>{d(!1),m(!1)};return l?s!=="intent"?[f,v,{}]:[f,v,{onFocus:Rr(p,A),onBlur:Rr(g,N),onMouseEnter:Rr(h,A),onMouseLeave:Rr(y,N),onTouchStart:Rr(S,A)}]:[!1,v,{}]}function Rr(s,i){return l=>{s&&s(l),l.defaultPrevented||i(l)}}function My({page:s,...i}){let{router:l}=og(),c=w.useMemo(()=>Jh(l.routes,s,l.basename),[l.routes,s,l.basename]);return c?w.createElement(Dy,{page:s,matches:c,...i}):null}function zy(s){let{manifest:i,routeModules:l}=cg(),[c,d]=w.useState([]);return w.useEffect(()=>{let f=!1;return jy(s,i,l).then(m=>{f||d(m)}),()=>{f=!0}},[s,i,l]),c}function Dy({page:s,matches:i,...l}){let c=rn(),{manifest:d,routeModules:f}=cg(),{basename:m}=og(),{loaderData:p,matches:g}=Ry(),h=w.useMemo(()=>Sh(s,i,g,d,c,"data"),[s,i,g,d,c]),y=w.useMemo(()=>Sh(s,i,g,d,c,"assets"),[s,i,g,d,c]),S=w.useMemo(()=>{if(s===c.pathname+c.search+c.hash)return[];let N=new Set,M=!1;if(i.forEach(j=>{var O;let C=d.routes[j.route.id];!C||!C.hasLoader||(!h.some(F=>F.route.id===j.route.id)&&j.route.id in p&&((O=f[j.route.id])!=null&&O.shouldRevalidate)||C.hasClientLoader?M=!0:N.add(j.route.id))}),N.size===0)return[];let R=Ay(s,m);return M&&N.size>0&&R.searchParams.set("_routes",i.filter(j=>N.has(j.route.id)).map(j=>j.route.id).join(",")),[R.pathname+R.search]},[m,p,c,d,h,i,s,f]),v=w.useMemo(()=>Ny(y,d),[y,d]),A=zy(y);return w.createElement(w.Fragment,null,S.map(N=>w.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...l})),v.map(N=>w.createElement("link",{key:N,rel:"modulepreload",href:N,...l})),A.map(({key:N,link:M})=>w.createElement("link",{key:N,...M})))}function Uy(...s){return i=>{s.forEach(l=>{typeof l=="function"?l(i):l!=null&&(l.current=i)})}}var ug=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ug&&(window.__reactRouterVersion="7.6.3")}catch{}function Ly({basename:s,children:i,window:l}){let c=w.useRef();c.current==null&&(c.current=vx({window:l,v5Compat:!0}));let d=c.current,[f,m]=w.useState({action:d.action,location:d.location}),p=w.useCallback(g=>{w.startTransition(()=>m(g))},[m]);return w.useLayoutEffect(()=>d.listen(p),[d,p]),w.createElement(dy,{basename:s,children:i,location:f.location,navigationType:f.action,navigator:d})}var dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fg=w.forwardRef(function({onClick:i,discover:l="render",prefetch:c="none",relative:d,reloadDocument:f,replace:m,state:p,target:g,to:h,preventScrollReset:y,viewTransition:S,...v},A){let{basename:N}=w.useContext(ea),M=typeof h=="string"&&dg.test(h),R,j=!1;if(typeof h=="string"&&M&&(R=h,ug))try{let W=new URL(window.location.href),le=h.startsWith("//")?new URL(W.protocol+h):new URL(h),U=Oa(le.pathname,N);le.origin===W.origin&&U!=null?h=U+le.search+le.hash:j=!0}catch{It(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let C=Fx(h,{relative:d}),[O,F,D]=Oy(c,v),ee=By(h,{replace:m,state:p,target:g,preventScrollReset:y,relative:d,viewTransition:S});function Q(W){i&&i(W),W.defaultPrevented||ee(W)}let B=w.createElement("a",{...v,...D,href:R||C,onClick:j||f?i:Q,ref:Uy(A,F),target:g,"data-discover":!M&&l==="render"?"true":void 0});return O&&!M?w.createElement(w.Fragment,null,B,w.createElement(My,{page:C})):B});fg.displayName="Link";var mg=w.forwardRef(function({"aria-current":i="page",caseSensitive:l=!1,className:c="",end:d=!1,style:f,to:m,viewTransition:p,children:g,...h},y){let S=Hr(m,{relative:h.relative}),v=rn(),A=w.useContext(Si),{navigator:N,basename:M}=w.useContext(ea),R=A!=null&&$y(S)&&p===!0,j=N.encodeLocation?N.encodeLocation(S).pathname:S.pathname,C=v.pathname,O=A&&A.navigation&&A.navigation.location?A.navigation.location.pathname:null;l||(C=C.toLowerCase(),O=O?O.toLowerCase():null,j=j.toLowerCase()),O&&M&&(O=Oa(O,M)||O);const F=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let D=C===j||!d&&C.startsWith(j)&&C.charAt(F)==="/",ee=O!=null&&(O===j||!d&&O.startsWith(j)&&O.charAt(j.length)==="/"),Q={isActive:D,isPending:ee,isTransitioning:R},B=D?i:void 0,W;typeof c=="function"?W=c(Q):W=[c,D?"active":null,ee?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let le=typeof f=="function"?f(Q):f;return w.createElement(fg,{...h,"aria-current":B,className:W,ref:y,style:le,to:m,viewTransition:p},typeof g=="function"?g(Q):g)});mg.displayName="NavLink";var _y=w.forwardRef(({discover:s="render",fetcherKey:i,navigate:l,reloadDocument:c,replace:d,state:f,method:m=fi,action:p,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:S,...v},A)=>{let N=Gy(),M=Ky(p,{relative:h}),R=m.toLowerCase()==="get"?"get":"post",j=typeof p=="string"&&dg.test(p),C=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let F=O.nativeEvent.submitter,D=(F==null?void 0:F.getAttribute("formmethod"))||m;N(F||O.currentTarget,{fetcherKey:i,method:D,navigate:l,replace:d,state:f,relative:h,preventScrollReset:y,viewTransition:S})};return w.createElement("form",{ref:A,method:R,action:M,onSubmit:c?g:C,...v,"data-discover":!j&&s==="render"?"true":void 0})});_y.displayName="Form";function Hy(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hg(s){let i=w.useContext(Ts);return Ye(i,Hy(s)),i}function By(s,{target:i,replace:l,state:c,preventScrollReset:d,relative:f,viewTransition:m}={}){let p=Mn(),g=rn(),h=Hr(s,{relative:f});return w.useCallback(y=>{if(xy(y,i)){y.preventDefault();let S=l!==void 0?l:Dr(g)===Dr(h);p(s,{replace:S,state:c,preventScrollReset:d,relative:f,viewTransition:m})}},[g,p,h,l,c,i,s,d,f,m])}var qy=0,Vy=()=>`__${String(++qy)}__`;function Gy(){let{router:s}=hg("useSubmit"),{basename:i}=w.useContext(ea),l=iy();return w.useCallback(async(c,d={})=>{let{action:f,method:m,encType:p,formData:g,body:h}=vy(c,i);if(d.navigate===!1){let y=d.fetcherKey||Vy();await s.fetch(y,l,d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,flushSync:d.flushSync})}else await s.navigate(d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,replace:d.replace,state:d.state,fromRouteId:l,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,i,l])}function Ky(s,{relative:i}={}){let{basename:l}=w.useContext(ea),c=w.useContext(Kt);Ye(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),f={...Hr(s||".",{relative:i})},m=rn();if(s==null){f.search=m.search;let p=new URLSearchParams(f.search),g=p.getAll("index");if(g.some(y=>y==="")){p.delete("index"),g.filter(S=>S).forEach(S=>p.append("index",S));let y=p.toString();f.search=y?`?${y}`:""}}return(!s||s===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(f.pathname=f.pathname==="/"?l:Aa([l,f.pathname])),Dr(f)}function $y(s,i={}){let l=w.useContext(tg);Ye(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=hg("useViewTransitionState"),d=Hr(s,{relative:i.relative});if(!l.isTransitioning)return!1;let f=Oa(l.currentLocation.pathname,c)||l.currentLocation.pathname,m=Oa(l.nextLocation.pathname,c)||l.nextLocation.pathname;return gi(d.pathname,m)!=null||gi(d.pathname,f)!=null}[...ky];const Yy=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},mu=()=>{const i=Yy().basePath||"";return i&&!i.startsWith("/")?"/"+i:i},Py=()=>mu()+"/api",hu=s=>{const i=Py(),l=s.startsWith("/")?s:"/"+s;return i+l},Fy=async()=>{try{const s=window.location.pathname,i=[s.replace(/\/[^/]*$/,"")+"/config","/config",...s.includes("/")?[s.split("/")[1]?`/${s.split("/")[1]}/config`:"/config"]:["/config"]];for(const l of i)try{const c=await fetch(l,{method:"GET",headers:{Accept:"application/json","Cache-Control":"no-cache"}});if(c.ok){const d=await c.json();if(d.success&&d.data)return d.data}}catch(c){console.debug(`Failed to load config from ${l}:`,c)}return console.warn("Could not load runtime config from server, using defaults"),{basePath:"",version:"dev",name:"mcphub"}}catch(s){return console.error("Error loading runtime config:",s),{basePath:"",version:"dev",name:"mcphub"}}},hi=[],Xy=s=>{hi.push(s)},gu=async(s,i={})=>{let l=s.toString(),c={...i};try{for(const f of hi)if(f.request){const m=await f.request(l,c);l=m.url,c=m.config}let d=await fetch(l,c);for(const f of hi)f.response&&(d=await f.response(d));return d}catch(d){let f=d;for(const m of hi)m.error&&(f=await m.error(f));throw f}},Ni=async(s,i={})=>{try{const l=hu(s),c=await gu(l,i);let d;try{d=await c.json()}catch{d={success:c.ok,message:c.ok?"Request successful":`HTTP ${c.status}: ${c.statusText}`}}if(!c.ok&&typeof d=="object"&&d!==null){const f=d;f.success!==!1&&(f.success=!1,f.message=f.message||`HTTP ${c.status}: ${c.statusText}`)}return d}catch(l){return console.error("API request error:",l),{success:!1,message:l instanceof Error?l.message:"An unknown error occurred"}}},bt=(s,i={})=>Ni(s,{...i,method:"GET"}),Wt=(s,i,l={})=>Ni(s,{...l,method:"POST",headers:{"Content-Type":"application/json",...l.headers},body:i?JSON.stringify(i):void 0}),ca=(s,i,l={})=>Ni(s,{...l,method:"PUT",headers:{"Content-Type":"application/json",...l.headers},body:i?JSON.stringify(i):void 0}),pi=(s,i={})=>Ni(s,{...i,method:"DELETE"}),pu="mcphub_token",Br=()=>localStorage.getItem(pu),gg=s=>{localStorage.setItem(pu,s)},xi=()=>{localStorage.removeItem(pu)},Qy={request:async(s,i)=>{const l=new Headers(i.headers),c=localStorage.getItem("i18nextLng")||"en";l.set("Accept-Language",c);const d=Br();return d&&l.set("x-auth-token",d),{url:s,config:{...i,headers:l}}},response:async s=>(s.status===401&&xi(),s),error:async s=>(console.error("Auth interceptor error:",s),s)},Zy=()=>{Xy(Qy)},Jy=async s=>{try{const i=await Wt("/auth/login",s);return i.success&&i.token?(gg(i.token),i):{success:!1,message:i.message||"Login failed"}}catch(i){return console.error("Login error:",i),{success:!1,message:"An error occurred during login"}}},Iy=async s=>{try{const i=await Wt("/auth/register",s);return i.success&&i.token?(gg(i.token),i):{success:!1,message:i.message||"Registration failed"}}catch(i){return console.error("Register error:",i),{success:!1,message:"An error occurred during registration"}}},Wy=async()=>{if(!Br())return{success:!1,message:"No authentication token"};try{return await bt("/auth/user")}catch(i){return console.error("Get current user error:",i),{success:!1,message:"An error occurred while fetching user data"}}},eb=async s=>{if(!Br())return{success:!1,message:"No authentication token"};try{return await Wt("/auth/change-password",s)}catch(l){return console.error("Change password error:",l),{success:!1,message:"An error occurred while changing password"}}},tb=()=>{xi()},ab=async()=>{var s,i;try{const l=mu(),c=await gu(`${l}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});if(c.ok){const d=await c.json();return{skipAuth:((s=d.data)==null?void 0:s.skipAuth)===!0,permissions:((i=d.data)==null?void 0:i.permissions)||{}}}return{skipAuth:!1}}catch(l){return console.debug("Failed to get public config:",l),{skipAuth:!1}}},oa={isAuthenticated:!1,loading:!0,user:null,error:null},pg=w.createContext({auth:oa,login:async()=>!1,register:async()=>!1,logout:()=>{}}),nb=({children:s})=>{const[i,l]=w.useState(oa);w.useEffect(()=>{(async()=>{const{skipAuth:p,permissions:g}=await ab();if(p){l({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:g},error:null});return}if(!Br()){l({...oa,loading:!1});return}try{const y=await Wy();y.success&&y.user?l({isAuthenticated:!0,loading:!1,user:y.user,error:null}):(xi(),l({...oa,loading:!1}))}catch{xi(),l({...oa,loading:!1})}})()},[]);const c=async(m,p)=>{try{const g=await Jy({username:m,password:p});return g.success&&g.token&&g.user?(l({isAuthenticated:!0,loading:!1,user:g.user,error:null}),!0):(l({...oa,loading:!1,error:g.message||"Authentication failed"}),!1)}catch{return l({...oa,loading:!1,error:"Authentication failed"}),!1}},d=async(m,p,g=!1)=>{try{const h=await Iy({username:m,password:p,isAdmin:g});return h.success&&h.token&&h.user?(l({isAuthenticated:!0,loading:!1,user:h.user,error:null}),!0):(l({...oa,loading:!1,error:h.message||"Registration failed"}),!1)}catch{return l({...oa,loading:!1,error:"Registration failed"}),!1}},f=()=>{tb(),l({...oa,loading:!1})};return r.jsx(pg.Provider,{value:{auth:i,login:c,register:d,logout:f},children:s})},qr=()=>w.useContext(pg);/**
52
+ * @license lucide-react v0.486.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const sb=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rb=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,l,c)=>c?c.toUpperCase():l.toLowerCase()),jh=s=>{const i=rb(s);return i.charAt(0).toUpperCase()+i.slice(1)},xg=(...s)=>s.filter((i,l,c)=>!!i&&i.trim()!==""&&c.indexOf(i)===l).join(" ").trim();/**
57
+ * @license lucide-react v0.486.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */var lb={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"};/**
62
+ * @license lucide-react v0.486.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const ib=w.forwardRef(({color:s="currentColor",size:i=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:d="",children:f,iconNode:m,...p},g)=>w.createElement("svg",{ref:g,...lb,width:i,height:i,stroke:s,strokeWidth:c?Number(l)*24/Number(i):l,className:xg("lucide",d),...p},[...m.map(([h,y])=>w.createElement(h,y)),...Array.isArray(f)?f:[f]]));/**
67
+ * @license lucide-react v0.486.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const Ze=(s,i)=>{const l=w.forwardRef(({className:c,...d},f)=>w.createElement(ib,{ref:f,iconNode:i,className:xg(`lucide-${sb(jh(s))}`,`lucide-${s}`,c),...d}));return l.displayName=jh(s),l};/**
72
+ * @license lucide-react v0.486.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const ob=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ci=Ze("check",ob);/**
77
+ * @license lucide-react v0.486.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const cb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xu=Ze("chevron-down",cb);/**
82
+ * @license lucide-react v0.486.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const ub=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yg=Ze("chevron-right",ub);/**
87
+ * @license lucide-react v0.486.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const db=[["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"}]],bg=Ze("circle-alert",db);/**
92
+ * @license lucide-react v0.486.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const fb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],mb=Ze("circle-check-big",fb);/**
97
+ * @license lucide-react v0.486.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const hb=[["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"}]],gb=Ze("circle-x",hb);/**
102
+ * @license lucide-react v0.486.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const pb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Jc=Ze("copy",pb);/**
107
+ * @license lucide-react v0.486.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const xb=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],yb=Ze("file-code",xb);/**
112
+ * @license lucide-react v0.486.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const bb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],vb=Ze("info",bb);/**
117
+ * @license lucide-react v0.486.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const wb=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Sb=Ze("link",wb);/**
122
+ * @license lucide-react v0.486.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const jb=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],Nb=Ze("loader",jb);/**
127
+ * @license lucide-react v0.486.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const Cb=[["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"}]],Eb=Ze("log-out",Cb);/**
132
+ * @license lucide-react v0.486.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Tb=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],kb=Ze("moon",Tb);/**
137
+ * @license lucide-react v0.486.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const Ab=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Rb=Ze("play",Ab);/**
142
+ * @license lucide-react v0.486.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Ob=[["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"}]],Mb=Ze("refresh-cw",Ob);/**
147
+ * @license lucide-react v0.486.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const zb=[["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"}]],Db=Ze("settings",zb);/**
152
+ * @license lucide-react v0.486.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const Ub=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],vg=Ze("square-pen",Ub);/**
157
+ * @license lucide-react v0.486.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const Lb=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],_b=Ze("sun",Lb);/**
162
+ * @license lucide-react v0.486.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const Hb=[["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"}]],Bb=Ze("trash",Hb);/**
167
+ * @license lucide-react v0.486.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const qb=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Vb=Ze("user",qb);/**
172
+ * @license lucide-react v0.486.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const Gb=[["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"}]],Kb=Ze("wrench",Gb);/**
177
+ * @license lucide-react v0.486.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const $b=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ur=Ze("x",$b);function wg(s){var i,l,c="";if(typeof s=="string"||typeof s=="number")c+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(i=0;i<d;i++)s[i]&&(l=wg(s[i]))&&(c&&(c+=" "),c+=l)}else for(l in s)s[l]&&(c&&(c+=" "),c+=l);return c}function Yb(){for(var s,i,l=0,c="",d=arguments.length;l<d;l++)(s=arguments[l])&&(i=wg(s))&&(c&&(c+=" "),c+=i);return c}const yu="-",Pb=s=>{const i=Xb(s),{conflictingClassGroups:l,conflictingClassGroupModifiers:c}=s;return{getClassGroupId:m=>{const p=m.split(yu);return p[0]===""&&p.length!==1&&p.shift(),Sg(p,i)||Fb(m)},getConflictingClassGroupIds:(m,p)=>{const g=l[m]||[];return p&&c[m]?[...g,...c[m]]:g}}},Sg=(s,i)=>{var m;if(s.length===0)return i.classGroupId;const l=s[0],c=i.nextPart.get(l),d=c?Sg(s.slice(1),c):void 0;if(d)return d;if(i.validators.length===0)return;const f=s.join(yu);return(m=i.validators.find(({validator:p})=>p(f)))==null?void 0:m.classGroupId},Nh=/^\[(.+)\]$/,Fb=s=>{if(Nh.test(s)){const i=Nh.exec(s)[1],l=i==null?void 0:i.substring(0,i.indexOf(":"));if(l)return"arbitrary.."+l}},Xb=s=>{const{theme:i,classGroups:l}=s,c={nextPart:new Map,validators:[]};for(const d in l)Ic(l[d],c,d,i);return c},Ic=(s,i,l,c)=>{s.forEach(d=>{if(typeof d=="string"){const f=d===""?i:Ch(i,d);f.classGroupId=l;return}if(typeof d=="function"){if(Qb(d)){Ic(d(c),i,l,c);return}i.validators.push({validator:d,classGroupId:l});return}Object.entries(d).forEach(([f,m])=>{Ic(m,Ch(i,f),l,c)})})},Ch=(s,i)=>{let l=s;return i.split(yu).forEach(c=>{l.nextPart.has(c)||l.nextPart.set(c,{nextPart:new Map,validators:[]}),l=l.nextPart.get(c)}),l},Qb=s=>s.isThemeGetter,Zb=s=>{if(s<1)return{get:()=>{},set:()=>{}};let i=0,l=new Map,c=new Map;const d=(f,m)=>{l.set(f,m),i++,i>s&&(i=0,c=l,l=new Map)};return{get(f){let m=l.get(f);if(m!==void 0)return m;if((m=c.get(f))!==void 0)return d(f,m),m},set(f,m){l.has(f)?l.set(f,m):d(f,m)}}},Wc="!",eu=":",Jb=eu.length,Ib=s=>{const{prefix:i,experimentalParseClassName:l}=s;let c=d=>{const f=[];let m=0,p=0,g=0,h;for(let N=0;N<d.length;N++){let M=d[N];if(m===0&&p===0){if(M===eu){f.push(d.slice(g,N)),g=N+Jb;continue}if(M==="/"){h=N;continue}}M==="["?m++:M==="]"?m--:M==="("?p++:M===")"&&p--}const y=f.length===0?d:d.substring(g),S=Wb(y),v=S!==y,A=h&&h>g?h-g:void 0;return{modifiers:f,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:A}};if(i){const d=i+eu,f=c;c=m=>m.startsWith(d)?f(m.substring(d.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(l){const d=c;c=f=>l({className:f,parseClassName:d})}return c},Wb=s=>s.endsWith(Wc)?s.substring(0,s.length-1):s.startsWith(Wc)?s.substring(1):s,ev=s=>{const i=Object.fromEntries(s.orderSensitiveModifiers.map(c=>[c,!0]));return c=>{if(c.length<=1)return c;const d=[];let f=[];return c.forEach(m=>{m[0]==="["||i[m]?(d.push(...f.sort(),m),f=[]):f.push(m)}),d.push(...f.sort()),d}},tv=s=>({cache:Zb(s.cacheSize),parseClassName:Ib(s),sortModifiers:ev(s),...Pb(s)}),av=/\s+/,nv=(s,i)=>{const{parseClassName:l,getClassGroupId:c,getConflictingClassGroupIds:d,sortModifiers:f}=i,m=[],p=s.trim().split(av);let g="";for(let h=p.length-1;h>=0;h-=1){const y=p[h],{isExternal:S,modifiers:v,hasImportantModifier:A,baseClassName:N,maybePostfixModifierPosition:M}=l(y);if(S){g=y+(g.length>0?" "+g:g);continue}let R=!!M,j=c(R?N.substring(0,M):N);if(!j){if(!R){g=y+(g.length>0?" "+g:g);continue}if(j=c(N),!j){g=y+(g.length>0?" "+g:g);continue}R=!1}const C=f(v).join(":"),O=A?C+Wc:C,F=O+j;if(m.includes(F))continue;m.push(F);const D=d(j,R);for(let ee=0;ee<D.length;++ee){const Q=D[ee];m.push(O+Q)}g=y+(g.length>0?" "+g:g)}return g};function sv(){let s=0,i,l,c="";for(;s<arguments.length;)(i=arguments[s++])&&(l=jg(i))&&(c&&(c+=" "),c+=l);return c}const jg=s=>{if(typeof s=="string")return s;let i,l="";for(let c=0;c<s.length;c++)s[c]&&(i=jg(s[c]))&&(l&&(l+=" "),l+=i);return l};function rv(s,...i){let l,c,d,f=m;function m(g){const h=i.reduce((y,S)=>S(y),s());return l=tv(h),c=l.cache.get,d=l.cache.set,f=p,p(g)}function p(g){const h=c(g);if(h)return h;const y=nv(g,l);return d(g,y),y}return function(){return f(sv.apply(null,arguments))}}const st=s=>{const i=l=>l[s]||[];return i.isThemeGetter=!0,i},Ng=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lv=/^\d+\/\d+$/,iv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ov=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bs=s=>lv.test(s),Ee=s=>!!s&&!Number.isNaN(Number(s)),sn=s=>!!s&&Number.isInteger(Number(s)),$c=s=>s.endsWith("%")&&Ee(s.slice(0,-1)),ka=s=>iv.test(s),fv=()=>!0,mv=s=>ov.test(s)&&!cv.test(s),Eg=()=>!1,hv=s=>uv.test(s),gv=s=>dv.test(s),pv=s=>!fe(s)&&!me(s),xv=s=>As(s,Ag,Eg),fe=s=>Ng.test(s),Rn=s=>As(s,Rg,mv),Yc=s=>As(s,Sv,Ee),Eh=s=>As(s,Tg,Eg),yv=s=>As(s,kg,gv),ii=s=>As(s,Og,hv),me=s=>Cg.test(s),Or=s=>Rs(s,Rg),bv=s=>Rs(s,jv),Th=s=>Rs(s,Tg),vv=s=>Rs(s,Ag),wv=s=>Rs(s,kg),oi=s=>Rs(s,Og,!0),As=(s,i,l)=>{const c=Ng.exec(s);return c?c[1]?i(c[1]):l(c[2]):!1},Rs=(s,i,l=!1)=>{const c=Cg.exec(s);return c?c[1]?i(c[1]):l:!1},Tg=s=>s==="position"||s==="percentage",kg=s=>s==="image"||s==="url",Ag=s=>s==="length"||s==="size"||s==="bg-size",Rg=s=>s==="length",Sv=s=>s==="number",jv=s=>s==="family-name",Og=s=>s==="shadow",Nv=()=>{const s=st("color"),i=st("font"),l=st("text"),c=st("font-weight"),d=st("tracking"),f=st("leading"),m=st("breakpoint"),p=st("container"),g=st("spacing"),h=st("radius"),y=st("shadow"),S=st("inset-shadow"),v=st("text-shadow"),A=st("drop-shadow"),N=st("blur"),M=st("perspective"),R=st("aspect"),j=st("ease"),C=st("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...F(),me,fe],ee=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],B=()=>[me,fe,g],W=()=>[bs,"full","auto",...B()],le=()=>[sn,"none","subgrid",me,fe],U=()=>["auto",{span:["full",sn,me,fe]},sn,me,fe],L=()=>[sn,"auto",me,fe],Z=()=>["auto","min","max","fr",me,fe],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...B()],G=()=>[bs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],X=()=>[s,me,fe],oe=()=>[...F(),Th,Eh,{position:[me,fe]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",vv,xv,{size:[me,fe]}],re=()=>[$c,Or,Rn],ne=()=>["","none","full",h,me,fe],ue=()=>["",Ee,Or,Rn],ve=()=>["solid","dashed","dotted","double"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Ee,$c,Th,Eh],Se=()=>["","none",N,me,fe],Ke=()=>["none",Ee,me,fe],Ve=()=>["none",Ee,me,fe],be=()=>[Ee,me,fe],Me=()=>[bs,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ka],breakpoint:[ka],color:[fv],container:[ka],"drop-shadow":[ka],ease:["in","out","in-out"],font:[pv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ka],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ka],shadow:[ka],spacing:["px",Ee],text:[ka],"text-shadow":[ka],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bs,fe,me,R]}],container:["container"],columns:[{columns:[Ee,fe,me,p]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{start:W()}],end:[{end:W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[sn,"auto",me,fe]}],basis:[{basis:[bs,"full","auto",p,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ee,bs,"auto","initial","none",fe]}],grow:[{grow:["",Ee,me,fe]}],shrink:[{shrink:["",Ee,me,fe]}],order:[{order:[sn,"first","last","none",me,fe]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[p,"screen",...G()]}],"min-w":[{"min-w":[p,"screen","none",...G()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",l,Or,Rn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,me,Yc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$c,fe]}],"font-family":[{font:[bv,fe,i]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,me,fe]}],"line-clamp":[{"line-clamp":[Ee,"none",me,Yc]}],leading:[{leading:[f,...B()]}],"list-image":[{"list-image":["none",me,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",me,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ee,"from-font","auto",me,Rn]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Ee,"auto",me,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sn,me,fe],radial:["",me,fe],conic:[sn,me,fe]},wv,yv]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ee,me,fe]}],"outline-w":[{outline:["",Ee,Or,Rn]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",y,oi,ii]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",S,oi,ii]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Ee,Rn]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",v,oi,ii]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Ee,me,fe]}],"mix-blend":[{"mix-blend":[...I(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":I()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ee]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[me,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":F()}],"mask-image-conic-pos":[{"mask-conic":[Ee]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",me,fe]}],filter:[{filter:["","none",me,fe]}],blur:[{blur:Se()}],brightness:[{brightness:[Ee,me,fe]}],contrast:[{contrast:[Ee,me,fe]}],"drop-shadow":[{"drop-shadow":["","none",A,oi,ii]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Ee,me,fe]}],"hue-rotate":[{"hue-rotate":[Ee,me,fe]}],invert:[{invert:["",Ee,me,fe]}],saturate:[{saturate:[Ee,me,fe]}],sepia:[{sepia:["",Ee,me,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",me,fe]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[Ee,me,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Ee,me,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ee,me,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ee,me,fe]}],"backdrop-invert":[{"backdrop-invert":["",Ee,me,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Ee,me,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Ee,me,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ee,me,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",me,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ee,"initial",me,fe]}],ease:[{ease:["linear","initial",j,me,fe]}],delay:[{delay:[Ee,me,fe]}],animate:[{animate:["none",C,me,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[M,me,fe]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ke()}],"rotate-x":[{"rotate-x":Ke()}],"rotate-y":[{"rotate-y":Ke()}],"rotate-z":[{"rotate-z":Ke()}],scale:[{scale:Ve()}],"scale-x":[{"scale-x":Ve()}],"scale-y":[{"scale-y":Ve()}],"scale-z":[{"scale-z":Ve()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[me,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Me()}],"translate-x":[{"translate-x":Me()}],"translate-y":[{"translate-y":Me()}],"translate-z":[{"translate-z":Me()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me,fe]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Ee,Or,Rn,Yc]}],stroke:[{stroke:["none",...X()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Cv=rv(Nv);function Ra(...s){return Cv(Yb(s))}const Ev=({message:s,type:i="info",duration:l=3e3,onClose:c,visible:d})=>{w.useEffect(()=>{if(d){const g=setTimeout(()=>{c()},l);return()=>clearTimeout(g)}},[d,l,c]);const f={success:r.jsx(Ci,{className:"w-5 h-5 text-green-500"}),error:r.jsx(Ur,{className:"w-5 h-5 text-red-500"}),info:r.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),warning:r.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})},m={success:"bg-green-50 border-green-200",error:"bg-red-50 border-red-200",info:"bg-blue-50 border-blue-200",warning:"bg-yellow-50 border-yellow-200"},p={success:"text-green-800",error:"text-red-800",info:"text-blue-800",warning:"text-yellow-800"};return r.jsx("div",{className:Ra("fixed top-4 right-4 z-50 max-w-sm p-4 rounded-md shadow-lg border",m[i],"transform transition-all duration-300 ease-in-out",d?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:f[i]}),r.jsx("div",{className:"ml-3",children:r.jsx("p",{className:Ra("text-sm font-medium",p[i]),children:s})}),r.jsx("div",{className:"ml-auto pl-3",children:r.jsx("div",{className:"-mx-1.5 -my-1.5",children:r.jsxs("button",{onClick:c,className:Ra("inline-flex rounded-md p-1.5",`hover:bg-${i}-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${i}-500`),children:[r.jsx("span",{className:"sr-only",children:"Dismiss"}),r.jsx(Ur,{className:"h-5 w-5"})]})})})]})})},Mg=w.createContext(void 0),Vr=()=>{const s=w.useContext(Mg);if(!s)throw new Error("useToast must be used within a ToastProvider");return s},Tv=({children:s})=>{const[i,l]=w.useState({message:"",type:"info",visible:!1,duration:3e3}),c=w.useCallback((f,m="info",p=3e3)=>{l({message:f,type:m,visible:!0,duration:p})},[]),d=w.useCallback(()=>{l(f=>({...f,visible:!1}))},[]);return r.jsxs(Mg.Provider,{value:{showToast:c},children:[s,r.jsx(Ev,{message:i.message,type:i.type,duration:i.duration,onClose:d,visible:i.visible})]})},zg=w.createContext(void 0),kv=()=>{const s=w.useContext(zg);if(!s)throw new Error("useTheme must be used within a ThemeProvider");return s},Av=({children:s})=>{const[i,l]=w.useState(()=>localStorage.getItem("theme")||"system"),[c,d]=w.useState("light"),f=m=>{l(m),localStorage.setItem("theme",m)};return w.useEffect(()=>{const m=()=>{const g=window.document.documentElement,h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",y=i==="system"?h:i;d(y),y==="dark"?(console.log("Applying dark mode to HTML root element"),g.classList.add("dark"),document.body.style.backgroundColor="#111827"):(console.log("Removing dark mode from HTML root element"),g.classList.remove("dark"),document.body.style.backgroundColor="")},p=window.matchMedia("(prefers-color-scheme: dark)");return p.addEventListener("change",m),m(),()=>{p.removeEventListener("change",m)}},[i]),r.jsx(zg.Provider,{value:{theme:i,setTheme:f,resolvedTheme:c},children:s})},Rv=(s,i,l,c)=>{var f,m,p,g;const d=[l,{code:i,...c||{}}];if((m=(f=s==null?void 0:s.services)==null?void 0:f.logger)!=null&&m.forward)return s.services.logger.forward(d,"warn","react-i18next::",!0);On(d[0])&&(d[0]=`react-i18next:: ${d[0]}`),(g=(p=s==null?void 0:s.services)==null?void 0:p.logger)!=null&&g.warn?s.services.logger.warn(...d):console!=null&&console.warn&&console.warn(...d)},kh={},tu=(s,i,l,c)=>{On(l)&&kh[l]||(On(l)&&(kh[l]=new Date),Rv(s,i,l,c))},Dg=(s,i)=>()=>{if(s.isInitialized)i();else{const l=()=>{setTimeout(()=>{s.off("initialized",l)},0),i()};s.on("initialized",l)}},au=(s,i,l)=>{s.loadNamespaces(i,Dg(s,l))},Ah=(s,i,l,c)=>{if(On(l)&&(l=[l]),s.options.preload&&s.options.preload.indexOf(i)>-1)return au(s,l,c);l.forEach(d=>{s.options.ns.indexOf(d)<0&&s.options.ns.push(d)}),s.loadLanguages(i,Dg(s,c))},Ov=(s,i,l={})=>!i.languages||!i.languages.length?(tu(i,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:i.languages}),!0):i.hasLoadedNamespace(s,{lng:l.lng,precheck:(c,d)=>{var f;if(((f=l.bindI18n)==null?void 0:f.indexOf("languageChanging"))>-1&&c.services.backendConnector.backend&&c.isLanguageChangingTo&&!d(c.isLanguageChangingTo,s))return!1}}),On=s=>typeof s=="string",Mv=s=>typeof s=="object"&&s!==null,zv=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Dv={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Uv=s=>Dv[s],Lv=s=>s.replace(zv,Uv);let nu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Lv};const _v=(s={})=>{nu={...nu,...s}},Hv=()=>nu;let Ug;const Bv=s=>{Ug=s},qv=()=>Ug,Vv={type:"3rdParty",init(s){_v(s.options.react),Bv(s)}},Gv=w.createContext();class Kv{constructor(){this.usedNamespaces={}}addUsedNamespaces(i){i.forEach(l=>{this.usedNamespaces[l]||(this.usedNamespaces[l]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const $v=(s,i)=>{const l=w.useRef();return w.useEffect(()=>{l.current=s},[s,i]),l.current},Lg=(s,i,l,c)=>s.getFixedT(i,l,c),Yv=(s,i,l,c)=>w.useCallback(Lg(s,i,l,c),[s,i,l,c]),Ne=(s,i={})=>{var F,D,ee,Q;const{i18n:l}=i,{i18n:c,defaultNS:d}=w.useContext(Gv)||{},f=l||c||qv();if(f&&!f.reportNamespaces&&(f.reportNamespaces=new Kv),!f){tu(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const B=(le,U)=>On(U)?U:Mv(U)&&On(U.defaultValue)?U.defaultValue:Array.isArray(le)?le[le.length-1]:le,W=[B,{},!1];return W.t=B,W.i18n={},W.ready=!1,W}(F=f.options.react)!=null&&F.wait&&tu(f,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...Hv(),...f.options.react,...i},{useSuspense:p,keyPrefix:g}=m;let h=d||((D=f.options)==null?void 0:D.defaultNS);h=On(h)?[h]:h||["translation"],(Q=(ee=f.reportNamespaces).addUsedNamespaces)==null||Q.call(ee,h);const y=(f.isInitialized||f.initializedStoreOnce)&&h.every(B=>Ov(B,f,m)),S=Yv(f,i.lng||null,m.nsMode==="fallback"?h:h[0],g),v=()=>S,A=()=>Lg(f,i.lng||null,m.nsMode==="fallback"?h:h[0],g),[N,M]=w.useState(v);let R=h.join();i.lng&&(R=`${i.lng}${R}`);const j=$v(R),C=w.useRef(!0);w.useEffect(()=>{const{bindI18n:B,bindI18nStore:W}=m;C.current=!0,!y&&!p&&(i.lng?Ah(f,i.lng,h,()=>{C.current&&M(A)}):au(f,h,()=>{C.current&&M(A)})),y&&j&&j!==R&&C.current&&M(A);const le=()=>{C.current&&M(A)};return B&&(f==null||f.on(B,le)),W&&(f==null||f.store.on(W,le)),()=>{C.current=!1,f&&(B==null||B.split(" ").forEach(U=>f.off(U,le))),W&&f&&W.split(" ").forEach(U=>f.store.off(U,le))}},[f,R]),w.useEffect(()=>{C.current&&y&&M(v)},[f,g,y]);const O=[N,f,y];if(O.t=N,O.i18n=f,O.ready=y,y||!y&&!p)return O;throw new Promise(B=>{i.lng?Ah(f,i.lng,h,()=>B()):au(f,h,()=>B())})},_g=()=>{const{t:s}=Ne(),{theme:i,setTheme:l}=kv(),c=()=>{l(i==="light"?"dark":"light")};return r.jsx("button",{onClick:c,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none",title:s(i==="light"?"theme.dark":"theme.light"),"aria-label":s(i==="light"?"theme.dark":"theme.light"),children:i==="light"?r.jsx(kb,{className:"h-5 w-5"}):r.jsx(_b,{className:"h-5 w-5"})})},Pv=s=>{const{t:i}=Ne();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:2,...s,children:[r.jsx("title",{children:i("common.language")}),r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2 12h20"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"})]})},Hg=()=>{const{i18n:s}=Ne(),[i,l]=w.useState(!1),[c,d]=w.useState(s.language),f=[{code:"en",label:"English"},{code:"zh",label:"中文"}];w.useEffect(()=>{d(s.language)},[s.language]),w.useEffect(()=>{const g=h=>{h.target.closest(".language-dropdown")||l(!1)};return i&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[i]);const m=g=>{localStorage.setItem("i18nextLng",g),l(!1),window.location.reload()},p=()=>{l(!i)};return r.jsxs("div",{className:"relative language-dropdown",children:[r.jsx("button",{onClick:p,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none","aria-label":"Language Switcher",children:r.jsx(Pv,{className:"h-5 w-5"})}),i&&r.jsx("div",{className:"absolute right-0 mt-2 w-24 bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-200 dark:border-gray-700 z-50",children:r.jsx("div",{children:f.map(g=>r.jsx("button",{onClick:()=>m(g.code),className:`flex items-center w-full px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${c.startsWith(g.code)?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,children:g.label},g.code))})})]})},Fv=s=>r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[r.jsx("title",{children:"GitHub"}),r.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]}),Xv=({onToggleSidebar:s})=>{const{t:i}=Ne();return r.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-10",children:r.jsxs("div",{className:"flex justify-between items-center px-3 py-3",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("button",{onClick:s,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none","aria-label":i("app.toggleSidebar"),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),r.jsx("h1",{className:"ml-4 text-xl font-bold text-gray-900 dark:text-white",children:i("app.title")})]}),r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 mr-2",children:"v0.8.7"}),r.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700","aria-label":"GitHub Repository",children:r.jsx(Fv,{className:"h-5 w-5"})}),r.jsx(_g,{}),r.jsx(Hg,{})]})]})})},Pc=({permissions:s,fallback:i=null,children:l})=>Bg(s)?r.jsx(r.Fragment,{children:l}):r.jsx(r.Fragment,{children:i}),Bg=s=>{const{auth:i}=qr();if(!i.isAuthenticated||!i.user)return!1;const l=i.user.permissions||[];return s==="x"&&!l.includes("x")?!1:l.includes("*")||i.user.isAdmin?!0:(Array.isArray(s)?s:[s]).some(d=>l.includes(d))},Qv="https://registry.npmjs.org",Zv="@samanhappy/mcphub",qg=async()=>{try{const s=await fetch(`${Qv}/${Zv}/latest`);if(!s.ok)throw new Error(`Failed to fetch latest version: ${s.status}`);return(await s.json()).version||null}catch(s){return console.error("Error checking for latest version:",s),null}},Vg=(s,i)=>{if(s==="dev")return-1;const l=s.split(".").map(Number),c=i.split(".").map(Number);for(let d=0;d<3;d++){const f=l[d]||0,m=c[d]||0;if(f>m)return-1;if(f<m)return 1}return 0},Jv=({isOpen:s,onClose:i,version:l})=>{const{t:c}=Ne(),[d,f]=w.useState(!1),[m,p]=w.useState(""),[g,h]=w.useState(!1),y=async()=>{h(!0);try{const S=await qg();S&&(p(S),f(Vg(l,S)>0))}catch(S){console.error("Failed to check for updates:",S)}finally{h(!1)}};return w.useEffect(()=>{s&&y()},[s,l]),s?r.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:i,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":c("common.close"),children:r.jsx(Ur,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("about.title")}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[c("about.currentVersion"),":"]}),r.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:l})]}),d&&m&&r.jsx("div",{className:"bg-blue-50 dark:bg-blue-900 p-3 rounded",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-3 flex-1 text-sm text-blue-700 dark:text-blue-300",children:[r.jsx("p",{children:c("about.newVersionAvailable",{version:m})}),r.jsx("p",{className:"mt-1",children:r.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:underline",children:c("about.viewOnGitHub")})})]})]})}),r.jsxs("button",{onClick:y,disabled:g,className:`mt-4 inline-flex items-center px-4 py-2 border border-gray-200 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium btn-secondary
182
+ ${g?"text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800":"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600"} focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500`,children:[r.jsx(Mb,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),c(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},Iv=({open:s,onOpenChange:i})=>{const{i18n:l,t:c}=Ne();return s?r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:()=>i(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":c("common.close"),children:r.jsx(Ur,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("sponsor.title")}),r.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:l.language==="zh"?r.jsx("img",{src:"./assets/reward.png",alt:c("sponsor.rewardAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}):r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:c("sponsor.supportMessage")}),r.jsx("a",{href:"https://ko-fi.com/samanhappy",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center bg-[#13C3FF] text-white px-4 py-2 rounded-md hover:bg-[#00A5E5] transition-colors",children:c("sponsor.supportButton")})]})})]})})}):null},Wv=({open:s,onOpenChange:i})=>{const{t:l}=Ne();return s?r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:()=>i(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":l("common.close"),children:r.jsx(Ur,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:l("wechat.title")}),r.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[r.jsx("img",{src:"./assets/wexin.png",alt:l("wechat.qrCodeAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}),r.jsx("p",{className:"mt-4 text-center text-gray-700 dark:text-gray-300",children:l("wechat.scanMessage")})]})]})})}):null},e1=s=>r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[r.jsx("title",{children:"WeChat"}),r.jsx("path",{d:"M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z"})]}),t1=s=>r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[r.jsx("title",{children:"Discord"}),r.jsx("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"})]}),a1=s=>r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[r.jsx("title",{children:"Sponsor"}),r.jsx("path",{d:"M17.625 1.499c-2.32 0-4.354 1.203-5.625 3.03-1.271-1.827-3.305-3.03-5.625-3.03C3.129 1.499 0 4.253 0 8.249c0 4.275 3.068 7.847 5.828 10.227a33.14 33.14 0 0 0 5.616 3.876l.028.017.008.003-.001.003c.163.085.342.126.521.125.179.001.358-.041.521-.125l-.001-.003.008-.003.028-.017a33.14 33.14 0 0 0 5.616-3.876C20.932 16.096 24 12.524 24 8.249c0-3.996-3.129-6.75-6.375-6.75zm-.919 15.275a30.766 30.766 0 0 1-4.703 3.316l-.004-.002-.004.002a30.955 30.955 0 0 1-4.703-3.316c-2.677-2.307-5.047-5.298-5.047-8.523 0-2.754 2.121-4.5 4.125-4.5 2.06 0 3.914 1.479 4.544 3.684.143.495.596.797 1.086.796.49.001.943-.302 1.085-.796.63-2.205 2.484-3.684 4.544-3.684 2.004 0 4.125 1.746 4.125 4.5 0 3.225-2.37 6.216-5.048 8.523z"})]}),n1=({collapsed:s,version:i})=>{var Q;const{t:l,i18n:c}=Ne(),d=Mn(),{auth:f,logout:m}=qr(),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[S,v]=w.useState(!1),[A,N]=w.useState(!1),[M,R]=w.useState(!1),j=w.useRef(null);w.useEffect(()=>{(async()=>{try{const W=await qg();W&&y(Vg(i,W)>0)}catch(W){console.error("Error checking for new version:",W)}})()},[i]),w.useEffect(()=>{const B=W=>{j.current&&!j.current.contains(W.target)&&g(!1)};return document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[]);const C=()=>{d("/settings"),g(!1)},O=()=>{m(),d("/login")},F=()=>{v(!0),g(!1)},D=()=>{N(!0),g(!1)},ee=()=>{R(!0),g(!1)};return r.jsxs("div",{ref:j,className:"relative",children:[r.jsxs("button",{onClick:()=>g(!p),className:`flex ${s?"justify-center":"items-center"} w-full p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors rounded-md ${p?"bg-gray-100 dark:bg-gray-700":""}`,children:[r.jsxs("div",{className:"flex-shrink-0 relative",children:[r.jsx("div",{className:"w-5 h-5 flex items-center justify-center rounded-full border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700",children:r.jsx(Vb,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),h&&r.jsx("span",{className:"absolute -top-1 -right-1 block w-2 h-2 bg-red-500 rounded-full"})]}),!s&&r.jsx("div",{className:"ml-3 flex flex-col items-start",children:r.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:((Q=f.user)==null?void 0:Q.username)||l("auth.user")})})]}),p&&r.jsxs("div",{className:"absolute top-0 transform -translate-y-full left-0 w-full min-w-max bg-white border border-gray-200 dark:bg-gray-800 z-50",children:[r.jsxs("button",{onClick:D,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(a1,{className:"h-4 w-4 mr-2"}),l("sponsor.label")]}),c.language==="zh"?r.jsxs("button",{onClick:ee,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(e1,{className:"h-4 w-4 mr-2"}),l("wechat.label")]}):r.jsxs("a",{href:"https://discord.gg/qMKNsn5Q",target:"_blank",rel:"noopener noreferrer",className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(t1,{className:"h-4 w-4 mr-2"}),l("discord.label")]}),r.jsxs("button",{onClick:C,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(Db,{className:"h-4 w-4 mr-2"}),l("nav.settings")]}),r.jsxs("button",{onClick:F,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 relative",children:[r.jsx(vb,{className:"h-4 w-4 mr-2"}),l("about.title"),h&&r.jsx("span",{className:"absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"})]}),r.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),r.jsxs("button",{onClick:O,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(Eb,{className:"h-4 w-4 mr-2"}),l("app.logout")]})]}),r.jsx(Jv,{isOpen:S,onClose:()=>v(!1),version:i}),r.jsx(Iv,{open:A,onOpenChange:N}),r.jsx(Wv,{open:M,onOpenChange:R})]})},s1=({collapsed:s})=>{var f;const{t:i}=Ne(),{auth:l}=qr(),c="0.8.7",d=[{path:"/",label:i("nav.dashboard"),icon:r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[r.jsx("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),r.jsx("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})]})},{path:"/servers",label:i("nav.servers"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"})})},{path:"/groups",label:i("nav.groups"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"})})},...(f=l.user)!=null&&f.isAdmin&&Bg("x")?[{path:"/users",label:i("nav.users"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M9 6a3 3 0 11-6 0 3 3 0 016 0zM17 6a3 3 0 11-6 0 3 3 0 016 0zM12.93 17c.046-.327.07-.66.07-1a6.97 6.97 0 00-1.5-4.33A5 5 0 0119 16v1h-6.07zM6 11a5 5 0 015 5v1H1v-1a5 5 0 015-5z"})})}]:[],{path:"/market",label:i("nav.market"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"})})},{path:"/logs",label:i("nav.logs"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}];return r.jsxs("aside",{className:`bg-white dark:bg-gray-800 shadow-sm transition-all duration-300 ease-in-out flex flex-col h-full relative ${s?"w-16":"w-64"}`,children:[r.jsx("div",{className:"overflow-y-auto flex-grow",children:r.jsx("nav",{className:"p-3 space-y-1",children:d.map(m=>r.jsxs(mg,{to:m.path,className:({isActive:p})=>`flex items-center px-2.5 py-2 rounded-lg transition-colors duration-200
183
+ ${p?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,end:m.path==="/",children:[r.jsx("span",{className:"flex-shrink-0",children:m.icon}),!s&&r.jsx("span",{className:"ml-3",children:m.label})]},m.path))})}),r.jsx("div",{className:"p-3 bg-white dark:bg-gray-800",children:r.jsx(n1,{collapsed:s,version:c})})]})},r1=({children:s})=>r.jsx("main",{className:"flex-1 overflow-auto p-6 bg-gray-100 dark:bg-gray-900",children:r.jsx("div",{className:"container mx-auto",children:s})}),l1=()=>{const[s,i]=Cs.useState(!1),l=()=>{i(!s)};return r.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[r.jsx(Xv,{onToggleSidebar:l}),r.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[r.jsx(s1,{collapsed:s}),r.jsx(r1,{children:r.jsx(ig,{})})]})]})},i1=({redirectPath:s="/login"})=>{const{t:i}=Ne(),{auth:l}=qr();return l.loading?r.jsx("div",{className:"flex items-center justify-center h-screen",children:i("app.loading")}):l.isAuthenticated?r.jsx(ig,{}):r.jsx(lg,{to:s,replace:!0})},o1=()=>{const{t:s}=Ne(),[i,l]=w.useState(""),[c,d]=w.useState(""),[f,m]=w.useState(null),[p,g]=w.useState(!1),{login:h}=qr(),y=Mn(),S=async v=>{v.preventDefault(),m(null),g(!0);try{if(!i||!c){m(s("auth.emptyFields")),g(!1);return}await h(i,c)?y("/"):m(s("auth.loginFailed"))}catch{m(s("auth.loginError"))}finally{g(!1)}};return r.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8 login-container",children:[r.jsxs("div",{className:"absolute top-4 right-4 w-full max-w-xs flex justify-end",children:[r.jsx(_g,{}),r.jsx(Hg,{})]}),r.jsxs("div",{className:"max-w-md w-full space-y-8 login-card p-8",children:[r.jsx("div",{children:r.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white",children:s("auth.loginTitle")})}),r.jsxs("form",{className:"mt-8 space-y-6",onSubmit:S,children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"username",className:"sr-only",children:s("auth.username")}),r.jsx("input",{id:"username",name:"username",type:"text",autoComplete:"username",required:!0,className:"appearance-none relative block w-full px-3 py-3 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white dark:bg-gray-800 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm transition-all duration-200 form-input shadow-sm",placeholder:s("auth.username"),value:i,onChange:v=>l(v.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"password",className:"sr-only",children:s("auth.password")}),r.jsx("input",{id:"password",name:"password",type:"password",autoComplete:"current-password",required:!0,className:"appearance-none relative block w-full px-3 py-3 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white dark:bg-gray-800 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm login-input transition-all duration-200 form-input shadow-sm",placeholder:s("auth.password"),value:c,onChange:v=>d(v.target.value)})]})]}),f&&r.jsx("div",{className:"text-red-500 dark:text-red-400 text-sm text-center error-box p-2 rounded",children:f}),r.jsx("div",{children:r.jsx("button",{type:"submit",disabled:p,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 login-button transition-all duration-200 btn-primary",children:s(p?"auth.loggingIn":"auth.login")})})]})]})]})},ci={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},Gr=()=>{const{t:s}=Ne(),[i,l]=w.useState([]),[c,d]=w.useState(null),[f,m]=w.useState(0),[p,g]=w.useState(!0),[h,y]=w.useState(0),S=w.useRef(null),v=w.useRef(0),A=()=>{S.current&&(clearInterval(S.current),S.current=null)},N=w.useCallback(()=>{A();const F=async()=>{try{const D=await bt("/servers");D&&D.success&&Array.isArray(D.data)?l(D.data):D&&Array.isArray(D)?l(D):(console.error("Invalid server data format:",D),l([])),d(null)}catch(D){console.error("Error fetching servers during normal polling:",D),navigator.onLine?D instanceof TypeError&&(D.message.includes("NetworkError")||D.message.includes("Failed to fetch"))?d(s("errors.serverConnection")):d(s("errors.serverFetch")):d(s("errors.network"))}};F(),S.current=setInterval(F,ci.normal.pollingInterval)},[s]);return w.useEffect(()=>{f>0&&(v.current=0,y(0));const F=async()=>{try{const D=await bt("/servers");return D&&D.success&&Array.isArray(D.data)?(l(D.data),g(!1),N(),!0):D&&Array.isArray(D)?(l(D),g(!1),N(),!0):(console.error("Invalid server data format:",D),l([]),g(!1),N(),!0)}catch(D){return v.current+=1,console.error(`Initial loading attempt ${v.current} failed:`,D),y(v.current),navigator.onLine?d(s("errors.initialStartup")):d(s("errors.network")),v.current>=ci.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),g(!1),A(),N()),!1}};return p?(A(),F(),S.current=setInterval(F,ci.startup.pollingInterval),console.log(`Started initial polling with interval: ${ci.startup.pollingInterval}ms`)):N(),()=>{A()}},[f,s,p,N]),{servers:i,error:c,setError:d,isLoading:p,fetchAttempts:h,triggerRefresh:()=>{A(),p&&(g(!0),v.current=0,y(0)),m(F=>F+1)},handleServerAdd:()=>{m(F=>F+1)},handleServerEdit:async F=>{try{const D=await bt("/settings");if(D&&D.success&&D.data&&D.data.mcpServers&&D.data.mcpServers[F.name]){const ee=D.data.mcpServers[F.name];return{name:F.name,status:F.status,tools:F.tools||[],config:ee}}else return console.error("Failed to get server config from settings:",D),d(s("server.invalidConfig",{serverName:F.name})),null}catch(D){return console.error("Error fetching server settings:",D),d(D instanceof Error?D.message:String(D)),null}},handleServerRemove:async F=>{try{const D=await pi(`/servers/${F}`);return!D||!D.success?(d((D==null?void 0:D.message)||s("server.deleteError",{serverName:F})),!1):(m(ee=>ee+1),!0)}catch(D){return d(s("errors.general")+": "+(D instanceof Error?D.message:String(D))),!1}},handleServerToggle:async(F,D)=>{try{const ee=await Wt(`/servers/${F.name}/toggle`,{enabled:D});return!ee||!ee.success?(console.error("Failed to toggle server:",ee),d((ee==null?void 0:ee.message)||s("server.toggleError",{serverName:F.name})),!1):(m(Q=>Q+1),!0)}catch(ee){return console.error("Error toggling server:",ee),d(ee instanceof Error?ee.message:String(ee)),!1}}}},c1=()=>{const{t:s}=Ne(),{servers:i,error:l,setError:c,isLoading:d}=Gr(),f={total:i.length,online:i.filter(p=>p.status==="connected").length,offline:i.filter(p=>p.status==="disconnected").length,connecting:i.filter(p=>p.status==="connecting").length},m={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.dashboard.title")}),l&&r.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-status-red text-lg font-medium",children:s("app.error")}),r.jsx("p",{className:"text-gray-600 mt-1",children:l})]}),r.jsx("button",{onClick:()=>c(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":s("app.closeButton"),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),d&&r.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}),!d&&r.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4",children:[r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.totalServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.total})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.onlineServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.online})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.offlineServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.offline})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.connectingServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.connecting})]})]})})]}),i.length>0&&!d&&r.jsxs("div",{className:"mt-8",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:s("pages.dashboard.recentServers")}),r.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:r.jsxs("table",{className:"min-w-full",children:[r.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.name")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.status")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.tools")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.enabled")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:i.slice(0,5).map((p,g)=>{var h;return r.jsxs("tr",{children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:p.name}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:r.jsx("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${p.status==="connected"?"status-badge-online":p.status==="disconnected"?"status-badge-offline":"status-badge-connecting"}`,children:s(m[p.status]||p.status)})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((h=p.tools)==null?void 0:h.length)||0}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:p.enabled!==!1?r.jsx("span",{className:"text-green-600",children:"✓"}):r.jsx("span",{className:"text-status-red",children:"✗"})})]},g)})})]})})]})]})},u1="modulepreload",d1=function(s,i){return new URL(s,i).href},Rh={},f1=function(i,l,c){let d=Promise.resolve();if(l&&l.length>0){let m=function(y){return Promise.all(y.map(S=>Promise.resolve(S).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),h=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));d=m(l.map(y=>{if(y=d1(y,c),y in Rh)return;Rh[y]=!0;const S=y.endsWith(".css"),v=S?'[rel="stylesheet"]':"";if(!!c)for(let M=p.length-1;M>=0;M--){const R=p[M];if(R.href===y&&(!S||R.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const N=document.createElement("link");if(N.rel=S?"stylesheet":u1,S||(N.as="script"),N.crossOrigin="",N.href=y,h&&N.setAttribute("nonce",h),document.head.appendChild(N),S)return new Promise((M,R)=>{N.addEventListener("load",M),N.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return d.then(m=>{for(const p of m||[])p.status==="rejected"&&f(p.reason);return i().catch(f)})},m1={default:"bg-blue-500 text-white hover:bg-blue-600",secondary:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600",outline:"bg-transparent border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800",destructive:"bg-red-500 text-white hover:bg-red-600"};function ui({children:s,variant:i="default",className:l,onClick:c}){return r.jsx("span",{className:Ra("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",m1[i],c?"cursor-pointer":"",l),onClick:c,children:s})}const h1=({status:s})=>{const{t:i}=Ne(),l={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline"},c={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return r.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${l[s]}`,children:i(c[s]||s)})},Gg=async(s,i)=>{var l;try{const c=i?`/tools/call/${i}`:"/tools/call",d=await Wt(c,{toolName:s.toolName,arguments:s.arguments},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return d.success?{success:!0,content:((l=d.data)==null?void 0:l.content)||[]}:{success:!1,error:d.message||"Tool call failed"}}catch(c){return console.error("Error calling tool:",c),{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}},g1=async(s,i,l)=>{try{const c=await Wt(`/servers/${s}/tools/${i}/toggle`,{enabled:l},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:c.success,error:c.success?void 0:c.message}}catch(c){return console.error("Error toggling tool:",c),{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}},Kg=async(s,i,l)=>{try{const c=await ca(`/servers/${s}/tools/${i}/description`,{description:l},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:c.success,error:c.success?void 0:c.message}}catch(c){return console.error("Error updating tool description:",c),{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}},p1=Object.freeze(Object.defineProperty({__proto__:null,callTool:Gg,toggleTool:g1,updateToolDescription:Kg},Symbol.toStringTag,{value:"Module"})),Ns=({checked:s,onCheckedChange:i,disabled:l=!1})=>r.jsx("button",{type:"button",role:"switch","aria-checked":s,disabled:l,className:Ra("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",s?"bg-blue-200":"bg-gray-100",l?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!l&&i(!s),children:r.jsx("span",{className:Ra("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",s?"translate-x-6":"translate-x-1")})}),x1=({schema:s,onSubmit:i,onCancel:l,loading:c=!1,storageKey:d,title:f})=>{const{t:m}=Ne(),[p,g]=w.useState({}),[h,y]=w.useState({}),[S,v]=w.useState(!1),[A,N]=w.useState(""),[M,R]=w.useState(""),j=w.useMemo(()=>(L=>{const Z=_=>{if(typeof _=="object"&&_!==null){const $=_;return{type:$.type||"string",description:$.description,enum:$.enum,default:$.default,properties:$.properties?Object.fromEntries(Object.entries($.properties).map(([E,G])=>[E,Z(G)])):void 0,required:$.required,items:$.items?Z($.items):void 0}}return{type:"string"}};return{type:L.type,properties:L.properties?Object.fromEntries(Object.entries(L.properties).map(([_,$])=>[_,Z($)])):void 0,required:L.required}})(s),[s]);w.useEffect(()=>{const U=(Z,_="")=>{const $={};return Z.type==="object"&&Z.properties&&Object.entries(Z.properties).forEach(([E,G])=>{const X=_?`${_}.${E}`:E;G.default!==void 0?$[E]=G.default:G.type==="string"?$[E]="":G.type==="number"||G.type==="integer"?$[E]=0:G.type==="boolean"?$[E]=!1:G.type==="array"?$[E]=[]:G.type==="object"&&(G.properties?$[E]=U(G,X):$[E]={})}),$};let L=U(j);if(d)try{const Z=localStorage.getItem(d);if(Z){const _=JSON.parse(Z);L={...L,..._}}}catch(Z){console.warn("Failed to load saved form data:",Z)}g(L)},[j,d]),w.useEffect(()=>{S&&Object.keys(p).length>0&&(N(JSON.stringify(p,null,2)),R(""))},[S,p]);const C=U=>{N(U),R("");try{const L=JSON.parse(U);if(g(L),d)try{localStorage.setItem(d,JSON.stringify(L))}catch(Z){console.warn("Failed to save form data to localStorage:",Z)}}catch{R(m("tool.invalidJsonFormat"))}},O=()=>{N(JSON.stringify(p,null,2)),R(""),v(!0)},F=()=>{if(A.trim())try{const U=JSON.parse(A);g(U),R(""),v(!1)}catch{R(m("tool.fixJsonBeforeSwitching"));return}else v(!1)},D=(U,L)=>{g(Z=>{const _={...Z},$=U.split(".");let E=_;for(let G=0;G<$.length-1;G++)E[$[G]]||(E[$[G]]={}),E=E[$[G]];if(E[$[$.length-1]]=L,d)try{localStorage.setItem(d,JSON.stringify(_))}catch(G){console.warn("Failed to save form data to localStorage:",G)}return _}),h[U]&&y(Z=>{const _={...Z};return delete _[U],_})},ee=()=>{const U={},L=(Z,_,$="")=>{Z.type==="object"&&Z.properties&&Object.entries(Z.properties).forEach(([E,G])=>{var T;const X=$?`${$}.${E}`:E,oe=B(_,X);if((T=Z.required)!=null&&T.includes(E)&&(oe==null||oe==="")){U[X]=`${E} is required`;return}oe!=null&&oe!==""&&(G.type==="string"&&typeof oe!="string"?U[X]=`${E} must be a string`:G.type==="number"&&typeof oe!="number"?U[X]=`${E} must be a number`:G.type==="integer"&&(!Number.isInteger(oe)||typeof oe!="number")?U[X]=`${E} must be an integer`:G.type==="boolean"&&typeof oe!="boolean"?U[X]=`${E} must be a boolean`:G.type==="array"&&Array.isArray(oe)?G.items&&oe.forEach((P,re)=>{var ne;((ne=G.items)==null?void 0:ne.type)==="object"&&G.items.properties&&L(G.items,P,`${X}.${re}`)}):G.type==="object"&&typeof oe=="object"&&L(G,oe,X))})};return L(j,p),y(U),Object.keys(U).length===0},Q=U=>{U.preventDefault(),ee()&&i(p)},B=(U,L)=>L.split(".").reduce((Z,_)=>Z==null?void 0:Z[_],U),W=(U,L,Z,_)=>{const $=Z==null?void 0:Z[U];return L.type==="string"?L.enum?r.jsxs("select",{value:$||"",onChange:E=>_(E.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),L.enum.map((E,G)=>r.jsx("option",{value:E,children:E},G))]}):r.jsx("input",{type:"text",value:$||"",onChange:E=>_(E.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input",placeholder:L.description||m("tool.enterKey",{key:U})}):L.type==="number"||L.type==="integer"?r.jsx("input",{type:"number",step:L.type==="integer"?"1":"any",value:$||"",onChange:E=>{const G=E.target.value===""?"":L.type==="integer"?parseInt(E.target.value):parseFloat(E.target.value);_(G)},className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input"}):L.type==="boolean"?r.jsx("input",{type:"checkbox",checked:$||!1,onChange:E=>_(E.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):r.jsx("input",{type:"text",value:$||"",onChange:E=>_(E.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input",placeholder:L.description||m("tool.enterKey",{key:U})})},le=(U,L,Z="")=>{var G,X,oe,T,P,re,ne,ue,ve,I,se,Se,Ke,Ve;const _=Z?`${Z}.${U}`:U,$=B(p,_),E=h[_];if(L.type==="array"){const be=B(p,_)||[];return r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Z?(X=(G=B(j,Z))==null?void 0:G.required)==null?void 0:X.includes(U):(oe=j.required)==null?void 0:oe.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),L.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:L.description}),r.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[be.map((Me,Fe)=>{var da,ln,on;return r.jsxs("div",{className:"mb-3 p-3 bg-white border rounded-md",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("span",{className:"text-sm font-medium text-gray-600",children:m("tool.item",{index:Fe+1})}),r.jsx("button",{type:"button",onClick:()=>{const De=[...be];De.splice(Fe,1),D(_,De)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((da=L.items)==null?void 0:da.type)==="string"&&L.items.enum?r.jsxs("select",{value:Me||"",onChange:De=>{const vt=[...be];vt[Fe]=De.target.value,D(_,vt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),L.items.enum.map((De,vt)=>r.jsx("option",{value:De,children:De},vt))]}):((ln=L.items)==null?void 0:ln.type)==="object"&&L.items.properties?r.jsx("div",{className:"space-y-3",children:Object.entries(L.items.properties).map(([De,vt])=>{var Ma,za;return r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[De,((za=(Ma=L.items)==null?void 0:Ma.required)==null?void 0:za.includes(De))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),W(De,vt,Me,fa=>{const Da=[...be];Da[Fe]={...Da[Fe],[De]:fa},D(_,Da)})]},De)})}):r.jsx("input",{type:"text",value:Me||"",onChange:De=>{const vt=[...be];vt[Fe]=De.target.value,D(_,vt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:m("tool.enterValue",{type:((on=L.items)==null?void 0:on.type)||"value"})})]},Fe)}),r.jsx("button",{type:"button",onClick:()=>{var Fe;const Me=((Fe=L.items)==null?void 0:Fe.type)==="object"?{}:"";D(_,[...be,Me])},className:"w-full mt-2 px-3 py-2 text-sm text-blue-600 border border-blue-300 rounded-md hover:bg-blue-50",children:m("tool.addItem",{key:U})})]}),E&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]},_)}return L.type==="object"?L.properties?r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Z?(P=(T=B(j,Z))==null?void 0:T.required)==null?void 0:P.includes(U):(re=j.required)==null?void 0:re.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),L.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:L.description}),r.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(L.properties).map(([be,Me])=>le(be,Me,_))}),E&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]},_):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Z?(ue=(ne=B(j,Z))==null?void 0:ne.required)==null?void 0:ue.includes(U):(ve=j.required)==null?void 0:ve.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),L.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:L.description}),r.jsx("textarea",{value:typeof $=="object"?JSON.stringify($,null,2):$||"{}",onChange:be=>{try{const Me=JSON.parse(be.target.value);D(_,Me)}catch{D(_,be.target.value)}},placeholder:`{
184
+ "key": "value"
185
+ }`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${E?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),E&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]},_):L.type==="string"?L.enum?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Z?!1:(I=j.required)==null?void 0:I.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),L.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:L.description}),r.jsxs("select",{value:$||"",onChange:be=>D(_,be.target.value),className:`w-full border rounded-md px-3 py-2 ${E?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),L.enum.map((be,Me)=>r.jsx("option",{value:be,children:be},Me))]}),E&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]},_):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Z?!1:(se=j.required)==null?void 0:se.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),L.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:L.description}),r.jsx("input",{type:"text",value:$||"",onChange:be=>D(_,be.target.value),className:`w-full border rounded-md px-3 py-2 ${E?"border-red":"border-gray-200"} focus:outline-none form-input`}),E&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]},_):L.type==="number"||L.type==="integer"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Z?!1:(Se=j.required)==null?void 0:Se.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),L.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:L.description}),r.jsx("input",{type:"number",step:L.type==="integer"?"1":"any",value:$||"",onChange:be=>{const Me=be.target.value===""?"":L.type==="integer"?parseInt(be.target.value):parseFloat(be.target.value);D(_,Me)},className:`w-full border rounded-md px-3 py-2 form-input ${E?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),E&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]},_):L.type==="boolean"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:$||!1,onChange:be=>D(_,be.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),r.jsxs("label",{className:"ml-2 block text-sm text-gray-700",children:[U,(Z?!1:(Ke=j.required)==null?void 0:Ke.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),L.description&&r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:L.description}),E&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]},_):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Z?!1:(Ve=j.required)==null?void 0:Ve.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",L.type,")"]})]}),L.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:L.description}),r.jsx("input",{type:"text",value:$||"",onChange:be=>D(_,be.target.value),placeholder:m("tool.enterValue",{type:L.type}),className:`w-full border rounded-md px-3 py-2 ${E?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),E&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]},_)};return j.properties?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex justify-between items-center pb-3",children:[r.jsx("h6",{className:"text-md font-medium text-gray-900",children:f}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx("button",{type:"button",onClick:F,className:`px-3 py-1 text-sm rounded-md transition-colors ${S?"text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary":"bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary"}`,children:m("tool.formMode")}),r.jsx("button",{type:"button",onClick:O,className:`px-3 py-1 text-sm rounded-md transition-colors ${S?"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary":"text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary"}`,children:m("tool.jsonMode")})]})]}),S?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("tool.jsonConfiguration")}),r.jsx("textarea",{value:A,onChange:U=>C(U.target.value),placeholder:`{
186
+ "key": "value"
187
+ }`,className:`w-full h-64 border rounded-md px-3 py-2 font-mono text-sm resize-y form-input ${M?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),M&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:M})]}),r.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),r.jsx("button",{onClick:()=>{try{const U=JSON.parse(A);i(U)}catch{R(m("tool.invalidJsonFormat"))}},disabled:c||!!M,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(c?"tool.running":"tool.runTool")})]})]}):r.jsxs("form",{onSubmit:Q,className:"space-y-4",children:[Object.entries(j.properties||{}).map(([U,L])=>le(U,L)),r.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),r.jsx("button",{type:"submit",disabled:c,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(c?"tool.running":"tool.runTool")})]})]})]}):r.jsxs("div",{className:"p-4 bg-gray-50 rounded-md",children:[r.jsx("p",{className:"text-sm text-gray-600",children:m("tool.noParameters")}),r.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-sm text-gray-600 bg-gray-100 rounded-md hover:bg-gray-200",children:m("tool.cancel")}),r.jsx("button",{onClick:()=>i({}),disabled:c,className:"px-4 py-2 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:m(c?"tool.running":"tool.runTool")})]})]})},y1=({result:s,onClose:i})=>{const{t:l}=Ne(),c=s.content,d=m=>Array.isArray(m)?m.map((p,g)=>r.jsx("div",{className:"mb-3 last:mb-0",children:f(p)},g)):f(m),f=m=>{if(typeof m=="string")return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m})});if(typeof m=="object"&&m!==null){if(m.type==="text"&&m.text)return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m.text})});if(m.type==="image"&&m.data)return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("img",{src:`data:${m.mimeType||"image/png"};base64,${m.data}`,alt:l("tool.toolResult"),className:"max-w-full h-auto rounded-md"})});try{const p=typeof m=="string"?JSON.parse(m):m;return r.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[r.jsx("div",{className:"text-xs text-gray-500 mb-2",children:l("tool.jsonResponse")}),r.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(p,null,2)})]})}catch{return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})}}return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})};return r.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[r.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[s.success?r.jsx(mb,{size:20,className:"text-status-green"}):r.jsx(gb,{size:20,className:"text-status-red"}),r.jsx("div",{children:r.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[l("tool.execution")," ",s.success?l("tool.successful"):l("tool.failed")]})})]}),r.jsx("button",{onClick:i,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),r.jsx("div",{className:"p-4",children:s.success?r.jsx("div",{children:s.content&&s.content.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.result")}),d(s.content)]}):r.jsx("div",{className:"text-sm text-gray-500 italic",children:l("tool.noContent")})}):r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[r.jsx(bg,{size:16,className:"text-red-500"}),r.jsx("span",{className:"text-sm font-medium text-red-700",children:l("tool.error")})]}),c&&c.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.errorDetails")}),d(c)]}):r.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:r.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:s.error||s.message||l("tool.unknownError")})})]})})]})},b1=({tool:s,server:i,onToggle:l,onDescriptionUpdate:c})=>{const{t:d}=Ne(),[f,m]=w.useState(!1),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[S,v]=w.useState(null),[A,N]=w.useState(!1),[M,R]=w.useState(s.description||""),j=w.useRef(null),C=w.useRef(null),[O,F]=w.useState(0);w.useEffect(()=>{A&&j.current&&(j.current.focus(),O>0&&(j.current.style.width=`${O+20}px`))},[A,O]),w.useEffect(()=>{!A&&C.current&&F(C.current.offsetWidth)},[A,M]);const D=w.useCallback(()=>`mcphub_tool_form_${i?`${i}_`:""}${s.name}`,[s.name,i]),ee=w.useCallback(()=>{localStorage.removeItem(D())},[D]),Q=$=>{l&&l(s.name,$)},B=()=>{N(!0)},W=async()=>{try{const $=await Kg(i,s.name,M);$.success?(N(!1),c&&c(s.name,M)):(R(s.description||""),console.error("Failed to update tool description:",$.error))}catch($){console.error("Error updating tool description:",$),R(s.description||""),N(!1)}},le=$=>{R($.target.value)},U=$=>{$.key==="Enter"?W():$.key==="Escape"&&(R(s.description||""),N(!1))},L=async $=>{y(!0);try{const E=await Gg({toolName:s.name,arguments:$},i);v(E)}catch(E){v({success:!1,error:E instanceof Error?E.message:"Unknown error occurred"})}finally{y(!1)}},Z=()=>{g(!1),ee(),v(null)},_=()=>{v(null)};return r.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg p-4 mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>m(!f),children:[r.jsx("div",{className:"flex-1",children:r.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[s.name.replace(i+"-",""),r.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:A?r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:j,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:M,onChange:le,onKeyDown:U,onClick:$=>$.stopPropagation(),style:{minWidth:"100px",width:O>0?`${O+20}px`:"auto"}}),r.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:$=>{$.stopPropagation(),W()},children:r.jsx(Ci,{size:16})})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:C,children:M||d("tool.noDescription")}),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:$=>{$.stopPropagation(),B()},children:r.jsx(vg,{size:14})})]})})]})}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("div",{className:"flex items-center space-x-2",onClick:$=>$.stopPropagation(),children:r.jsx(Ns,{checked:s.enabled??!0,onCheckedChange:Q,disabled:h})}),r.jsxs("button",{onClick:$=>{$.stopPropagation(),m(!0),g(!0)},className:"flex items-center space-x-1 px-3 py-1 text-sm text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors btn-primary",disabled:h||!s.enabled,children:[h?r.jsx(Nb,{size:14,className:"animate-spin"}):r.jsx(Rb,{size:14}),r.jsx("span",{children:d(h?"tool.running":"tool.run")})]}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:f?r.jsx(xu,{size:18}):r.jsx(yg,{size:18})})]})]}),f&&r.jsxs("div",{className:"mt-4 space-y-4",children:[!p&&r.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:d("tool.inputSchema")}),r.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(s.inputSchema,null,2)})]}),p&&r.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[r.jsx(x1,{schema:s.inputSchema||{type:"object"},onSubmit:L,onCancel:Z,loading:h,storageKey:D(),title:d("tool.runToolWithName",{name:s.name.replace(i+"-","")})}),S&&r.jsx("div",{className:"mt-4",children:r.jsx(y1,{result:S,onClose:_})})]})]})]})},$g=({isOpen:s,onClose:i,onConfirm:l,serverName:c,isGroup:d=!1,isUser:f=!1})=>{const{t:m}=Ne();return s?r.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:m(f?"users.confirmDelete":d?"groups.confirmDelete":"server.confirmDelete")}),r.jsx("p",{className:"text-gray-500 mb-6",children:f?m("users.deleteWarning",{username:c}):d?m("groups.deleteWarning",{name:c}):m("server.deleteWarning",{name:c})}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:i,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),r.jsx("button",{onClick:l,className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger",children:m("common.delete")})]})]})})}):null},v1=({server:s,onRemove:i,onEdit:l,onToggle:c,onRefresh:d})=>{var W;const{t:f}=Ne(),{showToast:m}=Vr(),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[S,v]=w.useState(!1),[A,N]=w.useState(!1),[M,R]=w.useState(!1),j=w.useRef(null);w.useEffect(()=>{const le=U=>{j.current&&!j.current.contains(U.target)&&N(!1)};return document.addEventListener("mousedown",le),()=>{document.removeEventListener("mousedown",le)}},[]);const C=le=>{le.stopPropagation(),y(!0)},O=le=>{le.stopPropagation(),l(s)},F=async le=>{if(le.stopPropagation(),!(S||!c)){v(!0);try{await c(s,s.enabled===!1)}finally{v(!1)}}},D=le=>{le.stopPropagation(),N(!A)},ee=le=>{if(le.stopPropagation(),!!s.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(s.error).then(()=>{R(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>R(!1),2e3)});else{const U=document.createElement("textarea");U.value=s.error,U.style.position="fixed",U.style.left="-9999px",document.body.appendChild(U),U.focus(),U.select();try{document.execCommand("copy"),R(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>R(!1),2e3)}catch(L){m(f("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",L)}document.body.removeChild(U)}},Q=()=>{i(s.name),y(!1)},B=async(le,U)=>{try{const{toggleTool:L}=await f1(async()=>{const{toggleTool:_}=await Promise.resolve().then(()=>p1);return{toggleTool:_}},[],import.meta.url),Z=await L(s.name,le,U);Z.success?(m(f(U?"tool.enableSuccess":"tool.disableSuccess",{name:le}),"success"),d&&d()):m(Z.error||f("tool.toggleFailed"),"error")}catch(L){console.error("Error toggling tool:",L),m(f("tool.toggleFailed"),"error")}};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`bg-white shadow rounded-lg p-6 mb-6 page-card transition-all duration-200 ${s.enabled===!1?"opacity-60":""}`,children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>g(!p),children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("h2",{className:`text-xl font-semibold ${s.enabled===!1?"text-gray-600":"text-gray-900"}`,children:s.name}),r.jsx(h1,{status:s.status}),r.jsxs("div",{className:"flex items-center px-2 py-1 bg-blue-50 text-blue-700 rounded-full text-sm btn-primary",children:[r.jsx("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),r.jsxs("span",{children:[((W=s.tools)==null?void 0:W.length)||0," ",f("server.tools")]})]}),s.error&&r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"cursor-pointer",onClick:D,"aria-label":f("server.viewErrorDetails"),children:r.jsx(bg,{className:"text-red-500 hover:text-red-600",size:18})}),A&&r.jsxs("div",{ref:j,className:"absolute z-10 mt-2 bg-white border border-gray-200 rounded-md shadow-lg p-0 w-120",style:{left:"-231px",top:"24px",maxHeight:"300px",overflowY:"auto",width:"480px",transform:"translateX(50%)"},onClick:le=>le.stopPropagation(),children:[r.jsxs("div",{className:"flex justify-between items-center sticky top-0 bg-white py-2 px-4 border-b border-gray-200 z-20 shadow-sm",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("h4",{className:"text-sm font-medium text-red-600",children:f("server.errorDetails")}),r.jsx("button",{onClick:ee,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:f("common.copy"),children:M?r.jsx(Ci,{size:14,className:"text-green-500"}):r.jsx(Jc,{size:14})})]}),r.jsx("button",{onClick:le=>{le.stopPropagation(),N(!1)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),r.jsx("div",{className:"p-4 pt-2",children:r.jsx("pre",{className:"text-sm text-gray-700 break-words whitespace-pre-wrap",children:s.error})})]})]})]}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx("button",{onClick:O,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:f("server.edit")}),r.jsx("div",{className:"flex items-center",children:r.jsx("button",{onClick:F,className:`px-3 py-1 text-sm rounded transition-colors ${S?"bg-gray-200 text-gray-500":s.enabled!==!1?"bg-green-100 text-green-800 hover:bg-green-200 btn-secondary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-primary"}`,disabled:S,children:S?f("common.processing"):s.enabled!==!1?f("server.disable"):f("server.enable")})}),r.jsx("button",{onClick:C,className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 text-sm btn-danger",children:f("server.delete")}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:p?r.jsx(xu,{size:18}):r.jsx(yg,{size:18})})]})]}),p&&s.tools&&r.jsxs("div",{className:"mt-6",children:[r.jsx("h6",{className:`font-medium ${s.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:f("server.tools")}),r.jsx("div",{className:"space-y-4",children:s.tools.map((le,U)=>r.jsx(b1,{server:s.name,tool:le,onToggle:B},U))})]})]}),r.jsx($g,{isOpen:h,onClose:()=>y(!1),onConfirm:Q,serverName:s.name})]})},bu=({onSubmit:s,onCancel:i,initialData:l=null,modalTitle:c,formError:d=null})=>{var $,E,G,X,oe,T,P,re,ne,ue,ve,I,se,Se,Ke,Ve,be,Me,Fe,da,ln,on,De,vt,Ma,za,fa,Da,Os,Kr,$r,Ua,ft,$t,mt,Yr,Pr,Fr,cn,un,ta,dn;const{t:f}=Ne(),m=()=>!l||!l.config?"stdio":l.config.type?l.config.type:l.config.url?"sse":"stdio",[p,g]=w.useState(m()),[h,y]=w.useState({name:l&&l.name||"",url:l&&l.config&&l.config.url||"",command:l&&l.config&&l.config.command||"",arguments:l&&l.config&&l.config.args?Array.isArray(l.config.args)?l.config.args.join(" "):String(l.config.args):"",args:l&&l.config&&l.config.args||[],type:m(),env:[],headers:[],options:{timeout:l&&l.config&&l.config.options&&l.config.options.timeout||6e4,resetTimeoutOnProgress:l&&l.config&&l.config.options&&l.config.options.resetTimeoutOnProgress||!1,maxTotalTimeout:l&&l.config&&l.config.options&&l.config.options.maxTotalTimeout||void 0},openapi:l&&l.config&&l.config.openapi?{url:l.config.openapi.url||"",schema:l.config.openapi.schema?JSON.stringify(l.config.openapi.schema,null,2):"",inputMode:l.config.openapi.url?"url":l.config.openapi.schema?"schema":"url",version:l.config.openapi.version||"3.1.0",securityType:(($=l.config.openapi.security)==null?void 0:$.type)||"none",apiKeyName:((G=(E=l.config.openapi.security)==null?void 0:E.apiKey)==null?void 0:G.name)||"",apiKeyIn:((oe=(X=l.config.openapi.security)==null?void 0:X.apiKey)==null?void 0:oe.in)||"header",apiKeyValue:((P=(T=l.config.openapi.security)==null?void 0:T.apiKey)==null?void 0:P.value)||"",httpScheme:((ne=(re=l.config.openapi.security)==null?void 0:re.http)==null?void 0:ne.scheme)||"bearer",httpCredentials:((ve=(ue=l.config.openapi.security)==null?void 0:ue.http)==null?void 0:ve.credentials)||"",oauth2Token:((se=(I=l.config.openapi.security)==null?void 0:I.oauth2)==null?void 0:se.token)||"",openIdConnectUrl:((Ke=(Se=l.config.openapi.security)==null?void 0:Se.openIdConnect)==null?void 0:Ke.url)||"",openIdConnectToken:((be=(Ve=l.config.openapi.security)==null?void 0:Ve.openIdConnect)==null?void 0:be.token)||""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none"}}),[S,v]=w.useState(l&&l.config&&l.config.env?Object.entries(l.config.env).map(([ce,ie])=>({key:ce,value:ie})):[]),[A,N]=w.useState(l&&l.config&&l.config.headers?Object.entries(l.config.headers).map(([ce,ie])=>({key:ce,value:ie})):[]),[M,R]=w.useState(!1),[j,C]=w.useState(null),O=!!l,F=ce=>{const{name:ie,value:ge}=ce.target;y({...h,[ie]:ge})},D=ce=>{const ie=ce.split(" ").filter(ge=>ge.trim()!=="");y({...h,arguments:ce,args:ie})},ee=ce=>{g(ce),y(ie=>({...ie,type:ce}))},Q=(ce,ie,ge)=>{const Yt=[...S];Yt[ce][ie]=ge,v(Yt)},B=()=>{v([...S,{key:"",value:""}])},W=ce=>{const ie=[...S];ie.splice(ce,1),v(ie)},le=(ce,ie,ge)=>{const Yt=[...A];Yt[ce][ie]=ge,N(Yt)},U=()=>{N([...A,{key:"",value:""}])},L=ce=>{const ie=[...A];ie.splice(ce,1),N(ie)},Z=(ce,ie)=>{y(ge=>({...ge,options:{...ge.options,[ce]:ie}}))},_=async ce=>{var ie,ge,Yt;ce.preventDefault(),C(null);try{const Pt={};S.forEach(({key:Ct,value:aa})=>{Ct.trim()&&(Pt[Ct.trim()]=aa)});const Ft={};A.forEach(({key:Ct,value:aa})=>{Ct.trim()&&(Ft[Ct.trim()]=aa)});const fn={};(ie=h.options)!=null&&ie.timeout&&h.options.timeout!==6e4&&(fn.timeout=h.options.timeout),(ge=h.options)!=null&&ge.resetTimeoutOnProgress&&(fn.resetTimeoutOnProgress=h.options.resetTimeoutOnProgress),(Yt=h.options)!=null&&Yt.maxTotalTimeout&&(fn.maxTotalTimeout=h.options.maxTotalTimeout);const Xr={name:h.name,config:{type:p,...p==="openapi"?{openapi:(()=>{var aa,zn,Ms,Qr,Xt,tt;const Ct={version:((aa=h.openapi)==null?void 0:aa.version)||"3.1.0"};if(((zn=h.openapi)==null?void 0:zn.inputMode)==="url")Ct.url=((Ms=h.openapi)==null?void 0:Ms.url)||"";else if(((Qr=h.openapi)==null?void 0:Qr.inputMode)==="schema"&&((Xt=h.openapi)!=null&&Xt.schema))try{Ct.schema=JSON.parse(h.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(tt=h.openapi)!=null&&tt.securityType&&h.openapi.securityType!=="none"&&(Ct.security={type:h.openapi.securityType,...h.openapi.securityType==="apiKey"&&{apiKey:{name:h.openapi.apiKeyName||"",in:h.openapi.apiKeyIn||"header",value:h.openapi.apiKeyValue||""}},...h.openapi.securityType==="http"&&{http:{scheme:h.openapi.httpScheme||"bearer",credentials:h.openapi.httpCredentials||""}},...h.openapi.securityType==="oauth2"&&{oauth2:{token:h.openapi.oauth2Token||""}},...h.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:h.openapi.openIdConnectUrl||"",token:h.openapi.openIdConnectToken||""}}}),Ct})(),...Object.keys(Ft).length>0?{headers:Ft}:{}}:p==="sse"||p==="streamable-http"?{url:h.url,...Object.keys(Ft).length>0?{headers:Ft}:{}}:{command:h.command,args:h.args,env:Object.keys(Pt).length>0?Pt:void 0},...Object.keys(fn).length>0?{options:fn}:{}}};s(Xr)}catch(Pt){C(`Error: ${Pt instanceof Error?Pt.message:String(Pt)}`)}};return r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-xl max-h-screen overflow-y-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:c}),r.jsx("button",{onClick:i,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(j||d)&&r.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:d||j}),r.jsxs("form",{onSubmit:_,children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:f("server.name")}),r.jsx("input",{type:"text",name:"name",id:"name",value:h.name,onChange:F,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: time-mcp",required:!0,disabled:O})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.type")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:p==="stdio",onChange:()=>ee("stdio"),className:"mr-1"}),r.jsx("label",{htmlFor:"command",children:"STDIO"})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>ee("sse"),className:"mr-1"}),r.jsx("label",{htmlFor:"url",children:"SSE"})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>ee("streamable-http"),className:"mr-1"}),r.jsx("label",{htmlFor:"streamable-http",children:"Streamable HTTP"})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>ee("openapi"),className:"mr-1"}),r.jsx("label",{htmlFor:"openapi",children:"OpenAPI"})]})]})]}),p==="openapi"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.inputMode")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((Me=h.openapi)==null?void 0:Me.inputMode)==="url",onChange:()=>y(ce=>({...ce,openapi:{...ce.openapi,inputMode:"url"}})),className:"mr-1"}),r.jsx("label",{htmlFor:"input-mode-url",children:f("server.openapi.inputModeUrl")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((Fe=h.openapi)==null?void 0:Fe.inputMode)==="schema",onChange:()=>y(ce=>({...ce,openapi:{...ce.openapi,inputMode:"schema"}})),className:"mr-1"}),r.jsx("label",{htmlFor:"input-mode-schema",children:f("server.openapi.inputModeSchema")})]})]})]}),((da=h.openapi)==null?void 0:da.inputMode)==="url"&&r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-url",children:f("server.openapi.specUrl")}),r.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((ln=h.openapi)==null?void 0:ln.url)||"",onChange:ce=>y(ie=>({...ie,openapi:{...ie.openapi,url:ce.target.value}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: https://api.example.com/openapi.json",required:p==="openapi"&&((on=h.openapi)==null?void 0:on.inputMode)==="url"})]}),((De=h.openapi)==null?void 0:De.inputMode)==="schema"&&r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-schema",children:f("server.openapi.schema")}),r.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((vt=h.openapi)==null?void 0:vt.schema)||"",onChange:ce=>y(ie=>({...ie,openapi:{...ie.openapi,schema:ce.target.value}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline font-mono text-sm",placeholder:`{
188
+ "openapi": "3.1.0",
189
+ "info": {
190
+ "title": "API",
191
+ "version": "1.0.0"
192
+ },
193
+ "servers": [
194
+ {
195
+ "url": "https://api.example.com"
196
+ }
197
+ ],
198
+ "paths": {
199
+ ...
200
+ }
201
+ }`,required:p==="openapi"&&((Ma=h.openapi)==null?void 0:Ma.inputMode)==="schema"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.openapi.schemaHelp")})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.security")}),r.jsxs("select",{value:((za=h.openapi)==null?void 0:za.securityType)||"none",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,securityType:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",children:[r.jsx("option",{value:"none",children:f("server.openapi.securityNone")}),r.jsx("option",{value:"apiKey",children:f("server.openapi.securityApiKey")}),r.jsx("option",{value:"http",children:f("server.openapi.securityHttp")}),r.jsx("option",{value:"oauth2",children:f("server.openapi.securityOAuth2")}),r.jsx("option",{value:"openIdConnect",children:f("server.openapi.securityOpenIdConnect")})]})]}),((fa=h.openapi)==null?void 0:fa.securityType)==="apiKey"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.apiKeyConfig")}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyName")}),r.jsx("input",{type:"text",value:((Da=h.openapi)==null?void 0:Da.apiKeyName)||"",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,apiKeyName:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyIn")}),r.jsxs("select",{value:((Os=h.openapi)==null?void 0:Os.apiKeyIn)||"header",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,apiKeyIn:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[r.jsx("option",{value:"header",children:"Header"}),r.jsx("option",{value:"query",children:"Query"}),r.jsx("option",{value:"cookie",children:"Cookie"})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyValue")}),r.jsx("input",{type:"password",value:((Kr=h.openapi)==null?void 0:Kr.apiKeyValue)||"",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,apiKeyValue:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),(($r=h.openapi)==null?void 0:$r.securityType)==="http"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.httpAuthConfig")}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpScheme")}),r.jsxs("select",{value:((Ua=h.openapi)==null?void 0:Ua.httpScheme)||"bearer",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,httpScheme:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[r.jsx("option",{value:"basic",children:"Basic"}),r.jsx("option",{value:"bearer",children:"Bearer"}),r.jsx("option",{value:"digest",children:"Digest"})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpCredentials")}),r.jsx("input",{type:"password",value:((ft=h.openapi)==null?void 0:ft.httpCredentials)||"",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,httpCredentials:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:(($t=h.openapi)==null?void 0:$t.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((mt=h.openapi)==null?void 0:mt.securityType)==="oauth2"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.oauth2Config")}),r.jsx("div",{className:"grid grid-cols-1 gap-3",children:r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.oauth2Token")}),r.jsx("input",{type:"password",value:((Yr=h.openapi)==null?void 0:Yr.oauth2Token)||"",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,oauth2Token:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})})]}),((Pr=h.openapi)==null?void 0:Pr.securityType)==="openIdConnect"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.openIdConnectConfig")}),r.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectUrl")}),r.jsx("input",{type:"url",value:((Fr=h.openapi)==null?void 0:Fr.openIdConnectUrl)||"",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,openIdConnectUrl:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"https://example.com/.well-known/openid_configuration"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectToken")}),r.jsx("input",{type:"password",value:((cn=h.openapi)==null?void 0:cn.openIdConnectToken)||"",onChange:ce=>y(ie=>{var ge;return{...ie,openapi:{...ie.openapi,openIdConnectToken:ce.target.value,url:((ge=ie.openapi)==null?void 0:ge.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"id-token"})]})]})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),r.jsx("button",{type:"button",onClick:U,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),A.map((ce,ie)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:ce.key,onChange:ge=>le(ie,"key",ge.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Authorization"}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:ce.value,onChange:ge=>le(ie,"value",ge.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Bearer token..."})]}),r.jsx("button",{type:"button",onClick:()=>L(ie),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},ie))]})]}):p==="sse"||p==="streamable-http"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"url",children:f("server.url")}),r.jsx("input",{type:"url",name:"url",id:"url",value:h.url,onChange:F,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:p==="streamable-http"?"e.g.: http://localhost:3000/mcp":"e.g.: http://localhost:3000/sse",required:p==="sse"||p==="streamable-http"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),r.jsx("button",{type:"button",onClick:U,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),A.map((ce,ie)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:ce.key,onChange:ge=>le(ie,"key",ge.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Authorization"}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:ce.value,onChange:ge=>le(ie,"value",ge.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Bearer token..."})]}),r.jsx("button",{type:"button",onClick:()=>L(ie),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},ie))]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"command",children:f("server.command")}),r.jsx("input",{type:"text",name:"command",id:"command",value:h.command,onChange:F,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: npx",required:p==="stdio"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"arguments",children:f("server.arguments")}),r.jsx("input",{type:"text",name:"arguments",id:"arguments",value:h.arguments,onChange:ce=>D(ce.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: -y time-mcp",required:p==="stdio"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.envVars")}),r.jsx("button",{type:"button",onClick:B,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),S.map((ce,ie)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:ce.key,onChange:ge=>Q(ie,"key",ge.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:f("server.key")}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:ce.value,onChange:ge=>Q(ie,"value",ge.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:f("server.value")})]}),r.jsx("button",{type:"button",onClick:()=>W(ie),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},ie))]})]}),p!=="openapi"&&r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 hover:bg-gray-100 p-3 rounded border border-gray-200",onClick:()=>R(!M),children:[r.jsx("label",{className:"text-gray-700 text-sm font-bold",children:f("server.requestOptions")}),r.jsx("span",{className:"text-gray-500 text-sm",children:M?"▼":"▶"})]}),M&&r.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:f("server.timeout")}),r.jsx("input",{type:"number",id:"timeout",value:((un=h.options)==null?void 0:un.timeout)||6e4,onChange:ce=>Z("timeout",parseInt(ce.target.value)||6e4),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"30000",min:"1000",max:"300000"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.timeoutDescription")})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:f("server.maxTotalTimeout")}),r.jsx("input",{type:"number",id:"maxTotalTimeout",value:((ta=h.options)==null?void 0:ta.maxTotalTimeout)||"",onChange:ce=>Z("maxTotalTimeout",ce.target.value?parseInt(ce.target.value):void 0),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"Optional",min:"1000"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.maxTotalTimeoutDescription")})]})]}),r.jsxs("div",{className:"mt-3",children:[r.jsxs("label",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:((dn=h.options)==null?void 0:dn.resetTimeoutOnProgress)||!1,onChange:ce=>Z("resetTimeoutOnProgress",ce.target.checked),className:"mr-2"}),r.jsx("span",{className:"text-gray-600 text-sm",children:f("server.resetTimeoutOnProgress")})]}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:f("server.resetTimeoutOnProgressDescription")})]})]})]}),r.jsxs("div",{className:"flex justify-end mt-6",children:[r.jsx("button",{type:"button",onClick:i,className:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-medium py-2 px-4 rounded mr-2 btn-secondary",children:f("server.cancel")}),r.jsx("button",{type:"submit",className:"bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded btn-primary",children:f(O?"server.save":"server.add")})]})]})]})},Yg=s=>{const i=new Set,l=/\$\{([^}]+)\}/g,c=f=>{let m;for(;(m=l.exec(f))!==null;)i.add(m[1])},d=(f,m="")=>{typeof f=="string"?c(f):Array.isArray(f)?f.forEach((p,g)=>d(p,`${m}[${g}]`)):f&&typeof f=="object"&&Object.entries(f).forEach(([p,g])=>{d(g,m?`${m}.${p}`:p)})};return d(s),Array.from(i)},w1=({onAdd:s})=>{const{t:i}=Ne(),[l,c]=w.useState(!1),[d,f]=w.useState(null),[m,p]=w.useState(!1),[g,h]=w.useState(null),[y,S]=w.useState([]),v=()=>{c(!l),f(null),p(!1),h(null)},A=async()=>{g&&(await N(g),p(!1),h(null))},N=async R=>{try{f(null);const j=await Wt("/servers",R);if(!j.success){j&&j.message?f(j.message):f(i("server.addError"));return}c(!1),s()}catch(j){console.error("Error adding server:",j),navigator.onLine?j instanceof TypeError&&(j.message.includes("NetworkError")||j.message.includes("Failed to fetch"))?f(i("errors.serverConnection")):f(i("errors.serverAdd")):f(i("errors.network"))}},M=async R=>{try{const j=Yg(R);j.length>0?(S(j),h(R),p(!0)):await N(R)}catch(j){console.error("Error processing server submission:",j),f(i("errors.serverAdd"))}};return r.jsxs("div",{children:[r.jsxs("button",{onClick:v,className:"w-full bg-blue-100 text-blue-800 rounded hover:bg-blue-200 py-2 px-4 flex items-center justify-center btn-primary",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})}),i("server.add")]}),l&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(bu,{onSubmit:M,onCancel:v,modalTitle:i("server.addServer"),formError:d})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[r.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:i("server.confirmVariables")}),r.jsx("p",{className:"text-gray-600 mb-4",children:i("server.variablesDetected")}),r.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),r.jsxs("div",{className:"ml-3",children:[r.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[i("server.detectedVariables"),":"]}),r.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:y.map((R,j)=>r.jsxs("li",{className:"font-mono",children:["$",`{${R}}`]},j))})]})]})}),r.jsx("p",{className:"text-gray-600 text-sm mb-6",children:i("server.confirmVariablesMessage")}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:()=>{p(!1),h(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:i("common.cancel")}),r.jsx("button",{onClick:A,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:i("server.confirmAndAdd")})]})]})})]})},S1=({server:s,onEdit:i,onCancel:l})=>{const{t:c}=Ne(),[d,f]=w.useState(null),m=async p=>{try{f(null);const g=await ca(`/servers/${s.name}`,p);if(!g.success){g&&g.message?f(g.message):f(c("server.updateError",{serverName:s.name}));return}i()}catch(g){console.error("Error updating server:",g),navigator.onLine?g instanceof TypeError&&(g.message.includes("NetworkError")||g.message.includes("Failed to fetch"))?f(c("errors.serverConnection")):f(c("errors.serverUpdate",{serverName:s.name})):f(c("errors.network"))}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(bu,{onSubmit:m,onCancel:l,initialData:s,modalTitle:c("server.editTitle",{serverName:s.name}),formError:d})})},j1=({isOpen:s,onClose:i,onConfirm:l,title:c,message:d,confirmText:f,cancelText:m,variant:p="warning"})=>{const{t:g}=Ne();if(!s)return null;const h=()=>{switch(p){case"danger":return{icon:r.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),confirmClass:"bg-red-600 hover:bg-red-700 text-white"};case"warning":return{icon:r.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),confirmClass:"bg-yellow-600 hover:bg-yellow-700 text-white"};case"info":return{icon:r.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"};default:return{icon:null,confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"}}},{icon:y,confirmClass:S}=h(),v=N=>{N.target===N.currentTarget&&i()},A=N=>{N.key==="Escape"?i():N.key==="Enter"&&l()};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:v,onKeyDown:A,tabIndex:-1,children:r.jsx("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full transform transition-all duration-200 ease-out",role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-message",children:r.jsxs("div",{className:"p-6",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[y&&r.jsx("div",{className:"flex-shrink-0",children:y}),r.jsxs("div",{className:"flex-1",children:[c&&r.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:c}),r.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:d})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{onClick:i,className:"px-4 py-2 text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-md transition-colors duration-150 btn-secondary",autoFocus:!0,children:m||g("common.cancel")}),r.jsx("button",{onClick:l,className:`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${S} ${p==="danger"?"btn-danger":p==="warning"?"btn-warning":"btn-primary"}`,children:f||g("common.confirm")})]})]})})})},N1=({onSuccess:s,onCancel:i})=>{const{t:l}=Ne(),[c,d]=w.useState(!1),[f,m]=w.useState(!1),[p,g]=w.useState(null),[h,y]=w.useState(null),[S,v]=w.useState(!1),[A,N]=w.useState(null),[M,R]=w.useState(""),[j,C]=w.useState(!1),[O,F]=w.useState(""),D=_=>{_.preventDefault(),d(!0)},ee=_=>{_.preventDefault(),d(!1)},Q=_=>{_.preventDefault(),d(!1);const $=_.dataTransfer.files;if($.length>0){const E=$[0];E.name.endsWith(".dxt")?(y(E),g(null)):g(l("dxt.invalidFileType"))}},B=_=>{const $=_.target.files;if($&&$.length>0){const E=$[0];E.name.endsWith(".dxt")?(y(E),g(null)):g(l("dxt.invalidFileType"))}},W=async()=>{if(!h){g(l("dxt.noFileSelected"));return}m(!0),g(null);try{const _=new FormData;_.append("dxtFile",h);const $=await gu(hu("/dxt/upload"),{method:"POST",body:_}),E=await $.json();if(!$.ok)throw new Error(E.message||`HTTP error! Status: ${$.status}`);if(E.success&&E.data)N(E.data.manifest),R(E.data.extractDir),v(!0);else throw new Error(E.message||l("dxt.uploadFailed"))}catch(_){console.error("DXT upload error:",_),g(_ instanceof Error?_.message:l("dxt.uploadFailed"))}finally{m(!1)}},le=async(_,$=!1)=>{var E;m(!0),g(null);try{const G=Z(A,M,_);if(!$){const oe=await bt("/servers");if(oe.success&&((E=oe.data)==null?void 0:E.find(P=>P.name===_))){F(_),C(!0),m(!1);return}}let X;if($?X=await ca(`/servers/${encodeURIComponent(_)}`,{name:_,config:G}):X=await Wt("/servers",{name:_,config:G}),X.success)s(G);else throw new Error(X.message||l("dxt.installFailed"))}catch(G){console.error("DXT install error:",G),g(G instanceof Error?G.message:l("dxt.installFailed")),m(!1)}},U=()=>{C(!1),O&&le(O,!0)},L=()=>{C(!1),F(""),m(!1)},Z=(_,$,E)=>{var oe;const G=((oe=_.server)==null?void 0:oe.mcp_config)||{},X={type:"stdio",command:G.command||"node",args:(G.args||[]).map(T=>T.replace("${__dirname}",$))};return G.env&&Object.keys(G.env).length>0&&(X.env={...G.env},Object.keys(X.env).forEach(T=>{typeof X.env[T]=="string"&&(X.env[T]=X.env[T].replace("${__dirname}",$))})),X};return S&&A?r.jsxs(r.Fragment,{children:[r.jsx(j1,{isOpen:j,onClose:L,onConfirm:U,title:l("dxt.serverExistsTitle"),message:l("dxt.serverExistsConfirm",{serverName:O}),confirmText:l("dxt.override"),cancelText:l("common.cancel"),variant:"warning"}),r.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${j?"opacity-50 pointer-events-none":""}`,children:r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("dxt.installServer")}),r.jsx("button",{onClick:i,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&r.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:r.jsx("p",{className:"text-red-700",children:p})}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[r.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:l("dxt.extensionInfo")}),r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.name"),":"]})," ",A.display_name||A.name]}),r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.version"),":"]})," ",A.version]}),r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.description"),":"]})," ",A.description]}),A.author&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.author"),":"]})," ",A.author.name]}),A.tools&&A.tools.length>0&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.tools"),":"]}),r.jsx("ul",{className:"list-disc list-inside ml-4",children:A.tools.map((_,$)=>r.jsxs("li",{children:[_.name," - ",_.description]},$))})]})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("dxt.serverName")}),r.jsx("input",{type:"text",id:"serverName",defaultValue:A.name,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:l("dxt.serverNamePlaceholder")})]}),r.jsxs("div",{className:"flex justify-end space-x-4",children:[r.jsx("button",{onClick:i,disabled:f,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:()=>{const _=document.getElementById("serverName"),$=(_==null?void 0:_.value.trim())||A.name;le($)},disabled:f,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:f?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("dxt.installing")]}):l("dxt.install")})]})]})]})})]}):r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-lg",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("dxt.uploadTitle")}),r.jsx("button",{onClick:i,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&r.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:r.jsx("p",{className:"text-red-700",children:p})}),r.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center transition-colors ${c?"border-blue-500 bg-blue-50":h?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:D,onDragLeave:ee,onDrop:Q,children:[h?r.jsxs("div",{className:"space-y-2",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-green-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),r.jsx("p",{className:"text-sm text-gray-900 font-medium",children:h.name}),r.jsxs("p",{className:"text-xs text-gray-500",children:[(h.size/1024/1024).toFixed(2)," MB"]})]}):r.jsxs("div",{className:"space-y-2",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-gray-900",children:l("dxt.dropFileHere")}),r.jsx("p",{className:"text-xs text-gray-500",children:l("dxt.orClickToSelect")})]})]}),r.jsx("input",{type:"file",accept:".dxt",onChange:B,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),r.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[r.jsx("button",{onClick:i,disabled:f,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:W,disabled:!h||f,className:"px-4 py-2 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:f?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("dxt.uploading")]}):l("dxt.upload")})]})]})})},C1=()=>{const{t:s}=Ne(),i=Mn(),{servers:l,error:c,setError:d,isLoading:f,handleServerAdd:m,handleServerEdit:p,handleServerRemove:g,handleServerToggle:h,triggerRefresh:y}=Gr(),[S,v]=w.useState(null),[A,N]=w.useState(!1),[M,R]=w.useState(!1),j=async D=>{const ee=await p(D);ee&&v(ee)},C=()=>{v(null),y()},O=async()=>{N(!0);try{y(),await new Promise(D=>setTimeout(D,500))}finally{N(!1)}},F=D=>{R(!1),y()};return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-8",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.servers.title")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("button",{onClick:()=>i("/market"),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3z"})}),s("nav.market")]}),r.jsx(w1,{onAdd:m}),r.jsxs("button",{onClick:()=>R(!0),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M5.5 13a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 13H11V9.413l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.413V13H5.5z"})}),s("dxt.upload")]}),r.jsxs("button",{onClick:O,disabled:A,className:`px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200 ${A?"opacity-70 cursor-not-allowed":""}`,children:[A?r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})}),s("common.refresh")]})]})]}),c&&r.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{children:r.jsx("p",{className:"text-gray-600 mt-1",children:c})}),r.jsx("button",{onClick:()=>d(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":s("app.closeButton"),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),f?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):l.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:r.jsx("p",{className:"text-gray-600",children:s("app.noServers")})}):r.jsx("div",{className:"space-y-6",children:l.map((D,ee)=>r.jsx(v1,{server:D,onRemove:g,onEdit:j,onToggle:h,onRefresh:y},ee))}),S&&r.jsx(S1,{server:S,onEdit:C,onCancel:()=>v(null)}),M&&r.jsx(N1,{onSuccess:F,onCancel:()=>R(!1)})]})},vu=()=>{const{t:s}=Ne(),[i,l]=w.useState([]),[c,d]=w.useState(!0),[f,m]=w.useState(null),[p,g]=w.useState(0),h=w.useCallback(async()=>{try{d(!0);const j=await bt("/groups");j&&j.success&&Array.isArray(j.data)?l(j.data):(console.error("Invalid group data format:",j),l([])),m(null)}catch(j){console.error("Error fetching groups:",j),m(j instanceof Error?j.message:"Failed to fetch groups"),l([])}finally{d(!1)}},[]),y=w.useCallback(()=>{g(j=>j+1)},[]),S=async(j,C,O=[])=>{try{const F=await Wt("/groups",{name:j,description:C,servers:O});return console.log("Group created successfully:",F),!F||!F.success?(m((F==null?void 0:F.message)||s("groups.createError")),F):(y(),F||null)}catch(F){return m(F instanceof Error?F.message:"Failed to create group"),null}},v=async(j,C)=>{try{const O=await ca(`/groups/${j}`,C);return!O||!O.success?(m((O==null?void 0:O.message)||s("groups.updateError")),O):(y(),O||null)}catch(O){return m(O instanceof Error?O.message:"Failed to update group"),null}},A=async(j,C)=>{try{const O=await ca(`/groups/${j}/servers/batch`,{servers:C});return!O||!O.success?(m((O==null?void 0:O.message)||s("groups.updateError")),null):(y(),O.data||null)}catch(O){return m(O instanceof Error?O.message:"Failed to update group servers"),null}},N=async j=>{try{const C=await pi(`/groups/${j}`);return!C||!C.success?(m((C==null?void 0:C.message)||s("groups.deleteError")),C):(y(),C)}catch(C){return m(C instanceof Error?C.message:"Failed to delete group"),null}},M=async(j,C)=>{try{const O=await Wt(`/groups/${j}/servers`,{serverName:C});return!O||!O.success?(m((O==null?void 0:O.message)||s("groups.serverAddError")),null):(y(),O.data||null)}catch(O){return m(O instanceof Error?O.message:"Failed to add server to group"),null}},R=async(j,C)=>{try{const O=await pi(`/groups/${j}/servers/${C}`);return!O||!O.success?(m((O==null?void 0:O.message)||s("groups.serverRemoveError")),null):(y(),O.data||null)}catch(O){return m(O instanceof Error?O.message:"Failed to remove server from group"),null}};return w.useEffect(()=>{h()},[h,p]),{groups:i,loading:c,error:f,setError:m,triggerRefresh:y,createGroup:S,updateGroup:v,updateGroupServers:A,deleteGroup:N,addServerToGroup:M,removeServerFromGroup:R}},Pg=({servers:s,value:i,onChange:l,className:c})=>{const{t:d}=Ne(),[f,m]=w.useState(new Set),p=Cs.useMemo(()=>i.map(j=>typeof j=="string"?{name:j,tools:"all"}:{...j,tools:j.tools||"all"}),[i]),g=Cs.useMemo(()=>s.filter(j=>j.enabled!==!1),[s]);Cs.useEffect(()=>{const j=new Set(p.map(O=>O.name)),C=new Set(g.map(O=>O.name));m(O=>{const F=new Set;return O.forEach(D=>{(j.has(D)||C.has(D))&&F.add(D)}),F})},[p,g]);const h=j=>{if(p.findIndex(O=>O.name===j)>=0){const O=p.filter(F=>F.name!==j);l(O)}else{const O=[...p,{name:j,tools:"all"}];l(O)}},y=j=>{m(C=>{const O=new Set(C);return O.has(j)?O.delete(j):O.add(j),O})},S=(j,C,O=!1)=>{if(Array.isArray(C)&&C.length===0){const F=p.filter(D=>D.name!==j);l(F),O||m(D=>{const ee=new Set(D);return ee.delete(j),ee})}else if(p.findIndex(D=>D.name===j)>=0){const D=p.map(ee=>ee.name===j?{...ee,tools:C}:ee);l(D)}else{const D=[...p,{name:j,tools:C}];l(D)}},v=(j,C)=>{var ee;const O=g.find(Q=>Q.name===j);if(!O)return;const F=((ee=O.tools)==null?void 0:ee.map(Q=>Q.name.replace(`${j}-`,"")))||[],D=p.find(Q=>Q.name===j);if(!D){const Q=[...p,{name:j,tools:[C]}];l(Q);return}if(D.tools==="all"){const Q=F.filter(B=>B!==C);S(j,Q)}else if(Array.isArray(D.tools)){const Q=D.tools;if(Q.includes(C)){const B=Q.filter(W=>W!==C);S(j,B)}else{const B=[...Q,C];B.length===F.length?S(j,"all"):S(j,B)}}},A=j=>{const C=p.find(O=>O.name===j);return C?C.tools==="all":!1},N=j=>{const C=p.find(O=>O.name===j);return C?Array.isArray(C.tools)&&C.tools.length>0:!1},M=(j,C)=>{const O=p.find(F=>F.name===j);return O?O.tools==="all"?!0:Array.isArray(O.tools)?O.tools.includes(C):!1:!1},R=j=>{const C=g.find(O=>O.name===j);return(C==null?void 0:C.tools)||[]};return r.jsxs("div",{className:Ra("space-y-4",c),children:[r.jsx("div",{className:"space-y-3",children:g.map(j=>{const C=A(j.name),O=N(j.name),F=f.has(j.name),D=R(j.name),ee=p.find(Q=>Q.name===j.name);return r.jsxs("div",{className:"border border-gray-200 rounded-lg hover:border-gray-300 hover:bg-gray-50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors",onClick:()=>y(j.name),children:[r.jsxs("div",{className:"flex items-center space-x-3",onClick:Q=>{Q.stopPropagation(),h(j.name)},children:[r.jsx("input",{type:"checkbox",checked:C||O,onChange:()=>h(j.name),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),r.jsx("span",{className:"font-medium text-gray-900 cursor-pointer select-none",children:j.name})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[ee&&ee.tools!=="all"&&Array.isArray(ee.tools)&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",d("groups.toolsSelected")," ",ee.tools.length,"/",D.length,")"]}),ee&&ee.tools==="all"&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",d("groups.allTools")," ",D.length,"/",D.length,")"]}),D.length>0&&r.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:r.jsx("svg",{className:Ra("w-5 h-5 transition-transform",F&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),F&&D.length>0&&r.jsxs("div",{className:"border-t border-gray-200 bg-gray-50 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("span",{className:"text-sm font-medium text-gray-700",children:d("groups.toolSelection")}),r.jsx("button",{type:"button",onClick:()=>{(ee==null?void 0:ee.tools)==="all"||Array.isArray(ee==null?void 0:ee.tools)&&ee.tools.length===D.length?S(j.name,[],!0):S(j.name,"all")},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:(ee==null?void 0:ee.tools)==="all"||Array.isArray(ee==null?void 0:ee.tools)&&ee.tools.length===D.length?d("groups.selectNone"):d("groups.selectAll")})]}),r.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:D.map(Q=>{const B=Q.name.replace(`${j.name}-`,""),W=M(j.name,B);return r.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:W,onChange:()=>v(j.name,B),className:"w-3 h-3 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),r.jsx("span",{className:"text-gray-700",children:B}),Q.description&&r.jsx("span",{className:"text-gray-400 text-xs truncate",children:Q.description})]},Q.name)})})]})]},j.name)})}),g.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:d("groups.noServerOptions")})]})},E1=({onAdd:s,onCancel:i})=>{const{t:l}=Ne(),{createGroup:c}=vu(),{servers:d}=Gr(),[f,m]=w.useState([]),[p,g]=w.useState(null),[h,y]=w.useState(!1),[S,v]=w.useState({name:"",description:"",servers:[]});w.useEffect(()=>{m(d.filter(M=>M.enabled!==!1))},[d]);const A=M=>{const{name:R,value:j}=M.target;v(C=>({...C,[R]:j}))},N=async M=>{M.preventDefault(),y(!0),g(null);try{if(!S.name.trim()){g(l("groups.nameRequired")),y(!1);return}const R=await c(S.name,S.description,S.servers);if(!R||!R.success){g((R==null?void 0:R.message)||l("groups.createError")),y(!1);return}s()}catch(R){g(R instanceof Error?R.message:String(R)),y(!1)}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[r.jsxs("div",{className:"p-6 flex-shrink-0",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:l("groups.addNew")}),p&&r.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:p})]}),r.jsxs("form",{onSubmit:N,className:"flex flex-col flex-1 min-h-0",children:[r.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[l("groups.name")," *"]}),r.jsx("input",{type:"text",id:"name",name:"name",value:S.name,onChange:A,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:l("groups.namePlaceholder"),required:!0})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:l("groups.configureTools")}),r.jsx(Pg,{servers:f,value:S.servers,onChange:M=>v(R=>({...R,servers:M})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",disabled:h,children:l("common.cancel")}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:h,children:l(h?"common.submitting":"common.create")})]})]})]})})},T1=({group:s,onEdit:i,onCancel:l})=>{const{t:c}=Ne(),{updateGroup:d}=vu(),{servers:f}=Gr(),[m,p]=w.useState([]),[g,h]=w.useState(null),[y,S]=w.useState(!1),[v,A]=w.useState({name:s.name,description:s.description||"",servers:s.servers||[]});w.useEffect(()=>{p(f.filter(R=>R.enabled!==!1))},[f]);const N=R=>{const{name:j,value:C}=R.target;A(O=>({...O,[j]:C}))},M=async R=>{R.preventDefault(),S(!0),h(null);try{if(!v.name.trim()){h(c("groups.nameRequired")),S(!1);return}const j=await d(s.id,{name:v.name,description:v.description,servers:v.servers});if(!j||!j.success){h((j==null?void 0:j.message)||c("groups.updateError")),S(!1);return}i()}catch(j){h(j instanceof Error?j.message:String(j)),S(!1)}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[r.jsxs("div",{className:"p-6 flex-shrink-0",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:c("groups.edit")}),g&&r.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:g})]}),r.jsxs("form",{onSubmit:M,className:"flex flex-col flex-1 min-h-0",children:[r.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[c("groups.name")," *"]}),r.jsx("input",{type:"text",id:"name",name:"name",value:v.name,onChange:N,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:c("groups.namePlaceholder"),required:!0})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:c("groups.configureTools")}),r.jsx(Pg,{servers:m,value:v.servers,onChange:R=>A(j=>({...j,servers:R})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",disabled:y,children:c("common.cancel")}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:y,children:c(y?"common.submitting":"common.save")})]})]})]})})},Fg=()=>{const{t:s}=Ne(),{showToast:i}=Vr(),[l,c]=w.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!1,bearerAuthKey:"",skipAuth:!1}),[d,f]=w.useState({bearerAuthKey:""}),[m,p]=w.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[g,h]=w.useState({enabled:!1,dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[y,S]=w.useState(!1),[v,A]=w.useState(null),[N,M]=w.useState(0),R=w.useCallback(()=>{M(Q=>Q+1)},[]),j=w.useCallback(async()=>{var Q,B,W,le,U,L;S(!0),A(null);try{const Z=await bt("/settings");Z.success&&((B=(Q=Z.data)==null?void 0:Q.systemConfig)!=null&&B.routing)&&c({enableGlobalRoute:Z.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:Z.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:Z.data.systemConfig.routing.enableBearerAuth??!1,bearerAuthKey:Z.data.systemConfig.routing.bearerAuthKey||"",skipAuth:Z.data.systemConfig.routing.skipAuth??!1}),Z.success&&((le=(W=Z.data)==null?void 0:W.systemConfig)!=null&&le.install)&&p({pythonIndexUrl:Z.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:Z.data.systemConfig.install.npmRegistry||"",baseUrl:Z.data.systemConfig.install.baseUrl||"http://localhost:3000"}),Z.success&&((L=(U=Z.data)==null?void 0:U.systemConfig)!=null&&L.smartRouting)&&h({enabled:Z.data.systemConfig.smartRouting.enabled??!1,dbUrl:Z.data.systemConfig.smartRouting.dbUrl||"",openaiApiBaseUrl:Z.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:Z.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:Z.data.systemConfig.smartRouting.openaiApiEmbeddingModel||""})}catch(Z){console.error("Failed to fetch settings:",Z),A(Z instanceof Error?Z.message:"Failed to fetch settings"),i(s("errors.failedToFetchSettings"))}finally{S(!1)}},[s]),C=async(Q,B)=>{S(!0),A(null);try{const W=await ca("/system-config",{routing:{[Q]:B}});return W.success?(c({...l,[Q]:B}),i(s("settings.systemConfigUpdated")),!0):(i(W.message||s("errors.failedToUpdateRouteConfig")),!1)}catch(W){return console.error("Failed to update routing config:",W),A(W instanceof Error?W.message:"Failed to update routing config"),i(s("errors.failedToUpdateRouteConfig")),!1}finally{S(!1)}},O=async(Q,B)=>{S(!0),A(null);try{const W=await ca("/system-config",{install:{[Q]:B}});return W.success?(p({...m,[Q]:B}),i(s("settings.systemConfigUpdated")),!0):(i(W.message||s("errors.failedToUpdateSystemConfig")),!1)}catch(W){return console.error("Failed to update system config:",W),A(W instanceof Error?W.message:"Failed to update system config"),i(s("errors.failedToUpdateSystemConfig")),!1}finally{S(!1)}},F=async(Q,B)=>{S(!0),A(null);try{const W=await ca("/system-config",{smartRouting:{[Q]:B}});return W.success?(h({...g,[Q]:B}),i(s("settings.systemConfigUpdated")),!0):(i(W.message||s("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(W){console.error("Failed to update smart routing config:",W);const le=W instanceof Error?W.message:"Failed to update smart routing config";return A(le),i(le),!1}finally{S(!1)}},D=async Q=>{S(!0),A(null);try{const B=await ca("/system-config",{smartRouting:Q});return B.success?(h({...g,...Q}),i(s("settings.systemConfigUpdated")),!0):(i(B.message||s("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(B){console.error("Failed to update smart routing config:",B);const W=B instanceof Error?B.message:"Failed to update smart routing config";return A(W),i(W),!1}finally{S(!1)}},ee=async Q=>{S(!0),A(null);try{const B=await ca("/system-config",{routing:Q});return B.success?(c({...l,...Q}),i(s("settings.systemConfigUpdated")),!0):(i(B.message||s("errors.failedToUpdateRouteConfig")),!1)}catch(B){return console.error("Failed to update routing config:",B),A(B instanceof Error?B.message:"Failed to update routing config"),i(s("errors.failedToUpdateRouteConfig")),!1}finally{S(!1)}};return w.useEffect(()=>{j()},[j,N]),w.useEffect(()=>{l&&f({bearerAuthKey:l.bearerAuthKey})},[l]),{routingConfig:l,tempRoutingConfig:d,setTempRoutingConfig:f,installConfig:m,smartRoutingConfig:g,loading:y,error:v,setError:A,triggerRefresh:R,fetchSettings:j,updateRoutingConfig:C,updateInstallConfig:O,updateSmartRoutingConfig:F,updateSmartRoutingConfigBatch:D,updateRoutingConfigBatch:ee}},k1=({group:s,servers:i,onEdit:l,onDelete:c})=>{const{t:d}=Ne(),{showToast:f}=Vr(),{installConfig:m}=Fg(),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[S,v]=w.useState(!1),[A,N]=w.useState(null),M=w.useRef(null);w.useEffect(()=>{const U=L=>{M.current&&!M.current.contains(L.target)&&v(!1)};return document.addEventListener("mousedown",U),()=>{document.removeEventListener("mousedown",U)}},[]);const R=()=>{l(s)},j=()=>{g(!0)},C=()=>{c(s.id),g(!1)},O=U=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(U).then(()=>{y(!0),v(!1),f(d("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)});else{const L=document.createElement("textarea");L.value=U,L.style.position="fixed",L.style.left="-9999px",document.body.appendChild(L),L.focus(),L.select();try{document.execCommand("copy"),y(!0),v(!1),f(d("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)}catch(Z){f(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",Z)}document.body.removeChild(L)}},F=()=>{O(s.id)},D=()=>{O(`${m.baseUrl}/mcp/${s.id}`)},ee=()=>{const U={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${s.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};O(JSON.stringify(U,null,2))},Q=U=>U.map(L=>typeof L=="string"?L:L.name),B=U=>{const L=s.servers.find(Z=>typeof Z=="string"?Z===U:Z.name===U);return typeof L=="string"?{name:L,tools:"all"}:L},W=Q(s.servers),le=i.filter(U=>W.includes(U.name));return r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 ",children:[r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:s.name}),r.jsxs("div",{className:"flex items-center ml-3",children:[r.jsx("span",{className:"text-xs text-gray-500 mr-1",children:s.id}),r.jsxs("div",{className:"relative",ref:M,children:[r.jsxs("button",{onClick:()=>v(!S),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:d("common.copy"),children:[h?r.jsx(Ci,{size:14,className:"text-green-500"}):r.jsx(Jc,{size:14}),r.jsx(xu,{size:12,className:"ml-1"})]}),S&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white shadow-lg rounded-md border border-gray-200 py-1 z-10 min-w-[140px]",children:[r.jsxs("button",{onClick:F,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(Jc,{size:12,className:"mr-2"}),d("common.copyId")]}),r.jsxs("button",{onClick:D,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(Sb,{size:12,className:"mr-2"}),d("common.copyUrl")]}),r.jsxs("button",{onClick:ee,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(yb,{size:12,className:"mr-2"}),d("common.copyJson")]})]})]})]})]}),s.description&&r.jsx("p",{className:"text-gray-600 text-sm mt-1",children:s.description})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"bg-blue-50 text-blue-700 px-3 py-1 rounded-full text-sm btn-secondary",children:d("groups.serverCount",{count:s.servers.length})}),r.jsx("button",{onClick:R,className:"text-gray-500 hover:text-gray-700",title:d("groups.edit"),children:r.jsx(vg,{size:18})}),r.jsx("button",{onClick:j,className:"text-gray-500 hover:text-red-600",title:d("groups.delete"),children:r.jsx(Bb,{size:18})})]})]}),r.jsx("div",{className:"mt-4",children:le.length===0?r.jsx("p",{className:"text-gray-500 italic",children:d("groups.noServers")}):r.jsx("div",{className:"flex flex-wrap gap-2",children:le.map(U=>{var X;const L=B(U.name),Z=L&&L.tools!=="all"&&Array.isArray(L.tools),_=Z&&Array.isArray(L==null?void 0:L.tools)?L.tools.length:((X=U.tools)==null?void 0:X.length)||0,$=A===U.name,E=()=>Z&&Array.isArray(L==null?void 0:L.tools)?L.tools:U.tools&&U.tools.length>0?U.tools.map(oe=>oe.name):[],G=()=>{N($?null:U.name)};return r.jsxs("div",{className:"relative",children:[r.jsxs("div",{className:"flex items-center space-x-2 bg-gray-50 rounded-lg px-3 py-2 cursor-pointer hover:bg-gray-100 transition-colors",onClick:G,children:[r.jsx("span",{className:"font-medium text-gray-700 text-sm",children:U.name}),r.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${U.status==="connected"?"bg-green-500":U.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),_>0&&r.jsxs("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded flex items-center gap-1",children:[r.jsx(Kb,{size:12}),_]})]}),$&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white shadow-lg rounded-md border border-gray-200 p-3 z-10 min-w-[300px] max-w-[400px]",children:[r.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[d(Z?"groups.selectedTools":"groups.allTools"),":"]}),r.jsx("div",{className:"flex flex-wrap gap-1",children:E().map((oe,T)=>r.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:oe},T))})]})]},U.name)})})}),r.jsx($g,{isOpen:p,onClose:()=>g(!1),onConfirm:C,serverName:s.name,isGroup:!0})]})},A1=()=>{const{t:s}=Ne(),{groups:i,loading:l,error:c,setError:d,deleteGroup:f,triggerRefresh:m}=vu(),{servers:p}=Gr(),[g,h]=w.useState(null),[y,S]=w.useState(!1),v=j=>{h(j)},A=()=>{h(null),m()},N=async j=>{const C=await f(j);(!C||!C.success)&&d((C==null?void 0:C.message)||s("groups.deleteError"))},M=()=>{S(!0)},R=()=>{S(!1),m()};return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-8",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.groups.title")}),r.jsx("div",{className:"flex space-x-4",children:r.jsxs("button",{onClick:M,className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 00-1 1v5H4a1 1 0 100 2h5v5a1 1 0 102 0v-5h5a1 1 0 100-2h-5V4a1 1 0 00-1-1z",clipRule:"evenodd"})}),s("groups.add")]})})]}),c&&r.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:r.jsx("p",{children:c})}),l?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:r.jsxs("div",{className:"flex flex-col items-center justify-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):i.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:r.jsx("p",{className:"text-gray-600",children:s("groups.noGroups")})}):r.jsx("div",{className:"space-y-6",children:i.map(j=>r.jsx(k1,{group:j,servers:p,onEdit:v,onDelete:N},j.id))}),y&&r.jsx(E1,{onAdd:R,onCancel:R}),g&&r.jsx(T1,{group:g,onEdit:A,onCancel:()=>h(null)})]})},R1=()=>r.jsx("div",{}),O1=({onSuccess:s,onCancel:i})=>{const{t:l}=Ne(),[c,d]=w.useState({currentPassword:"",newPassword:""}),[f,m]=w.useState(""),[p,g]=w.useState(!1),[h,y]=w.useState(null),[S,v]=w.useState(!1),A=M=>{const{name:R,value:j}=M.target;R==="confirmPassword"?m(j):d(C=>({...C,[R]:j}))},N=async M=>{if(M.preventDefault(),y(null),c.newPassword!==f){y(l("auth.passwordsNotMatch"));return}g(!0);try{const R=await eb(c);R.success?(v(!0),s&&s()):y(R.message||l("auth.changePasswordError"))}catch{y(l("auth.changePasswordError"))}finally{g(!1)}};return r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-md",children:[r.jsx("h2",{className:"text-xl font-bold mb-4",children:l("auth.changePassword")}),S?r.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:l("auth.changePasswordSuccess")}):r.jsxs("form",{onSubmit:N,children:[h&&r.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:h}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"currentPassword",children:l("auth.currentPassword")}),r.jsx("input",{type:"password",id:"currentPassword",name:"currentPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:c.currentPassword,onChange:A,required:!0})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"newPassword",children:l("auth.newPassword")}),r.jsx("input",{type:"password",id:"newPassword",name:"newPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:c.newPassword,onChange:A,required:!0,minLength:6})]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"confirmPassword",children:l("auth.confirmPassword")}),r.jsx("input",{type:"password",id:"confirmPassword",name:"confirmPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:f,onChange:A,required:!0,minLength:6})]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[i&&r.jsx("button",{type:"button",onClick:i,disabled:p,className:"py-2 px-4 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:l("common.cancel")}),r.jsx("button",{type:"submit",disabled:p,className:"py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 btn-primary",children:p?r.jsxs("span",{className:"flex items-center",children:[r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("common.save")]}):l("common.save")})]})]})]})};function M1(s=32){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",l=new Uint8Array(s);return crypto.getRandomValues(l),Array.from(l).map(c=>i.charAt(c%i.length)).join("")}const Fc={SETTINGS_SMART_ROUTING:"settings:smart_routing",SETTINGS_SKIP_AUTH:"settings:skip_auth",SETTINGS_INSTALL_CONFIG:"settings:install_config"},z1=()=>{const{t:s}=Ne(),i=Mn(),{showToast:l}=Vr(),[c,d]=w.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[f,m]=w.useState({dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),{routingConfig:p,tempRoutingConfig:g,setTempRoutingConfig:h,installConfig:y,smartRoutingConfig:S,loading:v,updateRoutingConfig:A,updateRoutingConfigBatch:N,updateInstallConfig:M,updateSmartRoutingConfig:R,updateSmartRoutingConfigBatch:j}=Fg();w.useEffect(()=>{y&&d(y)},[y]),w.useEffect(()=>{S&&m({dbUrl:S.dbUrl||"",openaiApiBaseUrl:S.openaiApiBaseUrl||"",openaiApiKey:S.openaiApiKey||"",openaiApiEmbeddingModel:S.openaiApiEmbeddingModel||""})},[S]);const[C,O]=w.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,password:!1}),F=_=>{O($=>({...$,[_]:!$[_]}))},D=async(_,$)=>{if(_==="enableBearerAuth"&&$===!0&&!g.bearerAuthKey&&!p.bearerAuthKey){const E=M1();ee(E),await N({enableBearerAuth:!0,bearerAuthKey:E})&&h(X=>({...X,bearerAuthKey:E}));return}await A(_,$)},ee=_=>{h($=>({...$,bearerAuthKey:_}))},Q=async()=>{await A("bearerAuthKey",g.bearerAuthKey)},B=(_,$)=>{d({...c,[_]:$})},W=async _=>{await M(_,c[_])},le=(_,$)=>{m({...f,[_]:$})},U=async _=>{await R(_,f[_])},L=async _=>{if(_){const $=f.dbUrl||S.dbUrl,E=f.openaiApiKey||S.openaiApiKey;if(!$||!E){const X=[];$||X.push(s("settings.dbUrl")),E||X.push(s("settings.openaiApiKey")),l(s("settings.smartRoutingValidationError",{fields:X.join(", ")}));return}const G={enabled:_};f.dbUrl!==S.dbUrl&&(G.dbUrl=f.dbUrl),f.openaiApiBaseUrl!==S.openaiApiBaseUrl&&(G.openaiApiBaseUrl=f.openaiApiBaseUrl),f.openaiApiKey!==S.openaiApiKey&&(G.openaiApiKey=f.openaiApiKey),f.openaiApiEmbeddingModel!==S.openaiApiEmbeddingModel&&(G.openaiApiEmbeddingModel=f.openaiApiEmbeddingModel),await j(G)}else await R("enabled",_)},Z=()=>{setTimeout(()=>{i("/")},2e3)};return r.jsxs("div",{className:"container mx-auto",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.settings.title")}),r.jsx(Pc,{permissions:Fc.SETTINGS_SMART_ROUTING,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>F("smartRoutingConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.smartRouting")}),r.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:C.smartRoutingConfig?"▼":"►"})]}),C.smartRoutingConfig&&r.jsxs("div",{className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableSmartRouting")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableSmartRoutingDescription")})]}),r.jsx(Ns,{disabled:v,checked:S.enabled,onCheckedChange:_=>L(_)})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.dbUrl")]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:f.dbUrl,onChange:_=>le("dbUrl",_.target.value),placeholder:s("settings.dbUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300 form-input",disabled:v}),r.jsx("button",{onClick:()=>U("dbUrl"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.openaiApiKey")]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"password",value:f.openaiApiKey,onChange:_=>le("openaiApiKey",_.target.value),placeholder:s("settings.openaiApiKeyPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300",disabled:v}),r.jsx("button",{onClick:()=>U("openaiApiKey"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.openaiApiBaseUrl")})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:f.openaiApiBaseUrl,onChange:_=>le("openaiApiBaseUrl",_.target.value),placeholder:s("settings.openaiApiBaseUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),r.jsx("button",{onClick:()=>U("openaiApiBaseUrl"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.openaiApiEmbeddingModel")})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:f.openaiApiEmbeddingModel,onChange:_=>le("openaiApiEmbeddingModel",_.target.value),placeholder:s("settings.openaiApiEmbeddingModelPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),r.jsx("button",{onClick:()=>U("openaiApiEmbeddingModel"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]})]})]})}),r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>F("routingConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.routeConfig")}),r.jsx("span",{className:"text-gray-500",children:C.routingConfig?"▼":"►"})]}),C.routingConfig&&r.jsxs("div",{className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableBearerAuth")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableBearerAuthDescription")})]}),r.jsx(Ns,{disabled:v,checked:p.enableBearerAuth,onCheckedChange:_=>D("enableBearerAuth",_)})]}),p.enableBearerAuth&&r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.bearerAuthKey")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.bearerAuthKeyDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:g.bearerAuthKey,onChange:_=>ee(_.target.value),placeholder:s("settings.bearerAuthKeyPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v||!p.enableBearerAuth}),r.jsx("button",{onClick:Q,disabled:v||!p.enableBearerAuth,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGlobalRoute")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGlobalRouteDescription")})]}),r.jsx(Ns,{disabled:v,checked:p.enableGlobalRoute,onCheckedChange:_=>D("enableGlobalRoute",_)})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGroupNameRoute")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGroupNameRouteDescription")})]}),r.jsx(Ns,{disabled:v,checked:p.enableGroupNameRoute,onCheckedChange:_=>D("enableGroupNameRoute",_)})]}),r.jsx(Pc,{permissions:Fc.SETTINGS_SKIP_AUTH,children:r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.skipAuth")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.skipAuthDescription")})]}),r.jsx(Ns,{disabled:v,checked:p.skipAuth,onCheckedChange:_=>D("skipAuth",_)})]})})]})]}),r.jsx(Pc,{permissions:Fc.SETTINGS_INSTALL_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>F("installConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.installConfig")}),r.jsx("span",{className:"text-gray-500",children:C.installConfig?"▼":"►"})]}),C.installConfig&&r.jsxs("div",{className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.baseUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.baseUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:c.baseUrl,onChange:_=>B("baseUrl",_.target.value),placeholder:s("settings.baseUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),r.jsx("button",{onClick:()=>W("baseUrl"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.pythonIndexUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.pythonIndexUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:c.pythonIndexUrl,onChange:_=>B("pythonIndexUrl",_.target.value),placeholder:s("settings.pythonIndexUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),r.jsx("button",{onClick:()=>W("pythonIndexUrl"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.npmRegistry")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.npmRegistryDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:c.npmRegistry,onChange:_=>B("npmRegistry",_.target.value),placeholder:s("settings.npmRegistryPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),r.jsx("button",{onClick:()=>W("npmRegistry"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]})]})]})}),r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>F("password"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("auth.changePassword")}),r.jsx("span",{className:"text-gray-500",children:C.password?"▼":"►"})]}),C.password&&r.jsx("div",{className:"max-w-lg mt-4",children:r.jsx(O1,{onSuccess:Z})})]})]})},D1=()=>{const{t:s}=Ne(),[i,l]=w.useState([]),[c,d]=w.useState([]),[f,m]=w.useState([]),[p,g]=w.useState([]),[h,y]=w.useState(""),[S,v]=w.useState(""),[A,N]=w.useState(""),[M,R]=w.useState(!0),[j,C]=w.useState(null),[O,F]=w.useState(null),[D,ee]=w.useState([]),[Q,B]=w.useState(1),[W,le]=w.useState(9),[U,L]=w.useState(1),Z=w.useCallback(async()=>{try{R(!0);const I=await bt("/market/servers");I&&I.success&&Array.isArray(I.data)?(d(I.data),_(I.data,Q)):(console.error("Invalid market servers data format:",I),C(s("market.fetchError")))}catch(I){console.error("Error fetching market servers:",I),C(I instanceof Error?I.message:String(I))}finally{R(!1)}},[s]),_=w.useCallback((I,se,Se=W)=>{const Ke=I.length,Ve=Math.ceil(Ke/Se);L(Ve);const be=Math.max(1,Math.min(se,Ve));be!==se&&B(be);const Me=(be-1)*Se,Fe=I.slice(Me,Me+Se);l(Fe)},[W]),$=w.useCallback(I=>{B(I),_(c,I,W)},[c,_,W]),E=w.useCallback(async()=>{try{const I=await bt("/market/categories");I&&I.success&&Array.isArray(I.data)?m(I.data):console.error("Invalid categories data format:",I)}catch(I){console.error("Error fetching categories:",I)}},[]),G=w.useCallback(async()=>{try{const I=await bt("/market/tags");I&&I.success&&Array.isArray(I.data)?g(I.data):console.error("Invalid tags data format:",I)}catch(I){console.error("Error fetching tags:",I)}},[]),X=w.useCallback(async I=>{try{R(!0);const se=await bt(`/market/servers/${I}`);return se&&se.success&&se.data?(F(se.data),se.data):(console.error("Invalid server data format:",se),C(s("market.serverNotFound")),null)}catch(se){return console.error(`Error fetching server ${I}:`,se),C(se instanceof Error?se.message:String(se)),null}finally{R(!1)}},[s]),oe=w.useCallback(async I=>{try{if(R(!0),N(I),!I.trim()){Z();return}const se=await bt(`/market/servers/search?query=${encodeURIComponent(I)}`);se&&se.success&&Array.isArray(se.data)?(d(se.data),B(1),_(se.data,1)):(console.error("Invalid search results format:",se),C(s("market.searchError")))}catch(se){console.error("Error searching servers:",se),C(se instanceof Error?se.message:String(se))}finally{R(!1)}},[s,c,_,Z]),T=w.useCallback(async I=>{try{if(R(!0),y(I),v(""),!I){Z();return}const se=await bt(`/market/categories/${encodeURIComponent(I)}`);se&&se.success&&Array.isArray(se.data)?(d(se.data),B(1),_(se.data,1)):(console.error("Invalid category filter results format:",se),C(s("market.filterError")))}catch(se){console.error("Error filtering servers by category:",se),C(se instanceof Error?se.message:String(se))}finally{R(!1)}},[s,Z,_]),P=w.useCallback(async I=>{try{if(R(!0),v(I),y(""),!I){Z();return}const se=await bt(`/market/tags/${encodeURIComponent(I)}`);se&&se.success&&Array.isArray(se.data)?(d(se.data),B(1),_(se.data,1)):(console.error("Invalid tag filter results format:",se),C(s("market.tagFilterError")))}catch(se){console.error("Error filtering servers by tag:",se),C(se instanceof Error?se.message:String(se))}finally{R(!1)}},[s,Z,_]),re=w.useCallback(async()=>{try{const I=await bt("/servers");if(I&&I.success&&Array.isArray(I.data)){const se=I.data.map(Se=>Se.name);ee(se)}}catch(I){console.error("Error fetching installed servers:",I)}},[]),ne=w.useCallback(I=>D.includes(I),[D]),ue=w.useCallback(async(I,se)=>{var Se,Ke;try{const Ve=(Se=I.installations)!=null&&Se.npm?"npm":Object.keys(I.installations||{}).length>0?Object.keys(I.installations)[0]:null;if(!Ve||!((Ke=I.installations)!=null&&Ke[Ve]))return C(s("market.noInstallationMethod")),!1;const be=I.installations[Ve],Me={name:I.name,config:se.type==="stdio"?{command:se.command||be.command||"",args:se.args||be.args||[],env:{...be.env,...se.env}}:se},Fe=await Wt("/servers",Me);if(!Fe.success)throw new Error(Fe.message||"Failed to install server");return await re(),!0}catch(Ve){return console.error("Error installing server:",Ve),C(Ve instanceof Error?Ve.message:String(Ve)),!1}},[s,re]),ve=w.useCallback(I=>{le(I),B(1),_(c,1,I)},[c,_]);return w.useEffect(()=>{Z(),E(),G(),re()},[Z,E,G,re]),{servers:i,allServers:c,categories:f,tags:p,selectedCategory:h,selectedTag:S,searchQuery:A,loading:M,error:j,setError:C,currentServer:O,fetchMarketServers:Z,fetchServerByName:X,searchServers:oe,filterByCategory:T,filterByTag:P,installServer:ue,currentPage:Q,totalPages:U,serversPerPage:W,changePage:$,changeServersPerPage:ve,isServerInstalled:ne}},U1=({server:s,onClick:i})=>{var p,g,h,y;const{t:l}=Ne(),c=()=>{if(!s.tags||s.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const S=28,v=C=>C.length+3;let A=0,N=0;const M=[...s.tags].sort((C,O)=>C.length-O.length);for(N=0;N<M.length;N++){const C=v(M[N]);if(A+C>S)break;if(A+=C,N===M.length-1)return{tagsToShow:M,hasMore:!1,moreCount:0}}N===0&&M.length>0&&(N=1);const R=M.length-N,j=3+String(R).length+l("market.moreTags").length;return A+j<=S||N<1?{tagsToShow:M.slice(0,N),hasMore:!0,moreCount:R}:{tagsToShow:M.slice(0,Math.max(1,N-1)),hasMore:!0,moreCount:R+1}},{tagsToShow:d,hasMore:f,moreCount:m}=c();return r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-5 hover:shadow-lg transition-all duration-200 cursor-pointer flex flex-col h-full page-card",onClick:()=>i(s),children:[r.jsxs("div",{className:"flex justify-between items-start mb-3",children:[r.jsx("h3",{className:"text-lg font-semibold text-gray-900 line-clamp-1 mr-2",children:s.display_name}),s.is_official&&r.jsx("span",{className:"text-xs font-medium px-2.5 py-0.5 rounded flex-shrink-0 label-primary",children:l("market.official")})]}),r.jsx("p",{className:"text-gray-600 text-sm mb-4 line-clamp-2 min-h-[40px]",children:s.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mb-2 min-h-[28px]",children:((p=s.categories)==null?void 0:p.length)>0?s.categories.map((S,v)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1.5 rounded whitespace-nowrap",children:S},v)):r.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})}),r.jsx("div",{className:"relative mb-3 min-h-[28px] overflow-x-auto",children:((g=s.tags)==null?void 0:g.length)>0?r.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[d.map((S,v)=>r.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0 label-secondary",children:["#",S]},v)),f&&r.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",m," ",l("market.moreTags")]})]}):r.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})}),r.jsxs("div",{className:"flex justify-between items-center mt-auto pt-2 text-xs text-gray-500",children:[r.jsxs("div",{className:"overflow-hidden",children:[r.jsxs("span",{className:"whitespace-nowrap",children:[l("market.by")," "]}),r.jsx("span",{className:"font-medium whitespace-nowrap overflow-hidden text-ellipsis max-w-[120px] inline-block align-bottom",children:((h=s.author)==null?void 0:h.name)||l("market.unknown")})]}),r.jsxs("div",{className:"flex items-center flex-shrink-0",children:[r.jsx("svg",{className:"h-4 w-4 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),r.jsxs("span",{children:[((y=s.tools)==null?void 0:y.length)||0," ",l("market.tools")]})]})]})]})},L1=({server:s,onBack:i,onInstall:l,installing:c=!1,isInstalled:d=!1})=>{var W,le;const{t:f}=Ne(),[m,p]=w.useState(!1),[g,h]=w.useState(null),[y,S]=w.useState(!1),[v,A]=w.useState(null),[N,M]=w.useState([]),R=()=>d?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installed")}:c?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white btn-primary",disabled:!1,text:f("market.install")},j=()=>{p(!m),h(null),S(!1),A(null)},C=async()=>{v&&(await O(v),S(!1),A(null))},O=async U=>{try{h(null),l(s,U.config),p(!1)}catch(L){console.error("Error installing server:",L),h(f("errors.serverInstall"))}},F=()=>{d||j()},D=()=>{if(!s.installations)return;if(s.installations.npm)return s.installations.npm;if(s.installations.uvx)return s.installations.uvx;if(s.installations.default)return s.installations.default;const U=Object.keys(s.installations);if(U.length>0)return s.installations[U[0]]},ee=async U=>{try{const L=Yg(U);L.length>0?(M(L),A(U),S(!0)):await O(U)}catch(L){console.error("Error processing server installation:",L),h(f("errors.serverInstall"))}},Q=R(),B=D();return r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[r.jsx("div",{className:"mb-4",children:r.jsxs("button",{onClick:i,className:"text-gray-600 hover:text-gray-900 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),f("market.backToList")]})}),r.jsxs("div",{className:"flex justify-between items-start mb-4",children:[r.jsx("div",{children:r.jsxs("h2",{className:"text-2xl font-bold text-gray-900 flex items-center flex-wrap",children:[s.display_name,r.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",s.name,")"]}),r.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[f("market.author"),": ",s.author.name," • ",f("market.license"),": ",s.license," •",r.jsx("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:f("market.repository")})]})]})}),r.jsxs("div",{className:"flex items-center",children:[s.is_official&&r.jsx("span",{className:"bg-blue-100 text-blue-800 text-sm font-normal px-4 py-2 rounded mr-2 flex items-center label-primary",children:f("market.official")}),r.jsx("button",{onClick:F,disabled:Q.disabled,className:Q.className,children:Q.text})]})]}),r.jsx("p",{className:"text-gray-700 mb-6",children:s.description}),r.jsxs("div",{className:"mb-6",children:[r.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[f("market.categories")," & ",f("market.tags")]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[(W=s.categories)==null?void 0:W.map((U,L)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:U},`cat-${L}`)),s.tags&&s.tags.map((U,L)=>r.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",U]},`tag-${L}`))]})]}),s.arguments&&Object.keys(s.arguments).length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.arguments")}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[r.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.argumentName")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.description")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.required")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.example")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(s.arguments).map(([U,L],Z)=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:U}),r.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:L.description}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:L.required?r.jsx("span",{className:"text-green-600",children:"✓"}):r.jsx("span",{className:"text-gray-600",children:"✗"})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:r.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:L.example})})]},Z))})]})})]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.tools")}),r.jsx("div",{className:"space-y-4",children:(le=s.tools)==null?void 0:le.map((U,L)=>r.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[r.jsxs("h4",{className:"font-medium mb-2",children:[U.name,r.jsx("button",{type:"button",onClick:()=>{const Z=document.getElementById(`schema-${L}`);Z&&Z.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:f("market.viewSchema")})]}),r.jsx("p",{className:"text-gray-600 mb-2",children:U.description}),r.jsx("div",{className:"mt-2",children:r.jsx("pre",{id:`schema-${L}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(U.inputSchema,null,2)})})]},L))})]}),s.examples&&s.examples.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.examples")}),r.jsx("div",{className:"space-y-4",children:s.examples.map((U,L)=>r.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[r.jsx("h4",{className:"font-medium mb-2",children:U.title}),r.jsx("p",{className:"text-gray-600 mb-2",children:U.description}),r.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:U.prompt})]},L))})]}),r.jsx("div",{className:"mt-6 flex justify-end",children:r.jsx("button",{onClick:F,disabled:Q.disabled,className:Q.className,children:Q.text})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(bu,{onSubmit:ee,onCancel:j,modalTitle:f("market.installServer",{name:s.display_name}),formError:g,initialData:{name:s.name,status:"disconnected",config:B?{command:B.command||"",args:B.args||[],env:B.env||{}}:void 0}})}),y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[r.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:f("server.confirmVariables")}),r.jsx("p",{className:"text-gray-600 mb-4",children:f("server.variablesDetected")}),r.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),r.jsxs("div",{className:"ml-3",children:[r.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[f("server.detectedVariables"),":"]}),r.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:N.map((U,L)=>r.jsxs("li",{className:"font-mono",children:["$",`{${U}}`]},L))})]})]})}),r.jsx("p",{className:"text-gray-600 text-sm mb-6",children:f("market.confirmVariablesMessage")}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:()=>{S(!1),A(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:f("common.cancel")}),r.jsx("button",{onClick:C,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:f("market.confirmAndInstall")})]})]})})]})},_1=({currentPage:s,totalPages:i,onPageChange:l})=>{const c=()=>{const d=[];d.push(r.jsx("button",{onClick:()=>l(1),className:`px-3 py-1 mx-1 rounded ${s===1?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"1"},"first"));const m=Math.max(2,s-Math.floor(5/2));m>2&&d.push(r.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let p=m;p<=Math.min(i-1,m+5-3);p++)d.push(r.jsx("button",{onClick:()=>l(p),className:`px-3 py-1 mx-1 rounded ${s===p?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:p},p));return m+5-3<i-1&&d.push(r.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),i>1&&d.push(r.jsx("button",{onClick:()=>l(i),className:`px-3 py-1 mx-1 rounded ${s===i?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:i},"last")),d};return i<=1?null:r.jsxs("div",{className:"flex justify-center items-center my-6",children:[r.jsx("button",{onClick:()=>l(Math.max(1,s-1)),disabled:s===1,className:`px-3 py-1 rounded mr-2 ${s===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"« Prev"}),r.jsx("div",{className:"flex",children:c()}),r.jsx("button",{onClick:()=>l(Math.min(i,s+1)),disabled:s===i,className:`px-3 py-1 rounded ml-2 ${s===i?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"Next »"})]})},Oh=()=>{const{t:s}=Ne(),i=Mn(),{serverName:l}=Jx(),{showToast:c}=Vr(),{servers:d,allServers:f,categories:m,loading:p,error:g,setError:h,searchServers:y,filterByCategory:S,filterByTag:v,selectedCategory:A,selectedTag:N,installServer:M,fetchServerByName:R,isServerInstalled:j,currentPage:C,totalPages:O,changePage:F,serversPerPage:D,changeServersPerPage:ee}=D1(),[Q,B]=w.useState(null),[W,le]=w.useState(""),[U,L]=w.useState(!1);w.useEffect(()=>{(async()=>{if(l){const re=await R(l);re?B(re):i("/market")}else B(null)})()},[l,R,i]);const Z=P=>{P.preventDefault(),y(W)},_=P=>{S(P)},$=()=>{le(""),S(""),v("")},E=P=>{i(`/market/${P.name}`)},G=()=>{i("/market")},X=async(P,re)=>{try{L(!0),await M(P,re)&&c(s("market.installSuccess",{serverName:P.display_name}),"success")}finally{L(!1)}},oe=P=>{F(P),window.scrollTo({top:0,behavior:"smooth"})},T=P=>{const re=parseInt(P.target.value,10);ee(re)};return Q?r.jsx(L1,{server:Q,onBack:G,onInstall:X,installing:U,isInstalled:j(Q.name)}):r.jsxs("div",{children:[r.jsx("div",{className:"flex justify-between items-center mb-8",children:r.jsx("div",{children:r.jsxs("h1",{className:"text-2xl font-bold text-gray-900 flex items-center",children:[s("market.title"),r.jsx("span",{className:"text-sm text-gray-500 font-normal ml-2",children:s("pages.market.title").split(" - ")[1]})]})})}),g&&r.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{children:g}),r.jsx("button",{onClick:()=>h(null),className:"text-red-700 hover:text-red-900 transition-colors duration-200",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 01.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),r.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:r.jsxs("form",{onSubmit:Z,className:"flex space-x-4 mb-0",children:[r.jsx("div",{className:"flex-grow",children:r.jsx("input",{type:"text",value:W,onChange:P=>le(P.target.value),placeholder:s("market.searchPlaceholder"),className:"shadow appearance-none border border-gray-200 rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input"})}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:s("market.search")}),(W||A||N)&&r.jsx("button",{type:"button",onClick:$,className:"border border-gray-300 text-gray-700 font-medium py-2 px-4 rounded hover:bg-gray-50 btn-secondary transition-all duration-200",children:s("market.clearFilters")})]})}),r.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[r.jsx("div",{className:"md:w-48 flex-shrink-0",children:r.jsx("div",{className:"bg-white shadow rounded-lg p-4 mb-6 sticky top-4 page-card",children:m.length>0?r.jsxs("div",{className:"mb-6",children:[r.jsxs("div",{className:"flex justify-between items-center mb-3",children:[r.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")}),A&&r.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>S(""),children:s("market.clearCategoryFilter")})]}),r.jsx("div",{className:"flex flex-col gap-2",children:m.map(P=>r.jsx("button",{onClick:()=>_(P),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${A===P?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:P},P))})]}):p?r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"mb-3",children:r.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),r.jsxs("div",{className:"flex flex-col gap-2 items-center py-4 loading-container",children:[r.jsxs("svg",{className:"animate-spin h-6 w-6 text-blue-500 mb-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-sm text-gray-600",children:s("app.loading")})]})]}):r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"mb-3",children:r.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),r.jsx("p",{className:"text-sm text-gray-600 py-2",children:s("market.noCategories")})]})})}),r.jsx("div",{className:"flex-grow",children:p?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):d.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:r.jsx("p",{className:"text-gray-600",children:s("market.noServers")})}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:d.map((P,re)=>r.jsx(U1,{server:P,onClick:E},re))}),r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("div",{className:"text-sm text-gray-500",children:s("market.showing",{from:(C-1)*D+1,to:Math.min(C*D,f.length),total:f.length})}),r.jsx(_1,{currentPage:C,totalPages:O,onPageChange:oe}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[s("market.perPage"),":"]}),r.jsxs("select",{id:"perPage",value:D,onChange:T,className:"border rounded p-1 text-sm btn-secondary outline-none",children:[r.jsx("option",{value:"6",children:"6"}),r.jsx("option",{value:"9",children:"9"}),r.jsx("option",{value:"12",children:"12"}),r.jsx("option",{value:"24",children:"24"})]})]})]}),r.jsx("div",{className:"mt-6"})]})})]})]})},H1={default:"bg-blue-500 text-white hover:bg-blue-600 focus:ring-blue-500",outline:"border border-gray-300 dark:border-gray-700 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300",ghost:"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300",link:"bg-transparent underline-offset-4 hover:underline text-blue-500 hover:text-blue-600",destructive:"bg-red-500 text-white hover:bg-red-600 focus:ring-red-500"},B1={default:"h-10 py-2 px-4",sm:"h-8 px-3 text-sm",lg:"h-12 px-6",icon:"h-10 w-10 p-0"};function q1({variant:s="default",size:i="default",className:l,disabled:c,children:d,...f}){return r.jsx("button",{className:Ra("rounded-md inline-flex items-center justify-center font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none",H1[s],B1[i],l),disabled:c,...f,children:d})}const V1=({logs:s,isLoading:i=!1,error:l=null,onClear:c})=>{const{t:d}=Ne(),f=w.useRef(null),[m,p]=w.useState(!0),[g,h]=w.useState(""),[y,S]=w.useState(["info","error","warn","debug"]),[v,A]=w.useState(["main","child"]);w.useEffect(()=>{m&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[s,m]);const N=s.filter(C=>{const O=g?C.message.toLowerCase().includes(g.toLowerCase()):!0,F=y.includes(C.type),D=v.includes(C.source);return O&&F&&D}),M=C=>new Date(C).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),R=C=>{switch(C){case"error":return"bg-red-400/80 text-white";case"warn":return"bg-yellow-400/80 text-gray-900";case"debug":return"bg-purple-400/80 text-white";case"info":return"bg-blue-400/80 text-white";default:return"bg-blue-400/80 text-white"}},j=C=>{switch(C){case"main":return"bg-green-400/80 text-white";case"child":return"bg-orange-400/80 text-white";default:return"bg-gray-400/80 text-white"}};return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"bg-card p-3 rounded-t-md flex flex-wrap items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("span",{className:"font-semibold text-sm",children:[d("logs.filters"),":"]}),r.jsx("input",{type:"text",placeholder:d("logs.search"),className:"shadow appearance-none border border-gray-200 rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",value:g,onChange:C=>h(C.target.value)}),r.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(C=>r.jsx(ui,{variant:y.includes(C)?"default":"outline",className:`cursor-pointer ${y.includes(C)?R(C):""}`,onClick:()=>{y.includes(C)?S(O=>O.filter(F=>F!==C)):S(O=>[...O,C])},children:C},C))}),r.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(C=>r.jsx(ui,{variant:v.includes(C)?"default":"outline",className:`cursor-pointer ${v.includes(C)?j(C):""}`,onClick:()=>{v.includes(C)?A(O=>O.filter(F=>F!==C)):A(O=>[...O,C])},children:d(C==="main"?"logs.mainProcess":"logs.childProcess")},C))})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("label",{className:"flex items-center gap-1 text-sm",children:[r.jsx("input",{type:"checkbox",checked:m,onChange:()=>p(!m),className:"form-checkbox h-4 w-4"}),d("logs.autoScroll")]}),r.jsx(q1,{variant:"outline",size:"sm",onClick:c,className:"btn-secondary",disabled:i||s.length===0,children:d("logs.clearLogs")})]})]}),r.jsx("div",{ref:f,className:"flex-grow p-2 overflow-auto bg-card rounded-b-md font-mono text-sm",style:{maxHeight:"calc(100vh - 300px)"},children:i?r.jsx("div",{className:"flex justify-center items-center h-full",children:r.jsx("span",{children:d("logs.loading")})}):l?r.jsx("div",{className:"text-red-500 p-2",children:l.message}):N.length===0?r.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||y.length<4||v.length<2?d("logs.noMatch"):d("logs.noLogs")}):N.map((C,O)=>r.jsxs("div",{className:`py-1 ${C.type==="error"?"text-red-500":C.type==="warn"?"text-yellow-500":""}`,children:[r.jsxs("span",{className:"text-gray-400",children:["[",M(C.timestamp),"]"]}),r.jsx(ui,{className:`ml-2 mr-1 ${R(C.type)}`,children:C.type}),r.jsxs(ui,{variant:"default",className:`mr-2 ${j(C.source)}`,children:[C.source==="main"?d("logs.main"):d("logs.child"),C.processId?` (${C.processId})`:""]}),r.jsx("span",{className:"whitespace-pre-wrap",children:C.message})]},`${C.timestamp}-${O}`))})]})},G1=async()=>{try{const s=await pi("/logs");if(!s.success)throw new Error(s.error||"Failed to clear logs")}catch(s){throw console.error("Error clearing logs:",s),s}},K1=()=>{const[s,i]=w.useState([]),[l,c]=w.useState(!0),[d,f]=w.useState(null);return w.useEffect(()=>{let p=null,g=!0;const h=()=>{try{p&&p.close();const y=Br();p=new EventSource(hu(`/logs/stream?token=${y}`)),p.onmessage=S=>{if(g)try{const v=JSON.parse(S.data);v.type==="initial"?(i(v.logs),c(!1)):v.type==="log"&&i(A=>[...A,v.log])}catch(v){console.error("Error parsing SSE message:",v)}},p.onerror=()=>{g&&(p&&(p.close(),setTimeout(h,5e3)),f(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(y){if(!g)return;f(y instanceof Error?y:new Error("Failed to connect to log stream")),c(!1)}};return h(),()=>{g=!1,p&&p.close()}},[]),{logs:s,loading:l,error:d,clearLogs:async()=>{try{await G1(),i([])}catch(p){f(p instanceof Error?p:new Error("Failed to clear logs"))}}}},$1=()=>{const{t:s}=Ne(),{logs:i,loading:l,error:c,clearLogs:d}=K1();return r.jsxs("div",{className:"container mx-auto p-4",children:[r.jsx("div",{className:"flex justify-between items-center mb-4",children:r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.logs.title")})}),r.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:r.jsx(V1,{logs:i,isLoading:l,error:c,onClear:d})})]})};function Mh(){const s=mu();return r.jsx(Av,{children:r.jsx(nb,{children:r.jsx(Tv,{children:r.jsx(Ly,{basename:s,children:r.jsxs(fy,{children:[r.jsx(zt,{path:"/login",element:r.jsx(o1,{})}),r.jsx(zt,{element:r.jsx(i1,{}),children:r.jsxs(zt,{element:r.jsx(l1,{}),children:[r.jsx(zt,{path:"/",element:r.jsx(c1,{})}),r.jsx(zt,{path:"/servers",element:r.jsx(C1,{})}),r.jsx(zt,{path:"/groups",element:r.jsx(A1,{})}),r.jsx(zt,{path:"/users",element:r.jsx(R1,{})}),r.jsx(zt,{path:"/market",element:r.jsx(Oh,{})}),r.jsx(zt,{path:"/market/:serverName",element:r.jsx(Oh,{})}),r.jsx(zt,{path:"/logs",element:r.jsx($1,{})}),r.jsx(zt,{path:"/settings",element:r.jsx(z1,{})})]})}),r.jsx(zt,{path:"*",element:r.jsx(lg,{to:"/"})})]})})})})})}const we=s=>typeof s=="string",Mr=()=>{let s,i;const l=new Promise((c,d)=>{s=c,i=d});return l.resolve=s,l.reject=i,l},zh=s=>s==null?"":""+s,Y1=(s,i,l)=>{s.forEach(c=>{i[c]&&(l[c]=i[c])})},P1=/###/g,Dh=s=>s&&s.indexOf("###")>-1?s.replace(P1,"."):s,Uh=s=>!s||we(s),zr=(s,i,l)=>{const c=we(i)?i.split("."):i;let d=0;for(;d<c.length-1;){if(Uh(s))return{};const f=Dh(c[d]);!s[f]&&l&&(s[f]=new l),Object.prototype.hasOwnProperty.call(s,f)?s=s[f]:s={},++d}return Uh(s)?{}:{obj:s,k:Dh(c[d])}},Lh=(s,i,l)=>{const{obj:c,k:d}=zr(s,i,Object);if(c!==void 0||i.length===1){c[d]=l;return}let f=i[i.length-1],m=i.slice(0,i.length-1),p=zr(s,m,Object);for(;p.obj===void 0&&m.length;)f=`${m[m.length-1]}.${f}`,m=m.slice(0,m.length-1),p=zr(s,m,Object),p!=null&&p.obj&&typeof p.obj[`${p.k}.${f}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${f}`]=l},F1=(s,i,l,c)=>{const{obj:d,k:f}=zr(s,i,Object);d[f]=d[f]||[],d[f].push(l)},yi=(s,i)=>{const{obj:l,k:c}=zr(s,i);if(l&&Object.prototype.hasOwnProperty.call(l,c))return l[c]},X1=(s,i,l)=>{const c=yi(s,l);return c!==void 0?c:yi(i,l)},Xg=(s,i,l)=>{for(const c in i)c!=="__proto__"&&c!=="constructor"&&(c in s?we(s[c])||s[c]instanceof String||we(i[c])||i[c]instanceof String?l&&(s[c]=i[c]):Xg(s[c],i[c],l):s[c]=i[c]);return s},vs=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Q1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Z1=s=>we(s)?s.replace(/[&<>"'\/]/g,i=>Q1[i]):s;class J1{constructor(i){this.capacity=i,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(i){const l=this.regExpMap.get(i);if(l!==void 0)return l;const c=new RegExp(i);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(i,c),this.regExpQueue.push(i),c}}const I1=[" ",",","?","!",";"],W1=new J1(20),e2=(s,i,l)=>{i=i||"",l=l||"";const c=I1.filter(m=>i.indexOf(m)<0&&l.indexOf(m)<0);if(c.length===0)return!0;const d=W1.getRegExp(`(${c.map(m=>m==="?"?"\\?":m).join("|")})`);let f=!d.test(s);if(!f){const m=s.indexOf(l);m>0&&!d.test(s.substring(0,m))&&(f=!0)}return f},su=function(s,i){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!s)return;if(s[i])return Object.prototype.hasOwnProperty.call(s,i)?s[i]:void 0;const c=i.split(l);let d=s;for(let f=0;f<c.length;){if(!d||typeof d!="object")return;let m,p="";for(let g=f;g<c.length;++g)if(g!==f&&(p+=l),p+=c[g],m=d[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<c.length-1)continue;f+=g-f+1;break}d=m}return d},bi=s=>s==null?void 0:s.replace("_","-"),t2={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,i){var l,c;(c=(l=console==null?void 0:console[s])==null?void 0:l.apply)==null||c.call(l,console,i)}};class vi{constructor(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(i,l)}init(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=l.prefix||"i18next:",this.logger=i||t2,this.options=l,this.debug=l.debug}log(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return this.forward(l,"log","",!0)}warn(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return this.forward(l,"warn","",!0)}error(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return this.forward(l,"error","")}deprecate(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(i,l,c,d){return d&&!this.debug?null:(we(i[0])&&(i[0]=`${c}${this.prefix} ${i[0]}`),this.logger[l](i))}create(i){return new vi(this.logger,{prefix:`${this.prefix}:${i}:`,...this.options})}clone(i){return i=i||this.options,i.prefix=i.prefix||this.prefix,new vi(this.logger,i)}}var ua=new vi;class Ei{constructor(){this.observers={}}on(i,l){return i.split(" ").forEach(c=>{this.observers[c]||(this.observers[c]=new Map);const d=this.observers[c].get(l)||0;this.observers[c].set(l,d+1)}),this}off(i,l){if(this.observers[i]){if(!l){delete this.observers[i];return}this.observers[i].delete(l)}}emit(i){for(var l=arguments.length,c=new Array(l>1?l-1:0),d=1;d<l;d++)c[d-1]=arguments[d];this.observers[i]&&Array.from(this.observers[i].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p(...c)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p.apply(p,[i,...c])})}}class _h extends Ei{constructor(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=i||{},this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}removeNamespaces(i){const l=this.options.ns.indexOf(i);l>-1&&this.options.ns.splice(l,1)}getResource(i,l,c){var h,y;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator,m=d.ignoreJSONStructure!==void 0?d.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;i.indexOf(".")>-1?p=i.split("."):(p=[i,l],c&&(Array.isArray(c)?p.push(...c):we(c)&&f?p.push(...c.split(f)):p.push(c)));const g=yi(this.data,p);return!g&&!l&&!c&&i.indexOf(".")>-1&&(i=p[0],l=p[1],c=p.slice(2).join(".")),g||!m||!we(c)?g:su((y=(h=this.data)==null?void 0:h[i])==null?void 0:y[l],c,f)}addResource(i,l,c,d){let f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const m=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let p=[i,l];c&&(p=p.concat(m?c.split(m):c)),i.indexOf(".")>-1&&(p=i.split("."),d=l,l=p[1]),this.addNamespaces(l),Lh(this.data,p,d),f.silent||this.emit("added",i,l,c,d)}addResources(i,l,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const f in c)(we(c[f])||Array.isArray(c[f]))&&this.addResource(i,l,f,c[f],{silent:!0});d.silent||this.emit("added",i,l,c)}addResourceBundle(i,l,c,d,f){let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},p=[i,l];i.indexOf(".")>-1&&(p=i.split("."),d=c,c=l,l=p[1]),this.addNamespaces(l);let g=yi(this.data,p)||{};m.skipCopy||(c=JSON.parse(JSON.stringify(c))),d?Xg(g,c,f):g={...g,...c},Lh(this.data,p,g),m.silent||this.emit("added",i,l,c)}removeResourceBundle(i,l){this.hasResourceBundle(i,l)&&delete this.data[i][l],this.removeNamespaces(l),this.emit("removed",i,l)}hasResourceBundle(i,l){return this.getResource(i,l)!==void 0}getResourceBundle(i,l){return l||(l=this.options.defaultNS),this.getResource(i,l)}getDataByLanguage(i){return this.data[i]}hasLanguageSomeTranslations(i){const l=this.getDataByLanguage(i);return!!(l&&Object.keys(l)||[]).find(d=>l[d]&&Object.keys(l[d]).length>0)}toJSON(){return this.data}}var Qg={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,i,l,c,d){return s.forEach(f=>{var m;i=((m=this.processors[f])==null?void 0:m.process(i,l,c,d))??i}),i}};const Hh={},Bh=s=>!we(s)&&typeof s!="boolean"&&typeof s!="number";class wi extends Ei{constructor(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Y1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,this),this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ua.create("translator")}changeLanguage(i){i&&(this.language=i)}exists(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;const c=this.resolve(i,l);return(c==null?void 0:c.res)!==void 0}extractFromKey(i,l){let c=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const d=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=l.ns||this.options.defaultNS||[];const m=c&&i.indexOf(c)>-1,p=!this.options.userDefinedKeySeparator&&!l.keySeparator&&!this.options.userDefinedNsSeparator&&!l.nsSeparator&&!e2(i,c,d);if(m&&!p){const g=i.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:i,namespaces:we(f)?[f]:f};const h=i.split(c);(c!==d||c===d&&this.options.ns.indexOf(h[0])>-1)&&(f=h.shift()),i=h.join(d)}return{key:i,namespaces:we(f)?[f]:f}}translate(i,l,c){if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof l=="object"&&(l={...l}),l||(l={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);const d=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,f=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:m,namespaces:p}=this.extractFromKey(i[i.length-1],l),g=p[p.length-1],h=l.lng||this.language,y=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode"){if(y){const U=l.nsSeparator||this.options.nsSeparator;return d?{res:`${g}${U}${m}`,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(l)}:`${g}${U}${m}`}return d?{res:m,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(l)}:m}const S=this.resolve(i,l);let v=S==null?void 0:S.res;const A=(S==null?void 0:S.usedKey)||m,N=(S==null?void 0:S.exactUsedKey)||m,M=["[object Number]","[object Function]","[object RegExp]"],R=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,C=l.count!==void 0&&!we(l.count),O=wi.hasDefaultValue(l),F=C?this.pluralResolver.getSuffix(h,l.count,l):"",D=l.ordinal&&C?this.pluralResolver.getSuffix(h,l.count,{ordinal:!1}):"",ee=C&&!l.ordinal&&l.count===0,Q=ee&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${F}`]||l[`defaultValue${D}`]||l.defaultValue;let B=v;j&&!v&&O&&(B=Q);const W=Bh(B),le=Object.prototype.toString.apply(B);if(j&&B&&W&&M.indexOf(le)<0&&!(we(R)&&Array.isArray(B))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const U=this.options.returnedObjectHandler?this.options.returnedObjectHandler(A,B,{...l,ns:p}):`key '${m} (${this.language})' returned an object instead of string.`;return d?(S.res=U,S.usedParams=this.getUsedParamsDetails(l),S):U}if(f){const U=Array.isArray(B),L=U?[]:{},Z=U?N:A;for(const _ in B)if(Object.prototype.hasOwnProperty.call(B,_)){const $=`${Z}${f}${_}`;O&&!v?L[_]=this.translate($,{...l,defaultValue:Bh(Q)?Q[_]:void 0,joinArrays:!1,ns:p}):L[_]=this.translate($,{...l,joinArrays:!1,ns:p}),L[_]===$&&(L[_]=B[_])}v=L}}else if(j&&we(R)&&Array.isArray(v))v=v.join(R),v&&(v=this.extendTranslation(v,i,l,c));else{let U=!1,L=!1;!this.isValidLookup(v)&&O&&(U=!0,v=Q),this.isValidLookup(v)||(L=!0,v=m);const _=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:v,$=O&&Q!==v&&this.options.updateMissing;if(L||U||$){if(this.logger.log($?"updateKey":"missingKey",h,g,m,$?Q:v),f){const oe=this.resolve(m,{...l,keySeparator:!1});oe&&oe.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let E=[];const G=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&G&&G[0])for(let oe=0;oe<G.length;oe++)E.push(G[oe]);else this.options.saveMissingTo==="all"?E=this.languageUtils.toResolveHierarchy(l.lng||this.language):E.push(l.lng||this.language);const X=(oe,T,P)=>{var ne;const re=O&&P!==v?P:_;this.options.missingKeyHandler?this.options.missingKeyHandler(oe,g,T,re,$,l):(ne=this.backendConnector)!=null&&ne.saveMissing&&this.backendConnector.saveMissing(oe,g,T,re,$,l),this.emit("missingKey",oe,g,T,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?E.forEach(oe=>{const T=this.pluralResolver.getSuffixes(oe,l);ee&&l[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(P=>{X([oe],m+P,l[`defaultValue${P}`]||Q)})}):X(E,m,Q))}v=this.extendTranslation(v,i,l,S,c),L&&v===m&&this.options.appendNamespaceToMissingKey&&(v=`${g}:${m}`),(L||U)&&this.options.parseMissingKeyHandler&&(v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}:${m}`:m,U?v:void 0))}return d?(S.res=v,S.usedParams=this.getUsedParamsDetails(l),S):v}extendTranslation(i,l,c,d,f){var h,y;var m=this;if((h=this.i18nFormat)!=null&&h.parse)i=this.i18nFormat.parse(i,{...this.options.interpolation.defaultVariables,...c},c.lng||this.language||d.usedLng,d.usedNS,d.usedKey,{resolved:d});else if(!c.skipInterpolation){c.interpolation&&this.interpolator.init({...c,interpolation:{...this.options.interpolation,...c.interpolation}});const S=we(i)&&(((y=c==null?void 0:c.interpolation)==null?void 0:y.skipOnVariables)!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(S){const N=i.match(this.interpolator.nestingRegexp);v=N&&N.length}let A=c.replace&&!we(c.replace)?c.replace:c;if(this.options.interpolation.defaultVariables&&(A={...this.options.interpolation.defaultVariables,...A}),i=this.interpolator.interpolate(i,A,c.lng||this.language||d.usedLng,c),S){const N=i.match(this.interpolator.nestingRegexp),M=N&&N.length;v<M&&(c.nest=!1)}!c.lng&&d&&d.res&&(c.lng=this.language||d.usedLng),c.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var N=arguments.length,M=new Array(N),R=0;R<N;R++)M[R]=arguments[R];return(f==null?void 0:f[0])===M[0]&&!c.context?(m.logger.warn(`It seems you are nesting recursively key: ${M[0]} in key: ${l[0]}`),null):m.translate(...M,l)},c)),c.interpolation&&this.interpolator.reset()}const p=c.postProcess||this.options.postProcess,g=we(p)?[p]:p;return i!=null&&(g!=null&&g.length)&&c.applyPostProcessor!==!1&&(i=Qg.handle(g,i,l,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...d,usedParams:this.getUsedParamsDetails(c)},...c}:c,this)),i}resolve(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c,d,f,m,p;return we(i)&&(i=[i]),i.forEach(g=>{if(this.isValidLookup(c))return;const h=this.extractFromKey(g,l),y=h.key;d=y;let S=h.namespaces;this.options.fallbackNS&&(S=S.concat(this.options.fallbackNS));const v=l.count!==void 0&&!we(l.count),A=v&&!l.ordinal&&l.count===0,N=l.context!==void 0&&(we(l.context)||typeof l.context=="number")&&l.context!=="",M=l.lngs?l.lngs:this.languageUtils.toResolveHierarchy(l.lng||this.language,l.fallbackLng);S.forEach(R=>{var j,C;this.isValidLookup(c)||(p=R,!Hh[`${M[0]}-${R}`]&&((j=this.utils)!=null&&j.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(p))&&(Hh[`${M[0]}-${R}`]=!0,this.logger.warn(`key "${d}" for languages "${M.join(", ")}" won't get resolved as namespace "${p}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),M.forEach(O=>{var ee;if(this.isValidLookup(c))return;m=O;const F=[y];if((ee=this.i18nFormat)!=null&&ee.addLookupKeys)this.i18nFormat.addLookupKeys(F,y,O,R,l);else{let Q;v&&(Q=this.pluralResolver.getSuffix(O,l.count,l));const B=`${this.options.pluralSeparator}zero`,W=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(F.push(y+Q),l.ordinal&&Q.indexOf(W)===0&&F.push(y+Q.replace(W,this.options.pluralSeparator)),A&&F.push(y+B)),N){const le=`${y}${this.options.contextSeparator}${l.context}`;F.push(le),v&&(F.push(le+Q),l.ordinal&&Q.indexOf(W)===0&&F.push(le+Q.replace(W,this.options.pluralSeparator)),A&&F.push(le+B))}}let D;for(;D=F.pop();)this.isValidLookup(c)||(f=D,c=this.getResource(O,R,D,l))}))})}),{res:c,usedKey:d,exactUsedKey:f,usedLng:m,usedNS:p}}isValidLookup(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}getResource(i,l,c){var f;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(i,l,c,d):this.resourceStore.getResource(i,l,c,d)}getUsedParamsDetails(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const l=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],c=i.replace&&!we(i.replace);let d=c?i.replace:i;if(c&&typeof i.count<"u"&&(d.count=i.count),this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),!c){d={...d};for(const f of l)delete d[f]}return d}static hasDefaultValue(i){const l="defaultValue";for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)&&l===c.substring(0,l.length)&&i[c]!==void 0)return!0;return!1}}class qh{constructor(i){this.options=i,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ua.create("languageUtils")}getScriptPartFromCode(i){if(i=bi(i),!i||i.indexOf("-")<0)return null;const l=i.split("-");return l.length===2||(l.pop(),l[l.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(l.join("-"))}getLanguagePartFromCode(i){if(i=bi(i),!i||i.indexOf("-")<0)return i;const l=i.split("-");return this.formatLanguageCode(l[0])}formatLanguageCode(i){if(we(i)&&i.indexOf("-")>-1){let l;try{l=Intl.getCanonicalLocales(i)[0]}catch{}return l&&this.options.lowerCaseLng&&(l=l.toLowerCase()),l||(this.options.lowerCaseLng?i.toLowerCase():i)}return this.options.cleanCode||this.options.lowerCaseLng?i.toLowerCase():i}isSupportedCode(i){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(i=this.getLanguagePartFromCode(i)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(i)>-1}getBestMatchFromCodes(i){if(!i)return null;let l;return i.forEach(c=>{if(l)return;const d=this.formatLanguageCode(c);(!this.options.supportedLngs||this.isSupportedCode(d))&&(l=d)}),!l&&this.options.supportedLngs&&i.forEach(c=>{if(l)return;const d=this.getLanguagePartFromCode(c);if(this.isSupportedCode(d))return l=d;l=this.options.supportedLngs.find(f=>{if(f===d)return f;if(!(f.indexOf("-")<0&&d.indexOf("-")<0)&&(f.indexOf("-")>0&&d.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===d||f.indexOf(d)===0&&d.length>1))return f})}),l||(l=this.getFallbackCodes(this.options.fallbackLng)[0]),l}getFallbackCodes(i,l){if(!i)return[];if(typeof i=="function"&&(i=i(l)),we(i)&&(i=[i]),Array.isArray(i))return i;if(!l)return i.default||[];let c=i[l];return c||(c=i[this.getScriptPartFromCode(l)]),c||(c=i[this.formatLanguageCode(l)]),c||(c=i[this.getLanguagePartFromCode(l)]),c||(c=i.default),c||[]}toResolveHierarchy(i,l){const c=this.getFallbackCodes(l||this.options.fallbackLng||[],i),d=[],f=m=>{m&&(this.isSupportedCode(m)?d.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return we(i)&&(i.indexOf("-")>-1||i.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(i)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(i)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(i))):we(i)&&f(this.formatLanguageCode(i)),c.forEach(m=>{d.indexOf(m)<0&&f(this.formatLanguageCode(m))}),d}}const Vh={zero:0,one:1,two:2,few:3,many:4,other:5},Gh={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class a2{constructor(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=i,this.options=l,this.logger=ua.create("pluralResolver"),this.pluralRulesCache={}}addRule(i,l){this.rules[i]=l}clearCache(){this.pluralRulesCache={}}getRule(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const c=bi(i==="dev"?"en":i),d=l.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:c,type:d});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let m;try{m=new Intl.PluralRules(c,{type:d})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Gh;if(!i.match(/-|_/))return Gh;const g=this.languageUtils.getLanguagePartFromCode(i);m=this.getRule(g,l)}return this.pluralRulesCache[f]=m,m}needsPlural(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=this.getRule(i,l);return c||(c=this.getRule("dev",l)),(c==null?void 0:c.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(i,l){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(i,c).map(d=>`${l}${d}`)}getSuffixes(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=this.getRule(i,l);return c||(c=this.getRule("dev",l)),c?c.resolvedOptions().pluralCategories.sort((d,f)=>Vh[d]-Vh[f]).map(d=>`${this.options.prepend}${l.ordinal?`ordinal${this.options.prepend}`:""}${d}`):[]}getSuffix(i,l){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const d=this.getRule(i,c);return d?`${this.options.prepend}${c.ordinal?`ordinal${this.options.prepend}`:""}${d.select(l)}`:(this.logger.warn(`no plural rule found for: ${i}`),this.getSuffix("dev",l,c))}}const Kh=function(s,i,l){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,f=X1(s,i,l);return!f&&d&&we(l)&&(f=su(s,l,c),f===void 0&&(f=su(i,l,c))),f},Xc=s=>s.replace(/\$/g,"$$$$");class n2{constructor(){var l;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ua.create("interpolator"),this.options=i,this.format=((l=i==null?void 0:i.interpolation)==null?void 0:l.format)||(c=>c),this.init(i)}init(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i.interpolation||(i.interpolation={escapeValue:!0});const{escape:l,escapeValue:c,useRawValueToEscape:d,prefix:f,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:y,unescapePrefix:S,nestingPrefix:v,nestingPrefixEscaped:A,nestingSuffix:N,nestingSuffixEscaped:M,nestingOptionsSeparator:R,maxReplaces:j,alwaysFormat:C}=i.interpolation;this.escape=l!==void 0?l:Z1,this.escapeValue=c!==void 0?c:!0,this.useRawValueToEscape=d!==void 0?d:!1,this.prefix=f?vs(f):m||"{{",this.suffix=p?vs(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=y?"":S||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=v?vs(v):A||vs("$t("),this.nestingSuffix=N?vs(N):M||vs(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=j||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const i=(l,c)=>(l==null?void 0:l.source)===c?(l.lastIndex=0,l):new RegExp(c,"g");this.regexp=i(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=i(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=i(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(i,l,c,d){var A;let f,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=N=>{if(N.indexOf(this.formatSeparator)<0){const C=Kh(l,g,N,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,c,{...d,...l,interpolationkey:N}):C}const M=N.split(this.formatSeparator),R=M.shift().trim(),j=M.join(this.formatSeparator).trim();return this.format(Kh(l,g,R,this.options.keySeparator,this.options.ignoreJSONStructure),j,c,{...d,...l,interpolationkey:R})};this.resetRegExp();const y=(d==null?void 0:d.missingInterpolationHandler)||this.options.missingInterpolationHandler,S=((A=d==null?void 0:d.interpolation)==null?void 0:A.skipOnVariables)!==void 0?d.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:N=>Xc(N)},{regex:this.regexp,safeValue:N=>this.escapeValue?Xc(this.escape(N)):Xc(N)}].forEach(N=>{for(p=0;f=N.regex.exec(i);){const M=f[1].trim();if(m=h(M),m===void 0)if(typeof y=="function"){const j=y(i,f,d);m=we(j)?j:""}else if(d&&Object.prototype.hasOwnProperty.call(d,M))m="";else if(S){m=f[0];continue}else this.logger.warn(`missed to pass in variable ${M} for interpolating ${i}`),m="";else!we(m)&&!this.useRawValueToEscape&&(m=zh(m));const R=N.safeValue(m);if(i=i.replace(f[0],R),S?(N.regex.lastIndex+=m.length,N.regex.lastIndex-=f[0].length):N.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),i}nest(i,l){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,f,m;const p=(g,h)=>{const y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;const S=g.split(new RegExp(`${y}[ ]*{`));let v=`{${S[1]}`;g=S[0],v=this.interpolate(v,m);const A=v.match(/'/g),N=v.match(/"/g);(((A==null?void 0:A.length)??0)%2===0&&!N||N.length%2!==0)&&(v=v.replace(/'/g,'"'));try{m=JSON.parse(v),h&&(m={...h,...m})}catch(M){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,M),`${g}${y}${v}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;d=this.nestingRegexp.exec(i);){let g=[];m={...c},m=m.replace&&!we(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;let h=!1;if(d[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(d[1])){const y=d[1].split(this.formatSeparator).map(S=>S.trim());d[1]=y.shift(),g=y,h=!0}if(f=l(p.call(this,d[1].trim(),m),m),f&&d[0]===i&&!we(f))return f;we(f)||(f=zh(f)),f||(this.logger.warn(`missed to resolve ${d[1]} for nesting ${i}`),f=""),h&&(f=g.reduce((y,S)=>this.format(y,S,c.lng,{...c,interpolationkey:d[1].trim()}),f.trim())),i=i.replace(d[0],f),this.regexp.lastIndex=0}return i}}const s2=s=>{let i=s.toLowerCase().trim();const l={};if(s.indexOf("(")>-1){const c=s.split("(");i=c[0].toLowerCase().trim();const d=c[1].substring(0,c[1].length-1);i==="currency"&&d.indexOf(":")<0?l.currency||(l.currency=d.trim()):i==="relativetime"&&d.indexOf(":")<0?l.range||(l.range=d.trim()):d.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),y=p.trim();l[y]||(l[y]=h),h==="false"&&(l[y]=!1),h==="true"&&(l[y]=!0),isNaN(h)||(l[y]=parseInt(h,10))}})}return{formatName:i,formatOptions:l}},ws=s=>{const i={};return(l,c,d)=>{let f=d;d&&d.interpolationkey&&d.formatParams&&d.formatParams[d.interpolationkey]&&d[d.interpolationkey]&&(f={...f,[d.interpolationkey]:void 0});const m=c+JSON.stringify(f);let p=i[m];return p||(p=s(bi(c),d),i[m]=p),p(l)}};class r2{constructor(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ua.create("formatter"),this.options=i,this.formats={number:ws((l,c)=>{const d=new Intl.NumberFormat(l,{...c});return f=>d.format(f)}),currency:ws((l,c)=>{const d=new Intl.NumberFormat(l,{...c,style:"currency"});return f=>d.format(f)}),datetime:ws((l,c)=>{const d=new Intl.DateTimeFormat(l,{...c});return f=>d.format(f)}),relativetime:ws((l,c)=>{const d=new Intl.RelativeTimeFormat(l,{...c});return f=>d.format(f,c.range||"day")}),list:ws((l,c)=>{const d=new Intl.ListFormat(l,{...c});return f=>d.format(f)})},this.init(i)}init(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=l.interpolation.formatSeparator||","}add(i,l){this.formats[i.toLowerCase().trim()]=l}addCached(i,l){this.formats[i.toLowerCase().trim()]=ws(l)}format(i,l,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=l.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(p=>p.indexOf(")")>-1)){const p=f.findIndex(g=>g.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,p)].join(this.formatSeparator)}return f.reduce((p,g)=>{var S;const{formatName:h,formatOptions:y}=s2(g);if(this.formats[h]){let v=p;try{const A=((S=d==null?void 0:d.formatParams)==null?void 0:S[d.interpolationkey])||{},N=A.locale||A.lng||d.locale||d.lng||c;v=this.formats[h](p,N,{...y,...d,...A})}catch(A){this.logger.warn(A)}return v}else this.logger.warn(`there was no format function for ${h}`);return p},i)}}const l2=(s,i)=>{s.pending[i]!==void 0&&(delete s.pending[i],s.pendingCount--)};class i2 extends Ei{constructor(i,l,c){var f,m;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=i,this.store=l,this.services=c,this.languageUtils=c.languageUtils,this.options=d,this.logger=ua.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=d.maxParallelReads||10,this.readingCalls=0,this.maxRetries=d.maxRetries>=0?d.maxRetries:5,this.retryTimeout=d.retryTimeout>=1?d.retryTimeout:350,this.state={},this.queue=[],(m=(f=this.backend)==null?void 0:f.init)==null||m.call(f,c,d.backend,d)}queueLoad(i,l,c,d){const f={},m={},p={},g={};return i.forEach(h=>{let y=!0;l.forEach(S=>{const v=`${h}|${S}`;!c.reload&&this.store.hasResourceBundle(h,S)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?m[v]===void 0&&(m[v]=!0):(this.state[v]=1,y=!1,m[v]===void 0&&(m[v]=!0),f[v]===void 0&&(f[v]=!0),g[S]===void 0&&(g[S]=!0)))}),y||(p[h]=!0)}),(Object.keys(f).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:d}),{toLoad:Object.keys(f),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(i,l,c){const d=i.split("|"),f=d[0],m=d[1];l&&this.emit("failedLoading",f,m,l),!l&&c&&this.store.addResourceBundle(f,m,c,void 0,void 0,{skipCopy:!0}),this.state[i]=l?-1:2,l&&c&&(this.state[i]=0);const p={};this.queue.forEach(g=>{F1(g.loaded,[f],m),l2(g,i),l&&g.errors.push(l),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const y=g.loaded[h];y.length&&y.forEach(S=>{p[h][S]===void 0&&(p[h][S]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(i,l,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,m=arguments.length>5?arguments[5]:void 0;if(!i.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:l,fcName:c,tried:d,wait:f,callback:m});return}this.readingCalls++;const p=(h,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const S=this.waitingReads.shift();this.read(S.lng,S.ns,S.fcName,S.tried,S.wait,S.callback)}if(h&&y&&d<this.maxRetries){setTimeout(()=>{this.read.call(this,i,l,c,d+1,f*2,m)},f);return}m(h,y)},g=this.backend[c].bind(this.backend);if(g.length===2){try{const h=g(i,l);h&&typeof h.then=="function"?h.then(y=>p(null,y)).catch(p):p(null,h)}catch(h){p(h)}return}return g(i,l,p)}prepareLoading(i,l){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),d&&d();we(i)&&(i=this.languageUtils.toResolveHierarchy(i)),we(l)&&(l=[l]);const f=this.queueLoad(i,l,c,d);if(!f.toLoad.length)return f.pending.length||d(),null;f.toLoad.forEach(m=>{this.loadOne(m)})}load(i,l,c){this.prepareLoading(i,l,{},c)}reload(i,l,c){this.prepareLoading(i,l,{reload:!0},c)}loadOne(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const c=i.split("|"),d=c[0],f=c[1];this.read(d,f,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${l}loading namespace ${f} for language ${d} failed`,m),!m&&p&&this.logger.log(`${l}loaded namespace ${f} for language ${d}`,p),this.loaded(i,m,p)})}saveMissing(i,l,c,d,f){var g,h,y,S,v;let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},p=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((h=(g=this.services)==null?void 0:g.utils)!=null&&h.hasLoadedNamespace&&!((S=(y=this.services)==null?void 0:y.utils)!=null&&S.hasLoadedNamespace(l))){this.logger.warn(`did not save key "${c}" as the namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(c==null||c==="")){if((v=this.backend)!=null&&v.create){const A={...m,isUpdate:f},N=this.backend.create.bind(this.backend);if(N.length<6)try{let M;N.length===5?M=N(i,l,c,d,A):M=N(i,l,c,d),M&&typeof M.then=="function"?M.then(R=>p(null,R)).catch(p):p(null,M)}catch(M){p(M)}else N(i,l,c,d,p,A)}!i||!i[0]||this.store.addResource(i[0],l,c,d)}}}const $h=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:s=>{let i={};if(typeof s[1]=="object"&&(i=s[1]),we(s[1])&&(i.defaultValue=s[1]),we(s[2])&&(i.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){const l=s[3]||s[2];Object.keys(l).forEach(c=>{i[c]=l[c]})}return i},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Yh=s=>{var i,l;return we(s.ns)&&(s.ns=[s.ns]),we(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),we(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),((l=(i=s.supportedLngs)==null?void 0:i.indexOf)==null?void 0:l.call(i,"cimode"))<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s},di=()=>{},o2=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(l=>{typeof s[l]=="function"&&(s[l]=s[l].bind(s))})};class Lr extends Ei{constructor(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Yh(i),this.services={},this.logger=ua,this.modules={external:[]},o2(this),l&&!this.isInitialized&&!i.isClone){if(!this.options.initAsync)return this.init(i,l),this;setTimeout(()=>{this.init(i,l)},0)}}init(){var i=this;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof l=="function"&&(c=l,l={}),l.defaultNS==null&&l.ns&&(we(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const d=$h();this.options={...d,...this.options,...Yh(l)},this.options.interpolation={...d.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator);const f=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?ua.init(f(this.modules.logger),this.options):ua.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=r2;const S=new qh(this.options);this.store=new _h(this.options.resources,this.options);const v=this.services;v.logger=ua,v.resourceStore=this.store,v.languageUtils=S,v.pluralResolver=new a2(S,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),y&&(!this.options.interpolation.format||this.options.interpolation.format===d.interpolation.format)&&(v.formatter=f(y),v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new n2(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new i2(f(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",function(A){for(var N=arguments.length,M=new Array(N>1?N-1:0),R=1;R<N;R++)M[R-1]=arguments[R];i.emit(A,...M)}),this.modules.languageDetector&&(v.languageDetector=f(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=f(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new wi(this.services,this.options),this.translator.on("*",function(A){for(var N=arguments.length,M=new Array(N>1?N-1:0),R=1;R<N;R++)M[R-1]=arguments[R];i.emit(A,...M)}),this.modules.external.forEach(A=>{A.init&&A.init(this)})}if(this.format=this.options.interpolation.format,c||(c=di),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(y=>{this[y]=function(){return i.store[y](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=function(){return i.store[y](...arguments),i}});const g=Mr(),h=()=>{const y=(S,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),g.resolve(v),c(S,v)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),g}loadResources(i){var f,m;let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:di;const d=we(i)?i:this.language;if(typeof i=="function"&&(c=i),!this.options.resources||this.options.partialBundledLanguages){if((d==null?void 0:d.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return c();const p=[],g=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(S=>{S!=="cimode"&&p.indexOf(S)<0&&p.push(S)})};d?g(d):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>g(y)),(m=(f=this.options.preload)==null?void 0:f.forEach)==null||m.call(f,h=>g(h)),this.services.backendConnector.load(p,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),c(h)})}else c(null)}reloadResources(i,l,c){const d=Mr();return typeof i=="function"&&(c=i,i=void 0),typeof l=="function"&&(c=l,l=void 0),i||(i=this.languages),l||(l=this.options.ns),c||(c=di),this.services.backendConnector.reload(i,l,f=>{d.resolve(),c(f)}),d}use(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&Qg.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}setResolvedLanguage(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(let l=0;l<this.languages.length;l++){const c=this.languages[l];if(!(["cimode","dev"].indexOf(c)>-1)&&this.store.hasLanguageSomeTranslations(c)){this.resolvedLanguage=c;break}}}changeLanguage(i,l){var c=this;this.isLanguageChangingTo=i;const d=Mr();this.emit("languageChanging",i);const f=g=>{this.language=g,this.languages=this.services.languageUtils.toResolveHierarchy(g),this.resolvedLanguage=void 0,this.setResolvedLanguage(g)},m=(g,h)=>{h?(f(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,d.resolve(function(){return c.t(...arguments)}),l&&l(g,function(){return c.t(...arguments)})},p=g=>{var y,S;!i&&!g&&this.services.languageDetector&&(g=[]);const h=we(g)?g:this.services.languageUtils.getBestMatchFromCodes(g);h&&(this.language||f(h),this.translator.language||this.translator.changeLanguage(h),(S=(y=this.services.languageDetector)==null?void 0:y.cacheUserLanguage)==null||S.call(y,h)),this.loadResources(h,v=>{m(v,h)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?p(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(p):this.services.languageDetector.detect(p):p(i),d}getFixedT(i,l,c){var d=this;const f=function(m,p){let g;if(typeof p!="object"){for(var h=arguments.length,y=new Array(h>2?h-2:0),S=2;S<h;S++)y[S-2]=arguments[S];g=d.options.overloadTranslationOptionHandler([m,p].concat(y))}else g={...p};g.lng=g.lng||f.lng,g.lngs=g.lngs||f.lngs,g.ns=g.ns||f.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||c||f.keyPrefix);const v=d.options.keySeparator||".";let A;return g.keyPrefix&&Array.isArray(m)?A=m.map(N=>`${g.keyPrefix}${v}${N}`):A=g.keyPrefix?`${g.keyPrefix}${v}${m}`:m,d.t(A,g)};return we(i)?f.lng=i:f.lngs=i,f.ns=l,f.keyPrefix=c,f}t(){var d;for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return(d=this.translator)==null?void 0:d.translate(...l)}exists(){var d;for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return(d=this.translator)==null?void 0:d.exists(...l)}setDefaultNamespace(i){this.options.defaultNS=i}hasLoadedNamespace(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const c=l.lng||this.resolvedLanguage||this.languages[0],d=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(c.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(l.precheck){const p=l.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(c,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(c,i)&&(!d||m(f,i)))}loadNamespaces(i,l){const c=Mr();return this.options.ns?(we(i)&&(i=[i]),i.forEach(d=>{this.options.ns.indexOf(d)<0&&this.options.ns.push(d)}),this.loadResources(d=>{c.resolve(),l&&l(d)}),c):(l&&l(),Promise.resolve())}loadLanguages(i,l){const c=Mr();we(i)&&(i=[i]);const d=this.options.preload||[],f=i.filter(m=>d.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return f.length?(this.options.preload=d.concat(f),this.loadResources(m=>{c.resolve(),l&&l(m)}),c):(l&&l(),Promise.resolve())}dir(i){var d,f;if(i||(i=this.resolvedLanguage||(((d=this.languages)==null?void 0:d.length)>0?this.languages[0]:this.language)),!i)return"rtl";const l=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],c=((f=this.services)==null?void 0:f.languageUtils)||new qh($h());return l.indexOf(c.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;return new Lr(i,l)}cloneInstance(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:di;const c=i.forkResourceStore;c&&delete i.forkResourceStore;const d={...this.options,...i,isClone:!0},f=new Lr(d);if((i.debug!==void 0||i.prefix!==void 0)&&(f.logger=f.logger.clone(i)),["store","services","language"].forEach(p=>{f[p]=this[p]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},c){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},Object.keys(g[h]).reduce((y,S)=>(y[S]={...g[h][S]},y),{})),{});f.store=new _h(p,d),f.services.resourceStore=f.store}return f.translator=new wi(f.services,d),f.translator.on("*",function(p){for(var g=arguments.length,h=new Array(g>1?g-1:0),y=1;y<g;y++)h[y-1]=arguments[y];f.emit(p,...h)}),f.init(d,l),f.translator.options=d,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pt=Lr.createInstance();pt.createInstance=Lr.createInstance;pt.createInstance;pt.dir;pt.init;pt.loadResources;pt.reloadResources;pt.use;pt.changeLanguage;pt.getFixedT;pt.t;pt.exists;pt.setDefaultNamespace;pt.hasLoadedNamespace;pt.loadNamespaces;pt.loadLanguages;const{slice:c2,forEach:u2}=[];function d2(s){return u2.call(c2.call(arguments,1),i=>{if(i)for(const l in i)s[l]===void 0&&(s[l]=i[l])}),s}function f2(s){return typeof s!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(l=>l.test(s))}const Ph=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,m2=function(s,i){const c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},d=encodeURIComponent(i);let f=`${s}=${d}`;if(c.maxAge>0){const m=c.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");f+=`; Max-Age=${Math.floor(m)}`}if(c.domain){if(!Ph.test(c.domain))throw new TypeError("option domain is invalid");f+=`; Domain=${c.domain}`}if(c.path){if(!Ph.test(c.path))throw new TypeError("option path is invalid");f+=`; Path=${c.path}`}if(c.expires){if(typeof c.expires.toUTCString!="function")throw new TypeError("option expires is invalid");f+=`; Expires=${c.expires.toUTCString()}`}if(c.httpOnly&&(f+="; HttpOnly"),c.secure&&(f+="; Secure"),c.sameSite)switch(typeof c.sameSite=="string"?c.sameSite.toLowerCase():c.sameSite){case!0:f+="; SameSite=Strict";break;case"lax":f+="; SameSite=Lax";break;case"strict":f+="; SameSite=Strict";break;case"none":f+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return c.partitioned&&(f+="; Partitioned"),f},Fh={create(s,i,l,c){let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};l&&(d.expires=new Date,d.expires.setTime(d.expires.getTime()+l*60*1e3)),c&&(d.domain=c),document.cookie=m2(s,i,d)},read(s){const i=`${s}=`,l=document.cookie.split(";");for(let c=0;c<l.length;c++){let d=l[c];for(;d.charAt(0)===" ";)d=d.substring(1,d.length);if(d.indexOf(i)===0)return d.substring(i.length,d.length)}return null},remove(s,i){this.create(s,"",-1,i)}};var h2={name:"cookie",lookup(s){let{lookupCookie:i}=s;if(i&&typeof document<"u")return Fh.read(i)||void 0},cacheUserLanguage(s,i){let{lookupCookie:l,cookieMinutes:c,cookieDomain:d,cookieOptions:f}=i;l&&typeof document<"u"&&Fh.create(l,s,c,d,f)}},g2={name:"querystring",lookup(s){var c;let{lookupQuerystring:i}=s,l;if(typeof window<"u"){let{search:d}=window.location;!window.location.search&&((c=window.location.hash)==null?void 0:c.indexOf("?"))>-1&&(d=window.location.hash.substring(window.location.hash.indexOf("?")));const m=d.substring(1).split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===i&&(l=m[p].substring(g+1))}}return l}},p2={name:"hash",lookup(s){var d;let{lookupHash:i,lookupFromHashIndex:l}=s,c;if(typeof window<"u"){const{hash:f}=window.location;if(f&&f.length>2){const m=f.substring(1);if(i){const p=m.split("&");for(let g=0;g<p.length;g++){const h=p[g].indexOf("=");h>0&&p[g].substring(0,h)===i&&(c=p[g].substring(h+1))}}if(c)return c;if(!c&&l>-1){const p=f.match(/\/([a-zA-Z-]*)/g);return Array.isArray(p)?(d=p[typeof l=="number"?l:0])==null?void 0:d.replace("/",""):void 0}}}return c}};let Ss=null;const Xh=()=>{if(Ss!==null)return Ss;try{if(Ss=typeof window<"u"&&window.localStorage!==null,!Ss)return!1;const s="i18next.translate.boo";window.localStorage.setItem(s,"foo"),window.localStorage.removeItem(s)}catch{Ss=!1}return Ss};var x2={name:"localStorage",lookup(s){let{lookupLocalStorage:i}=s;if(i&&Xh())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(s,i){let{lookupLocalStorage:l}=i;l&&Xh()&&window.localStorage.setItem(l,s)}};let js=null;const Qh=()=>{if(js!==null)return js;try{if(js=typeof window<"u"&&window.sessionStorage!==null,!js)return!1;const s="i18next.translate.boo";window.sessionStorage.setItem(s,"foo"),window.sessionStorage.removeItem(s)}catch{js=!1}return js};var y2={name:"sessionStorage",lookup(s){let{lookupSessionStorage:i}=s;if(i&&Qh())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(s,i){let{lookupSessionStorage:l}=i;l&&Qh()&&window.sessionStorage.setItem(l,s)}},b2={name:"navigator",lookup(s){const i=[];if(typeof navigator<"u"){const{languages:l,userLanguage:c,language:d}=navigator;if(l)for(let f=0;f<l.length;f++)i.push(l[f]);c&&i.push(c),d&&i.push(d)}return i.length>0?i:void 0}},v2={name:"htmlTag",lookup(s){let{htmlTag:i}=s,l;const c=i||(typeof document<"u"?document.documentElement:null);return c&&typeof c.getAttribute=="function"&&(l=c.getAttribute("lang")),l}},w2={name:"path",lookup(s){var d;let{lookupFromPathIndex:i}=s;if(typeof window>"u")return;const l=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(d=l[typeof i=="number"?i:0])==null?void 0:d.replace("/",""):void 0}},S2={name:"subdomain",lookup(s){var d,f;let{lookupFromSubdomainIndex:i}=s;const l=typeof i=="number"?i+1:1,c=typeof window<"u"&&((f=(d=window.location)==null?void 0:d.hostname)==null?void 0:f.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(c)return c[l]}};let Zg=!1;try{document.cookie,Zg=!0}catch{}const Jg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Zg||Jg.splice(1,1);const j2=()=>({order:Jg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:s=>s});class Ig{constructor(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(i,l)}init(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=i,this.options=d2(l,this.options||{},j2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=d=>d.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=c,this.addDetector(h2),this.addDetector(g2),this.addDetector(x2),this.addDetector(y2),this.addDetector(b2),this.addDetector(v2),this.addDetector(w2),this.addDetector(S2),this.addDetector(p2)}addDetector(i){return this.detectors[i.name]=i,this}detect(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,l=[];return i.forEach(c=>{if(this.detectors[c]){let d=this.detectors[c].lookup(this.options);d&&typeof d=="string"&&(d=[d]),d&&(l=l.concat(d))}}),l=l.filter(c=>c!=null&&!f2(c)).map(c=>this.options.convertDetectedLanguage(c)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?l:l.length>0?l[0]:null}cacheUserLanguage(i){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;l&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(i)>-1||l.forEach(c=>{this.detectors[c]&&this.detectors[c].cacheUserLanguage(i,this.options)}))}}Ig.type="languageDetector";const N2={title:"MCP Hub Dashboard",error:"Error",closeButton:"Close",noServers:"No MCP servers available",loading:"Loading...",logout:"Logout",profile:"Profile",changePassword:"Change Password",toggleSidebar:"Toggle Sidebar",welcomeUser:"Welcome, {{username}}",name:"MCP Hub"},C2={title:"About",versionInfo:"MCP Hub Version: {{version}}",newVersion:"New version available!",currentVersion:"Current version",newVersionAvailable:"New version {{version}} is available",viewOnGitHub:"View on GitHub",checkForUpdates:"Check for Updates",checking:"Checking for updates..."},E2={viewProfile:"View profile",userCenter:"User Center"},T2={label:"Sponsor",title:"Support the Project",rewardAlt:"Reward QR Code",supportMessage:"Support the development of MCP Hub by buying me a coffee!",supportButton:"Support on Ko-fi"},k2={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},A2={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},R2={title:"Theme",light:"Light",dark:"Dark",system:"System"},O2={login:"Login",loginTitle:"Login to MCP Hub",username:"Username",password:"Password",loggingIn:"Logging in...",emptyFields:"Username and password cannot be empty",loginFailed:"Login failed, please check your username and password",loginError:"An error occurred during login",currentPassword:"Current Password",newPassword:"New Password",confirmPassword:"Confirm Password",passwordsNotMatch:"New password and confirmation do not match",changePasswordSuccess:"Password changed successfully",changePasswordError:"Failed to change password",changePassword:"Change Password",passwordChanged:"Password changed successfully",passwordChangeError:"Failed to change password"},M2={addServer:"Add Server",add:"Add",edit:"Edit",delete:"Delete",confirmDelete:"Are you sure you want to delete this server?",deleteWarning:"Deleting server '{{name}}' will remove it and all its data. This action cannot be undone.",status:"Status",tools:"Tools",name:"Server Name",url:"Server URL",apiKey:"API Key",save:"Save",cancel:"Cancel",invalidConfig:"Could not find configuration data for {{serverName}}",addError:"Failed to add server",editError:"Failed to edit server {{serverName}}",deleteError:"Failed to delete server {{serverName}}",updateError:"Failed to update server",editTitle:"Edit Server: {{serverName}}",type:"Server Type",command:"Command",arguments:"Arguments",envVars:"Environment Variables",headers:"HTTP Headers",key:"key",value:"value",enabled:"Enabled",enable:"Enable",disable:"Disable",requestOptions:"Configuration",timeout:"Request Timeout",timeoutDescription:"Timeout for requests to the MCP server (ms)",maxTotalTimeout:"Maximum Total Timeout",maxTotalTimeoutDescription:"Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",resetTimeoutOnProgress:"Reset Timeout on Progress",resetTimeoutOnProgressDescription:"Reset timeout on progress notifications",remove:"Remove",toggleError:"Failed to toggle server {{serverName}}",alreadyExists:"Server {{serverName}} already exists",invalidData:"Invalid server data provided",notFound:"Server {{serverName}} not found",namePlaceholder:"Enter server name",urlPlaceholder:"Enter server URL",commandPlaceholder:"Enter command",argumentsPlaceholder:"Enter arguments",errorDetails:"Error Details",viewErrorDetails:"View error details",confirmVariables:"Confirm Variable Configuration",variablesDetected:"Variables detected in configuration. Please confirm these variables are properly configured:",detectedVariables:"Detected Variables",confirmVariablesMessage:"Please ensure these variables are properly defined in your runtime environment. Continue adding server?",confirmAndAdd:"Confirm and Add",openapi:{inputMode:"Input Mode",inputModeUrl:"Specification URL",inputModeSchema:"JSON Schema",specUrl:"OpenAPI Specification URL",schema:"OpenAPI JSON Schema",schemaHelp:"Paste your complete OpenAPI JSON schema here",security:"Security Type",securityNone:"None",securityApiKey:"API Key",securityHttp:"HTTP Authentication",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API Key Configuration",apiKeyName:"Header/Parameter Name",apiKeyIn:"Location",apiKeyValue:"API Key Value",httpAuthConfig:"HTTP Authentication Configuration",httpScheme:"Authentication Scheme",httpCredentials:"Credentials",oauth2Config:"OAuth 2.0 Configuration",oauth2Token:"Access Token",openIdConnectConfig:"OpenID Connect Configuration",openIdConnectUrl:"Discovery URL",openIdConnectToken:"ID Token"}},z2={online:"Online",offline:"Offline",connecting:"Connecting"},D2={general:"Something went wrong",network:"Network connection error. Please check your internet connection",serverConnection:"Unable to connect to the server. Please check if the server is running",serverAdd:"Failed to add server. Please check the server status",serverUpdate:"Failed to edit server {{serverName}}. Please check the server status",serverFetch:"Failed to retrieve server data. Please try again later",initialStartup:"The server might be starting up. Please wait a moment as this process can take some time on first launch...",serverInstall:"Failed to install server",failedToFetchSettings:"Failed to fetch settings",failedToUpdateRouteConfig:"Failed to update route configuration",failedToUpdateSmartRoutingConfig:"Failed to update smart routing configuration"},U2={processing:"Processing...",save:"Save",cancel:"Cancel",refresh:"Refresh",create:"Create",creating:"Creating...",update:"Update",updating:"Updating...",submitting:"Submitting...",delete:"Delete",remove:"Remove",copy:"Copy",copyId:"Copy ID",copyUrl:"Copy URL",copyJson:"Copy JSON",copySuccess:"Copied to clipboard",copyFailed:"Copy failed",close:"Close",confirm:"Confirm",language:"Language"},L2={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",logs:"Logs"},_2={dashboard:{title:"Dashboard",totalServers:"Total",onlineServers:"Online",offlineServers:"Offline",connectingServers:"Connecting",recentServers:"Recent Servers"},servers:{title:"Servers Management"},groups:{title:"Group Management"},users:{title:"User Management"},settings:{title:"Settings",language:"Language",account:"Account Settings",password:"Change Password",appearance:"Appearance",routeConfig:"Security",installConfig:"Installation",smartRouting:"Smart Routing"},market:{title:"Server Market - (Data from mcpm.sh)"},logs:{title:"System Logs"}},H2={filters:"Filters",search:"Search logs...",autoScroll:"Auto-scroll",clearLogs:"Clear logs",loading:"Loading logs...",noLogs:"No logs available.",noMatch:"No logs match the current filters.",mainProcess:"Main Process",childProcess:"Child Process",main:"Main",child:"Child"},B2={add:"Add",addNew:"Add New Group",edit:"Edit Group",delete:"Delete",confirmDelete:"Are you sure you want to delete this group?",deleteWarning:"Deleting group '{{name}}' will remove it and all its server associations. This action cannot be undone.",name:"Group Name",namePlaceholder:"Enter group name",nameRequired:"Group name is required",description:"Description",descriptionPlaceholder:"Enter group description (optional)",createError:"Failed to create group",updateError:"Failed to update group",deleteError:"Failed to delete group",serverAddError:"Failed to add server to group",serverRemoveError:"Failed to remove server from group",addServer:"Add Server to Group",selectServer:"Select a server to add",servers:"Servers in Group",remove:"Remove",noGroups:"No groups available. Create a new group to get started.",noServers:"No servers in this group.",noServerOptions:"No servers available",serverCount:"{{count}} Servers",toolSelection:"Tool Selection",toolsSelected:"Selected",allTools:"All",selectedTools:"Selected tools",selectAll:"Select All",selectNone:"Select None",configureTools:"Configure Tools"},q2={title:"Server Market",official:"Official",by:"By",unknown:"Unknown",tools:"tools",search:"Search",searchPlaceholder:"Search for servers by name, category, or tags",clearFilters:"Clear",clearCategoryFilter:"",clearTagFilter:"",categories:"Categories",tags:"Tags",showTags:"Show tags",hideTags:"Hide tags",moreTags:"",noServers:"No servers found matching your search",backToList:"Back to list",install:"Install",installing:"Installing...",installed:"Installed",installServer:"Install Server: {{name}}",installSuccess:"Server {{serverName}} installed successfully",author:"Author",license:"License",repository:"Repository",examples:"Examples",arguments:"Arguments",argumentName:"Name",description:"Description",required:"Required",example:"Example",viewSchema:"View schema",fetchError:"Error fetching market servers",serverNotFound:"Server not found",searchError:"Error searching servers",filterError:"Error filtering servers by category",tagFilterError:"Error filtering servers by tag",noInstallationMethod:"No installation method available for this server",showing:"Showing {{from}}-{{to}} of {{total}} servers",perPage:"Per page",confirmVariablesMessage:"Please ensure these variables are properly defined in your runtime environment. Continue installing server?",confirmAndInstall:"Confirm and Install"},V2={run:"Run",running:"Running...",runTool:"Run Tool",cancel:"Cancel",noDescription:"No description available",inputSchema:"Input Schema:",runToolWithName:"Run Tool: {{name}}",execution:"Tool Execution",successful:"Successful",failed:"Failed",result:"Result:",error:"Error",errorDetails:"Error Details:",noContent:"Tool executed successfully but returned no content.",unknownError:"Unknown error occurred",jsonResponse:"JSON Response:",toolResult:"Tool result",noParameters:"This tool does not require any parameters.",selectOption:"Select an option",enterValue:"Enter {{type}} value",enabled:"Enabled",enableSuccess:"Tool {{name}} enabled successfully",disableSuccess:"Tool {{name}} disabled successfully",toggleFailed:"Failed to toggle tool status",parameters:"Tool Parameters",formMode:"Form Mode",jsonMode:"JSON Mode",jsonConfiguration:"JSON Configuration",invalidJsonFormat:"Invalid JSON format",fixJsonBeforeSwitching:"Please fix JSON format before switching to form mode",item:"Item {{index}}",addItem:"Add {{key}} item",enterKey:"Enter {{key}}"},G2={enableGlobalRoute:"Enable Global Route",enableGlobalRouteDescription:"Allow connections to /sse endpoint without specifying a group ID",enableGroupNameRoute:"Enable Group Name Route",enableGroupNameRouteDescription:"Allow connections to /sse endpoint using group names instead of just group IDs",enableBearerAuth:"Enable Bearer Authentication",enableBearerAuthDescription:"Require bearer token authentication for MCP requests",bearerAuthKey:"Bearer Authentication Key",bearerAuthKeyDescription:"The authentication key that will be required in the Bearer token",bearerAuthKeyPlaceholder:"Enter bearer authentication key",skipAuth:"Skip Authentication",skipAuthDescription:"Bypass login requirement for frontend and API access (DEFAULT OFF for security)",pythonIndexUrl:"Python Package Repository URL",pythonIndexUrlDescription:"Set UV_DEFAULT_INDEX environment variable for Python package installation",pythonIndexUrlPlaceholder:"e.g. https://pypi.org/simple",npmRegistry:"NPM Registry URL",npmRegistryDescription:"Set npm_config_registry environment variable for NPM package installation",npmRegistryPlaceholder:"e.g. https://registry.npmjs.org/",baseUrl:"Base URL",baseUrlDescription:"Base URL for MCP requests",baseUrlPlaceholder:"e.g. http://localhost:3000",installConfig:"Installation",systemConfigUpdated:"System configuration updated successfully",enableSmartRouting:"Enable Smart Routing",enableSmartRoutingDescription:"Enable smart routing feature to search the most suitable tool based on input (using $smart group name)",dbUrl:"PostgreSQL URL (requires pgvector support)",dbUrlPlaceholder:"e.g. postgresql://user:password@localhost:5432/dbname",openaiApiBaseUrl:"OpenAI API Base URL",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API Key",openaiApiKeyPlaceholder:"Enter OpenAI API key",openaiApiEmbeddingModel:"OpenAI Embedding Model",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"Smart routing configuration updated successfully",smartRoutingRequiredFields:"Database URL and OpenAI API Key are required to enable smart routing",smartRoutingValidationError:"Please fill in the required fields before enabling Smart Routing: {{fields}}"},K2={upload:"Upload",uploadTitle:"Upload DXT Extension",dropFileHere:"Drop your .dxt file here",orClickToSelect:"or click to select from your computer",invalidFileType:"Please select a valid .dxt file",noFileSelected:"Please select a .dxt file to upload",uploading:"Uploading...",uploadFailed:"Failed to upload DXT file",installServer:"Install MCP Server from DXT",extensionInfo:"Extension Information",name:"Name",version:"Version",description:"Description",author:"Author",tools:"Tools",serverName:"Server Name",serverNamePlaceholder:"Enter a name for this server",install:"Install",installing:"Installing...",installFailed:"Failed to install server from DXT",serverExistsTitle:"Server Already Exists",serverExistsConfirm:"Server '{{serverName}}' already exists. Do you want to override it with the new version?",override:"Override"},$2={add:"Add User",addNew:"Add New User",edit:"Edit User",delete:"Delete User",create:"Create User",update:"Update User",username:"Username",password:"Password",newPassword:"New Password",confirmPassword:"Confirm Password",adminRole:"Administrator",admin:"Admin",user:"User",permissions:"Permissions",adminPermissions:"Full system access",userPermissions:"Limited access",currentUser:"You",noUsers:"No users found",adminRequired:"Administrator access required to manage users",usernameRequired:"Username is required",passwordRequired:"Password is required",passwordTooShort:"Password must be at least 6 characters long",passwordMismatch:"Passwords do not match",usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",newPasswordPlaceholder:"Leave empty to keep current password",confirmPasswordPlaceholder:"Confirm new password",createError:"Failed to create user",updateError:"Failed to update user",deleteError:"Failed to delete user",statsError:"Failed to fetch user statistics",deleteConfirmation:"Are you sure you want to delete user '{{username}}'? This action cannot be undone.",confirmDelete:"Delete User",deleteWarning:"Are you sure you want to delete user '{{username}}'? This action cannot be undone."},Y2={errors:{readonly:"Readonly for demo environment",serverNameRequired:"Server name is required",serverConfigRequired:"Server configuration is required",serverConfigInvalid:"Server configuration must include either a URL, OpenAPI specification URL or schema, or command with arguments",serverTypeInvalid:"Server type must be one of: stdio, sse, streamable-http, openapi",urlRequiredForType:"URL is required for {{type}} server type",openapiSpecRequired:"OpenAPI specification URL or schema is required for openapi server type",headersInvalidFormat:"Headers must be an object",headersNotSupportedForStdio:"Headers are not supported for stdio server type",serverNotFound:"Server not found",failedToRemoveServer:"Server not found or failed to remove",internalServerError:"Internal server error",failedToGetServers:"Failed to get servers information",failedToGetServerSettings:"Failed to get server settings",failedToGetServerConfig:"Failed to get server configuration",failedToSaveSettings:"Failed to save settings",toolNameRequired:"Server name and tool name are required",descriptionMustBeString:"Description must be a string",groupIdRequired:"Group ID is required",groupNameRequired:"Group name is required",groupNotFound:"Group not found",groupIdAndServerNameRequired:"Group ID and server name are required",groupOrServerNotFound:"Group or server not found",toolsMustBeAllOrArray:'Tools must be "all" or an array of strings',serverNameAndToolNameRequired:"Server name and tool name are required",usernameRequired:"Username is required",userNotFound:"User not found",failedToGetUsers:"Failed to get users information",failedToGetUserInfo:"Failed to get user information",failedToGetUserStats:"Failed to get user statistics",marketServerNameRequired:"Server name is required",marketServerNotFound:"Market server not found",failedToGetMarketServers:"Failed to get market servers information",failedToGetMarketServer:"Failed to get market server information",failedToGetMarketCategories:"Failed to get market categories",failedToGetMarketTags:"Failed to get market tags",failedToSearchMarketServers:"Failed to search market servers",failedToFilterMarketServers:"Failed to filter market servers",failedToProcessDxtFile:"Failed to process DXT file"},success:{serverCreated:"Server created successfully",serverUpdated:"Server updated successfully",serverRemoved:"Server removed successfully",serverToggled:"Server status toggled successfully",toolToggled:"Tool {{name}} {{action}} successfully",toolDescriptionUpdated:"Tool {{name}} description updated successfully",systemConfigUpdated:"System configuration updated successfully",groupCreated:"Group created successfully",groupUpdated:"Group updated successfully",groupDeleted:"Group deleted successfully",serverAddedToGroup:"Server added to group successfully",serverRemovedFromGroup:"Server removed from group successfully",serverToolsUpdated:"Server tools updated successfully"}},P2={app:N2,about:C2,profile:E2,sponsor:T2,wechat:k2,discord:A2,theme:R2,auth:O2,server:M2,status:z2,errors:D2,common:U2,nav:L2,pages:_2,logs:H2,groups:B2,market:q2,tool:V2,settings:G2,dxt:K2,users:$2,api:Y2},F2={title:"MCP Hub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCP Hub"},X2={title:"关于",versionInfo:"MCP Hub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},Q2={viewProfile:"查看个人中心",userCenter:"个人中心"},Z2={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCP Hub 的开发!",supportButton:"在 Ko-fi 上支持"},J2={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},I2={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},W2={title:"主题",light:"浅色",dark:"深色",system:"系统"},ew={login:"登录",loginTitle:"登录 MCP Hub",username:"用户名",password:"密码",loggingIn:"登录中...",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败"},tw={addServer:"添加服务器",add:"添加",edit:"编辑",delete:"删除",confirmDelete:"您确定要删除此服务器吗?",deleteWarning:"删除服务器 '{{name}}' 将会移除该服务器及其所有数据。此操作无法撤销。",status:"状态",tools:"工具",name:"服务器名称",url:"服务器 URL",apiKey:"API 密钥",save:"保存",cancel:"取消",addError:"添加服务器失败",editError:"编辑服务器 {{serverName}} 失败",invalidConfig:"无法找到 {{serverName}} 的配置数据",deleteError:"删除服务器 {{serverName}} 失败",updateError:"更新服务器失败",editTitle:"编辑服务器: {{serverName}}",type:"服务器类型",command:"命令",arguments:"参数",envVars:"环境变量",headers:"HTTP 请求头",key:"键",value:"值",enabled:"已启用",enable:"启用",disable:"禁用",requestOptions:"配置",timeout:"请求超时",timeoutDescription:"请求超时时间(毫秒)",maxTotalTimeout:"最大总超时",maxTotalTimeoutDescription:"无论是否有进度通知的最大总超时时间(毫秒)",resetTimeoutOnProgress:"收到进度通知时重置超时",resetTimeoutOnProgressDescription:"适用于发送周期性进度更新的长时间运行操作",remove:"移除",toggleError:"切换服务器 {{serverName}} 状态失败",alreadyExists:"服务器 {{serverName}} 已经存在",invalidData:"提供的服务器数据无效",notFound:"找不到服务器 {{serverName}}",namePlaceholder:"请输入服务器名称",urlPlaceholder:"请输入服务器URL",commandPlaceholder:"请输入命令",argumentsPlaceholder:"请输入参数",errorDetails:"错误详情",viewErrorDetails:"查看错误详情",confirmVariables:"确认变量配置",variablesDetected:"检测到配置中包含变量,请确认这些变量是否已正确配置:",detectedVariables:"检测到的变量",confirmVariablesMessage:"请确保这些变量在运行环境中已正确定义。是否继续添加服务器?",confirmAndAdd:"确认并添加",openapi:{inputMode:"输入模式",inputModeUrl:"规范 URL",inputModeSchema:"JSON 模式",specUrl:"OpenAPI 规范 URL",schema:"OpenAPI JSON 模式",schemaHelp:"请在此处粘贴完整的 OpenAPI JSON 模式",security:"安全类型",securityNone:"无",securityApiKey:"API 密钥",securityHttp:"HTTP 认证",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API 密钥配置",apiKeyName:"请求头/参数名称",apiKeyIn:"位置",apiKeyValue:"API 密钥值",httpAuthConfig:"HTTP 认证配置",httpScheme:"认证方案",httpCredentials:"凭据",oauth2Config:"OAuth 2.0 配置",oauth2Token:"访问令牌",openIdConnectConfig:"OpenID Connect 配置",openIdConnectUrl:"发现 URL",openIdConnectToken:"ID 令牌"}},aw={online:"在线",offline:"离线",connecting:"连接中"},nw={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},sw={processing:"处理中...",save:"保存",cancel:"取消",refresh:"刷新",create:"创建",creating:"创建中...",update:"更新",updating:"更新中...",submitting:"提交中...",delete:"删除",remove:"移除",copy:"复制",copyId:"复制ID",copyUrl:"复制URL",copyJson:"复制JSON",copySuccess:"已复制到剪贴板",copyFailed:"复制失败",close:"关闭",confirm:"确认",language:"语言"},rw={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",logs:"日志"},lw={dashboard:{title:"仪表盘",totalServers:"总数",onlineServers:"在线",offlineServers:"离线",connectingServers:"连接中",recentServers:"最近的服务器"},servers:{title:"服务器管理"},settings:{title:"设置",language:"语言",account:"账户设置",password:"修改密码",appearance:"外观",routeConfig:"安全配置",installConfig:"安装",smartRouting:"智能路由"},groups:{title:"分组管理"},users:{title:"用户管理"},market:{title:"服务器市场 - (数据来源于 mcpm.sh)"},logs:{title:"系统日志"}},iw={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},ow={add:"添加",addNew:"添加新分组",edit:"编辑分组",delete:"删除",confirmDelete:"您确定要删除此分组吗?",deleteWarning:"删除分组 '{{name}}' 将会移除该分组及其所有服务器关联。此操作无法撤销。",name:"分组名称",namePlaceholder:"请输入分组名称",nameRequired:"分组名称不能为空",description:"描述",descriptionPlaceholder:"请输入分组描述(可选)",createError:"创建分组失败",updateError:"更新分组失败",deleteError:"删除分组失败",serverAddError:"向分组添加服务器失败",serverRemoveError:"从分组移除服务器失败",addServer:"添加服务器到分组",selectServer:"选择要添加的服务器",servers:"分组中的服务器",remove:"移除",noGroups:"暂无可用分组。创建一个新分组以开始使用。",noServers:"此分组中没有服务器。",noServerOptions:"没有可用的服务器",serverCount:"{{count}} 台服务器",toolSelection:"工具选择",toolsSelected:"选择",allTools:"全部",selectedTools:"选中的工具",selectAll:"全选",selectNone:"全不选",configureTools:"配置工具"},cw={title:"服务器市场",official:"官方",by:"作者",unknown:"未知",tools:"工具",search:"搜索",searchPlaceholder:"搜索服务器名称、分类或标签",clearFilters:"清除",clearCategoryFilter:"",clearTagFilter:"",categories:"分类",tags:"标签",showTags:"显示标签",hideTags:"隐藏标签",moreTags:"",noServers:"未找到匹配的服务器",backToList:"返回列表",install:"安装",installing:"安装中...",installed:"已安装",installServer:"安装服务器: {{name}}",installSuccess:"服务器 {{serverName}} 安装成功",author:"作者",license:"许可证",repository:"代码仓库",examples:"示例",arguments:"参数",argumentName:"名称",description:"描述",required:"必填",example:"示例",viewSchema:"查看结构",fetchError:"获取服务器市场数据失败",serverNotFound:"未找到服务器",searchError:"搜索服务器失败",filterError:"按分类筛选服务器失败",tagFilterError:"按标签筛选服务器失败",noInstallationMethod:"该服务器没有可用的安装方法",showing:"显示 {{from}}-{{to}}/{{total}} 个服务器",perPage:"每页显示",confirmVariablesMessage:"请确保这些变量在运行环境中已正确定义。是否继续安装服务器?",confirmAndInstall:"确认并安装"},uw={run:"运行",running:"运行中...",runTool:"运行",cancel:"取消",noDescription:"无描述信息",inputSchema:"输入模式:",runToolWithName:"运行工具:{{name}}",execution:"工具执行",successful:"成功",failed:"失败",result:"结果:",error:"错误",errorDetails:"错误详情:",noContent:"工具执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",toolResult:"工具结果",noParameters:"此工具不需要任何参数。",selectOption:"选择一个选项",enterValue:"输入{{type}}值",enabled:"已启用",enableSuccess:"工具 {{name}} 启用成功",disableSuccess:"工具 {{name}} 禁用成功",toggleFailed:"切换工具状态失败",parameters:"工具参数",formMode:"表单模式",jsonMode:"JSON 模式",jsonConfiguration:"JSON 配置",invalidJsonFormat:"无效的 JSON 格式",fixJsonBeforeSwitching:"请修复 JSON 格式后再切换到表单模式",item:"项目 {{index}}",addItem:"添加 {{key}} 项目",enterKey:"输入 {{key}}"},dw={enableGlobalRoute:"启用全局路由",enableGlobalRouteDescription:"允许不指定组 ID 就连接到 /sse 端点",enableGroupNameRoute:"启用组名路由",enableGroupNameRouteDescription:"允许使用组名而不仅仅是组 ID 连接到 /sse 端点",enableBearerAuth:"启用 Bearer 认证",enableBearerAuthDescription:"对 MCP 请求启用 Bearer 令牌认证",bearerAuthKey:"Bearer 认证密钥",bearerAuthKeyDescription:"Bearer 令牌中需要携带的认证密钥",bearerAuthKeyPlaceholder:"请输入 Bearer 认证密钥",skipAuth:"免登录开关",skipAuthDescription:"跳过前端和 API 访问的登录要求(默认关闭确保安全性)",pythonIndexUrl:"Python 包仓库地址",pythonIndexUrlDescription:"设置 UV_DEFAULT_INDEX 环境变量,用于 Python 包安装",pythonIndexUrlPlaceholder:"例如: https://mirrors.aliyun.com/pypi/simple",npmRegistry:"NPM 仓库地址",npmRegistryDescription:"设置 npm_config_registry 环境变量,用于 NPM 包安装",npmRegistryPlaceholder:"例如: https://registry.npmmirror.com/",baseUrl:"基础地址",baseUrlDescription:"用于 MCP 请求的基础地址",baseUrlPlaceholder:"例如: http://localhost:3000",installConfig:"安装配置",systemConfigUpdated:"系统配置更新成功",enableSmartRouting:"启用智能路由",enableSmartRoutingDescription:"开启智能路由功能,根据输入自动搜索最合适的工具(使用 $smart 分组)",dbUrl:"PostgreSQL 连接地址(必须支持 pgvector)",dbUrlPlaceholder:"例如: postgresql://user:password@localhost:5432/dbname",openaiApiBaseUrl:"OpenAI API 基础地址",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API 密钥",openaiApiKeyDescription:"用于访问 OpenAI API 的密钥",openaiApiKeyPlaceholder:"请输入 OpenAI API 密钥",openaiApiEmbeddingModel:"OpenAI 嵌入模型",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"智能路由配置更新成功",smartRoutingRequiredFields:"启用智能路由需要填写数据库连接地址和 OpenAI API 密钥",smartRoutingValidationError:"启用智能路由前请先填写必要字段:{{fields}}"},fw={upload:"上传",uploadTitle:"上传 DXT 扩展",dropFileHere:"将 .dxt 文件拖拽到此处",orClickToSelect:"或点击从计算机选择",invalidFileType:"请选择有效的 .dxt 文件",noFileSelected:"请选择要上传的 .dxt 文件",uploading:"上传中...",uploadFailed:"上传 DXT 文件失败",installServer:"从 DXT 安装 MCP 服务器",extensionInfo:"扩展信息",name:"名称",version:"版本",description:"描述",author:"作者",tools:"工具",serverName:"服务器名称",serverNamePlaceholder:"为此服务器输入名称",install:"安装",installing:"安装中...",installFailed:"从 DXT 安装服务器失败",serverExistsTitle:"服务器已存在",serverExistsConfirm:"服务器 '{{serverName}}' 已存在。是否要用新版本覆盖它?",override:"覆盖"},mw={add:"添加",addNew:"添加新用户",edit:"编辑用户",delete:"删除用户",create:"创建",update:"更新",username:"用户名",password:"密码",newPassword:"新密码",confirmPassword:"确认密码",adminRole:"管理员",admin:"管理员",user:"用户",permissions:"权限",adminPermissions:"完全系统访问权限",userPermissions:"受限访问权限",currentUser:"当前用户",noUsers:"没有找到用户",adminRequired:"需要管理员权限才能管理用户",usernameRequired:"用户名是必需的",passwordRequired:"密码是必需的",passwordTooShort:"密码至少需要6个字符",passwordMismatch:"密码不匹配",usernamePlaceholder:"输入用户名",passwordPlaceholder:"输入密码",newPasswordPlaceholder:"留空保持当前密码",confirmPasswordPlaceholder:"确认新密码",createError:"创建用户失败",updateError:"更新用户失败",deleteError:"删除用户失败",statsError:"获取用户统计失败",deleteConfirmation:"您确定要删除用户 '{{username}}' 吗?此操作无法撤消。",confirmDelete:"删除用户",deleteWarning:"您确定要删除用户 '{{username}}' 吗?此操作无法撤消。"},hw={errors:{readonly:"演示环境无法修改数据",serverNameRequired:"服务器名称是必需的",serverConfigRequired:"服务器配置是必需的",serverConfigInvalid:"服务器配置必须包含 URL、OpenAPI 规范 URL 或模式,或者带参数的命令",serverTypeInvalid:"服务器类型必须是以下之一:stdio、sse、streamable-http、openapi",urlRequiredForType:"{{type}} 服务器类型需要 URL",openapiSpecRequired:"openapi 服务器类型需要 OpenAPI 规范 URL 或模式",headersInvalidFormat:"请求头必须是对象格式",headersNotSupportedForStdio:"stdio 服务器类型不支持请求头",serverNotFound:"找不到服务器",failedToRemoveServer:"找不到服务器或删除失败",internalServerError:"服务器内部错误",failedToGetServers:"获取服务器信息失败",failedToGetServerSettings:"获取服务器设置失败",failedToGetServerConfig:"获取服务器配置失败",failedToSaveSettings:"保存设置失败",toolNameRequired:"服务器名称和工具名称是必需的",descriptionMustBeString:"描述必须是字符串",groupIdRequired:"分组 ID 是必需的",groupNameRequired:"分组名称是必需的",groupNotFound:"找不到分组",groupIdAndServerNameRequired:"分组 ID 和服务器名称是必需的",groupOrServerNotFound:"找不到分组或服务器",toolsMustBeAllOrArray:'工具必须是 "all" 或字符串数组',serverNameAndToolNameRequired:"服务器名称和工具名称是必需的",usernameRequired:"用户名是必需的",userNotFound:"找不到用户",failedToGetUsers:"获取用户信息失败",failedToGetUserInfo:"获取用户信息失败",failedToGetUserStats:"获取用户统计信息失败",marketServerNameRequired:"服务器名称是必需的",marketServerNotFound:"找不到市场服务器",failedToGetMarketServers:"获取市场服务器信息失败",failedToGetMarketServer:"获取市场服务器信息失败",failedToGetMarketCategories:"获取市场类别失败",failedToGetMarketTags:"获取市场标签失败",failedToSearchMarketServers:"搜索市场服务器失败",failedToFilterMarketServers:"过滤市场服务器失败",failedToProcessDxtFile:"处理 DXT 文件失败"},success:{serverCreated:"服务器创建成功",serverUpdated:"服务器更新成功",serverRemoved:"服务器删除成功",serverToggled:"服务器状态切换成功",toolToggled:"工具 {{name}} {{action}} 成功",toolDescriptionUpdated:"工具 {{name}} 描述更新成功",systemConfigUpdated:"系统配置更新成功",groupCreated:"分组创建成功",groupUpdated:"分组更新成功",groupDeleted:"分组删除成功",serverAddedToGroup:"服务器添加到分组成功",serverRemovedFromGroup:"服务器从分组移除成功",serverToolsUpdated:"服务器工具更新成功"}},gw={app:F2,about:X2,profile:Q2,sponsor:Z2,wechat:J2,discord:I2,theme:W2,auth:ew,server:tw,status:aw,errors:nw,common:sw,nav:rw,pages:lw,logs:iw,groups:ow,market:cw,tool:uw,settings:dw,dxt:fw,users:mw,api:hw};pt.use(Ig).use(Vv).init({resources:{en:{translation:P2},zh:{translation:gw}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const pw=()=>{Zy()};pw();async function xw(){try{console.log("Loading runtime configuration...");const s=await Fy();console.log("Runtime configuration loaded:",s),window.__MCPHUB_CONFIG__=s,ph.createRoot(document.getElementById("root")).render(r.jsx(Cs.StrictMode,{children:r.jsx(Mh,{})}))}catch(s){console.error("Failed to initialize app:",s),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},ph.createRoot(document.getElementById("root")).render(r.jsx(Cs.StrictMode,{children:r.jsx(Mh,{})}))}}xw();
202
+ //# sourceMappingURL=index-BgZVsrAO.js.map