@samanhappy/mcphub 0.9.12 → 0.9.13

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,217 @@
1
+ (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();function lp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vc={exports:{}},zn={};/**
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 hh;function Nx(){if(hh)return zn;hh=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(i,u,d){var m=null;if(d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),"key"in u){d={};for(var p in u)p!=="key"&&(d[p]=u[p])}else d=u;return u=d.ref,{$$typeof:n,type:i,key:m,ref:u!==void 0?u:null,props:d}}return zn.Fragment=l,zn.jsx=o,zn.jsxs=o,zn}var ph;function Sx(){return ph||(ph=1,Vc.exports=Nx()),Vc.exports}var r=Sx(),Gc={exports:{}},Re={};/**
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 gh;function Cx(){if(gh)return Re;gh=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=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"),N=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=N&&M[N]||M["@@iterator"],typeof M=="function"?M:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,T={};function R(M,Q,oe){this.props=M,this.context=Q,this.refs=T,this.updater=oe||k}R.prototype.isReactComponent={},R.prototype.setState=function(M,Q){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,Q,"setState")},R.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function A(){}A.prototype=R.prototype;function j(M,Q,oe){this.props=M,this.context=Q,this.refs=T,this.updater=oe||k}var O=j.prototype=new A;O.constructor=j,S(O,R.prototype),O.isPureReactComponent=!0;var F=Array.isArray,Z={H:null,A:null,T:null,S:null,V:null},re=Object.prototype.hasOwnProperty;function te(M,Q,oe,q,G,ue){return oe=ue.ref,{$$typeof:n,type:M,key:Q,ref:oe!==void 0?oe:null,props:ue}}function I(M,Q){return te(M.type,Q,void 0,void 0,void 0,M.props)}function le(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function se(M){var Q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(oe){return Q[oe]})}var U=/\/+/g;function z(M,Q){return typeof M=="object"&&M!==null&&M.key!=null?se(""+M.key):Q.toString(36)}function W(){}function H(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(W,W):(M.status="pending",M.then(function(Q){M.status==="pending"&&(M.status="fulfilled",M.value=Q)},function(Q){M.status==="pending"&&(M.status="rejected",M.reason=Q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function B(M,Q,oe,q,G){var ue=typeof M;(ue==="undefined"||ue==="boolean")&&(M=null);var J=!1;if(M===null)J=!0;else switch(ue){case"bigint":case"string":case"number":J=!0;break;case"object":switch(M.$$typeof){case n:case l:J=!0;break;case y:return J=M._init,B(J(M._payload),Q,oe,q,G)}}if(J)return G=G(M),J=q===""?"."+z(M,0):q,F(G)?(oe="",J!=null&&(oe=J.replace(U,"$&/")+"/"),B(G,Q,oe,"",function(be){return be})):G!=null&&(le(G)&&(G=I(G,oe+(G.key==null||M&&M.key===G.key?"":(""+G.key).replace(U,"$&/")+"/")+J)),Q.push(G)),1;J=0;var $=q===""?".":q+":";if(F(M))for(var ce=0;ce<M.length;ce++)q=M[ce],ue=$+z(q,ce),J+=B(q,Q,oe,ue,G);else if(ce=C(M),typeof ce=="function")for(M=ce.call(M),ce=0;!(q=M.next()).done;)q=q.value,ue=$+z(q,ce++),J+=B(q,Q,oe,ue,G);else if(ue==="object"){if(typeof M.then=="function")return B(H(M),Q,oe,q,G);throw Q=String(M),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return J}function w(M,Q,oe){if(M==null)return M;var q=[],G=0;return B(M,q,"","",function(ue){return Q.call(oe,ue,G++)}),q}function E(M){if(M._status===-1){var Q=M._result;Q=Q(),Q.then(function(oe){(M._status===0||M._status===-1)&&(M._status=1,M._result=oe)},function(oe){(M._status===0||M._status===-1)&&(M._status=2,M._result=oe)}),M._status===-1&&(M._status=0,M._result=Q)}if(M._status===1)return M._result.default;throw M._result}var _=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)};function fe(){}return Re.Children={map:w,forEach:function(M,Q,oe){w(M,function(){Q.apply(this,arguments)},oe)},count:function(M){var Q=0;return w(M,function(){Q++}),Q},toArray:function(M){return w(M,function(Q){return Q})||[]},only:function(M){if(!le(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Re.Component=R,Re.Fragment=o,Re.Profiler=u,Re.PureComponent=j,Re.StrictMode=i,Re.Suspense=g,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,Re.__COMPILER_RUNTIME={__proto__:null,c:function(M){return Z.H.useMemoCache(M)}},Re.cache=function(M){return function(){return M.apply(null,arguments)}},Re.cloneElement=function(M,Q,oe){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var q=S({},M.props),G=M.key,ue=void 0;if(Q!=null)for(J in Q.ref!==void 0&&(ue=void 0),Q.key!==void 0&&(G=""+Q.key),Q)!re.call(Q,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&Q.ref===void 0||(q[J]=Q[J]);var J=arguments.length-2;if(J===1)q.children=oe;else if(1<J){for(var $=Array(J),ce=0;ce<J;ce++)$[ce]=arguments[ce+2];q.children=$}return te(M.type,G,void 0,void 0,ue,q)},Re.createContext=function(M){return M={$$typeof:m,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:d,_context:M},M},Re.createElement=function(M,Q,oe){var q,G={},ue=null;if(Q!=null)for(q in Q.key!==void 0&&(ue=""+Q.key),Q)re.call(Q,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(G[q]=Q[q]);var J=arguments.length-2;if(J===1)G.children=oe;else if(1<J){for(var $=Array(J),ce=0;ce<J;ce++)$[ce]=arguments[ce+2];G.children=$}if(M&&M.defaultProps)for(q in J=M.defaultProps,J)G[q]===void 0&&(G[q]=J[q]);return te(M,ue,void 0,void 0,null,G)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(M){return{$$typeof:p,render:M}},Re.isValidElement=le,Re.lazy=function(M){return{$$typeof:y,_payload:{_status:-1,_result:M},_init:E}},Re.memo=function(M,Q){return{$$typeof:h,type:M,compare:Q===void 0?null:Q}},Re.startTransition=function(M){var Q=Z.T,oe={};Z.T=oe;try{var q=M(),G=Z.S;G!==null&&G(oe,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(fe,_)}catch(ue){_(ue)}finally{Z.T=Q}},Re.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},Re.use=function(M){return Z.H.use(M)},Re.useActionState=function(M,Q,oe){return Z.H.useActionState(M,Q,oe)},Re.useCallback=function(M,Q){return Z.H.useCallback(M,Q)},Re.useContext=function(M){return Z.H.useContext(M)},Re.useDebugValue=function(){},Re.useDeferredValue=function(M,Q){return Z.H.useDeferredValue(M,Q)},Re.useEffect=function(M,Q,oe){var q=Z.H;if(typeof oe=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return q.useEffect(M,Q)},Re.useId=function(){return Z.H.useId()},Re.useImperativeHandle=function(M,Q,oe){return Z.H.useImperativeHandle(M,Q,oe)},Re.useInsertionEffect=function(M,Q){return Z.H.useInsertionEffect(M,Q)},Re.useLayoutEffect=function(M,Q){return Z.H.useLayoutEffect(M,Q)},Re.useMemo=function(M,Q){return Z.H.useMemo(M,Q)},Re.useOptimistic=function(M,Q){return Z.H.useOptimistic(M,Q)},Re.useReducer=function(M,Q,oe){return Z.H.useReducer(M,Q,oe)},Re.useRef=function(M){return Z.H.useRef(M)},Re.useState=function(M){return Z.H.useState(M)},Re.useSyncExternalStore=function(M,Q,oe){return Z.H.useSyncExternalStore(M,Q,oe)},Re.useTransition=function(){return Z.H.useTransition()},Re.version="19.1.1",Re}var xh;function du(){return xh||(xh=1,Gc.exports=Cx()),Gc.exports}var b=du();const Os=lp(b);var Kc={exports:{}},Ln={},Fc={exports:{}},$c={};/**
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 yh;function Ex(){return yh||(yh=1,(function(n){function l(w,E){var _=w.length;w.push(E);e:for(;0<_;){var fe=_-1>>>1,M=w[fe];if(0<u(M,E))w[fe]=E,w[_]=M,_=fe;else break e}}function o(w){return w.length===0?null:w[0]}function i(w){if(w.length===0)return null;var E=w[0],_=w.pop();if(_!==E){w[0]=_;e:for(var fe=0,M=w.length,Q=M>>>1;fe<Q;){var oe=2*(fe+1)-1,q=w[oe],G=oe+1,ue=w[G];if(0>u(q,_))G<M&&0>u(ue,q)?(w[fe]=ue,w[G]=_,fe=G):(w[fe]=q,w[oe]=_,fe=oe);else if(G<M&&0>u(ue,_))w[fe]=ue,w[G]=_,fe=G;else break e}}return E}function u(w,E){var _=w.sortIndex-E.sortIndex;return _!==0?_:w.id-E.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var g=[],h=[],y=1,N=null,C=3,k=!1,S=!1,T=!1,R=!1,A=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function F(w){for(var E=o(h);E!==null;){if(E.callback===null)i(h);else if(E.startTime<=w)i(h),E.sortIndex=E.expirationTime,l(g,E);else break;E=o(h)}}function Z(w){if(T=!1,F(w),!S)if(o(g)!==null)S=!0,re||(re=!0,z());else{var E=o(h);E!==null&&B(Z,E.startTime-w)}}var re=!1,te=-1,I=5,le=-1;function se(){return R?!0:!(n.unstable_now()-le<I)}function U(){if(R=!1,re){var w=n.unstable_now();le=w;var E=!0;try{e:{S=!1,T&&(T=!1,j(te),te=-1),k=!0;var _=C;try{t:{for(F(w),N=o(g);N!==null&&!(N.expirationTime>w&&se());){var fe=N.callback;if(typeof fe=="function"){N.callback=null,C=N.priorityLevel;var M=fe(N.expirationTime<=w);if(w=n.unstable_now(),typeof M=="function"){N.callback=M,F(w),E=!0;break t}N===o(g)&&i(g),F(w)}else i(g);N=o(g)}if(N!==null)E=!0;else{var Q=o(h);Q!==null&&B(Z,Q.startTime-w),E=!1}}break e}finally{N=null,C=_,k=!1}E=void 0}}finally{E?z():re=!1}}}var z;if(typeof O=="function")z=function(){O(U)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,H=W.port2;W.port1.onmessage=U,z=function(){H.postMessage(null)}}else z=function(){A(U,0)};function B(w,E){te=A(function(){w(n.unstable_now())},E)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(w){w.callback=null},n.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<w?Math.floor(1e3/w):5},n.unstable_getCurrentPriorityLevel=function(){return C},n.unstable_next=function(w){switch(C){case 1:case 2:case 3:var E=3;break;default:E=C}var _=C;C=E;try{return w()}finally{C=_}},n.unstable_requestPaint=function(){R=!0},n.unstable_runWithPriority=function(w,E){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var _=C;C=w;try{return E()}finally{C=_}},n.unstable_scheduleCallback=function(w,E,_){var fe=n.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?fe+_:fe):_=fe,w){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=_+M,w={id:y++,callback:E,priorityLevel:w,startTime:_,expirationTime:M,sortIndex:-1},_>fe?(w.sortIndex=_,l(h,w),o(g)===null&&w===o(h)&&(T?(j(te),te=-1):T=!0,B(Z,_-fe))):(w.sortIndex=M,l(g,w),S||k||(S=!0,re||(re=!0,z()))),w},n.unstable_shouldYield=se,n.unstable_wrapCallback=function(w){var E=C;return function(){var _=C;C=E;try{return w.apply(this,arguments)}finally{C=_}}}})($c)),$c}var bh;function kx(){return bh||(bh=1,Fc.exports=Ex()),Fc.exports}var Ic={exports:{}},Ct={};/**
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 vh;function Tx(){if(vh)return Ct;vh=1;var n=du();function l(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(g,h,y){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:N==null?null:""+N,children:g,containerInfo:h,implementation:y}}var m=n.__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 Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ct.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(l(299));return d(g,h,null,y)},Ct.flushSync=function(g){var h=m.T,y=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=y,i.d.f()}},Ct.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(g,h))},Ct.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Ct.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,N=p(y,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,k=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:N,integrity:C,fetchPriority:k}):y==="script"&&i.d.X(g,{crossOrigin:N,integrity:C,fetchPriority:k,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ct.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);i.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},Ct.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,N=p(y,h.crossOrigin);i.d.L(g,y,{crossOrigin:N,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})}},Ct.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=p(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},Ct.requestFormReset=function(g){i.d.r(g)},Ct.unstable_batchedUpdates=function(g,h){return g(h)},Ct.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},Ct.useFormStatus=function(){return m.H.useHostTransitionStatus()},Ct.version="19.1.1",Ct}var wh;function Ax(){if(wh)return Ic.exports;wh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Ic.exports=Tx(),Ic.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 jh;function Rx(){if(jh)return Ln;jh=1;var n=kx(),l=du(),o=Ax();function i(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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(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(d(e)!==e)throw Error(i(188))}function g(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,s=t;;){var c=a.return;if(c===null)break;var f=c.alternate;if(f===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===a)return p(c),e;if(f===s)return p(c),t;f=f.sibling}throw Error(i(188))}if(a.return!==s.return)a=c,s=f;else{for(var x=!1,v=c.child;v;){if(v===a){x=!0,a=c,s=f;break}if(v===s){x=!0,s=c,a=f;break}v=v.sibling}if(!x){for(v=f.child;v;){if(v===a){x=!0,a=f,s=c;break}if(v===s){x=!0,s=f,a=c;break}v=v.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==s)throw Error(i(190))}if(a.tag!==3)throw Error(i(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,N=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),O=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function z(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var W=Symbol.for("react.client.reference");function H(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===W?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case R:return"Profiler";case T:return"StrictMode";case Z:return"Suspense";case re:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case O:return(e.displayName||"Context")+".Provider";case j: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 te:return t=e.displayName||null,t!==null?t:H(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return H(e(t))}catch{}}return null}var B=Array.isArray,w=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_={pending:!1,data:null,method:null,action:null},fe=[],M=-1;function Q(e){return{current:e}}function oe(e){0>M||(e.current=fe[M],fe[M]=null,M--)}function q(e,t){M++,fe[M]=e.current,e.current=t}var G=Q(null),ue=Q(null),J=Q(null),$=Q(null);function ce(e,t){switch(q(J,t),q(ue,e),q(G,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vm(t),e=Gm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}oe(G),q(G,e)}function be(){oe(G),oe(ue),oe(J)}function Ne(e){e.memoizedState!==null&&q($,e);var t=G.current,a=Gm(t,e.type);t!==a&&(q(ue,e),q(G,a))}function ye(e){ue.current===e&&(oe(G),oe(ue)),$.current===e&&(oe($),Rn._currentValue=_)}var Ae=Object.prototype.hasOwnProperty,ie=n.unstable_scheduleCallback,Te=n.unstable_cancelCallback,et=n.unstable_shouldYield,xt=n.unstable_requestPaint,De=n.unstable_now,jt=n.unstable_getCurrentPriorityLevel,da=n.unstable_ImmediatePriority,fa=n.unstable_UserBlockingPriority,It=n.unstable_NormalPriority,ma=n.unstable_LowPriority,xr=n.unstable_IdlePriority,Xe=n.log,yr=n.unstable_setDisableYieldValue,_t=null,it=null;function Mt(e){if(typeof Xe=="function"&&yr(e),it&&typeof it.setStrictMode=="function")try{it.setStrictMode(_t,e)}catch{}}var nt=Math.clz32?Math.clz32:Gr,Vr=Math.log,Fa=Math.LN2;function Gr(e){return e>>>=0,e===0?32:31-(Vr(e)/Fa|0)|0}var Pt=256,ja=4194304;function Nt(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 ke(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var v=s&134217727;return v!==0?(s=v&~f,s!==0?c=Nt(s):(x&=v,x!==0?c=Nt(x):a||(a=v&~e,a!==0&&(c=Nt(a))))):(v=s&~f,v!==0?c=Nt(v):x!==0?c=Nt(x):a||(a=s&~e,a!==0&&(c=Nt(a)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:c}function Pe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function me(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 de(){var e=Pt;return Pt<<=1,(Pt&4194048)===0&&(Pt=256),e}function he(){var e=ja;return ja<<=1,(ja&62914560)===0&&(ja=4194304),e}function Yt(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function br(e,t,a,s,c,f){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 v=e.entanglements,D=e.expirationTimes,K=e.hiddenUpdates;for(a=x&~a;0<a;){var ee=31-nt(a),ne=1<<ee;v[ee]=0,D[ee]=-1;var Y=K[ee];if(Y!==null)for(K[ee]=null,ee=0;ee<Y.length;ee++){var X=Y[ee];X!==null&&(X.lane&=-536870913)}a&=~ne}s!==0&&$a(e,s,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~t))}function $a(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-nt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&4194090}function Wn(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-nt(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function Tt(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 ha(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Hs(){var e=E.p;return e!==0?e:(e=window.event,e===void 0?32:ih(e.type))}function el(e,t){var a=E.p;try{return E.p=e,t()}finally{E.p=a}}var la=Math.random().toString(36).slice(2),ct="__reactFiber$"+la,yt="__reactProps$"+la,Na="__reactContainer$"+la,Ia="__reactEvents$"+la,mg="__reactListeners$"+la,hg="__reactHandles$"+la,Au="__reactResources$"+la,Bs="__reactMarker$"+la;function zo(e){delete e[ct],delete e[yt],delete e[Ia],delete e[mg],delete e[hg]}function Kr(e){var t=e[ct];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Na]||a[ct]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Im(e);e!==null;){if(a=e[ct])return a;e=Im(e)}return t}e=a,a=e.parentNode}return null}function Fr(e){if(e=e[ct]||e[Na]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function qs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function $r(e){var t=e[Au];return t||(t=e[Au]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[Bs]=!0}var Ru=new Set,Mu={};function vr(e,t){Ir(e,t),Ir(e+"Capture",t)}function Ir(e,t){for(Mu[e]=t,e=0;e<t.length;e++)Ru.add(t[e])}var pg=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]*$"),Ou={},Du={};function gg(e){return Ae.call(Du,e)?!0:Ae.call(Ou,e)?!1:pg.test(e)?Du[e]=!0:(Ou[e]=!0,!1)}function tl(e,t,a){if(gg(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function al(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 Sa(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}var Lo,Uu;function Yr(e){if(Lo===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Lo=t&&t[1]||"",Uu=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Lo+e+Uu}var _o=!1;function Po(e,t){if(!e||_o)return"";_o=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(X){var Y=X}Reflect.construct(e,[],ne)}else{try{ne.call()}catch(X){Y=X}e.call(ne.prototype)}}else{try{throw Error()}catch(X){Y=X}(ne=e())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(X){if(X&&Y&&typeof X.stack=="string")return[X.stack,Y.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),x=f[0],v=f[1];if(x&&v){var D=x.split(`
44
+ `),K=v.split(`
45
+ `);for(c=s=0;s<D.length&&!D[s].includes("DetermineComponentFrameRoot");)s++;for(;c<K.length&&!K[c].includes("DetermineComponentFrameRoot");)c++;if(s===D.length||c===K.length)for(s=D.length-1,c=K.length-1;1<=s&&0<=c&&D[s]!==K[c];)c--;for(;1<=s&&0<=c;s--,c--)if(D[s]!==K[c]){if(s!==1||c!==1)do if(s--,c--,0>c||D[s]!==K[c]){var ee=`
46
+ `+D[s].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=s&&0<=c);break}}}finally{_o=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Yr(a):""}function xg(e){switch(e.tag){case 26:case 27:case 5:return Yr(e.type);case 16:return Yr("Lazy");case 13:return Yr("Suspense");case 19:return Yr("SuspenseList");case 0:case 15:return Po(e.type,!1);case 11:return Po(e.type.render,!1);case 1:return Po(e.type,!0);case 31:return Yr("Activity");default:return""}}function zu(e){try{var t="";do t+=xg(e),e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}function Xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yg(e){var t=Lu(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){s=""+x,f.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rl(e){e._valueTracker||(e._valueTracker=yg(e))}function _u(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=Lu(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function sl(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 bg=/[\n"\\]/g;function Qt(e){return e.replace(bg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ho(e,t,a,s,c,f,x,v){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=""+Xt(t)):e.value!==""+Xt(t)&&(e.value=""+Xt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Bo(e,x,Xt(t)):a!=null?Bo(e,x,Xt(a)):s!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Xt(v):e.removeAttribute("name")}function Pu(e,t,a,s,c,f,x,v){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null))return;a=a!=null?""+Xt(a):"",t=t!=null?""+Xt(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=v?e.checked:!!s,e.defaultChecked=!!s,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x)}function Bo(e,t,a){t==="number"&&sl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Xr(e,t,a,s){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&s&&(e[a].defaultSelected=!0)}else{for(a=""+Xt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Hu(e,t,a){if(t!=null&&(t=""+Xt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Xt(a):""}function Bu(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(i(92));if(B(s)){if(1<s.length)throw Error(i(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=Xt(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s)}function Qr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var vg=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 qu(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||vg.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Vu(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&qu(e,c,s)}else for(var f in t)t.hasOwnProperty(f)&&qu(e,f,t[f])}function qo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["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"]]),jg=/^[\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 nl(e){return jg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Vo=null;function Go(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jr=null,Zr=null;function Gu(e){var t=Fr(e);if(t&&(e=t.stateNode)){var a=e[yt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ho(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="'+Qt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[yt]||null;if(!c)throw Error(i(90));Ho(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&_u(s)}break e;case"textarea":Hu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Xr(e,!!a.multiple,t,!1)}}}var Ko=!1;function Ku(e,t,a){if(Ko)return e(t,a);Ko=!0;try{var s=e(t);return s}finally{if(Ko=!1,(Jr!==null||Zr!==null)&&(Kl(),Jr&&(t=Jr,e=Zr,Zr=Jr=null,Gu(t),e)))for(t=0;t<e.length;t++)Gu(e[t])}}function Vs(e,t){var a=e.stateNode;if(a===null)return null;var s=a[yt]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fo=!1;if(Ca)try{var Gs={};Object.defineProperty(Gs,"passive",{get:function(){Fo=!0}}),window.addEventListener("test",Gs,Gs),window.removeEventListener("test",Gs,Gs)}catch{Fo=!1}var Ya=null,$o=null,ll=null;function Fu(){if(ll)return ll;var e,t=$o,a=t.length,s,c="value"in Ya?Ya.value:Ya.textContent,f=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(s=1;s<=x&&t[a-s]===c[f-s];s++);return ll=c.slice(e,1<s?1-s:void 0)}function ol(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function il(){return!0}function $u(){return!1}function Ot(e){function t(a,s,c,f,x){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(f):f[v]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?il:$u,this.isPropagationStopped=$u,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=il)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=il)},persist:function(){},isPersistent:il}),t}var wr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cl=Ot(wr),Ks=y({},wr,{view:0,detail:0}),Ng=Ot(Ks),Io,Yo,Fs,ul=y({},Ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qo,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!==Fs&&(Fs&&e.type==="mousemove"?(Io=e.screenX-Fs.screenX,Yo=e.screenY-Fs.screenY):Yo=Io=0,Fs=e),Io)},movementY:function(e){return"movementY"in e?e.movementY:Yo}}),Iu=Ot(ul),Sg=y({},ul,{dataTransfer:0}),Cg=Ot(Sg),Eg=y({},Ks,{relatedTarget:0}),Xo=Ot(Eg),kg=y({},wr,{animationName:0,elapsedTime:0,pseudoElement:0}),Tg=Ot(kg),Ag=y({},wr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Rg=Ot(Ag),Mg=y({},wr,{data:0}),Yu=Ot(Mg),Og={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dg={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"},Ug={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ug[e])?!!t[e]:!1}function Qo(){return zg}var Lg=y({},Ks,{key:function(e){if(e.key){var t=Og[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qo,charCode:function(e){return e.type==="keypress"?ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_g=Ot(Lg),Pg=y({},ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xu=Ot(Pg),Hg=y({},Ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qo}),Bg=Ot(Hg),qg=y({},wr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vg=Ot(qg),Gg=y({},ul,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Kg=Ot(Gg),Fg=y({},wr,{newState:0,oldState:0}),$g=Ot(Fg),Ig=[9,13,27,32],Jo=Ca&&"CompositionEvent"in window,$s=null;Ca&&"documentMode"in document&&($s=document.documentMode);var Yg=Ca&&"TextEvent"in window&&!$s,Qu=Ca&&(!Jo||$s&&8<$s&&11>=$s),Ju=" ",Zu=!1;function Wu(e,t){switch(e){case"keyup":return Ig.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ed(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function Xg(e,t){switch(e){case"compositionend":return ed(t);case"keypress":return t.which!==32?null:(Zu=!0,Ju);case"textInput":return e=t.data,e===Ju&&Zu?null:e;default:return null}}function Qg(e,t){if(Wr)return e==="compositionend"||!Jo&&Wu(e,t)?(e=Fu(),ll=$o=Ya=null,Wr=!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 Qu&&t.locale!=="ko"?null:t.data;default:return null}}var Jg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jg[e.type]:t==="textarea"}function ad(e,t,a,s){Jr?Zr?Zr.push(s):Zr=[s]:Jr=s,t=Ql(t,"onChange"),0<t.length&&(a=new cl("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Is=null,Ys=null;function Zg(e){_m(e,0)}function dl(e){var t=qs(e);if(_u(t))return e}function rd(e,t){if(e==="change")return t}var sd=!1;if(Ca){var Zo;if(Ca){var Wo="oninput"in document;if(!Wo){var nd=document.createElement("div");nd.setAttribute("oninput","return;"),Wo=typeof nd.oninput=="function"}Zo=Wo}else Zo=!1;sd=Zo&&(!document.documentMode||9<document.documentMode)}function ld(){Is&&(Is.detachEvent("onpropertychange",od),Ys=Is=null)}function od(e){if(e.propertyName==="value"&&dl(Ys)){var t=[];ad(t,Ys,e,Go(e)),Ku(Zg,t)}}function Wg(e,t,a){e==="focusin"?(ld(),Is=t,Ys=a,Is.attachEvent("onpropertychange",od)):e==="focusout"&&ld()}function e0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return dl(Ys)}function t0(e,t){if(e==="click")return dl(t)}function a0(e,t){if(e==="input"||e==="change")return dl(t)}function r0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bt=typeof Object.is=="function"?Object.is:r0;function Xs(e,t){if(Bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Ae.call(t,c)||!Bt(e[c],t[c]))return!1}return!0}function id(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cd(e,t){var a=id(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=id(a)}}function ud(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ud(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=sl(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=sl(e.document)}return t}function ei(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 s0=Ca&&"documentMode"in document&&11>=document.documentMode,es=null,ti=null,Qs=null,ai=!1;function fd(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ai||es==null||es!==sl(s)||(s=es,"selectionStart"in s&&ei(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Qs&&Xs(Qs,s)||(Qs=s,s=Ql(ti,"onSelect"),0<s.length&&(t=new cl("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=es)))}function jr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var ts={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},ri={},md={};Ca&&(md=document.createElement("div").style,"AnimationEvent"in window||(delete ts.animationend.animation,delete ts.animationiteration.animation,delete ts.animationstart.animation),"TransitionEvent"in window||delete ts.transitionend.transition);function Nr(e){if(ri[e])return ri[e];if(!ts[e])return e;var t=ts[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in md)return ri[e]=t[a];return e}var hd=Nr("animationend"),pd=Nr("animationiteration"),gd=Nr("animationstart"),n0=Nr("transitionrun"),l0=Nr("transitionstart"),o0=Nr("transitioncancel"),xd=Nr("transitionend"),yd=new Map,si="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(" ");si.push("scrollEnd");function oa(e,t){yd.set(e,t),vr(t,[e])}var bd=new WeakMap;function Jt(e,t){if(typeof e=="object"&&e!==null){var a=bd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:zu(t)},bd.set(e,t),t)}return{value:e,source:t,stack:zu(t)}}var Zt=[],as=0,ni=0;function fl(){for(var e=as,t=ni=as=0;t<e;){var a=Zt[t];Zt[t++]=null;var s=Zt[t];Zt[t++]=null;var c=Zt[t];Zt[t++]=null;var f=Zt[t];if(Zt[t++]=null,s!==null&&c!==null){var x=s.pending;x===null?c.next=c:(c.next=x.next,x.next=c),s.pending=c}f!==0&&vd(a,c,f)}}function ml(e,t,a,s){Zt[as++]=e,Zt[as++]=t,Zt[as++]=a,Zt[as++]=s,ni|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function li(e,t,a,s){return ml(e,t,a,s),hl(e)}function rs(e,t){return ml(e,null,null,t),hl(e)}function vd(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,f=e.return;f!==null;)f.childLanes|=a,s=f.alternate,s!==null&&(s.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-nt(a),e=f.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),f):null}function hl(e){if(50<jn)throw jn=0,fc=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ss={};function i0(e,t,a,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,a,s){return new i0(e,t,a,s)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ea(e,t){var a=e.alternate;return a===null?(a=qt(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 wd(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 pl(e,t,a,s,c,f){var x=0;if(s=e,typeof e=="function")oi(e)&&(x=1);else if(typeof e=="string")x=ux(e,a,G.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=qt(31,a,t,c),e.elementType=le,e.lanes=f,e;case S:return Sr(a.children,c,f,t);case T:x=8,c|=24;break;case R:return e=qt(12,a,t,c|2),e.elementType=R,e.lanes=f,e;case Z:return e=qt(13,a,t,c),e.elementType=Z,e.lanes=f,e;case re:return e=qt(19,a,t,c),e.elementType=re,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:case O:x=10;break e;case j:x=9;break e;case F:x=11;break e;case te:x=14;break e;case I:x=16,s=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),s=null}return t=qt(x,a,t,c),t.elementType=e,t.type=s,t.lanes=f,t}function Sr(e,t,a,s){return e=qt(7,e,s,t),e.lanes=a,e}function ii(e,t,a){return e=qt(6,e,null,t),e.lanes=a,e}function ci(e,t,a){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ns=[],ls=0,gl=null,xl=0,Wt=[],ea=0,Cr=null,ka=1,Ta="";function Er(e,t){ns[ls++]=xl,ns[ls++]=gl,gl=e,xl=t}function jd(e,t,a){Wt[ea++]=ka,Wt[ea++]=Ta,Wt[ea++]=Cr,Cr=e;var s=ka;e=Ta;var c=32-nt(s)-1;s&=~(1<<c),a+=1;var f=32-nt(t)+c;if(30<f){var x=c-c%5;f=(s&(1<<x)-1).toString(32),s>>=x,c-=x,ka=1<<32-nt(t)+c|a<<c|s,Ta=f+e}else ka=1<<f|a<<c|s,Ta=e}function ui(e){e.return!==null&&(Er(e,1),jd(e,1,0))}function di(e){for(;e===gl;)gl=ns[--ls],ns[ls]=null,xl=ns[--ls],ns[ls]=null;for(;e===Cr;)Cr=Wt[--ea],Wt[ea]=null,Ta=Wt[--ea],Wt[ea]=null,ka=Wt[--ea],Wt[ea]=null}var At=null,tt=null,Be=!1,kr=null,pa=!1,fi=Error(i(519));function Tr(e){var t=Error(i(418,""));throw Ws(Jt(t,e)),fi}function Nd(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[ct]=e,t[yt]=s,a){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(a=0;a<Sn.length;a++)Le(Sn[a],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),Pu(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),rl(t);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),Bu(t,s.value,s.defaultValue,s.children),rl(t)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||qm(t.textContent,a)?(s.popover!=null&&(Le("beforetoggle",t),Le("toggle",t)),s.onScroll!=null&&Le("scroll",t),s.onScrollEnd!=null&&Le("scrollend",t),s.onClick!=null&&(t.onclick=Jl),t=!0):t=!1,t||Tr(e)}function Sd(e){for(At=e.return;At;)switch(At.tag){case 5:case 13:pa=!1;return;case 27:case 3:pa=!0;return;default:At=At.return}}function Js(e){if(e!==At)return!1;if(!Be)return Sd(e),Be=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Tc(e.type,e.memoizedProps)),a=!a),a&&tt&&Tr(e),Sd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){tt=ca(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}tt=null}}else t===27?(t=tt,ur(e.type)?(e=Oc,Oc=null,tt=e):tt=t):tt=At?ca(e.stateNode.nextSibling):null;return!0}function Zs(){tt=At=null,Be=!1}function Cd(){var e=kr;return e!==null&&(zt===null?zt=e:zt.push.apply(zt,e),kr=null),e}function Ws(e){kr===null?kr=[e]:kr.push(e)}var mi=Q(null),Ar=null,Aa=null;function Xa(e,t,a){q(mi,t._currentValue),t._currentValue=a}function Ra(e){e._currentValue=mi.current,oe(mi)}function hi(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function pi(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var x=c.child;f=f.firstContext;e:for(;f!==null;){var v=f;f=c;for(var D=0;D<t.length;D++)if(v.context===t[D]){f.lanes|=a,v=f.alternate,v!==null&&(v.lanes|=a),hi(f.return,a,e),s||(x=null);break e}f=v.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,f=x.alternate,f!==null&&(f.lanes|=a),hi(x,a,e),x=null}else x=c.child;if(x!==null)x.return=c;else for(x=c;x!==null;){if(x===e){x=null;break}if(c=x.sibling,c!==null){c.return=x.return,x=c;break}x=x.return}c=x}}function en(e,t,a,s){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var x=c.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var v=c.type;Bt(c.pendingProps.value,x.value)||(e!==null?e.push(v):e=[v])}}else if(c===$.current){if(x=c.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Rn):e=[Rn])}c=c.return}e!==null&&pi(t,e,a,s),t.flags|=262144}function yl(e){for(e=e.firstContext;e!==null;){if(!Bt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Rr(e){Ar=e,Aa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return Ed(Ar,e)}function bl(e,t){return Ar===null&&Rr(e),Ed(e,t)}function Ed(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Aa===null){if(e===null)throw Error(i(308));Aa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Aa=Aa.next=t;return a}var c0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},u0=n.unstable_scheduleCallback,d0=n.unstable_NormalPriority,ut={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gi(){return{controller:new c0,data:new Map,refCount:0}}function tn(e){e.refCount--,e.refCount===0&&u0(d0,function(){e.controller.abort()})}var an=null,xi=0,os=0,is=null;function f0(e,t){if(an===null){var a=an=[];xi=0,os=bc(),is={status:"pending",value:void 0,then:function(s){a.push(s)}}}return xi++,t.then(kd,kd),t}function kd(){if(--xi===0&&an!==null){is!==null&&(is.status="fulfilled");var e=an;an=null,os=0,is=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function m0(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var Td=w.S;w.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&f0(e,t),Td!==null&&Td(e,t)};var Mr=Q(null);function yi(){var e=Mr.current;return e!==null?e:Ie.pooledCache}function vl(e,t){t===null?q(Mr,Mr.current):q(Mr,t.pool)}function Ad(){var e=yi();return e===null?null:{parent:ut._currentValue,pool:e}}var rn=Error(i(460)),Rd=Error(i(474)),wl=Error(i(542)),bi={then:function(){}};function Md(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jl(){}function Od(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(jl,jl),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ud(e),e;default:if(typeof t.status=="string")t.then(jl,jl);else{if(e=Ie,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ud(e),e}throw sn=t,rn}}var sn=null;function Dd(){if(sn===null)throw Error(i(459));var e=sn;return sn=null,e}function Ud(e){if(e===rn||e===wl)throw Error(i(483))}var Qa=!1;function vi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wi(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 Ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Za(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(qe&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=hl(e),vd(e,null,a),t}return ml(e,s,t,a),hl(e)}function nn(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Wn(e,a)}}function ji(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?c=f=x:f=f.next=x,a=a.next}while(a!==null);f===null?c=f=t:f=f.next=t}else c=f=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Ni=!1;function ln(){if(Ni){var e=is;if(e!==null)throw e}}function on(e,t,a,s){Ni=!1;var c=e.updateQueue;Qa=!1;var f=c.firstBaseUpdate,x=c.lastBaseUpdate,v=c.shared.pending;if(v!==null){c.shared.pending=null;var D=v,K=D.next;D.next=null,x===null?f=K:x.next=K,x=D;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,v=ee.lastBaseUpdate,v!==x&&(v===null?ee.firstBaseUpdate=K:v.next=K,ee.lastBaseUpdate=D))}if(f!==null){var ne=c.baseState;x=0,ee=K=D=null,v=f;do{var Y=v.lane&-536870913,X=Y!==v.lane;if(X?(_e&Y)===Y:(s&Y)===Y){Y!==0&&Y===os&&(Ni=!0),ee!==null&&(ee=ee.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var Ce=e,je=v;Y=t;var Fe=a;switch(je.tag){case 1:if(Ce=je.payload,typeof Ce=="function"){ne=Ce.call(Fe,ne,Y);break e}ne=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=je.payload,Y=typeof Ce=="function"?Ce.call(Fe,ne,Y):Ce,Y==null)break e;ne=y({},ne,Y);break e;case 2:Qa=!0}}Y=v.callback,Y!==null&&(e.flags|=64,X&&(e.flags|=8192),X=c.callbacks,X===null?c.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:v.tag,payload:v.payload,callback:v.callback,next:null},ee===null?(K=ee=X,D=ne):ee=ee.next=X,x|=Y;if(v=v.next,v===null){if(v=c.shared.pending,v===null)break;X=v,v=X.next,X.next=null,c.lastBaseUpdate=X,c.shared.pending=null}}while(!0);ee===null&&(D=ne),c.baseState=D,c.firstBaseUpdate=K,c.lastBaseUpdate=ee,f===null&&(c.shared.lanes=0),lr|=x,e.lanes=x,e.memoizedState=ne}}function zd(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Ld(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)zd(a[e],t)}var cs=Q(null),Nl=Q(0);function _d(e,t){e=_a,q(Nl,e),q(cs,t),_a=e|t.baseLanes}function Si(){q(Nl,_a),q(cs,cs.current)}function Ci(){_a=Nl.current,oe(cs),oe(Nl)}var Wa=0,Me=null,Ge=null,lt=null,Sl=!1,us=!1,Or=!1,Cl=0,cn=0,ds=null,h0=0;function rt(){throw Error(i(321))}function Ei(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Bt(e[a],t[a]))return!1;return!0}function ki(e,t,a,s,c,f){return Wa=f,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?wf:jf,Or=!1,f=a(s,c),Or=!1,us&&(f=Hd(t,a,s,c)),Pd(e),f}function Pd(e){w.H=Ml;var t=Ge!==null&&Ge.next!==null;if(Wa=0,lt=Ge=Me=null,Sl=!1,cn=0,ds=null,t)throw Error(i(300));e===null||ht||(e=e.dependencies,e!==null&&yl(e)&&(ht=!0))}function Hd(e,t,a,s){Me=e;var c=0;do{if(us&&(ds=null),cn=0,us=!1,25<=c)throw Error(i(301));if(c+=1,lt=Ge=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}w.H=w0,f=t(a,s)}while(us);return f}function p0(){var e=w.H,t=e.useState()[0];return t=typeof t.then=="function"?un(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(Me.flags|=1024),t}function Ti(){var e=Cl!==0;return Cl=0,e}function Ai(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Ri(e){if(Sl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Sl=!1}Wa=0,lt=Ge=Me=null,us=!1,cn=Cl=0,ds=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?Me.memoizedState=lt=e:lt=lt.next=e,lt}function ot(){if(Ge===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=lt===null?Me.memoizedState:lt.next;if(t!==null)lt=t,Ge=e;else{if(e===null)throw Me.alternate===null?Error(i(467)):Error(i(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},lt===null?Me.memoizedState=lt=e:lt=lt.next=e}return lt}function Mi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function un(e){var t=cn;return cn+=1,ds===null&&(ds=[]),e=Od(ds,e,t),t=Me,(lt===null?t.memoizedState:lt.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?wf:jf),e}function El(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return un(e);if(e.$$typeof===O)return St(e)}throw Error(i(438,String(e)))}function Oi(e){var t=null,a=Me.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=Me.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Mi(),Me.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=se;return t.index++,a}function Ma(e,t){return typeof t=="function"?t(e):t}function kl(e){var t=ot();return Di(t,Ge,e)}function Di(e,t,a){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=a;var c=e.baseQueue,f=s.pending;if(f!==null){if(c!==null){var x=c.next;c.next=f.next,f.next=x}t.baseQueue=c=f,s.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var v=x=null,D=null,K=t,ee=!1;do{var ne=K.lane&-536870913;if(ne!==K.lane?(_e&ne)===ne:(Wa&ne)===ne){var Y=K.revertLane;if(Y===0)D!==null&&(D=D.next={lane:0,revertLane:0,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ne===os&&(ee=!0);else if((Wa&Y)===Y){K=K.next,Y===os&&(ee=!0);continue}else ne={lane:0,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(v=D=ne,x=f):D=D.next=ne,Me.lanes|=Y,lr|=Y;ne=K.action,Or&&a(f,ne),f=K.hasEagerState?K.eagerState:a(f,ne)}else Y={lane:ne,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(v=D=Y,x=f):D=D.next=Y,Me.lanes|=ne,lr|=ne;K=K.next}while(K!==null&&K!==t);if(D===null?x=f:D.next=v,!Bt(f,e.memoizedState)&&(ht=!0,ee&&(a=is,a!==null)))throw a;e.memoizedState=f,e.baseState=x,e.baseQueue=D,s.lastRenderedState=f}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Ui(e){var t=ot(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,f=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do f=e(f,x.action),x=x.next;while(x!==c);Bt(f,t.memoizedState)||(ht=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,s]}function Bd(e,t,a){var s=Me,c=ot(),f=Be;if(f){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!Bt((Ge||c).memoizedState,a);x&&(c.memoizedState=a,ht=!0),c=c.queue;var v=Gd.bind(null,s,c,e);if(dn(2048,8,v,[e]),c.getSnapshot!==t||x||lt!==null&&lt.memoizedState.tag&1){if(s.flags|=2048,fs(9,Tl(),Vd.bind(null,s,c,a,t),null),Ie===null)throw Error(i(349));f||(Wa&124)!==0||qd(s,t,a)}return a}function qd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Me.updateQueue,t===null?(t=Mi(),Me.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Vd(e,t,a,s){t.value=a,t.getSnapshot=s,Kd(t)&&Fd(e)}function Gd(e,t,a){return a(function(){Kd(t)&&Fd(e)})}function Kd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Bt(e,a)}catch{return!0}}function Fd(e){var t=rs(e,2);t!==null&&$t(t,e,2)}function zi(e){var t=Dt();if(typeof e=="function"){var a=e;if(e=a(),Or){Mt(!0);try{a()}finally{Mt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:e},t}function $d(e,t,a,s){return e.baseState=a,Di(e,Ge,typeof s=="function"?s:Ma)}function g0(e,t,a,s,c){if(Rl(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};w.T!==null?a(!0):f.isTransition=!1,s(f),a=t.pending,a===null?(f.next=t.pending=f,Id(t,f)):(f.next=a.next,t.pending=a.next=f)}}function Id(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var f=w.T,x={};w.T=x;try{var v=a(c,s),D=w.S;D!==null&&D(x,v),Yd(e,t,v)}catch(K){Li(e,t,K)}finally{w.T=f}}else try{f=a(c,s),Yd(e,t,f)}catch(K){Li(e,t,K)}}function Yd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){Xd(e,t,s)},function(s){return Li(e,t,s)}):Xd(e,t,a)}function Xd(e,t,a){t.status="fulfilled",t.value=a,Qd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Id(e,a)))}function Li(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,Qd(t),t=t.next;while(t!==s)}e.action=null}function Qd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jd(e,t){return t}function Zd(e,t){if(Be){var a=Ie.formState;if(a!==null){e:{var s=Me;if(Be){if(tt){t:{for(var c=tt,f=pa;c.nodeType!==8;){if(!f){c=null;break t}if(c=ca(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){tt=ca(c.nextSibling),s=c.data==="F!";break e}}Tr(s)}s=!1}s&&(t=a[0])}}return a=Dt(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jd,lastRenderedState:t},a.queue=s,a=yf.bind(null,Me,s),s.dispatch=a,s=zi(!1),f=qi.bind(null,Me,!1,s.queue),s=Dt(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=g0.bind(null,Me,c,f,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function Wd(e){var t=ot();return ef(t,Ge,e)}function ef(e,t,a){if(t=Di(e,t,Jd)[0],e=kl(Ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=un(t)}catch(x){throw x===rn?wl:x}else s=t;t=ot();var c=t.queue,f=c.dispatch;return a!==t.memoizedState&&(Me.flags|=2048,fs(9,Tl(),x0.bind(null,c,a),null)),[s,f,e]}function x0(e,t){e.action=t}function tf(e){var t=ot(),a=Ge;if(a!==null)return ef(t,a,e);ot(),t=t.memoizedState,a=ot();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function fs(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=Me.updateQueue,t===null&&(t=Mi(),Me.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Tl(){return{destroy:void 0,resource:void 0}}function af(){return ot().memoizedState}function Al(e,t,a,s){var c=Dt();s=s===void 0?null:s,Me.flags|=e,c.memoizedState=fs(1|t,Tl(),a,s)}function dn(e,t,a,s){var c=ot();s=s===void 0?null:s;var f=c.memoizedState.inst;Ge!==null&&s!==null&&Ei(s,Ge.memoizedState.deps)?c.memoizedState=fs(t,f,a,s):(Me.flags|=e,c.memoizedState=fs(1|t,f,a,s))}function rf(e,t){Al(8390656,8,e,t)}function sf(e,t){dn(2048,8,e,t)}function nf(e,t){return dn(4,2,e,t)}function lf(e,t){return dn(4,4,e,t)}function of(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 cf(e,t,a){a=a!=null?a.concat([e]):null,dn(4,4,of.bind(null,t,e),a)}function _i(){}function uf(e,t){var a=ot();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&Ei(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function df(e,t){var a=ot();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&Ei(t,s[1]))return s[0];if(s=e(),Or){Mt(!0);try{e()}finally{Mt(!1)}}return a.memoizedState=[s,t],s}function Pi(e,t,a){return a===void 0||(Wa&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=hm(),Me.lanes|=e,lr|=e,a)}function ff(e,t,a,s){return Bt(a,t)?a:cs.current!==null?(e=Pi(e,a,s),Bt(e,t)||(ht=!0),e):(Wa&42)===0?(ht=!0,e.memoizedState=a):(e=hm(),Me.lanes|=e,lr|=e,t)}function mf(e,t,a,s,c){var f=E.p;E.p=f!==0&&8>f?f:8;var x=w.T,v={};w.T=v,qi(e,!1,t,a);try{var D=c(),K=w.S;if(K!==null&&K(v,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ee=m0(D,s);fn(e,t,ee,Ft(e))}else fn(e,t,s,Ft(e))}catch(ne){fn(e,t,{then:function(){},status:"rejected",reason:ne},Ft())}finally{E.p=f,w.T=x}}function y0(){}function Hi(e,t,a,s){if(e.tag!==5)throw Error(i(476));var c=hf(e).queue;mf(e,c,t,_,a===null?y0:function(){return pf(e),a(s)})}function hf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_,baseState:_,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:_},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pf(e){var t=hf(e).next.queue;fn(e,t,{},Ft())}function Bi(){return St(Rn)}function gf(){return ot().memoizedState}function xf(){return ot().memoizedState}function b0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ft();e=Ja(a);var s=Za(t,e,a);s!==null&&($t(s,t,a),nn(s,t,a)),t={cache:gi()},e.payload=t;return}t=t.return}}function v0(e,t,a){var s=Ft();a={lane:s,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Rl(e)?bf(t,a):(a=li(e,t,a,s),a!==null&&($t(a,e,s),vf(a,t,s)))}function yf(e,t,a){var s=Ft();fn(e,t,a,s)}function fn(e,t,a,s){var c={lane:s,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Rl(e))bf(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var x=t.lastRenderedState,v=f(x,a);if(c.hasEagerState=!0,c.eagerState=v,Bt(v,x))return ml(e,t,c,0),Ie===null&&fl(),!1}catch{}finally{}if(a=li(e,t,c,s),a!==null)return $t(a,e,s),vf(a,t,s),!0}return!1}function qi(e,t,a,s){if(s={lane:2,revertLane:bc(),action:s,hasEagerState:!1,eagerState:null,next:null},Rl(e)){if(t)throw Error(i(479))}else t=li(e,a,s,2),t!==null&&$t(t,e,2)}function Rl(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function bf(e,t){us=Sl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function vf(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Wn(e,a)}}var Ml={readContext:St,use:El,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt},wf={readContext:St,use:El,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:rf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Al(4194308,4,of.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Al(4194308,4,e,t)},useInsertionEffect:function(e,t){Al(4,2,e,t)},useMemo:function(e,t){var a=Dt();t=t===void 0?null:t;var s=e();if(Or){Mt(!0);try{e()}finally{Mt(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=Dt();if(a!==void 0){var c=a(t);if(Or){Mt(!0);try{a(t)}finally{Mt(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=v0.bind(null,Me,e),[s.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=zi(e);var t=e.queue,a=yf.bind(null,Me,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:_i,useDeferredValue:function(e,t){var a=Dt();return Pi(a,e,t)},useTransition:function(){var e=zi(!1);return e=mf.bind(null,Me,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=Me,c=Dt();if(Be){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),Ie===null)throw Error(i(349));(_e&124)!==0||qd(s,t,a)}c.memoizedState=a;var f={value:a,getSnapshot:t};return c.queue=f,rf(Gd.bind(null,s,f,e),[e]),s.flags|=2048,fs(9,Tl(),Vd.bind(null,s,f,a,t),null),a},useId:function(){var e=Dt(),t=Ie.identifierPrefix;if(Be){var a=Ta,s=ka;a=(s&~(1<<32-nt(s)-1)).toString(32)+a,t="«"+t+"R"+a,a=Cl++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=h0++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Bi,useFormState:Zd,useActionState:Zd,useOptimistic:function(e){var t=Dt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=qi.bind(null,Me,!0,a),a.dispatch=t,[e,t]},useMemoCache:Oi,useCacheRefresh:function(){return Dt().memoizedState=b0.bind(null,Me)}},jf={readContext:St,use:El,useCallback:uf,useContext:St,useEffect:sf,useImperativeHandle:cf,useInsertionEffect:nf,useLayoutEffect:lf,useMemo:df,useReducer:kl,useRef:af,useState:function(){return kl(Ma)},useDebugValue:_i,useDeferredValue:function(e,t){var a=ot();return ff(a,Ge.memoizedState,e,t)},useTransition:function(){var e=kl(Ma)[0],t=ot().memoizedState;return[typeof e=="boolean"?e:un(e),t]},useSyncExternalStore:Bd,useId:gf,useHostTransitionStatus:Bi,useFormState:Wd,useActionState:Wd,useOptimistic:function(e,t){var a=ot();return $d(a,Ge,e,t)},useMemoCache:Oi,useCacheRefresh:xf},w0={readContext:St,use:El,useCallback:uf,useContext:St,useEffect:sf,useImperativeHandle:cf,useInsertionEffect:nf,useLayoutEffect:lf,useMemo:df,useReducer:Ui,useRef:af,useState:function(){return Ui(Ma)},useDebugValue:_i,useDeferredValue:function(e,t){var a=ot();return Ge===null?Pi(a,e,t):ff(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Ui(Ma)[0],t=ot().memoizedState;return[typeof e=="boolean"?e:un(e),t]},useSyncExternalStore:Bd,useId:gf,useHostTransitionStatus:Bi,useFormState:tf,useActionState:tf,useOptimistic:function(e,t){var a=ot();return Ge!==null?$d(a,Ge,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Oi,useCacheRefresh:xf},ms=null,mn=0;function Ol(e){var t=mn;return mn+=1,ms===null&&(ms=[]),Od(ms,e,t)}function hn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Dl(e,t){throw t.$$typeof===N?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Nf(e){var t=e._init;return t(e._payload)}function Sf(e){function t(P,L){if(e){var V=P.deletions;V===null?(P.deletions=[L],P.flags|=16):V.push(L)}}function a(P,L){if(!e)return null;for(;L!==null;)t(P,L),L=L.sibling;return null}function s(P){for(var L=new Map;P!==null;)P.key!==null?L.set(P.key,P):L.set(P.index,P),P=P.sibling;return L}function c(P,L){return P=Ea(P,L),P.index=0,P.sibling=null,P}function f(P,L,V){return P.index=V,e?(V=P.alternate,V!==null?(V=V.index,V<L?(P.flags|=67108866,L):V):(P.flags|=67108866,L)):(P.flags|=1048576,L)}function x(P){return e&&P.alternate===null&&(P.flags|=67108866),P}function v(P,L,V,ae){return L===null||L.tag!==6?(L=ii(V,P.mode,ae),L.return=P,L):(L=c(L,V),L.return=P,L)}function D(P,L,V,ae){var pe=V.type;return pe===S?ee(P,L,V.props.children,ae,V.key):L!==null&&(L.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===I&&Nf(pe)===L.type)?(L=c(L,V.props),hn(L,V),L.return=P,L):(L=pl(V.type,V.key,V.props,null,P.mode,ae),hn(L,V),L.return=P,L)}function K(P,L,V,ae){return L===null||L.tag!==4||L.stateNode.containerInfo!==V.containerInfo||L.stateNode.implementation!==V.implementation?(L=ci(V,P.mode,ae),L.return=P,L):(L=c(L,V.children||[]),L.return=P,L)}function ee(P,L,V,ae,pe){return L===null||L.tag!==7?(L=Sr(V,P.mode,ae,pe),L.return=P,L):(L=c(L,V),L.return=P,L)}function ne(P,L,V){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=ii(""+L,P.mode,V),L.return=P,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case C:return V=pl(L.type,L.key,L.props,null,P.mode,V),hn(V,L),V.return=P,V;case k:return L=ci(L,P.mode,V),L.return=P,L;case I:var ae=L._init;return L=ae(L._payload),ne(P,L,V)}if(B(L)||z(L))return L=Sr(L,P.mode,V,null),L.return=P,L;if(typeof L.then=="function")return ne(P,Ol(L),V);if(L.$$typeof===O)return ne(P,bl(P,L),V);Dl(P,L)}return null}function Y(P,L,V,ae){var pe=L!==null?L.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return pe!==null?null:v(P,L,""+V,ae);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case C:return V.key===pe?D(P,L,V,ae):null;case k:return V.key===pe?K(P,L,V,ae):null;case I:return pe=V._init,V=pe(V._payload),Y(P,L,V,ae)}if(B(V)||z(V))return pe!==null?null:ee(P,L,V,ae,null);if(typeof V.then=="function")return Y(P,L,Ol(V),ae);if(V.$$typeof===O)return Y(P,L,bl(P,V),ae);Dl(P,V)}return null}function X(P,L,V,ae,pe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return P=P.get(V)||null,v(L,P,""+ae,pe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:return P=P.get(ae.key===null?V:ae.key)||null,D(L,P,ae,pe);case k:return P=P.get(ae.key===null?V:ae.key)||null,K(L,P,ae,pe);case I:var Ue=ae._init;return ae=Ue(ae._payload),X(P,L,V,ae,pe)}if(B(ae)||z(ae))return P=P.get(V)||null,ee(L,P,ae,pe,null);if(typeof ae.then=="function")return X(P,L,V,Ol(ae),pe);if(ae.$$typeof===O)return X(P,L,V,bl(L,ae),pe);Dl(L,ae)}return null}function Ce(P,L,V,ae){for(var pe=null,Ue=null,ve=L,Se=L=0,gt=null;ve!==null&&Se<V.length;Se++){ve.index>Se?(gt=ve,ve=null):gt=ve.sibling;var He=Y(P,ve,V[Se],ae);if(He===null){ve===null&&(ve=gt);break}e&&ve&&He.alternate===null&&t(P,ve),L=f(He,L,Se),Ue===null?pe=He:Ue.sibling=He,Ue=He,ve=gt}if(Se===V.length)return a(P,ve),Be&&Er(P,Se),pe;if(ve===null){for(;Se<V.length;Se++)ve=ne(P,V[Se],ae),ve!==null&&(L=f(ve,L,Se),Ue===null?pe=ve:Ue.sibling=ve,Ue=ve);return Be&&Er(P,Se),pe}for(ve=s(ve);Se<V.length;Se++)gt=X(ve,P,Se,V[Se],ae),gt!==null&&(e&&gt.alternate!==null&&ve.delete(gt.key===null?Se:gt.key),L=f(gt,L,Se),Ue===null?pe=gt:Ue.sibling=gt,Ue=gt);return e&&ve.forEach(function(pr){return t(P,pr)}),Be&&Er(P,Se),pe}function je(P,L,V,ae){if(V==null)throw Error(i(151));for(var pe=null,Ue=null,ve=L,Se=L=0,gt=null,He=V.next();ve!==null&&!He.done;Se++,He=V.next()){ve.index>Se?(gt=ve,ve=null):gt=ve.sibling;var pr=Y(P,ve,He.value,ae);if(pr===null){ve===null&&(ve=gt);break}e&&ve&&pr.alternate===null&&t(P,ve),L=f(pr,L,Se),Ue===null?pe=pr:Ue.sibling=pr,Ue=pr,ve=gt}if(He.done)return a(P,ve),Be&&Er(P,Se),pe;if(ve===null){for(;!He.done;Se++,He=V.next())He=ne(P,He.value,ae),He!==null&&(L=f(He,L,Se),Ue===null?pe=He:Ue.sibling=He,Ue=He);return Be&&Er(P,Se),pe}for(ve=s(ve);!He.done;Se++,He=V.next())He=X(ve,P,Se,He.value,ae),He!==null&&(e&&He.alternate!==null&&ve.delete(He.key===null?Se:He.key),L=f(He,L,Se),Ue===null?pe=He:Ue.sibling=He,Ue=He);return e&&ve.forEach(function(jx){return t(P,jx)}),Be&&Er(P,Se),pe}function Fe(P,L,V,ae){if(typeof V=="object"&&V!==null&&V.type===S&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case C:e:{for(var pe=V.key;L!==null;){if(L.key===pe){if(pe=V.type,pe===S){if(L.tag===7){a(P,L.sibling),ae=c(L,V.props.children),ae.return=P,P=ae;break e}}else if(L.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===I&&Nf(pe)===L.type){a(P,L.sibling),ae=c(L,V.props),hn(ae,V),ae.return=P,P=ae;break e}a(P,L);break}else t(P,L);L=L.sibling}V.type===S?(ae=Sr(V.props.children,P.mode,ae,V.key),ae.return=P,P=ae):(ae=pl(V.type,V.key,V.props,null,P.mode,ae),hn(ae,V),ae.return=P,P=ae)}return x(P);case k:e:{for(pe=V.key;L!==null;){if(L.key===pe)if(L.tag===4&&L.stateNode.containerInfo===V.containerInfo&&L.stateNode.implementation===V.implementation){a(P,L.sibling),ae=c(L,V.children||[]),ae.return=P,P=ae;break e}else{a(P,L);break}else t(P,L);L=L.sibling}ae=ci(V,P.mode,ae),ae.return=P,P=ae}return x(P);case I:return pe=V._init,V=pe(V._payload),Fe(P,L,V,ae)}if(B(V))return Ce(P,L,V,ae);if(z(V)){if(pe=z(V),typeof pe!="function")throw Error(i(150));return V=pe.call(V),je(P,L,V,ae)}if(typeof V.then=="function")return Fe(P,L,Ol(V),ae);if(V.$$typeof===O)return Fe(P,L,bl(P,V),ae);Dl(P,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,L!==null&&L.tag===6?(a(P,L.sibling),ae=c(L,V),ae.return=P,P=ae):(a(P,L),ae=ii(V,P.mode,ae),ae.return=P,P=ae),x(P)):a(P,L)}return function(P,L,V,ae){try{mn=0;var pe=Fe(P,L,V,ae);return ms=null,pe}catch(ve){if(ve===rn||ve===wl)throw ve;var Ue=qt(29,ve,null,P.mode);return Ue.lanes=ae,Ue.return=P,Ue}finally{}}}var hs=Sf(!0),Cf=Sf(!1),ta=Q(null),ga=null;function er(e){var t=e.alternate;q(dt,dt.current&1),q(ta,e),ga===null&&(t===null||cs.current!==null||t.memoizedState!==null)&&(ga=e)}function Ef(e){if(e.tag===22){if(q(dt,dt.current),q(ta,e),ga===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(ga=e)}}else tr()}function tr(){q(dt,dt.current),q(ta,ta.current)}function Oa(e){oe(ta),ga===e&&(ga=null),oe(dt)}var dt=Q(0);function Ul(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==="$?"||Mc(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 Vi(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Gi={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=Ft(),c=Ja(s);c.payload=t,a!=null&&(c.callback=a),t=Za(e,c,s),t!==null&&($t(t,e,s),nn(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=Ft(),c=Ja(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Za(e,c,s),t!==null&&($t(t,e,s),nn(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ft(),s=Ja(a);s.tag=2,t!=null&&(s.callback=t),t=Za(e,s,a),t!==null&&($t(t,e,a),nn(t,e,a))}};function kf(e,t,a,s,c,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,x):t.prototype&&t.prototype.isPureReactComponent?!Xs(a,s)||!Xs(c,f):!0}function Tf(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&Gi.enqueueReplaceState(t,t.state,null)}function Dr(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}var zl=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 Af(e){zl(e)}function Rf(e){console.error(e)}function Mf(e){zl(e)}function Ll(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Of(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Ki(e,t,a){return a=Ja(a),a.tag=3,a.payload={element:null},a.callback=function(){Ll(e,t)},a}function Df(e){return e=Ja(e),e.tag=3,e}function Uf(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var f=s.value;e.payload=function(){return c(f)},e.callback=function(){Of(t,a,s)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Of(t,a,s),typeof c!="function"&&(or===null?or=new Set([this]):or.add(this));var v=s.stack;this.componentDidCatch(s.value,{componentStack:v!==null?v:""})})}function j0(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&en(t,a,c,!0),a=ta.current,a!==null){switch(a.tag){case 13:return ga===null?hc():a.alternate===null&&at===0&&(at=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===bi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),gc(e,s,c)),!1;case 22:return a.flags|=65536,s===bi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),gc(e,s,c)),!1}throw Error(i(435,a.tag))}return gc(e,s,c),hc(),!1}if(Be)return t=ta.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==fi&&(e=Error(i(422),{cause:s}),Ws(Jt(e,a)))):(s!==fi&&(t=Error(i(423),{cause:s}),Ws(Jt(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Jt(s,a),c=Ki(e.stateNode,s,c),ji(e,c),at!==4&&(at=2)),!1;var f=Error(i(520),{cause:s});if(f=Jt(f,a),wn===null?wn=[f]:wn.push(f),at!==4&&(at=2),t===null)return!0;s=Jt(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Ki(a.stateNode,s,e),ji(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(or===null||!or.has(f))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Df(c),Uf(c,e,a,s),ji(a,c),!1}a=a.return}while(a!==null);return!1}var zf=Error(i(461)),ht=!1;function bt(e,t,a,s){t.child=e===null?Cf(t,null,a,s):hs(t,e.child,a,s)}function Lf(e,t,a,s,c){a=a.render;var f=t.ref;if("ref"in s){var x={};for(var v in s)v!=="ref"&&(x[v]=s[v])}else x=s;return Rr(t),s=ki(e,t,a,x,f,c),v=Ti(),e!==null&&!ht?(Ai(e,t,c),Da(e,t,c)):(Be&&v&&ui(t),t.flags|=1,bt(e,t,s,c),t.child)}function _f(e,t,a,s,c){if(e===null){var f=a.type;return typeof f=="function"&&!oi(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,Pf(e,t,f,s,c)):(e=pl(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Zi(e,c)){var x=f.memoizedProps;if(a=a.compare,a=a!==null?a:Xs,a(x,s)&&e.ref===t.ref)return Da(e,t,c)}return t.flags|=1,e=Ea(f,s),e.ref=t.ref,e.return=t,t.child=e}function Pf(e,t,a,s,c){if(e!==null){var f=e.memoizedProps;if(Xs(f,s)&&e.ref===t.ref)if(ht=!1,t.pendingProps=s=f,Zi(e,c))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,Da(e,t,c)}return Fi(e,t,a,s,c)}function Hf(e,t,a){var s=t.pendingProps,c=s.children,f=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if((t.flags&128)!==0){if(s=f!==null?f.baseLanes|a:a,e!==null){for(c=t.child=e.child,f=0;c!==null;)f=f|c.lanes|c.childLanes,c=c.sibling;t.childLanes=f&~s}else t.childLanes=0,t.child=null;return Bf(e,t,s,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vl(t,f!==null?f.cachePool:null),f!==null?_d(t,f):Si(),Ef(t);else return t.lanes=t.childLanes=536870912,Bf(e,t,f!==null?f.baseLanes|a:a,a)}else f!==null?(vl(t,f.cachePool),_d(t,f),tr(),t.memoizedState=null):(e!==null&&vl(t,null),Si(),tr());return bt(e,t,c,a),t.child}function Bf(e,t,a,s){var c=yi();return c=c===null?null:{parent:ut._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&vl(t,null),Si(),Ef(t),e!==null&&en(e,t,s,!0),null}function _l(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(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Fi(e,t,a,s,c){return Rr(t),a=ki(e,t,a,s,void 0,c),s=Ti(),e!==null&&!ht?(Ai(e,t,c),Da(e,t,c)):(Be&&s&&ui(t),t.flags|=1,bt(e,t,a,c),t.child)}function qf(e,t,a,s,c,f){return Rr(t),t.updateQueue=null,a=Hd(t,s,a,c),Pd(e),s=Ti(),e!==null&&!ht?(Ai(e,t,f),Da(e,t,f)):(Be&&s&&ui(t),t.flags|=1,bt(e,t,a,f),t.child)}function Vf(e,t,a,s,c){if(Rr(t),t.stateNode===null){var f=ss,x=a.contextType;typeof x=="object"&&x!==null&&(f=St(x)),f=new a(s,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Gi,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=s,f.state=t.memoizedState,f.refs={},vi(t),x=a.contextType,f.context=typeof x=="object"&&x!==null?St(x):ss,f.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Vi(t,a,x,s),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Gi.enqueueReplaceState(f,f.state,null),on(t,s,f,c),ln(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){f=t.stateNode;var v=t.memoizedProps,D=Dr(a,v);f.props=D;var K=f.context,ee=a.contextType;x=ss,typeof ee=="object"&&ee!==null&&(x=St(ee));var ne=a.getDerivedStateFromProps;ee=typeof ne=="function"||typeof f.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,ee||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v||K!==x)&&Tf(t,f,s,x),Qa=!1;var Y=t.memoizedState;f.state=Y,on(t,s,f,c),ln(),K=t.memoizedState,v||Y!==K||Qa?(typeof ne=="function"&&(Vi(t,a,ne,s),K=t.memoizedState),(D=Qa||kf(t,a,D,s,Y,K,x))?(ee||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=K),f.props=s,f.state=K,f.context=x,s=D):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,wi(e,t),x=t.memoizedProps,ee=Dr(a,x),f.props=ee,ne=t.pendingProps,Y=f.context,K=a.contextType,D=ss,typeof K=="object"&&K!==null&&(D=St(K)),v=a.getDerivedStateFromProps,(K=typeof v=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==ne||Y!==D)&&Tf(t,f,s,D),Qa=!1,Y=t.memoizedState,f.state=Y,on(t,s,f,c),ln();var X=t.memoizedState;x!==ne||Y!==X||Qa||e!==null&&e.dependencies!==null&&yl(e.dependencies)?(typeof v=="function"&&(Vi(t,a,v,s),X=t.memoizedState),(ee=Qa||kf(t,a,ee,s,Y,X,D)||e!==null&&e.dependencies!==null&&yl(e.dependencies))?(K||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,X,D),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,X,D)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=X),f.props=s,f.state=X,f.context=D,s=ee):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),s=!1)}return f=s,_l(e,t),s=(t.flags&128)!==0,f||s?(f=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&s?(t.child=hs(t,e.child,null,c),t.child=hs(t,null,a,c)):bt(e,t,a,c),t.memoizedState=f.state,e=t.child):e=Da(e,t,c),e}function Gf(e,t,a,s){return Zs(),t.flags|=256,bt(e,t,a,s),t.child}var $i={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ii(e){return{baseLanes:e,cachePool:Ad()}}function Yi(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=aa),e}function Kf(e,t,a){var s=t.pendingProps,c=!1,f=(t.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(dt.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(c?er(t):tr(),Be){var v=tt,D;if(D=v){e:{for(D=v,v=pa;D.nodeType!==8;){if(!v){v=null;break e}if(D=ca(D.nextSibling),D===null){v=null;break e}}v=D}v!==null?(t.memoizedState={dehydrated:v,treeContext:Cr!==null?{id:ka,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},D=qt(18,null,null,0),D.stateNode=v,D.return=t,t.child=D,At=t,tt=null,D=!0):D=!1}D||Tr(t)}if(v=t.memoizedState,v!==null&&(v=v.dehydrated,v!==null))return Mc(v)?t.lanes=32:t.lanes=536870912,null;Oa(t)}return v=s.children,s=s.fallback,c?(tr(),c=t.mode,v=Pl({mode:"hidden",children:v},c),s=Sr(s,c,a,null),v.return=t,s.return=t,v.sibling=s,t.child=v,c=t.child,c.memoizedState=Ii(a),c.childLanes=Yi(e,x,a),t.memoizedState=$i,s):(er(t),Xi(t,v))}if(D=e.memoizedState,D!==null&&(v=D.dehydrated,v!==null)){if(f)t.flags&256?(er(t),t.flags&=-257,t=Qi(e,t,a)):t.memoizedState!==null?(tr(),t.child=e.child,t.flags|=128,t=null):(tr(),c=s.fallback,v=t.mode,s=Pl({mode:"visible",children:s.children},v),c=Sr(c,v,a,null),c.flags|=2,s.return=t,c.return=t,s.sibling=c,t.child=s,hs(t,e.child,null,a),s=t.child,s.memoizedState=Ii(a),s.childLanes=Yi(e,x,a),t.memoizedState=$i,t=c);else if(er(t),Mc(v)){if(x=v.nextSibling&&v.nextSibling.dataset,x)var K=x.dgst;x=K,s=Error(i(419)),s.stack="",s.digest=x,Ws({value:s,source:null,stack:null}),t=Qi(e,t,a)}else if(ht||en(e,t,a,!1),x=(a&e.childLanes)!==0,ht||x){if(x=Ie,x!==null&&(s=a&-a,s=(s&42)!==0?1:Tt(s),s=(s&(x.suspendedLanes|a))!==0?0:s,s!==0&&s!==D.retryLane))throw D.retryLane=s,rs(e,s),$t(x,e,s),zf;v.data==="$?"||hc(),t=Qi(e,t,a)}else v.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,tt=ca(v.nextSibling),At=t,Be=!0,kr=null,pa=!1,e!==null&&(Wt[ea++]=ka,Wt[ea++]=Ta,Wt[ea++]=Cr,ka=e.id,Ta=e.overflow,Cr=t),t=Xi(t,s.children),t.flags|=4096);return t}return c?(tr(),c=s.fallback,v=t.mode,D=e.child,K=D.sibling,s=Ea(D,{mode:"hidden",children:s.children}),s.subtreeFlags=D.subtreeFlags&65011712,K!==null?c=Ea(K,c):(c=Sr(c,v,a,null),c.flags|=2),c.return=t,s.return=t,s.sibling=c,t.child=s,s=c,c=t.child,v=e.child.memoizedState,v===null?v=Ii(a):(D=v.cachePool,D!==null?(K=ut._currentValue,D=D.parent!==K?{parent:K,pool:K}:D):D=Ad(),v={baseLanes:v.baseLanes|a,cachePool:D}),c.memoizedState=v,c.childLanes=Yi(e,x,a),t.memoizedState=$i,s):(er(t),a=e.child,e=a.sibling,a=Ea(a,{mode:"visible",children:s.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 Xi(e,t){return t=Pl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Pl(e,t){return e=qt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Qi(e,t,a){return hs(t,e.child,null,a),e=Xi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ff(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),hi(e.return,t,a)}function Ji(e,t,a,s,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=s,f.tail=a,f.tailMode=c)}function $f(e,t,a){var s=t.pendingProps,c=s.revealOrder,f=s.tail;if(bt(e,t,s.children,a),s=dt.current,(s&2)!==0)s=s&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&&Ff(e,a,t);else if(e.tag===19)Ff(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}s&=1}switch(q(dt,s),c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Ul(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Ji(t,!1,c,a,f);break;case"backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Ul(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Ji(t,!0,a,null,f);break;case"together":Ji(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Da(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),lr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(en(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=Ea(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ea(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Zi(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&yl(e)))}function N0(e,t,a){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Xa(t,ut,e.memoizedState.cache),Zs();break;case 27:case 5:Ne(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Xa(t,t.type,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(er(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Kf(e,t,a):(er(t),e=Da(e,t,a),e!==null?e.sibling:null);er(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(en(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return $f(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),q(dt,dt.current),s)break;return null;case 22:case 23:return t.lanes=0,Hf(e,t,a);case 24:Xa(t,ut,e.memoizedState.cache)}return Da(e,t,a)}function If(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!Zi(e,a)&&(t.flags&128)===0)return ht=!1,N0(e,t,a);ht=(e.flags&131072)!==0}else ht=!1,Be&&(t.flags&1048576)!==0&&jd(t,xl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var s=t.elementType,c=s._init;if(s=c(s._payload),t.type=s,typeof s=="function")oi(s)?(e=Dr(s,e),t.tag=1,t=Vf(null,t,s,e,a)):(t.tag=0,t=Fi(null,t,s,e,a));else{if(s!=null){if(c=s.$$typeof,c===F){t.tag=11,t=Lf(null,t,s,e,a);break e}else if(c===te){t.tag=14,t=_f(null,t,s,e,a);break e}}throw t=H(s)||s,Error(i(306,t,""))}}return t;case 0:return Fi(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=Dr(s,t.pendingProps),Vf(e,t,s,c,a);case 3:e:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));s=t.pendingProps;var f=t.memoizedState;c=f.element,wi(e,t),on(t,s,null,a);var x=t.memoizedState;if(s=x.cache,Xa(t,ut,s),s!==f.cache&&pi(t,[ut],a,!0),ln(),s=x.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Gf(e,t,s,a);break e}else if(s!==c){c=Jt(Error(i(424)),t),Ws(c),t=Gf(e,t,s,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(tt=ca(e.firstChild),At=t,Be=!0,kr=null,pa=!0,a=Cf(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Zs(),s===c){t=Da(e,t,a);break e}bt(e,t,s,a)}t=t.child}return t;case 26:return _l(e,t),e===null?(a=Jm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Be||(a=t.type,e=t.pendingProps,s=Zl(J.current).createElement(a),s[ct]=t,s[yt]=e,wt(s,a,e),mt(s),t.stateNode=s):t.memoizedState=Jm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&Be&&(s=t.stateNode=Ym(t.type,t.pendingProps,J.current),At=t,pa=!0,c=tt,ur(t.type)?(Oc=c,tt=ca(s.firstChild)):tt=c),bt(e,t,t.pendingProps.children,a),_l(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((c=s=tt)&&(s=J0(s,t.type,t.pendingProps,pa),s!==null?(t.stateNode=s,At=t,tt=ca(s.firstChild),pa=!1,c=!0):c=!1),c||Tr(t)),Ne(t),c=t.type,f=t.pendingProps,x=e!==null?e.memoizedProps:null,s=f.children,Tc(c,f)?s=null:x!==null&&Tc(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=ki(e,t,p0,null,null,a),Rn._currentValue=c),_l(e,t),bt(e,t,s,a),t.child;case 6:return e===null&&Be&&((e=a=tt)&&(a=Z0(a,t.pendingProps,pa),a!==null?(t.stateNode=a,At=t,tt=null,e=!0):e=!1),e||Tr(t)),null;case 13:return Kf(e,t,a);case 4:return ce(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=hs(t,null,s,a):bt(e,t,s,a),t.child;case 11:return Lf(e,t,t.type,t.pendingProps,a);case 7:return bt(e,t,t.pendingProps,a),t.child;case 8:return bt(e,t,t.pendingProps.children,a),t.child;case 12:return bt(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,Xa(t,t.type,s.value),bt(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,Rr(t),c=St(c),s=s(c),t.flags|=1,bt(e,t,s,a),t.child;case 14:return _f(e,t,t.type,t.pendingProps,a);case 15:return Pf(e,t,t.type,t.pendingProps,a);case 19:return $f(e,t,a);case 31:return s=t.pendingProps,a=t.mode,s={mode:s.mode,children:s.children},e===null?(a=Pl(s,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=Ea(e.child,s),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Hf(e,t,a);case 24:return Rr(t),s=St(ut),e===null?(c=yi(),c===null&&(c=Ie,f=gi(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=a),c=f),t.memoizedState={parent:s,cache:c},vi(t),Xa(t,ut,c)):((e.lanes&a)!==0&&(wi(e,t),on(t,null,null,a),ln()),c=e.memoizedState,f=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Xa(t,ut,s)):(s=f.cache,Xa(t,ut,s),s!==c.cache&&pi(t,[ut],a,!0))),bt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ua(e){e.flags|=4}function Yf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t)){if(t=ta.current,t!==null&&((_e&4194048)===_e?ga!==null:(_e&62914560)!==_e&&(_e&536870912)===0||t!==ga))throw sn=bi,Rd;e.flags|=8192}}function Hl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?he():536870912,e.lanes|=t,ys|=t)}function pn(e,t){if(!Be)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 s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function S0(e,t,a){var s=t.pendingProps;switch(di(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ra(ut),be(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Js(t)?Ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Cd())),Ze(t),null;case 26:return a=t.memoizedState,e===null?(Ua(t),a!==null?(Ze(t),Yf(t,a)):(Ze(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Ua(t),Ze(t),Yf(t,a)):(Ze(t),t.flags&=-16777217):(e.memoizedProps!==s&&Ua(t),Ze(t),t.flags&=-16777217),null;case 27:ye(t),a=J.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ua(t);else{if(!s){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}e=G.current,Js(t)?Nd(t):(e=Ym(c,s,a),t.stateNode=e,Ua(t))}return Ze(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ua(t);else{if(!s){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}if(e=G.current,Js(t))Nd(t);else{switch(c=Zl(J.current),e){case 1:e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?c.createElement("select",{is:s.is}):c.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?c.createElement(a,{is:s.is}):c.createElement(a)}}e[ct]=t,e[yt]=s;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)e.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=e;e:switch(wt(e,a,s),a){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Ua(t)}}return Ze(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ua(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(i(166));if(e=J.current,Js(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=At,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[ct]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||qm(e.nodeValue,a)),e||Tr(t)}else e=Zl(e).createTextNode(s),e[ct]=t,t.stateNode=e}return Ze(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Js(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[ct]=t}else Zs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),c=!1}else c=Cd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Oa(t),t):(Oa(t),null)}if(Oa(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=s!==null,e=e!==null&&e.memoizedState!==null,a){s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool);var f=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==c&&(s.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),Hl(t,t.updateQueue),Ze(t),null;case 4:return be(),e===null&&Nc(t.stateNode.containerInfo),Ze(t),null;case 10:return Ra(t.type),Ze(t),null;case 19:if(oe(dt),c=t.memoizedState,c===null)return Ze(t),null;if(s=(t.flags&128)!==0,f=c.rendering,f===null)if(s)pn(c,!1);else{if(at!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Ul(e),f!==null){for(t.flags|=128,pn(c,!1),e=f.updateQueue,t.updateQueue=e,Hl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)wd(a,e),a=a.sibling;return q(dt,dt.current&1|2),t.child}e=e.sibling}c.tail!==null&&De()>Vl&&(t.flags|=128,s=!0,pn(c,!1),t.lanes=4194304)}else{if(!s)if(e=Ul(f),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Hl(t,e),pn(c,!0),c.tail===null&&c.tailMode==="hidden"&&!f.alternate&&!Be)return Ze(t),null}else 2*De()-c.renderingStartTime>Vl&&a!==536870912&&(t.flags|=128,s=!0,pn(c,!1),t.lanes=4194304);c.isBackwards?(f.sibling=t.child,t.child=f):(e=c.last,e!==null?e.sibling=f:t.child=f,c.last=f)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=De(),t.sibling=null,e=dt.current,q(dt,s?e&1|2:e&1),t):(Ze(t),null);case 22:case 23:return Oa(t),Ci(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),a=t.updateQueue,a!==null&&Hl(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&oe(Mr),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ra(ut),Ze(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function C0(e,t){switch(di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ra(ut),be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 13:if(Oa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Zs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(dt),null;case 4:return be(),null;case 10:return Ra(t.type),null;case 22:case 23:return Oa(t),Ci(),e!==null&&oe(Mr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ra(ut),null;case 25:return null;default:return null}}function Xf(e,t){switch(di(t),t.tag){case 3:Ra(ut),be();break;case 26:case 27:case 5:ye(t);break;case 4:be();break;case 13:Oa(t);break;case 19:oe(dt);break;case 10:Ra(t.type);break;case 22:case 23:Oa(t),Ci(),e!==null&&oe(Mr);break;case 24:Ra(ut)}}function gn(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var f=a.create,x=a.inst;s=f(),x.destroy=s}a=a.next}while(a!==c)}}catch(v){$e(t,t.return,v)}}function ar(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var f=c.next;s=f;do{if((s.tag&e)===e){var x=s.inst,v=x.destroy;if(v!==void 0){x.destroy=void 0,c=t;var D=a,K=v;try{K()}catch(ee){$e(c,D,ee)}}}s=s.next}while(s!==f)}}catch(ee){$e(t,t.return,ee)}}function Qf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Ld(t,a)}catch(s){$e(e,e.return,s)}}}function Jf(e,t,a){a.props=Dr(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){$e(e,t,s)}}function xn(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){$e(e,t,c)}}function xa(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){$e(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){$e(e,t,c)}else a.current=null}function Zf(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){$e(e,e.return,c)}}function Wi(e,t,a){try{var s=e.stateNode;$0(s,e.type,a,t),s[yt]=t}catch(c){$e(e,e.return,c)}}function Wf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ur(e.type)||e.tag===4}function ec(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wf(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&&ur(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 tc(e,t,a){var s=e.tag;if(s===5||s===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=Jl));else if(s!==4&&(s===27&&ur(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(tc(e,t,a),e=e.sibling;e!==null;)tc(e,t,a),e=e.sibling}function Bl(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&ur(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Bl(e,t,a),e=e.sibling;e!==null;)Bl(e,t,a),e=e.sibling}function em(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);wt(t,s,a),t[ct]=e,t[yt]=a}catch(f){$e(e,e.return,f)}}var za=!1,st=!1,ac=!1,tm=typeof WeakSet=="function"?WeakSet:Set,pt=null;function E0(e,t){if(e=e.containerInfo,Ec=so,e=dd(e),ei(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var x=0,v=-1,D=-1,K=0,ee=0,ne=e,Y=null;t:for(;;){for(var X;ne!==a||c!==0&&ne.nodeType!==3||(v=x+c),ne!==f||s!==0&&ne.nodeType!==3||(D=x+s),ne.nodeType===3&&(x+=ne.nodeValue.length),(X=ne.firstChild)!==null;)Y=ne,ne=X;for(;;){if(ne===e)break t;if(Y===a&&++K===c&&(v=x),Y===f&&++ee===s&&(D=x),(X=ne.nextSibling)!==null)break;ne=Y,Y=ne.parentNode}ne=X}a=v===-1||D===-1?null:{start:v,end:D}}else a=null}a=a||{start:0,end:0}}else a=null;for(kc={focusedElem:e,selectionRange:a},so=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,f=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,a=t,c=f.memoizedProps,f=f.memoizedState,s=a.stateNode;try{var Ce=Dr(a.type,c,a.elementType===a.type);e=s.getSnapshotBeforeUpdate(Ce,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(je){$e(a,a.return,je)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Rc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Rc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}}function am(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:rr(e,a),s&4&&gn(5,a);break;case 1:if(rr(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){$e(a,a.return,x)}else{var c=Dr(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){$e(a,a.return,x)}}s&64&&Qf(a),s&512&&xn(a,a.return);break;case 3:if(rr(e,a),s&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{Ld(e,t)}catch(x){$e(a,a.return,x)}}break;case 27:t===null&&s&4&&em(a);case 26:case 5:rr(e,a),t===null&&s&4&&Zf(a),s&512&&xn(a,a.return);break;case 12:rr(e,a);break;case 13:rr(e,a),s&4&&nm(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=z0.bind(null,a),W0(e,a))));break;case 22:if(s=a.memoizedState!==null||za,!s){t=t!==null&&t.memoizedState!==null||st,c=za;var f=st;za=s,(st=t)&&!f?sr(e,a,(a.subtreeFlags&8772)!==0):rr(e,a),za=c,st=f}break;case 30:break;default:rr(e,a)}}function rm(e){var t=e.alternate;t!==null&&(e.alternate=null,rm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qe=null,Ut=!1;function La(e,t,a){for(a=a.child;a!==null;)sm(e,t,a),a=a.sibling}function sm(e,t,a){if(it&&typeof it.onCommitFiberUnmount=="function")try{it.onCommitFiberUnmount(_t,a)}catch{}switch(a.tag){case 26:st||xa(a,t),La(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:st||xa(a,t);var s=Qe,c=Ut;ur(a.type)&&(Qe=a.stateNode,Ut=!1),La(e,t,a),En(a.stateNode),Qe=s,Ut=c;break;case 5:st||xa(a,t);case 6:if(s=Qe,c=Ut,Qe=null,La(e,t,a),Qe=s,Ut=c,Qe!==null)if(Ut)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(a.stateNode)}catch(f){$e(a,t,f)}else try{Qe.removeChild(a.stateNode)}catch(f){$e(a,t,f)}break;case 18:Qe!==null&&(Ut?(e=Qe,$m(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Un(e)):$m(Qe,a.stateNode));break;case 4:s=Qe,c=Ut,Qe=a.stateNode.containerInfo,Ut=!0,La(e,t,a),Qe=s,Ut=c;break;case 0:case 11:case 14:case 15:st||ar(2,a,t),st||ar(4,a,t),La(e,t,a);break;case 1:st||(xa(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Jf(a,t,s)),La(e,t,a);break;case 21:La(e,t,a);break;case 22:st=(s=st)||a.memoizedState!==null,La(e,t,a),st=s;break;default:La(e,t,a)}}function nm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Un(e)}catch(a){$e(t,t.return,a)}}function k0(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tm),t;default:throw Error(i(435,e.tag))}}function rc(e,t){var a=k0(e);t.forEach(function(s){var c=L0.bind(null,e,s);a.has(s)||(a.add(s),s.then(c,c))})}function Vt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],f=e,x=t,v=x;e:for(;v!==null;){switch(v.tag){case 27:if(ur(v.type)){Qe=v.stateNode,Ut=!1;break e}break;case 5:Qe=v.stateNode,Ut=!1;break e;case 3:case 4:Qe=v.stateNode.containerInfo,Ut=!0;break e}v=v.return}if(Qe===null)throw Error(i(160));sm(f,x,c),Qe=null,Ut=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)lm(t,e),t=t.sibling}var ia=null;function lm(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Gt(e),s&4&&(ar(3,e,e.return),gn(3,e),ar(5,e,e.return));break;case 1:Vt(t,e),Gt(e),s&512&&(st||a===null||xa(a,a.return)),s&64&&za&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=ia;if(Vt(t,e),Gt(e),s&512&&(st||a===null||xa(a,a.return)),s&4){var f=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Bs]||f[ct]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(s),c.head.insertBefore(f,c.querySelector("head > title"))),wt(f,s,a),f[ct]=e,mt(f),s=f;break e;case"link":var x=eh("link","href",c).get(s+(a.href||""));if(x){for(var v=0;v<x.length;v++)if(f=x[v],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(v,1);break t}}f=c.createElement(s),wt(f,s,a),c.head.appendChild(f);break;case"meta":if(x=eh("meta","content",c).get(s+(a.content||""))){for(v=0;v<x.length;v++)if(f=x[v],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(v,1);break t}}f=c.createElement(s),wt(f,s,a),c.head.appendChild(f);break;default:throw Error(i(468,s))}f[ct]=e,mt(f),s=f}e.stateNode=s}else th(c,e.type,e.stateNode);else e.stateNode=Wm(c,s,e.memoizedProps);else f!==s?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,s===null?th(c,e.type,e.stateNode):Wm(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Wi(e,e.memoizedProps,a.memoizedProps)}break;case 27:Vt(t,e),Gt(e),s&512&&(st||a===null||xa(a,a.return)),a!==null&&s&4&&Wi(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Vt(t,e),Gt(e),s&512&&(st||a===null||xa(a,a.return)),e.flags&32){c=e.stateNode;try{Qr(c,"")}catch(X){$e(e,e.return,X)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,Wi(e,c,a!==null?a.memoizedProps:c)),s&1024&&(ac=!0);break;case 6:if(Vt(t,e),Gt(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(X){$e(e,e.return,X)}}break;case 3:if(to=null,c=ia,ia=Wl(t.containerInfo),Vt(t,e),ia=c,Gt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Un(t.containerInfo)}catch(X){$e(e,e.return,X)}ac&&(ac=!1,om(e));break;case 4:s=ia,ia=Wl(e.stateNode.containerInfo),Vt(t,e),Gt(e),ia=s;break;case 12:Vt(t,e),Gt(e);break;case 13:Vt(t,e),Gt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(cc=De()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,rc(e,s)));break;case 22:c=e.memoizedState!==null;var D=a!==null&&a.memoizedState!==null,K=za,ee=st;if(za=K||c,st=ee||D,Vt(t,e),st=ee,za=K,Gt(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||D||za||st||Ur(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){D=a=t;try{if(f=D.stateNode,c)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{v=D.stateNode;var ne=D.memoizedProps.style,Y=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;v.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(X){$e(D,D.return,X)}}}else if(t.tag===6){if(a===null){D=t;try{D.stateNode.nodeValue=c?"":D.memoizedProps}catch(X){$e(D,D.return,X)}}}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}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,rc(e,a))));break;case 19:Vt(t,e),Gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,rc(e,s)));break;case 30:break;case 21:break;default:Vt(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(Wf(s)){a=s;break}s=s.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,f=ec(e);Bl(e,f,c);break;case 5:var x=a.stateNode;a.flags&32&&(Qr(x,""),a.flags&=-33);var v=ec(e);Bl(e,v,x);break;case 3:case 4:var D=a.stateNode.containerInfo,K=ec(e);tc(e,K,D);break;default:throw Error(i(161))}}catch(ee){$e(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function om(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;om(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function rr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)am(e,t.alternate,t),t=t.sibling}function Ur(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ar(4,t,t.return),Ur(t);break;case 1:xa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Jf(t,t.return,a),Ur(t);break;case 27:En(t.stateNode);case 26:case 5:xa(t,t.return),Ur(t);break;case 22:t.memoizedState===null&&Ur(t);break;case 30:Ur(t);break;default:Ur(t)}e=e.sibling}}function sr(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,f=t,x=f.flags;switch(f.tag){case 0:case 11:case 15:sr(c,f,a),gn(4,f);break;case 1:if(sr(c,f,a),s=f,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(K){$e(s,s.return,K)}if(s=f,c=s.updateQueue,c!==null){var v=s.stateNode;try{var D=c.shared.hiddenCallbacks;if(D!==null)for(c.shared.hiddenCallbacks=null,c=0;c<D.length;c++)zd(D[c],v)}catch(K){$e(s,s.return,K)}}a&&x&64&&Qf(f),xn(f,f.return);break;case 27:em(f);case 26:case 5:sr(c,f,a),a&&s===null&&x&4&&Zf(f),xn(f,f.return);break;case 12:sr(c,f,a);break;case 13:sr(c,f,a),a&&x&4&&nm(c,f);break;case 22:f.memoizedState===null&&sr(c,f,a),xn(f,f.return);break;case 30:break;default:sr(c,f,a)}t=t.sibling}}function sc(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&&tn(a))}function nc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&tn(e))}function ya(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)im(e,t,a,s),t=t.sibling}function im(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ya(e,t,a,s),c&2048&&gn(9,t);break;case 1:ya(e,t,a,s);break;case 3:ya(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&tn(e)));break;case 12:if(c&2048){ya(e,t,a,s),e=t.stateNode;try{var f=t.memoizedProps,x=f.id,v=f.onPostCommit;typeof v=="function"&&v(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){$e(t,t.return,D)}}else ya(e,t,a,s);break;case 13:ya(e,t,a,s);break;case 23:break;case 22:f=t.stateNode,x=t.alternate,t.memoizedState!==null?f._visibility&2?ya(e,t,a,s):yn(e,t):f._visibility&2?ya(e,t,a,s):(f._visibility|=2,ps(e,t,a,s,(t.subtreeFlags&10256)!==0)),c&2048&&sc(x,t);break;case 24:ya(e,t,a,s),c&2048&&nc(t.alternate,t);break;default:ya(e,t,a,s)}}function ps(e,t,a,s,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var f=e,x=t,v=a,D=s,K=x.flags;switch(x.tag){case 0:case 11:case 15:ps(f,x,v,D,c),gn(8,x);break;case 23:break;case 22:var ee=x.stateNode;x.memoizedState!==null?ee._visibility&2?ps(f,x,v,D,c):yn(f,x):(ee._visibility|=2,ps(f,x,v,D,c)),c&&K&2048&&sc(x.alternate,x);break;case 24:ps(f,x,v,D,c),c&&K&2048&&nc(x.alternate,x);break;default:ps(f,x,v,D,c)}t=t.sibling}}function yn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:yn(a,s),c&2048&&sc(s.alternate,s);break;case 24:yn(a,s),c&2048&&nc(s.alternate,s);break;default:yn(a,s)}t=t.sibling}}var bn=8192;function gs(e){if(e.subtreeFlags&bn)for(e=e.child;e!==null;)cm(e),e=e.sibling}function cm(e){switch(e.tag){case 26:gs(e),e.flags&bn&&e.memoizedState!==null&&fx(ia,e.memoizedState,e.memoizedProps);break;case 5:gs(e);break;case 3:case 4:var t=ia;ia=Wl(e.stateNode.containerInfo),gs(e),ia=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=bn,bn=16777216,gs(e),bn=t):gs(e));break;default:gs(e)}}function um(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 vn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];pt=s,fm(s,e)}um(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)dm(e),e=e.sibling}function dm(e){switch(e.tag){case 0:case 11:case 15:vn(e),e.flags&2048&&ar(9,e,e.return);break;case 3:vn(e);break;case 12:vn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ql(e)):vn(e);break;default:vn(e)}}function ql(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];pt=s,fm(s,e)}um(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ar(8,t,t.return),ql(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,ql(t));break;default:ql(t)}e=e.sibling}}function fm(e,t){for(;pt!==null;){var a=pt;switch(a.tag){case 0:case 11:case 15:ar(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:tn(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,pt=s;else e:for(a=e;pt!==null;){s=pt;var c=s.sibling,f=s.return;if(rm(s),s===a){pt=null;break e}if(c!==null){c.return=f,pt=c;break e}pt=f}}}var T0={getCacheForType:function(e){var t=St(ut),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},A0=typeof WeakMap=="function"?WeakMap:Map,qe=0,Ie=null,ze=null,_e=0,Ve=0,Kt=null,nr=!1,xs=!1,lc=!1,_a=0,at=0,lr=0,zr=0,oc=0,aa=0,ys=0,wn=null,zt=null,ic=!1,cc=0,Vl=1/0,Gl=null,or=null,vt=0,ir=null,bs=null,vs=0,uc=0,dc=null,mm=null,jn=0,fc=null;function Ft(){if((qe&2)!==0&&_e!==0)return _e&-_e;if(w.T!==null){var e=os;return e!==0?e:bc()}return Hs()}function hm(){aa===0&&(aa=(_e&536870912)===0||Be?de():536870912);var e=ta.current;return e!==null&&(e.flags|=32),aa}function $t(e,t,a){(e===Ie&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)&&(ws(e,0),cr(e,_e,aa,!1)),Ht(e,a),((qe&2)===0||e!==Ie)&&(e===Ie&&((qe&2)===0&&(zr|=a),at===4&&cr(e,_e,aa,!1)),ba(e))}function pm(e,t,a){if((qe&6)!==0)throw Error(i(327));var s=!a&&(t&124)===0&&(t&e.expiredLanes)===0||Pe(e,t),c=s?O0(e,t):pc(e,t,!0),f=s;do{if(c===0){xs&&!s&&cr(e,t,0,!1);break}else{if(a=e.current.alternate,f&&!R0(a)){c=pc(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var v=e;c=wn;var D=v.current.memoizedState.isDehydrated;if(D&&(ws(v,x).flags|=256),x=pc(v,x,!1),x!==2){if(lc&&!D){v.errorRecoveryDisabledLanes|=f,zr|=f,c=4;break e}f=zt,zt=c,f!==null&&(zt===null?zt=f:zt.push.apply(zt,f))}c=x}if(f=!1,c!==2)continue}}if(c===1){ws(e,0),cr(e,t,0,!0);break}e:{switch(s=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:cr(s,t,aa,!nr);break e;case 2:zt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=cc+300-De(),10<c)){if(cr(s,t,aa,!nr),ke(s,0,!0)!==0)break e;s.timeoutHandle=Km(gm.bind(null,s,a,zt,Gl,ic,t,aa,zr,ys,nr,f,2,-0,0),c);break e}gm(s,a,zt,Gl,ic,t,aa,zr,ys,nr,f,0,-0,0)}}break}while(!0);ba(e)}function gm(e,t,a,s,c,f,x,v,D,K,ee,ne,Y,X){if(e.timeoutHandle=-1,ne=t.subtreeFlags,(ne&8192||(ne&16785408)===16785408)&&(An={stylesheets:null,count:0,unsuspend:dx},cm(t),ne=mx(),ne!==null)){e.cancelPendingCommit=ne(Nm.bind(null,e,t,f,a,s,c,x,v,D,ee,1,Y,X)),cr(e,f,x,!K);return}Nm(e,t,f,a,s,c,x,v,D)}function R0(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 s=0;s<a.length;s++){var c=a[s],f=c.getSnapshot;c=c.value;try{if(!Bt(f(),c))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 cr(e,t,a,s){t&=~oc,t&=~zr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var f=31-nt(c),x=1<<f;s[f]=-1,c&=~x}a!==0&&$a(e,a,t)}function Kl(){return(qe&6)===0?(Nn(0),!1):!0}function mc(){if(ze!==null){if(Ve===0)var e=ze.return;else e=ze,Aa=Ar=null,Ri(e),ms=null,mn=0,e=ze;for(;e!==null;)Xf(e.alternate,e),e=e.return;ze=null}}function ws(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Y0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),mc(),Ie=e,ze=a=Ea(e.current,null),_e=t,Ve=0,Kt=null,nr=!1,xs=Pe(e,t),lc=!1,ys=aa=oc=zr=lr=at=0,zt=wn=null,ic=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-nt(s),f=1<<c;t|=e[c],s&=~f}return _a=t,fl(),a}function xm(e,t){Me=null,w.H=Ml,t===rn||t===wl?(t=Dd(),Ve=3):t===Rd?(t=Dd(),Ve=4):Ve=t===zf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Kt=t,ze===null&&(at=1,Ll(e,Jt(t,e.current)))}function ym(){var e=w.H;return w.H=Ml,e===null?Ml:e}function bm(){var e=w.A;return w.A=T0,e}function hc(){at=4,nr||(_e&4194048)!==_e&&ta.current!==null||(xs=!0),(lr&134217727)===0&&(zr&134217727)===0||Ie===null||cr(Ie,_e,aa,!1)}function pc(e,t,a){var s=qe;qe|=2;var c=ym(),f=bm();(Ie!==e||_e!==t)&&(Gl=null,ws(e,t)),t=!1;var x=at;e:do try{if(Ve!==0&&ze!==null){var v=ze,D=Kt;switch(Ve){case 8:mc(),x=6;break e;case 3:case 2:case 9:case 6:ta.current===null&&(t=!0);var K=Ve;if(Ve=0,Kt=null,js(e,v,D,K),a&&xs){x=0;break e}break;default:K=Ve,Ve=0,Kt=null,js(e,v,D,K)}}M0(),x=at;break}catch(ee){xm(e,ee)}while(!0);return t&&e.shellSuspendCounter++,Aa=Ar=null,qe=s,w.H=c,w.A=f,ze===null&&(Ie=null,_e=0,fl()),x}function M0(){for(;ze!==null;)vm(ze)}function O0(e,t){var a=qe;qe|=2;var s=ym(),c=bm();Ie!==e||_e!==t?(Gl=null,Vl=De()+500,ws(e,t)):xs=Pe(e,t);e:do try{if(Ve!==0&&ze!==null){t=ze;var f=Kt;t:switch(Ve){case 1:Ve=0,Kt=null,js(e,t,f,1);break;case 2:case 9:if(Md(f)){Ve=0,Kt=null,wm(t);break}t=function(){Ve!==2&&Ve!==9||Ie!==e||(Ve=7),ba(e)},f.then(t,t);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:Md(f)?(Ve=0,Kt=null,wm(t)):(Ve=0,Kt=null,js(e,t,f,7));break;case 5:var x=null;switch(ze.tag){case 26:x=ze.memoizedState;case 5:case 27:var v=ze;if(!x||ah(x)){Ve=0,Kt=null;var D=v.sibling;if(D!==null)ze=D;else{var K=v.return;K!==null?(ze=K,Fl(K)):ze=null}break t}}Ve=0,Kt=null,js(e,t,f,5);break;case 6:Ve=0,Kt=null,js(e,t,f,6);break;case 8:mc(),at=6;break e;default:throw Error(i(462))}}D0();break}catch(ee){xm(e,ee)}while(!0);return Aa=Ar=null,w.H=s,w.A=c,qe=a,ze!==null?0:(Ie=null,_e=0,fl(),at)}function D0(){for(;ze!==null&&!et();)vm(ze)}function vm(e){var t=If(e.alternate,e,_a);e.memoizedProps=e.pendingProps,t===null?Fl(e):ze=t}function wm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=qf(a,t,t.pendingProps,t.type,void 0,_e);break;case 11:t=qf(a,t,t.pendingProps,t.type.render,t.ref,_e);break;case 5:Ri(t);default:Xf(a,t),t=ze=wd(t,_a),t=If(a,t,_a)}e.memoizedProps=e.pendingProps,t===null?Fl(e):ze=t}function js(e,t,a,s){Aa=Ar=null,Ri(t),ms=null,mn=0;var c=t.return;try{if(j0(e,c,t,a,_e)){at=1,Ll(e,Jt(a,e.current)),ze=null;return}}catch(f){if(c!==null)throw ze=c,f;at=1,Ll(e,Jt(a,e.current)),ze=null;return}t.flags&32768?(Be||s===1?e=!0:xs||(_e&536870912)!==0?e=!1:(nr=e=!0,(s===2||s===9||s===3||s===6)&&(s=ta.current,s!==null&&s.tag===13&&(s.flags|=16384))),jm(t,e)):Fl(t)}function Fl(e){var t=e;do{if((t.flags&32768)!==0){jm(t,nr);return}e=t.return;var a=S0(t.alternate,t,_a);if(a!==null){ze=a;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);at===0&&(at=5)}function jm(e,t){do{var a=C0(e.alternate,e);if(a!==null){a.flags&=32767,ze=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=a}while(e!==null);at=6,ze=null}function Nm(e,t,a,s,c,f,x,v,D){e.cancelPendingCommit=null;do $l();while(vt!==0);if((qe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=ni,br(e,a,f,x,v,D),e===Ie&&(ze=Ie=null,_e=0),bs=t,ir=e,vs=a,uc=f,dc=c,mm=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_0(It,function(){return Tm(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=w.T,w.T=null,c=E.p,E.p=2,x=qe,qe|=4;try{E0(e,t,a)}finally{qe=x,E.p=c,w.T=s}}vt=1,Sm(),Cm(),Em()}}function Sm(){if(vt===1){vt=0;var e=ir,t=bs,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=w.T,w.T=null;var s=E.p;E.p=2;var c=qe;qe|=4;try{lm(t,e);var f=kc,x=dd(e.containerInfo),v=f.focusedElem,D=f.selectionRange;if(x!==v&&v&&v.ownerDocument&&ud(v.ownerDocument.documentElement,v)){if(D!==null&&ei(v)){var K=D.start,ee=D.end;if(ee===void 0&&(ee=K),"selectionStart"in v)v.selectionStart=K,v.selectionEnd=Math.min(ee,v.value.length);else{var ne=v.ownerDocument||document,Y=ne&&ne.defaultView||window;if(Y.getSelection){var X=Y.getSelection(),Ce=v.textContent.length,je=Math.min(D.start,Ce),Fe=D.end===void 0?je:Math.min(D.end,Ce);!X.extend&&je>Fe&&(x=Fe,Fe=je,je=x);var P=cd(v,je),L=cd(v,Fe);if(P&&L&&(X.rangeCount!==1||X.anchorNode!==P.node||X.anchorOffset!==P.offset||X.focusNode!==L.node||X.focusOffset!==L.offset)){var V=ne.createRange();V.setStart(P.node,P.offset),X.removeAllRanges(),je>Fe?(X.addRange(V),X.extend(L.node,L.offset)):(V.setEnd(L.node,L.offset),X.addRange(V))}}}}for(ne=[],X=v;X=X.parentNode;)X.nodeType===1&&ne.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<ne.length;v++){var ae=ne[v];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}so=!!Ec,kc=Ec=null}finally{qe=c,E.p=s,w.T=a}}e.current=t,vt=2}}function Cm(){if(vt===2){vt=0;var e=ir,t=bs,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=w.T,w.T=null;var s=E.p;E.p=2;var c=qe;qe|=4;try{am(e,t.alternate,t)}finally{qe=c,E.p=s,w.T=a}}vt=3}}function Em(){if(vt===4||vt===3){vt=0,xt();var e=ir,t=bs,a=vs,s=mm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?vt=5:(vt=0,bs=ir=null,km(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(or=null),ha(a),t=t.stateNode,it&&typeof it.onCommitFiberRoot=="function")try{it.onCommitFiberRoot(_t,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=w.T,c=E.p,E.p=2,w.T=null;try{for(var f=e.onRecoverableError,x=0;x<s.length;x++){var v=s[x];f(v.value,{componentStack:v.stack})}}finally{w.T=t,E.p=c}}(vs&3)!==0&&$l(),ba(e),c=e.pendingLanes,(a&4194090)!==0&&(c&42)!==0?e===fc?jn++:(jn=0,fc=e):jn=0,Nn(0)}}function km(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,tn(t)))}function $l(e){return Sm(),Cm(),Em(),Tm()}function Tm(){if(vt!==5)return!1;var e=ir,t=uc;uc=0;var a=ha(vs),s=w.T,c=E.p;try{E.p=32>a?32:a,w.T=null,a=dc,dc=null;var f=ir,x=vs;if(vt=0,bs=ir=null,vs=0,(qe&6)!==0)throw Error(i(331));var v=qe;if(qe|=4,dm(f.current),im(f,f.current,x,a),qe=v,Nn(0,!1),it&&typeof it.onPostCommitFiberRoot=="function")try{it.onPostCommitFiberRoot(_t,f)}catch{}return!0}finally{E.p=c,w.T=s,km(e,t)}}function Am(e,t,a){t=Jt(a,t),t=Ki(e.stateNode,t,2),e=Za(e,t,2),e!==null&&(Ht(e,2),ba(e))}function $e(e,t,a){if(e.tag===3)Am(e,e,a);else for(;t!==null;){if(t.tag===3){Am(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(or===null||!or.has(s))){e=Jt(a,e),a=Df(2),s=Za(t,a,2),s!==null&&(Uf(a,s,t,e),Ht(s,2),ba(s));break}}t=t.return}}function gc(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new A0;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(lc=!0,c.add(a),e=U0.bind(null,e,t,a),t.then(e,e))}function U0(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ie===e&&(_e&a)===a&&(at===4||at===3&&(_e&62914560)===_e&&300>De()-cc?(qe&2)===0&&ws(e,0):oc|=a,ys===_e&&(ys=0)),ba(e)}function Rm(e,t){t===0&&(t=he()),e=rs(e,t),e!==null&&(Ht(e,t),ba(e))}function z0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Rm(e,a)}function L0(e,t){var a=0;switch(e.tag){case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(t),Rm(e,a)}function _0(e,t){return ie(e,t)}var Il=null,Ns=null,xc=!1,Yl=!1,yc=!1,Lr=0;function ba(e){e!==Ns&&e.next===null&&(Ns===null?Il=Ns=e:Ns=Ns.next=e),Yl=!0,xc||(xc=!0,H0())}function Nn(e,t){if(!yc&&Yl){yc=!0;do for(var a=!1,s=Il;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var f=0;else{var x=s.suspendedLanes,v=s.pingedLanes;f=(1<<31-nt(42|e)+1)-1,f&=c&~(x&~v),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,Um(s,f))}else f=_e,f=ke(s,s===Ie?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||Pe(s,f)||(a=!0,Um(s,f));s=s.next}while(a);yc=!1}}function P0(){Mm()}function Mm(){Yl=xc=!1;var e=0;Lr!==0&&(I0()&&(e=Lr),Lr=0);for(var t=De(),a=null,s=Il;s!==null;){var c=s.next,f=Om(s,t);f===0?(s.next=null,a===null?Il=c:a.next=c,c===null&&(Ns=a)):(a=s,(e!==0||(f&3)!==0)&&(Yl=!0)),s=c}Nn(e)}function Om(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-nt(f),v=1<<x,D=c[x];D===-1?((v&a)===0||(v&s)!==0)&&(c[x]=me(v,t)):D<=t&&(e.expiredLanes|=v),f&=~v}if(t=Ie,a=_e,a=ke(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Te(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Pe(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&Te(s),ha(a)){case 2:case 8:a=fa;break;case 32:a=It;break;case 268435456:a=xr;break;default:a=It}return s=Dm.bind(null,e),a=ie(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&Te(s),e.callbackPriority=2,e.callbackNode=null,2}function Dm(e,t){if(vt!==0&&vt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if($l()&&e.callbackNode!==a)return null;var s=_e;return s=ke(e,e===Ie?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(pm(e,s,t),Om(e,De()),e.callbackNode!=null&&e.callbackNode===a?Dm.bind(null,e):null)}function Um(e,t){if($l())return null;pm(e,t,!0)}function H0(){X0(function(){(qe&6)!==0?ie(da,P0):Mm()})}function bc(){return Lr===0&&(Lr=de()),Lr}function zm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:nl(""+e)}function Lm(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 B0(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var f=zm((c[yt]||null).action),x=s.submitter;x&&(t=(t=x[yt]||null)?zm(t.formAction):x.getAttribute("formAction"),t!==null&&(f=t,x=null));var v=new cl("action","action",null,s,c);e.push({event:v,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Lr!==0){var D=x?Lm(c,x):new FormData(c);Hi(a,{pending:!0,data:D,method:c.method,action:f},null,D)}}else typeof f=="function"&&(v.preventDefault(),D=x?Lm(c,x):new FormData(c),Hi(a,{pending:!0,data:D,method:c.method,action:f},f,D))},currentTarget:c}]})}}for(var vc=0;vc<si.length;vc++){var wc=si[vc],q0=wc.toLowerCase(),V0=wc[0].toUpperCase()+wc.slice(1);oa(q0,"on"+V0)}oa(hd,"onAnimationEnd"),oa(pd,"onAnimationIteration"),oa(gd,"onAnimationStart"),oa("dblclick","onDoubleClick"),oa("focusin","onFocus"),oa("focusout","onBlur"),oa(n0,"onTransitionRun"),oa(l0,"onTransitionStart"),oa(o0,"onTransitionCancel"),oa(xd,"onTransitionEnd"),Ir("onMouseEnter",["mouseout","mouseover"]),Ir("onMouseLeave",["mouseout","mouseover"]),Ir("onPointerEnter",["pointerout","pointerover"]),Ir("onPointerLeave",["pointerout","pointerover"]),vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vr("onBeforeInput",["compositionend","keypress","textInput","paste"]),vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sn="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(" "),G0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sn));function _m(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var f=void 0;if(t)for(var x=s.length-1;0<=x;x--){var v=s[x],D=v.instance,K=v.currentTarget;if(v=v.listener,D!==f&&c.isPropagationStopped())break e;f=v,c.currentTarget=K;try{f(c)}catch(ee){zl(ee)}c.currentTarget=null,f=D}else for(x=0;x<s.length;x++){if(v=s[x],D=v.instance,K=v.currentTarget,v=v.listener,D!==f&&c.isPropagationStopped())break e;f=v,c.currentTarget=K;try{f(c)}catch(ee){zl(ee)}c.currentTarget=null,f=D}}}}function Le(e,t){var a=t[Ia];a===void 0&&(a=t[Ia]=new Set);var s=e+"__bubble";a.has(s)||(Pm(t,e,2,!1),a.add(s))}function jc(e,t,a){var s=0;t&&(s|=4),Pm(a,e,s,t)}var Xl="_reactListening"+Math.random().toString(36).slice(2);function Nc(e){if(!e[Xl]){e[Xl]=!0,Ru.forEach(function(a){a!=="selectionchange"&&(G0.has(a)||jc(a,!1,e),jc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xl]||(t[Xl]=!0,jc("selectionchange",!1,t))}}function Pm(e,t,a,s){switch(ih(t)){case 2:var c=gx;break;case 8:c=xx;break;default:c=_c}a=c.bind(null,t,a,e),c=void 0,!Fo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function Sc(e,t,a,s,c){var f=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var x=s.tag;if(x===3||x===4){var v=s.stateNode.containerInfo;if(v===c)break;if(x===4)for(x=s.return;x!==null;){var D=x.tag;if((D===3||D===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;v!==null;){if(x=Kr(v),x===null)return;if(D=x.tag,D===5||D===6||D===26||D===27){s=f=x;continue e}v=v.parentNode}}s=s.return}Ku(function(){var K=f,ee=Go(a),ne=[];e:{var Y=yd.get(e);if(Y!==void 0){var X=cl,Ce=e;switch(e){case"keypress":if(ol(a)===0)break e;case"keydown":case"keyup":X=_g;break;case"focusin":Ce="focus",X=Xo;break;case"focusout":Ce="blur",X=Xo;break;case"beforeblur":case"afterblur":X=Xo;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":X=Iu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Cg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=Bg;break;case hd:case pd:case gd:X=Tg;break;case xd:X=Vg;break;case"scroll":case"scrollend":X=Ng;break;case"wheel":X=Kg;break;case"copy":case"cut":case"paste":X=Rg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Xu;break;case"toggle":case"beforetoggle":X=$g}var je=(t&4)!==0,Fe=!je&&(e==="scroll"||e==="scrollend"),P=je?Y!==null?Y+"Capture":null:Y;je=[];for(var L=K,V;L!==null;){var ae=L;if(V=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||V===null||P===null||(ae=Vs(L,P),ae!=null&&je.push(Cn(L,ae,V))),Fe)break;L=L.return}0<je.length&&(Y=new X(Y,Ce,null,a,ee),ne.push({event:Y,listeners:je}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",Y&&a!==Vo&&(Ce=a.relatedTarget||a.fromElement)&&(Kr(Ce)||Ce[Na]))break e;if((X||Y)&&(Y=ee.window===ee?ee:(Y=ee.ownerDocument)?Y.defaultView||Y.parentWindow:window,X?(Ce=a.relatedTarget||a.toElement,X=K,Ce=Ce?Kr(Ce):null,Ce!==null&&(Fe=d(Ce),je=Ce.tag,Ce!==Fe||je!==5&&je!==27&&je!==6)&&(Ce=null)):(X=null,Ce=K),X!==Ce)){if(je=Iu,ae="onMouseLeave",P="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(je=Xu,ae="onPointerLeave",P="onPointerEnter",L="pointer"),Fe=X==null?Y:qs(X),V=Ce==null?Y:qs(Ce),Y=new je(ae,L+"leave",X,a,ee),Y.target=Fe,Y.relatedTarget=V,ae=null,Kr(ee)===K&&(je=new je(P,L+"enter",Ce,a,ee),je.target=V,je.relatedTarget=Fe,ae=je),Fe=ae,X&&Ce)t:{for(je=X,P=Ce,L=0,V=je;V;V=Ss(V))L++;for(V=0,ae=P;ae;ae=Ss(ae))V++;for(;0<L-V;)je=Ss(je),L--;for(;0<V-L;)P=Ss(P),V--;for(;L--;){if(je===P||P!==null&&je===P.alternate)break t;je=Ss(je),P=Ss(P)}je=null}else je=null;X!==null&&Hm(ne,Y,X,je,!1),Ce!==null&&Fe!==null&&Hm(ne,Fe,Ce,je,!0)}}e:{if(Y=K?qs(K):window,X=Y.nodeName&&Y.nodeName.toLowerCase(),X==="select"||X==="input"&&Y.type==="file")var pe=rd;else if(td(Y))if(sd)pe=a0;else{pe=e0;var Ue=Wg}else X=Y.nodeName,!X||X.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?K&&qo(K.elementType)&&(pe=rd):pe=t0;if(pe&&(pe=pe(e,K))){ad(ne,pe,a,ee);break e}Ue&&Ue(e,Y,K),e==="focusout"&&K&&Y.type==="number"&&K.memoizedProps.value!=null&&Bo(Y,"number",Y.value)}switch(Ue=K?qs(K):window,e){case"focusin":(td(Ue)||Ue.contentEditable==="true")&&(es=Ue,ti=K,Qs=null);break;case"focusout":Qs=ti=es=null;break;case"mousedown":ai=!0;break;case"contextmenu":case"mouseup":case"dragend":ai=!1,fd(ne,a,ee);break;case"selectionchange":if(s0)break;case"keydown":case"keyup":fd(ne,a,ee)}var ve;if(Jo)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Wr?Wu(e,a)&&(Se="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Se="onCompositionStart");Se&&(Qu&&a.locale!=="ko"&&(Wr||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Wr&&(ve=Fu()):(Ya=ee,$o="value"in Ya?Ya.value:Ya.textContent,Wr=!0)),Ue=Ql(K,Se),0<Ue.length&&(Se=new Yu(Se,e,null,a,ee),ne.push({event:Se,listeners:Ue}),ve?Se.data=ve:(ve=ed(a),ve!==null&&(Se.data=ve)))),(ve=Yg?Xg(e,a):Qg(e,a))&&(Se=Ql(K,"onBeforeInput"),0<Se.length&&(Ue=new Yu("onBeforeInput","beforeinput",null,a,ee),ne.push({event:Ue,listeners:Se}),Ue.data=ve)),B0(ne,e,K,a,ee)}_m(ne,t)})}function Cn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ql(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Vs(e,a),c!=null&&s.unshift(Cn(e,c,f)),c=Vs(e,t),c!=null&&s.push(Cn(e,c,f))),e.tag===3)return s;e=e.return}return[]}function Ss(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Hm(e,t,a,s,c){for(var f=t._reactName,x=[];a!==null&&a!==s;){var v=a,D=v.alternate,K=v.stateNode;if(v=v.tag,D!==null&&D===s)break;v!==5&&v!==26&&v!==27||K===null||(D=K,c?(K=Vs(a,f),K!=null&&x.unshift(Cn(a,K,D))):c||(K=Vs(a,f),K!=null&&x.push(Cn(a,K,D)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var K0=/\r\n?/g,F0=/\u0000|\uFFFD/g;function Bm(e){return(typeof e=="string"?e:""+e).replace(K0,`
49
+ `).replace(F0,"")}function qm(e,t){return t=Bm(t),Bm(e)===t}function Jl(){}function Ke(e,t,a,s,c,f){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Qr(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Qr(e,""+s);break;case"className":al(e,"class",s);break;case"tabIndex":al(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":al(e,a,s);break;case"style":Vu(e,s,f);break;case"data":if(t!=="object"){al(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=nl(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="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 f=="function"&&(a==="formAction"?(t!=="input"&&Ke(e,t,"name",c.name,c,null),Ke(e,t,"formEncType",c.formEncType,c,null),Ke(e,t,"formMethod",c.formMethod,c,null),Ke(e,t,"formTarget",c.formTarget,c,null)):(Ke(e,t,"encType",c.encType,c,null),Ke(e,t,"method",c.method,c,null),Ke(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=nl(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Jl);break;case"onScroll":s!=null&&Le("scroll",e);break;case"onScrollEnd":s!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=nl(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Le("beforetoggle",e),Le("toggle",e),tl(e,"popover",s);break;case"xlinkActuate":Sa(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Sa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Sa(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Sa(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Sa(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Sa(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":tl(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=wg.get(a)||a,tl(e,a,s))}}function Cc(e,t,a,s,c,f){switch(a){case"style":Vu(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof s=="string"?Qr(e,s):(typeof s=="number"||typeof s=="bigint")&&Qr(e,""+s);break;case"onScroll":s!=null&&Le("scroll",e);break;case"onScrollEnd":s!=null&&Le("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Jl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mu.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),f=e[yt]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof s=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):tl(e,a,s)}}}function wt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var s=!1,c=!1,f;for(f in a)if(a.hasOwnProperty(f)){var x=a[f];if(x!=null)switch(f){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ke(e,t,f,x,a,null)}}c&&Ke(e,t,"srcSet",a.srcSet,a,null),s&&Ke(e,t,"src",a.src,a,null);return;case"input":Le("invalid",e);var v=f=x=c=null,D=null,K=null;for(s in a)if(a.hasOwnProperty(s)){var ee=a[s];if(ee!=null)switch(s){case"name":c=ee;break;case"type":x=ee;break;case"checked":D=ee;break;case"defaultChecked":K=ee;break;case"value":f=ee;break;case"defaultValue":v=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(i(137,t));break;default:Ke(e,t,s,ee,a,null)}}Pu(e,f,v,D,K,x,c,!1),rl(e);return;case"select":Le("invalid",e),s=x=f=null;for(c in a)if(a.hasOwnProperty(c)&&(v=a[c],v!=null))switch(c){case"value":f=v;break;case"defaultValue":x=v;break;case"multiple":s=v;default:Ke(e,t,c,v,a,null)}t=f,a=x,e.multiple=!!s,t!=null?Xr(e,!!s,t,!1):a!=null&&Xr(e,!!s,a,!0);return;case"textarea":Le("invalid",e),f=c=s=null;for(x in a)if(a.hasOwnProperty(x)&&(v=a[x],v!=null))switch(x){case"value":s=v;break;case"defaultValue":c=v;break;case"children":f=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:Ke(e,t,x,v,a,null)}Bu(e,s,c,f),rl(e);return;case"option":for(D in a)if(a.hasOwnProperty(D)&&(s=a[D],s!=null))switch(D){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ke(e,t,D,s,a,null)}return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(s=0;s<Sn.length;s++)Le(Sn[s],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("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(K in a)if(a.hasOwnProperty(K)&&(s=a[K],s!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ke(e,t,K,s,a,null)}return;default:if(qo(t)){for(ee in a)a.hasOwnProperty(ee)&&(s=a[ee],s!==void 0&&Cc(e,t,ee,s,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(s=a[v],s!=null&&Ke(e,t,v,s,a,null))}function $0(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,x=null,v=null,D=null,K=null,ee=null;for(X in a){var ne=a[X];if(a.hasOwnProperty(X)&&ne!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":D=ne;default:s.hasOwnProperty(X)||Ke(e,t,X,null,s,ne)}}for(var Y in s){var X=s[Y];if(ne=a[Y],s.hasOwnProperty(Y)&&(X!=null||ne!=null))switch(Y){case"type":f=X;break;case"name":c=X;break;case"checked":K=X;break;case"defaultChecked":ee=X;break;case"value":x=X;break;case"defaultValue":v=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,t));break;default:X!==ne&&Ke(e,t,Y,X,s,ne)}}Ho(e,x,v,D,K,ee,f,c);return;case"select":X=x=v=Y=null;for(f in a)if(D=a[f],a.hasOwnProperty(f)&&D!=null)switch(f){case"value":break;case"multiple":X=D;default:s.hasOwnProperty(f)||Ke(e,t,f,null,s,D)}for(c in s)if(f=s[c],D=a[c],s.hasOwnProperty(c)&&(f!=null||D!=null))switch(c){case"value":Y=f;break;case"defaultValue":v=f;break;case"multiple":x=f;default:f!==D&&Ke(e,t,c,f,s,D)}t=v,a=x,s=X,Y!=null?Xr(e,!!a,Y,!1):!!s!=!!a&&(t!=null?Xr(e,!!a,t,!0):Xr(e,!!a,a?[]:"",!1));return;case"textarea":X=Y=null;for(v in a)if(c=a[v],a.hasOwnProperty(v)&&c!=null&&!s.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ke(e,t,v,null,s,c)}for(x in s)if(c=s[x],f=a[x],s.hasOwnProperty(x)&&(c!=null||f!=null))switch(x){case"value":Y=c;break;case"defaultValue":X=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&Ke(e,t,x,c,s,f)}Hu(e,Y,X);return;case"option":for(var Ce in a)if(Y=a[Ce],a.hasOwnProperty(Ce)&&Y!=null&&!s.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:Ke(e,t,Ce,null,s,Y)}for(D in s)if(Y=s[D],X=a[D],s.hasOwnProperty(D)&&Y!==X&&(Y!=null||X!=null))switch(D){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:Ke(e,t,D,Y,s,X)}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 je in a)Y=a[je],a.hasOwnProperty(je)&&Y!=null&&!s.hasOwnProperty(je)&&Ke(e,t,je,null,s,Y);for(K in s)if(Y=s[K],X=a[K],s.hasOwnProperty(K)&&Y!==X&&(Y!=null||X!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:Ke(e,t,K,Y,s,X)}return;default:if(qo(t)){for(var Fe in a)Y=a[Fe],a.hasOwnProperty(Fe)&&Y!==void 0&&!s.hasOwnProperty(Fe)&&Cc(e,t,Fe,void 0,s,Y);for(ee in s)Y=s[ee],X=a[ee],!s.hasOwnProperty(ee)||Y===X||Y===void 0&&X===void 0||Cc(e,t,ee,Y,s,X);return}}for(var P in a)Y=a[P],a.hasOwnProperty(P)&&Y!=null&&!s.hasOwnProperty(P)&&Ke(e,t,P,null,s,Y);for(ne in s)Y=s[ne],X=a[ne],!s.hasOwnProperty(ne)||Y===X||Y==null&&X==null||Ke(e,t,ne,Y,s,X)}var Ec=null,kc=null;function Zl(e){return e.nodeType===9?e:e.ownerDocument}function Vm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Gm(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 Tc(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 Ac=null;function I0(){var e=window.event;return e&&e.type==="popstate"?e===Ac?!1:(Ac=e,!0):(Ac=null,!1)}var Km=typeof setTimeout=="function"?setTimeout:void 0,Y0=typeof clearTimeout=="function"?clearTimeout:void 0,Fm=typeof Promise=="function"?Promise:void 0,X0=typeof queueMicrotask=="function"?queueMicrotask:typeof Fm<"u"?function(e){return Fm.resolve(null).then(e).catch(Q0)}:Km;function Q0(e){setTimeout(function(){throw e})}function ur(e){return e==="head"}function $m(e,t){var a=t,s=0,c=0;do{var f=a.nextSibling;if(e.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(0<s&&8>s){a=s;var x=e.ownerDocument;if(a&1&&En(x.documentElement),a&2&&En(x.body),a&4)for(a=x.head,En(a),x=a.firstChild;x;){var v=x.nextSibling,D=x.nodeName;x[Bs]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&x.rel.toLowerCase()==="stylesheet"||a.removeChild(x),x=v}}if(c===0){e.removeChild(f),Un(t);return}c--}else a==="$"||a==="$?"||a==="$!"?c++:s=a.charCodeAt(0)-48;else s=0;a=f}while(a);Un(t)}function Rc(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":Rc(a),zo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function J0(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Bs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=ca(e.nextSibling),e===null)break}return null}function Z0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ca(e.nextSibling),e===null))return null;return e}function Mc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function W0(e,t){var a=e.ownerDocument;if(e.data!=="$?"||a.readyState==="complete")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function ca(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 Oc=null;function Im(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 Ym(e,t,a){switch(t=Zl(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function En(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zo(e)}var ra=new Map,Xm=new Set;function Wl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pa=E.d;E.d={f:ex,r:tx,D:ax,C:rx,L:sx,m:nx,X:ox,S:lx,M:ix};function ex(){var e=Pa.f(),t=Kl();return e||t}function tx(e){var t=Fr(e);t!==null&&t.tag===5&&t.type==="form"?pf(t):Pa.r(e)}var Cs=typeof document>"u"?null:document;function Qm(e,t,a){var s=Cs;if(s&&typeof t=="string"&&t){var c=Qt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Xm.has(c)||(Xm.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),wt(t,"link",e),mt(t),s.head.appendChild(t)))}}function ax(e){Pa.D(e),Qm("dns-prefetch",e,null)}function rx(e,t){Pa.C(e,t),Qm("preconnect",e,t)}function sx(e,t,a){Pa.L(e,t,a);var s=Cs;if(s&&e&&t){var c='link[rel="preload"][as="'+Qt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+Qt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+Qt(a.imageSizes)+'"]')):c+='[href="'+Qt(e)+'"]';var f=c;switch(t){case"style":f=Es(e);break;case"script":f=ks(e)}ra.has(f)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ra.set(f,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(kn(f))||t==="script"&&s.querySelector(Tn(f))||(t=s.createElement("link"),wt(t,"link",e),mt(t),s.head.appendChild(t)))}}function nx(e,t){Pa.m(e,t);var a=Cs;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Qt(s)+'"][href="'+Qt(e)+'"]',f=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=ks(e)}if(!ra.has(f)&&(e=y({rel:"modulepreload",href:e},t),ra.set(f,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Tn(f)))return}s=a.createElement("link"),wt(s,"link",e),mt(s),a.head.appendChild(s)}}}function lx(e,t,a){Pa.S(e,t,a);var s=Cs;if(s&&e){var c=$r(s).hoistableStyles,f=Es(e);t=t||"default";var x=c.get(f);if(!x){var v={loading:0,preload:null};if(x=s.querySelector(kn(f)))v.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ra.get(f))&&Dc(e,a);var D=x=s.createElement("link");mt(D),wt(D,"link",e),D._p=new Promise(function(K,ee){D.onload=K,D.onerror=ee}),D.addEventListener("load",function(){v.loading|=1}),D.addEventListener("error",function(){v.loading|=2}),v.loading|=4,eo(x,t,s)}x={type:"stylesheet",instance:x,count:1,state:v},c.set(f,x)}}}function ox(e,t){Pa.X(e,t);var a=Cs;if(a&&e){var s=$r(a).hoistableScripts,c=ks(e),f=s.get(c);f||(f=a.querySelector(Tn(c)),f||(e=y({src:e,async:!0},t),(t=ra.get(c))&&Uc(e,t),f=a.createElement("script"),mt(f),wt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(c,f))}}function ix(e,t){Pa.M(e,t);var a=Cs;if(a&&e){var s=$r(a).hoistableScripts,c=ks(e),f=s.get(c);f||(f=a.querySelector(Tn(c)),f||(e=y({src:e,async:!0,type:"module"},t),(t=ra.get(c))&&Uc(e,t),f=a.createElement("script"),mt(f),wt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(c,f))}}function Jm(e,t,a,s){var c=(c=J.current)?Wl(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Es(a.href),a=$r(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Es(a.href);var f=$r(c).hoistableStyles,x=f.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=c.querySelector(kn(e)))&&!f._p&&(x.instance=f,x.state.loading=5),ra.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},ra.set(e,a),f||cx(c,e,a,x.state))),t&&s===null)throw Error(i(528,""));return x}if(t&&s!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ks(a),a=$r(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Es(e){return'href="'+Qt(e)+'"'}function kn(e){return'link[rel="stylesheet"]['+e+"]"}function Zm(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function cx(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),wt(t,"link",a),mt(t),e.head.appendChild(t))}function ks(e){return'[src="'+Qt(e)+'"]'}function Tn(e){return"script[async]"+e}function Wm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Qt(a.href)+'"]');if(s)return t.instance=s,mt(s),s;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),mt(s),wt(s,"style",c),eo(s,a.precedence,e),t.instance=s;case"stylesheet":c=Es(a.href);var f=e.querySelector(kn(c));if(f)return t.state.loading|=4,t.instance=f,mt(f),f;s=Zm(a),(c=ra.get(c))&&Dc(s,c),f=(e.ownerDocument||e).createElement("link"),mt(f);var x=f;return x._p=new Promise(function(v,D){x.onload=v,x.onerror=D}),wt(f,"link",s),t.state.loading|=4,eo(f,a.precedence,e),t.instance=f;case"script":return f=ks(a.src),(c=e.querySelector(Tn(f)))?(t.instance=c,mt(c),c):(s=a,(c=ra.get(f))&&(s=y({},a),Uc(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),mt(c),wt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,eo(s,a.precedence,e));return t.instance}function eo(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,f=c,x=0;x<s.length;x++){var v=s[x];if(v.dataset.precedence===t)f=v;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Dc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var to=null;function eh(e,t,a){if(to===null){var s=new Map,c=to=new Map;c.set(a,s)}else c=to,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var f=a[c];if(!(f[Bs]||f[ct]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(t)||"";x=e+x;var v=s.get(x);v?v.push(f):s.set(x,[f])}}return s}function th(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function ux(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 ah(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var An=null;function dx(){}function fx(e,t,a){if(An===null)throw Error(i(475));var s=An;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var c=Es(a.href),f=e.querySelector(kn(c));if(f){e=f._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=ao.bind(s),e.then(s,s)),t.state.loading|=4,t.instance=f,mt(f);return}f=e.ownerDocument||e,a=Zm(a),(c=ra.get(c))&&Dc(a,c),f=f.createElement("link"),mt(f);var x=f;x._p=new Promise(function(v,D){x.onload=v,x.onerror=D}),wt(f,"link",a),t.instance=f}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(s.count++,t=ao.bind(s),e.addEventListener("load",t),e.addEventListener("error",t))}}function mx(){if(An===null)throw Error(i(475));var e=An;return e.stylesheets&&e.count===0&&zc(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function ao(){if(this.count--,this.count===0){if(this.stylesheets)zc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ro=null;function zc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ro=new Map,t.forEach(hx,e),ro=null,ao.call(e))}function hx(e,t){if(!(t.state.loading&4)){var a=ro.get(e);if(a)var s=a.get(null);else{a=new Map,ro.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var x=c[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),s=x)}s&&a.set(null,s)}c=t.instance,x=c.getAttribute("data-precedence"),f=a.get(x)||s,f===s&&a.set(null,c),a.set(x,c),this.count++,s=ao.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Rn={$$typeof:O,Provider:null,Consumer:null,_currentValue:_,_currentValue2:_,_threadCount:0};function px(e,t,a,s,c,f,x,v){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=Yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yt(0),this.hiddenUpdates=Yt(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=v,this.incompleteTransitions=new Map}function rh(e,t,a,s,c,f,x,v,D,K,ee,ne){return e=new px(e,t,a,x,v,D,K,ne),t=1,f===!0&&(t|=24),f=qt(3,null,null,t),e.current=f,f.stateNode=e,t=gi(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:s,isDehydrated:a,cache:t},vi(f),e}function sh(e){return e?(e=ss,e):ss}function nh(e,t,a,s,c,f){c=sh(c),s.context===null?s.context=c:s.pendingContext=c,s=Ja(t),s.payload={element:a},f=f===void 0?null:f,f!==null&&(s.callback=f),a=Za(e,s,t),a!==null&&($t(a,e,t),nn(a,e,t))}function lh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Lc(e,t){lh(e,t),(e=e.alternate)&&lh(e,t)}function oh(e){if(e.tag===13){var t=rs(e,67108864);t!==null&&$t(t,e,67108864),Lc(e,67108864)}}var so=!0;function gx(e,t,a,s){var c=w.T;w.T=null;var f=E.p;try{E.p=2,_c(e,t,a,s)}finally{E.p=f,w.T=c}}function xx(e,t,a,s){var c=w.T;w.T=null;var f=E.p;try{E.p=8,_c(e,t,a,s)}finally{E.p=f,w.T=c}}function _c(e,t,a,s){if(so){var c=Pc(s);if(c===null)Sc(e,t,s,no,a),ch(e,s);else if(bx(c,e,t,a,s))s.stopPropagation();else if(ch(e,s),t&4&&-1<yx.indexOf(e)){for(;c!==null;){var f=Fr(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=Nt(f.pendingLanes);if(x!==0){var v=f;for(v.pendingLanes|=2,v.entangledLanes|=2;x;){var D=1<<31-nt(x);v.entanglements[1]|=D,x&=~D}ba(f),(qe&6)===0&&(Vl=De()+500,Nn(0))}}break;case 13:v=rs(f,2),v!==null&&$t(v,f,2),Kl(),Lc(f,2)}if(f=Pc(s),f===null&&Sc(e,t,s,no,a),f===c)break;c=f}c!==null&&s.stopPropagation()}else Sc(e,t,s,null,a)}}function Pc(e){return e=Go(e),Hc(e)}var no=null;function Hc(e){if(no=null,e=Kr(e),e!==null){var t=d(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 no=e,null}function ih(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(jt()){case da:return 2;case fa:return 8;case It:case ma:return 32;case xr:return 268435456;default:return 32}default:return 32}}var Bc=!1,dr=null,fr=null,mr=null,Mn=new Map,On=new Map,hr=[],yx="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 ch(e,t){switch(e){case"focusin":case"focusout":dr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":mr=null;break;case"pointerover":case"pointerout":Mn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":On.delete(t.pointerId)}}function Dn(e,t,a,s,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Fr(t),t!==null&&oh(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function bx(e,t,a,s,c){switch(t){case"focusin":return dr=Dn(dr,e,t,a,s,c),!0;case"dragenter":return fr=Dn(fr,e,t,a,s,c),!0;case"mouseover":return mr=Dn(mr,e,t,a,s,c),!0;case"pointerover":var f=c.pointerId;return Mn.set(f,Dn(Mn.get(f)||null,e,t,a,s,c)),!0;case"gotpointercapture":return f=c.pointerId,On.set(f,Dn(On.get(f)||null,e,t,a,s,c)),!0}return!1}function uh(e){var t=Kr(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,el(e.priority,function(){if(a.tag===13){var s=Ft();s=Tt(s);var c=rs(a,s);c!==null&&$t(c,a,s),Lc(a,s)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function lo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Pc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Vo=s,a.target.dispatchEvent(s),Vo=null}else return t=Fr(a),t!==null&&oh(t),e.blockedOn=a,!1;t.shift()}return!0}function dh(e,t,a){lo(e)&&a.delete(t)}function vx(){Bc=!1,dr!==null&&lo(dr)&&(dr=null),fr!==null&&lo(fr)&&(fr=null),mr!==null&&lo(mr)&&(mr=null),Mn.forEach(dh),On.forEach(dh)}function oo(e,t){e.blockedOn===t&&(e.blockedOn=null,Bc||(Bc=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,vx)))}var io=null;function fh(e){io!==e&&(io=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){io===e&&(io=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(Hc(s||a)===null)continue;break}var f=Fr(a);f!==null&&(e.splice(t,3),t-=3,Hi(f,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function Un(e){function t(D){return oo(D,e)}dr!==null&&oo(dr,e),fr!==null&&oo(fr,e),mr!==null&&oo(mr,e),Mn.forEach(t),On.forEach(t);for(var a=0;a<hr.length;a++){var s=hr[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<hr.length&&(a=hr[0],a.blockedOn===null);)uh(a),a.blockedOn===null&&hr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],f=a[s+1],x=c[yt]||null;if(typeof f=="function")x||fh(a);else if(x){var v=null;if(f&&f.hasAttribute("formAction")){if(c=f,x=f[yt]||null)v=x.formAction;else if(Hc(c)!==null)continue}else v=x.action;typeof v=="function"?a[s+1]=v:(a.splice(s,3),s-=3),fh(a)}}}function qc(e){this._internalRoot=e}co.prototype.render=qc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,s=Ft();nh(a,s,e,t,null,null)},co.prototype.unmount=qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;nh(e.current,2,null,e,null,null),Kl(),t[Na]=null}};function co(e){this._internalRoot=e}co.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hs();e={blockedOn:null,target:e,priority:t};for(var a=0;a<hr.length&&t!==0&&t<hr[a].priority;a++);hr.splice(a,0,e),a===0&&uh(e)}};var mh=l.version;if(mh!=="19.1.1")throw Error(i(527,mh,"19.1.1"));E.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=g(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var wx={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uo.isDisabled&&uo.supportsFiber)try{_t=uo.inject(wx),it=uo}catch{}}return Ln.createRoot=function(e,t){if(!u(e))throw Error(i(299));var a=!1,s="",c=Af,f=Rf,x=Mf,v=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(v=t.unstable_transitionCallbacks)),t=rh(e,1,!1,null,null,a,s,c,f,x,v,null),e[Na]=t.current,Nc(e),new qc(t)},Ln.hydrateRoot=function(e,t,a){if(!u(e))throw Error(i(299));var s=!1,c="",f=Af,x=Rf,v=Mf,D=null,K=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(D=a.unstable_transitionCallbacks),a.formState!==void 0&&(K=a.formState)),t=rh(e,1,!0,t,a??null,s,c,f,x,v,D,K),t.context=sh(null),a=t.current,s=Ft(),s=Tt(s),c=Ja(s),c.callback=null,Za(a,c,s),a=s,t.current.lanes=a,Ht(t,a),ba(t),e[Na]=t.current,Nc(e),new co(t)},Ln.version="19.1.1",Ln}var Nh;function Mx(){if(Nh)return Kc.exports;Nh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Kc.exports=Rx(),Kc.exports}var Ox=Mx();const Sh=lp(Ox);/**
50
+ * react-router v7.8.2
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var Ch="popstate";function Dx(n={}){function l(i,u){let{pathname:d,search:m,hash:p}=i.location;return Wc("",{pathname:d,search:m,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function o(i,u){return typeof u=="string"?u:Gn(u)}return zx(l,o,null,n)}function Je(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function sa(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Ux(){return Math.random().toString(36).substring(2,10)}function Eh(n,l){return{usr:n.state,key:n.key,idx:l}}function Wc(n,l,o=null,i){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Ds(l):l,state:o,key:l&&l.key||i||Ux()}}function Gn({pathname:n="/",search:l="",hash:o=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(n+=o.charAt(0)==="#"?o:"#"+o),n}function Ds(n){let l={};if(n){let o=n.indexOf("#");o>=0&&(l.hash=n.substring(o),n=n.substring(0,o));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function zx(n,l,o,i={}){let{window:u=document.defaultView,v5Compat:d=!1}=i,m=u.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 N(){p="POP";let R=y(),A=R==null?null:R-h;h=R,g&&g({action:p,location:T.location,delta:A})}function C(R,A){p="PUSH";let j=Wc(T.location,R,A);h=y()+1;let O=Eh(j,h),F=T.createHref(j);try{m.pushState(O,"",F)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;u.location.assign(F)}d&&g&&g({action:p,location:T.location,delta:1})}function k(R,A){p="REPLACE";let j=Wc(T.location,R,A);h=y();let O=Eh(j,h),F=T.createHref(j);m.replaceState(O,"",F),d&&g&&g({action:p,location:T.location,delta:0})}function S(R){return Lx(R)}let T={get action(){return p},get location(){return n(u,m)},listen(R){if(g)throw new Error("A history only accepts one active listener");return u.addEventListener(Ch,N),g=R,()=>{u.removeEventListener(Ch,N),g=null}},createHref(R){return l(u,R)},createURL:S,encodeLocation(R){let A=S(R);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:C,replace:k,go(R){return m.go(R)}};return T}function Lx(n,l=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),Je(o,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:Gn(n);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=o+i),new URL(i,o)}function op(n,l,o="/"){return _x(n,l,o,!1)}function _x(n,l,o,i){let u=typeof l=="string"?Ds(l):l,d=Va(u.pathname||"/",o);if(d==null)return null;let m=ip(n);Px(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Xx(d);p=Ix(m[g],h,i)}return p}function ip(n,l=[],o=[],i="",u=!1){let d=(m,p,g=u,h)=>{let y={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&g)return;Je(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let N=Ba([i,y.relativePath]),C=o.concat(y);m.children&&m.children.length>0&&(Je(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${N}".`),ip(m.children,l,C,N,g)),!(m.path==null&&!m.index)&&l.push({path:N,score:Fx(N,m.index),routesMeta:C})};return n.forEach((m,p)=>{var g;if(m.path===""||!((g=m.path)!=null&&g.includes("?")))d(m,p);else for(let h of cp(m.path))d(m,p,!0,h)}),l}function cp(n){let l=n.split("/");if(l.length===0)return[];let[o,...i]=l,u=o.endsWith("?"),d=o.replace(/\?$/,"");if(i.length===0)return u?[d,""]:[d];let m=cp(i.join("/")),p=[];return p.push(...m.map(g=>g===""?d:[d,g].join("/"))),u&&p.push(...m),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function Px(n){n.sort((l,o)=>l.score!==o.score?o.score-l.score:$x(l.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var Hx=/^:[\w-]+$/,Bx=3,qx=2,Vx=1,Gx=10,Kx=-2,kh=n=>n==="*";function Fx(n,l){let o=n.split("/"),i=o.length;return o.some(kh)&&(i+=Kx),l&&(i+=qx),o.filter(u=>!kh(u)).reduce((u,d)=>u+(Hx.test(d)?Bx:d===""?Vx:Gx),i)}function $x(n,l){return n.length===l.length&&n.slice(0,-1).every((i,u)=>i===l[u])?n[n.length-1]-l[l.length-1]:0}function Ix(n,l,o=!1){let{routesMeta:i}=n,u={},d="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,y=d==="/"?l:l.slice(d.length)||"/",N=wo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),C=g.route;if(!N&&h&&o&&!i[i.length-1].route.index&&(N=wo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!N)return null;Object.assign(u,N.params),m.push({params:u,pathname:Ba([d,N.pathname]),pathnameBase:Wx(Ba([d,N.pathnameBase])),route:C}),N.pathnameBase!=="/"&&(d=Ba([d,N.pathnameBase]))}return m}function wo(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[o,i]=Yx(n.path,n.caseSensitive,n.end),u=l.match(o);if(!u)return null;let d=u[0],m=d.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:N},C)=>{if(y==="*"){let S=p[C]||"";m=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const k=p[C];return N&&!k?h[y]=void 0:h[y]=(k||"").replace(/%2F/g,"/"),h},{}),pathname:d,pathnameBase:m,pattern:n}}function Yx(n,l=!1,o=!0){sa(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],u="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g)=>(i.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),u+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?u+="\\/*$":n!==""&&n!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),i]}function Xx(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return sa(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function Va(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let o=l.endsWith("/")?l.length-1:l.length,i=n.charAt(o);return i&&i!=="/"?null:n.slice(o)||"/"}function Qx(n,l="/"){let{pathname:o,search:i="",hash:u=""}=typeof n=="string"?Ds(n):n;return{pathname:o?o.startsWith("/")?o:Jx(o,l):l,search:ey(i),hash:ty(u)}}function Jx(n,l){let o=l.replace(/\/+$/,"").split("/");return n.split("/").forEach(u=>{u===".."?o.length>1&&o.pop():u!=="."&&o.push(u)}),o.length>1?o.join("/"):"/"}function Yc(n,l,o,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zx(n){return n.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function fu(n){let l=Zx(n);return l.map((o,i)=>i===l.length-1?o.pathname:o.pathnameBase)}function mu(n,l,o,i=!1){let u;typeof n=="string"?u=Ds(n):(u={...n},Je(!u.pathname||!u.pathname.includes("?"),Yc("?","pathname","search",u)),Je(!u.pathname||!u.pathname.includes("#"),Yc("#","pathname","hash",u)),Je(!u.search||!u.search.includes("#"),Yc("#","search","hash",u)));let d=n===""||u.pathname==="",m=d?"/":u.pathname,p;if(m==null)p=o;else{let N=l.length-1;if(!i&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),N-=1;u.pathname=C.join("/")}p=N>=0?l[N]:"/"}let g=Qx(u,p),h=m&&m!=="/"&&m.endsWith("/"),y=(d||m===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var Ba=n=>n.join("/").replace(/\/\/+/g,"/"),Wx=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),ey=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,ty=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function ay(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}var up=["POST","PUT","PATCH","DELETE"];new Set(up);var ry=["GET",...up];new Set(ry);var Us=b.createContext(null);Us.displayName="DataRouter";var To=b.createContext(null);To.displayName="DataRouterState";b.createContext(!1);var dp=b.createContext({isTransitioning:!1});dp.displayName="ViewTransition";var sy=b.createContext(new Map);sy.displayName="Fetchers";var ny=b.createContext(null);ny.displayName="Await";var ua=b.createContext(null);ua.displayName="Navigation";var Yn=b.createContext(null);Yn.displayName="Location";var na=b.createContext({outlet:null,matches:[],isDataRoute:!1});na.displayName="Route";var hu=b.createContext(null);hu.displayName="RouteError";function ly(n,{relative:l}={}){Je(zs(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=b.useContext(ua),{hash:u,pathname:d,search:m}=Xn(n,{relative:l}),p=d;return o!=="/"&&(p=d==="/"?o:Ba([o,d])),i.createHref({pathname:p,search:m,hash:u})}function zs(){return b.useContext(Yn)!=null}function Ga(){return Je(zs(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Yn).location}var fp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function mp(n){b.useContext(ua).static||b.useLayoutEffect(n)}function Ka(){let{isDataRoute:n}=b.useContext(na);return n?wy():oy()}function oy(){Je(zs(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Us),{basename:l,navigator:o}=b.useContext(ua),{matches:i}=b.useContext(na),{pathname:u}=Ga(),d=JSON.stringify(fu(i)),m=b.useRef(!1);return mp(()=>{m.current=!0}),b.useCallback((g,h={})=>{if(sa(m.current,fp),!m.current)return;if(typeof g=="number"){o.go(g);return}let y=mu(g,JSON.parse(d),u,h.relative==="path");n==null&&l!=="/"&&(y.pathname=y.pathname==="/"?l:Ba([l,y.pathname])),(h.replace?o.replace:o.push)(y,h.state,h)},[l,o,d,u,n])}var iy=b.createContext(null);function cy(n){let l=b.useContext(na).outlet;return l&&b.createElement(iy.Provider,{value:n},l)}function hp(){let{matches:n}=b.useContext(na),l=n[n.length-1];return l?l.params:{}}function Xn(n,{relative:l}={}){let{matches:o}=b.useContext(na),{pathname:i}=Ga(),u=JSON.stringify(fu(o));return b.useMemo(()=>mu(n,JSON.parse(u),i,l==="path"),[n,u,i,l])}function uy(n,l){return pp(n,l)}function pp(n,l,o,i,u){var j;Je(zs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=b.useContext(ua),{matches:m}=b.useContext(na),p=m[m.length-1],g=p?p.params:{},h=p?p.pathname:"/",y=p?p.pathnameBase:"/",N=p&&p.route;{let O=N&&N.path||"";gp(h,!N||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${O}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let C=Ga(),k;if(l){let O=typeof l=="string"?Ds(l):l;Je(y==="/"||((j=O.pathname)==null?void 0:j.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${O.pathname}" was given in the \`location\` prop.`),k=O}else k=C;let S=k.pathname||"/",T=S;if(y!=="/"){let O=y.replace(/^\//,"").split("/");T="/"+S.replace(/^\//,"").split("/").slice(O.length).join("/")}let R=op(n,{pathname:T});sa(N||R!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),sa(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.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 A=py(R&&R.map(O=>Object.assign({},O,{params:Object.assign({},g,O.params),pathname:Ba([y,d.encodeLocation?d.encodeLocation(O.pathname).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?y:Ba([y,d.encodeLocation?d.encodeLocation(O.pathnameBase).pathname:O.pathnameBase])})),m,o,i,u);return l&&A?b.createElement(Yn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...k},navigationType:"POP"}},A):A}function dy(){let n=vy(),l=ay(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),o=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},d={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:d},"ErrorBoundary")," or"," ",b.createElement("code",{style:d},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},l),o?b.createElement("pre",{style:u},o):null,m)}var fy=b.createElement(dy,null),my=class extends b.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.unstable_onError?this.props.unstable_onError(n,l):console.error("React Router caught the following error during render",n)}render(){return this.state.error!==void 0?b.createElement(na.Provider,{value:this.props.routeContext},b.createElement(hu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function hy({routeContext:n,match:l,children:o}){let i=b.useContext(Us);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),b.createElement(na.Provider,{value:n},o)}function py(n,l=[],o=null,i=null,u=null){if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(l.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let d=n,m=o==null?void 0:o.errors;if(m!=null){let h=d.findIndex(y=>y.route.id&&(m==null?void 0:m[y.route.id])!==void 0);Je(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),d=d.slice(0,Math.min(d.length,h+1))}let p=!1,g=-1;if(o)for(let h=0;h<d.length;h++){let y=d[h];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(g=h),y.route.id){let{loaderData:N,errors:C}=o,k=y.route.loader&&!N.hasOwnProperty(y.route.id)&&(!C||C[y.route.id]===void 0);if(y.route.lazy||k){p=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}return d.reduceRight((h,y,N)=>{let C,k=!1,S=null,T=null;o&&(C=m&&y.route.id?m[y.route.id]:void 0,S=y.route.errorElement||fy,p&&(g<0&&N===0?(gp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,T=null):g===N&&(k=!0,T=y.route.hydrateFallbackElement||null)));let R=l.concat(d.slice(0,N+1)),A=()=>{let j;return C?j=S:k?j=T:y.route.Component?j=b.createElement(y.route.Component,null):y.route.element?j=y.route.element:j=h,b.createElement(hy,{match:y,routeContext:{outlet:h,matches:R,isDataRoute:o!=null},children:j})};return o&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?b.createElement(my,{location:o.location,revalidation:o.revalidation,component:S,error:C,children:A(),routeContext:{outlet:null,matches:R,isDataRoute:!0},unstable_onError:i}):A()},null)}function pu(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gy(n){let l=b.useContext(Us);return Je(l,pu(n)),l}function xy(n){let l=b.useContext(To);return Je(l,pu(n)),l}function yy(n){let l=b.useContext(na);return Je(l,pu(n)),l}function gu(n){let l=yy(n),o=l.matches[l.matches.length-1];return Je(o.route.id,`${n} can only be used on routes that contain a unique "id"`),o.route.id}function by(){return gu("useRouteId")}function vy(){var i;let n=b.useContext(hu),l=xy("useRouteError"),o=gu("useRouteError");return n!==void 0?n:(i=l.errors)==null?void 0:i[o]}function wy(){let{router:n}=gy("useNavigate"),l=gu("useNavigate"),o=b.useRef(!1);return mp(()=>{o.current=!0}),b.useCallback(async(u,d={})=>{sa(o.current,fp),o.current&&(typeof u=="number"?n.navigate(u):await n.navigate(u,{fromRouteId:l,...d}))},[n,l])}var Th={};function gp(n,l,o){!l&&!Th[n]&&(Th[n]=!0,sa(!1,o))}b.memo(jy);function jy({routes:n,future:l,state:o,unstable_onError:i}){return pp(n,void 0,o,i,l)}function jo({to:n,replace:l,state:o,relative:i}){Je(zs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=b.useContext(ua);sa(!u,"<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:d}=b.useContext(na),{pathname:m}=Ga(),p=Ka(),g=mu(n,fu(d),m,i==="path"),h=JSON.stringify(g);return b.useEffect(()=>{p(JSON.parse(h),{replace:l,state:o,relative:i})},[p,h,i,l,o]),null}function xp(n){return cy(n.context)}function Rt(n){Je(!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 Ny({basename:n="/",children:l=null,location:o,navigationType:i="POP",navigator:u,static:d=!1}){Je(!zs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=n.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:m,navigator:u,static:d,future:{}}),[m,u,d]);typeof o=="string"&&(o=Ds(o));let{pathname:g="/",search:h="",hash:y="",state:N=null,key:C="default"}=o,k=b.useMemo(()=>{let S=Va(g,m);return S==null?null:{location:{pathname:S,search:h,hash:y,state:N,key:C},navigationType:i}},[m,g,h,y,N,C,i]);return sa(k!=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.`),k==null?null:b.createElement(ua.Provider,{value:p},b.createElement(Yn.Provider,{children:l,value:k}))}function Sy({children:n,location:l}){return uy(eu(n),l)}function eu(n,l=[]){let o=[];return b.Children.forEach(n,(i,u)=>{if(!b.isValidElement(i))return;let d=[...l,u];if(i.type===b.Fragment){o.push.apply(o,eu(i.props.children,d));return}Je(i.type===Rt,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Je(!i.props.index||!i.props.children,"An index route cannot have child routes.");let m={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(m.children=eu(i.props.children,d)),o.push(m)}),o}var yo="get",bo="application/x-www-form-urlencoded";function Ao(n){return n!=null&&typeof n.tagName=="string"}function Cy(n){return Ao(n)&&n.tagName.toLowerCase()==="button"}function Ey(n){return Ao(n)&&n.tagName.toLowerCase()==="form"}function ky(n){return Ao(n)&&n.tagName.toLowerCase()==="input"}function Ty(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Ay(n,l){return n.button===0&&(!l||l==="_self")&&!Ty(n)}function tu(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,o)=>{let i=n[o];return l.concat(Array.isArray(i)?i.map(u=>[o,u]):[[o,i]])},[]))}function Ry(n,l){let o=tu(n);return l&&l.forEach((i,u)=>{o.has(u)||l.getAll(u).forEach(d=>{o.append(u,d)})}),o}var fo=null;function My(){if(fo===null)try{new FormData(document.createElement("form"),0),fo=!1}catch{fo=!0}return fo}var Oy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xc(n){return n!=null&&!Oy.has(n)?(sa(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${bo}"`),null):n}function Dy(n,l){let o,i,u,d,m;if(Ey(n)){let p=n.getAttribute("action");i=p?Va(p,l):null,o=n.getAttribute("method")||yo,u=Xc(n.getAttribute("enctype"))||bo,d=new FormData(n)}else if(Cy(n)||ky(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(i=g?Va(g,l):null,o=n.getAttribute("formmethod")||p.getAttribute("method")||yo,u=Xc(n.getAttribute("formenctype"))||Xc(p.getAttribute("enctype"))||bo,d=new FormData(p,n),!My()){let{name:h,type:y,value:N}=n;if(y==="image"){let C=h?`${h}.`:"";d.append(`${C}x`,"0"),d.append(`${C}y`,"0")}else h&&d.append(h,N)}}else{if(Ao(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=yo,i=null,u=bo,m=n}return d&&u==="text/plain"&&(m=d,d=void 0),{action:i,method:o.toLowerCase(),encType:u,formData:d,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xu(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Uy(n,l,o){let i=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i.pathname==="/"?i.pathname=`_root.${o}`:l&&Va(i.pathname,l)==="/"?i.pathname=`${l.replace(/\/$/,"")}/_root.${o}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${o}`,i}async function zy(n,l){if(n.id in l)return l[n.id];try{let o=await import(n.module);return l[n.id]=o,o}catch(o){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ly(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function _y(n,l,o){let i=await Promise.all(n.map(async u=>{let d=l.routes[u.route.id];if(d){let m=await zy(d,o);return m.links?m.links():[]}return[]}));return qy(i.flat(1).filter(Ly).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Ah(n,l,o,i,u,d){let m=(g,h)=>o[h]?g.route.id!==o[h].route.id:!0,p=(g,h)=>{var y;return o[h].pathname!==g.pathname||((y=o[h].route.path)==null?void 0:y.endsWith("*"))&&o[h].params["*"]!==g.params["*"]};return d==="assets"?l.filter((g,h)=>m(g,h)||p(g,h)):d==="data"?l.filter((g,h)=>{var N;let y=i.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let C=g.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((N=o[0])==null?void 0:N.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function Py(n,l,{includeHydrateFallback:o}={}){return Hy(n.map(i=>{let u=l.routes[i.route.id];if(!u)return[];let d=[u.module];return u.clientActionModule&&(d=d.concat(u.clientActionModule)),u.clientLoaderModule&&(d=d.concat(u.clientLoaderModule)),o&&u.hydrateFallbackModule&&(d=d.concat(u.hydrateFallbackModule)),u.imports&&(d=d.concat(u.imports)),d}).flat(1))}function Hy(n){return[...new Set(n)]}function By(n){let l={},o=Object.keys(n).sort();for(let i of o)l[i]=n[i];return l}function qy(n,l){let o=new Set;return new Set(l),n.reduce((i,u)=>{let d=JSON.stringify(By(u));return o.has(d)||(o.add(d),i.push({key:d,link:u})),i},[])}function yp(){let n=b.useContext(Us);return xu(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Vy(){let n=b.useContext(To);return xu(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var yu=b.createContext(void 0);yu.displayName="FrameworkContext";function bp(){let n=b.useContext(yu);return xu(n,"You must render this element inside a <HydratedRouter> element"),n}function Gy(n,l){let o=b.useContext(yu),[i,u]=b.useState(!1),[d,m]=b.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:N}=l,C=b.useRef(null);b.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let T=A=>{A.forEach(j=>{m(j.isIntersecting)})},R=new IntersectionObserver(T,{threshold:.5});return C.current&&R.observe(C.current),()=>{R.disconnect()}}},[n]),b.useEffect(()=>{if(i){let T=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(T)}}},[i]);let k=()=>{u(!0)},S=()=>{u(!1),m(!1)};return o?n!=="intent"?[d,C,{}]:[d,C,{onFocus:_n(p,k),onBlur:_n(g,S),onMouseEnter:_n(h,k),onMouseLeave:_n(y,S),onTouchStart:_n(N,k)}]:[!1,C,{}]}function _n(n,l){return o=>{n&&n(o),o.defaultPrevented||l(o)}}function Ky({page:n,...l}){let{router:o}=yp(),i=b.useMemo(()=>op(o.routes,n,o.basename),[o.routes,n,o.basename]);return i?b.createElement($y,{page:n,matches:i,...l}):null}function Fy(n){let{manifest:l,routeModules:o}=bp(),[i,u]=b.useState([]);return b.useEffect(()=>{let d=!1;return _y(n,l,o).then(m=>{d||u(m)}),()=>{d=!0}},[n,l,o]),i}function $y({page:n,matches:l,...o}){let i=Ga(),{manifest:u,routeModules:d}=bp(),{basename:m}=yp(),{loaderData:p,matches:g}=Vy(),h=b.useMemo(()=>Ah(n,l,g,u,i,"data"),[n,l,g,u,i]),y=b.useMemo(()=>Ah(n,l,g,u,i,"assets"),[n,l,g,u,i]),N=b.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let S=new Set,T=!1;if(l.forEach(A=>{var O;let j=u.routes[A.route.id];!j||!j.hasLoader||(!h.some(F=>F.route.id===A.route.id)&&A.route.id in p&&((O=d[A.route.id])!=null&&O.shouldRevalidate)||j.hasClientLoader?T=!0:S.add(A.route.id))}),S.size===0)return[];let R=Uy(n,m,"data");return T&&S.size>0&&R.searchParams.set("_routes",l.filter(A=>S.has(A.route.id)).map(A=>A.route.id).join(",")),[R.pathname+R.search]},[m,p,i,u,h,l,n,d]),C=b.useMemo(()=>Py(y,u),[y,u]),k=Fy(y);return b.createElement(b.Fragment,null,N.map(S=>b.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...o})),C.map(S=>b.createElement("link",{key:S,rel:"modulepreload",href:S,...o})),k.map(({key:S,link:T})=>b.createElement("link",{key:S,nonce:o.nonce,...T})))}function Iy(...n){return l=>{n.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var vp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vp&&(window.__reactRouterVersion="7.8.2")}catch{}function Yy({basename:n,children:l,window:o}){let i=b.useRef();i.current==null&&(i.current=Dx({window:o,v5Compat:!0}));let u=i.current,[d,m]=b.useState({action:u.action,location:u.location}),p=b.useCallback(g=>{b.startTransition(()=>m(g))},[m]);return b.useLayoutEffect(()=>u.listen(p),[u,p]),b.createElement(Ny,{basename:n,children:l,location:d.location,navigationType:d.action,navigator:u})}var wp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jp=b.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:u,reloadDocument:d,replace:m,state:p,target:g,to:h,preventScrollReset:y,viewTransition:N,...C},k){let{basename:S}=b.useContext(ua),T=typeof h=="string"&&wp.test(h),R,A=!1;if(typeof h=="string"&&T&&(R=h,vp))try{let le=new URL(window.location.href),se=h.startsWith("//")?new URL(le.protocol+h):new URL(h),U=Va(se.pathname,S);se.origin===le.origin&&U!=null?h=U+se.search+se.hash:A=!0}catch{sa(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let j=ly(h,{relative:u}),[O,F,Z]=Gy(i,C),re=Jy(h,{replace:m,state:p,target:g,preventScrollReset:y,relative:u,viewTransition:N});function te(le){l&&l(le),le.defaultPrevented||re(le)}let I=b.createElement("a",{...C,...Z,href:R||j,onClick:A||d?l:te,ref:Iy(k,F),target:g,"data-discover":!T&&o==="render"?"true":void 0});return O&&!T?b.createElement(b.Fragment,null,I,b.createElement(Ky,{page:j})):I});jp.displayName="Link";var Np=b.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:u=!1,style:d,to:m,viewTransition:p,children:g,...h},y){let N=Xn(m,{relative:h.relative}),C=Ga(),k=b.useContext(To),{navigator:S,basename:T}=b.useContext(ua),R=k!=null&&rb(N)&&p===!0,A=S.encodeLocation?S.encodeLocation(N).pathname:N.pathname,j=C.pathname,O=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;o||(j=j.toLowerCase(),O=O?O.toLowerCase():null,A=A.toLowerCase()),O&&T&&(O=Va(O,T)||O);const F=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let Z=j===A||!u&&j.startsWith(A)&&j.charAt(F)==="/",re=O!=null&&(O===A||!u&&O.startsWith(A)&&O.charAt(A.length)==="/"),te={isActive:Z,isPending:re,isTransitioning:R},I=Z?l:void 0,le;typeof i=="function"?le=i(te):le=[i,Z?"active":null,re?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let se=typeof d=="function"?d(te):d;return b.createElement(jp,{...h,"aria-current":I,className:le,ref:y,style:se,to:m,viewTransition:p},typeof g=="function"?g(te):g)});Np.displayName="NavLink";var Xy=b.forwardRef(({discover:n="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:u,state:d,method:m=yo,action:p,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:N,...C},k)=>{let S=tb(),T=ab(p,{relative:h}),R=m.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&wp.test(p),j=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let F=O.nativeEvent.submitter,Z=(F==null?void 0:F.getAttribute("formmethod"))||m;S(F||O.currentTarget,{fetcherKey:l,method:Z,navigate:o,replace:u,state:d,relative:h,preventScrollReset:y,viewTransition:N})};return b.createElement("form",{ref:k,method:R,action:T,onSubmit:i?g:j,...C,"data-discover":!A&&n==="render"?"true":void 0})});Xy.displayName="Form";function Qy(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sp(n){let l=b.useContext(Us);return Je(l,Qy(n)),l}function Jy(n,{target:l,replace:o,state:i,preventScrollReset:u,relative:d,viewTransition:m}={}){let p=Ka(),g=Ga(),h=Xn(n,{relative:d});return b.useCallback(y=>{if(Ay(y,l)){y.preventDefault();let N=o!==void 0?o:Gn(g)===Gn(h);p(n,{replace:N,state:i,preventScrollReset:u,relative:d,viewTransition:m})}},[g,p,h,o,i,l,n,u,d,m])}function Zy(n){sa(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=b.useRef(tu(n)),o=b.useRef(!1),i=Ga(),u=b.useMemo(()=>Ry(i.search,o.current?null:l.current),[i.search]),d=Ka(),m=b.useCallback((p,g)=>{const h=tu(typeof p=="function"?p(new URLSearchParams(u)):p);o.current=!0,d("?"+h,g)},[d,u]);return[u,m]}var Wy=0,eb=()=>`__${String(++Wy)}__`;function tb(){let{router:n}=Sp("useSubmit"),{basename:l}=b.useContext(ua),o=by();return b.useCallback(async(i,u={})=>{let{action:d,method:m,encType:p,formData:g,body:h}=Dy(i,l);if(u.navigate===!1){let y=u.fetcherKey||eb();await n.fetch(y,o,u.action||d,{preventScrollReset:u.preventScrollReset,formData:g,body:h,formMethod:u.method||m,formEncType:u.encType||p,flushSync:u.flushSync})}else await n.navigate(u.action||d,{preventScrollReset:u.preventScrollReset,formData:g,body:h,formMethod:u.method||m,formEncType:u.encType||p,replace:u.replace,state:u.state,fromRouteId:o,flushSync:u.flushSync,viewTransition:u.viewTransition})},[n,l,o])}function ab(n,{relative:l}={}){let{basename:o}=b.useContext(ua),i=b.useContext(na);Je(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),d={...Xn(n||".",{relative:l})},m=Ga();if(n==null){d.search=m.search;let p=new URLSearchParams(d.search),g=p.getAll("index");if(g.some(y=>y==="")){p.delete("index"),g.filter(N=>N).forEach(N=>p.append("index",N));let y=p.toString();d.search=y?`?${y}`:""}}return(!n||n===".")&&u.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:Ba([o,d.pathname])),Gn(d)}function rb(n,{relative:l}={}){let o=b.useContext(dp);Je(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Sp("useViewTransitionState"),u=Xn(n,{relative:l});if(!o.isTransitioning)return!1;let d=Va(o.currentLocation.pathname,i)||o.currentLocation.pathname,m=Va(o.nextLocation.pathname,i)||o.nextLocation.pathname;return wo(u.pathname,m)!=null||wo(u.pathname,d)!=null}const sb=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},bu=()=>{const l=sb().basePath||"";return l&&!l.startsWith("/")?"/"+l:l},nb=()=>bu()+"/api",vu=n=>{const l=nb(),o=n.startsWith("/")?n:"/"+n;return l+o},lb=async()=>{try{const n=window.location.pathname,l=[n.replace(/\/[^/]*$/,"")+"/config","/config",...n.includes("/")?[n.split("/")[1]?`/${n.split("/")[1]}/config`:"/config"]:["/config"]];for(const o of l)try{const i=await fetch(o,{method:"GET",headers:{Accept:"application/json","Cache-Control":"no-cache"}});if(i.ok){const u=await i.json();if(u.success&&u.data)return u.data}}catch(i){console.debug(`Failed to load config from ${o}:`,i)}return console.warn("Could not load runtime config from server, using defaults"),{basePath:"",version:"dev",name:"mcphub"}}catch(n){return console.error("Error loading runtime config:",n),{basePath:"",version:"dev",name:"mcphub"}}},vo=[],ob=n=>{vo.push(n)},wu=async(n,l={})=>{let o=n.toString(),i={...l};try{for(const d of vo)if(d.request){const m=await d.request(o,i);o=m.url,i=m.config}let u=await fetch(o,i);for(const d of vo)d.response&&(u=await d.response(u));return u}catch(u){let d=u;for(const m of vo)m.error&&(d=await m.error(d));throw d}},Ro=async(n,l={})=>{try{const o=vu(n),i=await wu(o,l);let u;try{u=await i.json()}catch{u={success:i.ok,message:i.ok?"Request successful":`HTTP ${i.status}: ${i.statusText}`}}if(!i.ok&&typeof u=="object"&&u!==null){const d=u;d.success!==!1&&(d.success=!1,d.message=d.message||`HTTP ${i.status}: ${i.statusText}`)}return u}catch(o){return console.error("API request error:",o),{success:!1,message:o instanceof Error?o.message:"An unknown error occurred"}}},Ye=(n,l={})=>Ro(n,{...l,method:"GET"}),Et=(n,l,o={})=>Ro(n,{...o,method:"POST",headers:{"Content-Type":"application/json",...o.headers},body:l?JSON.stringify(l):void 0}),Lt=(n,l,o={})=>Ro(n,{...o,method:"PUT",headers:{"Content-Type":"application/json",...o.headers},body:l?JSON.stringify(l):void 0}),Kn=(n,l={})=>Ro(n,{...l,method:"DELETE"}),ju="mcphub_token",Qn=()=>localStorage.getItem(ju),Cp=n=>{localStorage.setItem(ju,n)},No=()=>{localStorage.removeItem(ju)},ib={request:async(n,l)=>{const o=new Headers(l.headers),i=localStorage.getItem("i18nextLng")||"en";o.set("Accept-Language",i);const u=Qn();return u&&o.set("x-auth-token",u),{url:n,config:{...l,headers:o}}},response:async n=>(n.status===401&&No(),n),error:async n=>(console.error("Auth interceptor error:",n),n)},cb=()=>{ob(ib)},ub=async n=>{try{const l=await Et("/auth/login",n);return l.success&&l.token?(Cp(l.token),l):{success:!1,message:l.message||"Login failed"}}catch(l){return console.error("Login error:",l),{success:!1,message:"An error occurred during login"}}},db=async n=>{try{const l=await Et("/auth/register",n);return l.success&&l.token?(Cp(l.token),l):{success:!1,message:l.message||"Registration failed"}}catch(l){return console.error("Register error:",l),{success:!1,message:"An error occurred during registration"}}},fb=async()=>{if(!Qn())return{success:!1,message:"No authentication token"};try{return await Ye("/auth/user")}catch(l){return console.error("Get current user error:",l),{success:!1,message:"An error occurred while fetching user data"}}},mb=async n=>{if(!Qn())return{success:!1,message:"No authentication token"};try{return await Et("/auth/change-password",n)}catch(o){return console.error("Change password error:",o),{success:!1,message:"An error occurred while changing password"}}},hb=()=>{No()},pb=async()=>{var n,l;try{const o=bu(),i=await wu(`${o}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});if(i.ok){const u=await i.json();return{skipAuth:((n=u.data)==null?void 0:n.skipAuth)===!0,permissions:((l=u.data)==null?void 0:l.permissions)||{}}}return{skipAuth:!1}}catch(o){return console.debug("Failed to get public config:",o),{skipAuth:!1}}},va={isAuthenticated:!1,loading:!0,user:null,error:null},Ep=b.createContext({auth:va,login:async()=>!1,register:async()=>!1,logout:()=>{}}),gb=({children:n})=>{const[l,o]=b.useState(va);b.useEffect(()=>{(async()=>{const{skipAuth:p,permissions:g}=await pb();if(p){o({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:g},error:null});return}if(!Qn()){o({...va,loading:!1});return}try{const y=await fb();y.success&&y.user?o({isAuthenticated:!0,loading:!1,user:y.user,error:null}):(No(),o({...va,loading:!1}))}catch{No(),o({...va,loading:!1})}})()},[]);const i=async(m,p)=>{try{const g=await ub({username:m,password:p});return g.success&&g.token&&g.user?(o({isAuthenticated:!0,loading:!1,user:g.user,error:null}),!0):(o({...va,loading:!1,error:g.message||"Authentication failed"}),!1)}catch{return o({...va,loading:!1,error:"Authentication failed"}),!1}},u=async(m,p,g=!1)=>{try{const h=await db({username:m,password:p,isAdmin:g});return h.success&&h.token&&h.user?(o({isAuthenticated:!0,loading:!1,user:h.user,error:null}),!0):(o({...va,loading:!1,error:h.message||"Registration failed"}),!1)}catch{return o({...va,loading:!1,error:"Registration failed"}),!1}},d=()=>{hb(),o({...va,loading:!1})};return r.jsx(Ep.Provider,{value:{auth:l,login:i,register:u,logout:d},children:n})},Br=()=>b.useContext(Ep),xb=(n,l,o,i)=>{var d,m,p,g;const u=[o,{code:l,...i||{}}];if((m=(d=n==null?void 0:n.services)==null?void 0:d.logger)!=null&&m.forward)return n.services.logger.forward(u,"warn","react-i18next::",!0);Hr(u[0])&&(u[0]=`react-i18next:: ${u[0]}`),(g=(p=n==null?void 0:n.services)==null?void 0:p.logger)!=null&&g.warn?n.services.logger.warn(...u):console!=null&&console.warn&&console.warn(...u)},Rh={},au=(n,l,o,i)=>{Hr(o)&&Rh[o]||(Hr(o)&&(Rh[o]=new Date),xb(n,l,o,i))},kp=(n,l)=>()=>{if(n.isInitialized)l();else{const o=()=>{setTimeout(()=>{n.off("initialized",o)},0),l()};n.on("initialized",o)}},ru=(n,l,o)=>{n.loadNamespaces(l,kp(n,o))},Mh=(n,l,o,i)=>{if(Hr(o)&&(o=[o]),n.options.preload&&n.options.preload.indexOf(l)>-1)return ru(n,o,i);o.forEach(u=>{n.options.ns.indexOf(u)<0&&n.options.ns.push(u)}),n.loadLanguages(l,kp(n,i))},yb=(n,l,o={})=>!l.languages||!l.languages.length?(au(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:o.lng,precheck:(i,u)=>{if(o.bindI18n&&o.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!u(i.isLanguageChangingTo,n))return!1}}),Hr=n=>typeof n=="string",bb=n=>typeof n=="object"&&n!==null,vb=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,wb={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},jb=n=>wb[n],Nb=n=>n.replace(vb,jb);let su={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Nb};const Sb=(n={})=>{su={...su,...n}},Cb=()=>su;let Tp;const Eb=n=>{Tp=n},kb=()=>Tp,Tb={type:"3rdParty",init(n){Sb(n.options.react),Eb(n)}},Ab=b.createContext();class Rb{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(o=>{this.usedNamespaces[o]||(this.usedNamespaces[o]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Mb=(n,l)=>{const o=b.useRef();return b.useEffect(()=>{o.current=n},[n,l]),o.current},Ap=(n,l,o,i)=>n.getFixedT(l,o,i),Ob=(n,l,o,i)=>b.useCallback(Ap(n,l,o,i),[n,l,o,i]),we=(n,l={})=>{var F,Z,re,te;const{i18n:o}=l,{i18n:i,defaultNS:u}=b.useContext(Ab)||{},d=o||i||kb();if(d&&!d.reportNamespaces&&(d.reportNamespaces=new Rb),!d){au(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const I=(se,U)=>Hr(U)?U:bb(U)&&Hr(U.defaultValue)?U.defaultValue:Array.isArray(se)?se[se.length-1]:se,le=[I,{},!1];return le.t=I,le.i18n={},le.ready=!1,le}(F=d.options.react)!=null&&F.wait&&au(d,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...Cb(),...d.options.react,...l},{useSuspense:p,keyPrefix:g}=m;let h=u||((Z=d.options)==null?void 0:Z.defaultNS);h=Hr(h)?[h]:h||["translation"],(te=(re=d.reportNamespaces).addUsedNamespaces)==null||te.call(re,h);const y=(d.isInitialized||d.initializedStoreOnce)&&h.every(I=>yb(I,d,m)),N=Ob(d,l.lng||null,m.nsMode==="fallback"?h:h[0],g),C=()=>N,k=()=>Ap(d,l.lng||null,m.nsMode==="fallback"?h:h[0],g),[S,T]=b.useState(C);let R=h.join();l.lng&&(R=`${l.lng}${R}`);const A=Mb(R),j=b.useRef(!0);b.useEffect(()=>{const{bindI18n:I,bindI18nStore:le}=m;j.current=!0,!y&&!p&&(l.lng?Mh(d,l.lng,h,()=>{j.current&&T(k)}):ru(d,h,()=>{j.current&&T(k)})),y&&A&&A!==R&&j.current&&T(k);const se=()=>{j.current&&T(k)};return I&&(d==null||d.on(I,se)),le&&(d==null||d.store.on(le,se)),()=>{j.current=!1,d&&I&&(I==null||I.split(" ").forEach(U=>d.off(U,se))),le&&d&&le.split(" ").forEach(U=>d.store.off(U,se))}},[d,R]),b.useEffect(()=>{j.current&&y&&T(C)},[d,g,y]);const O=[S,d,y];if(O.t=S,O.i18n=d,O.ready=y,y||!y&&!p)return O;throw new Promise(I=>{l.lng?Mh(d,l.lng,h,()=>I()):ru(d,h,()=>I())})};/**
61
+ * @license lucide-react v0.486.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Db=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ub=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,o,i)=>i?i.toUpperCase():o.toLowerCase()),Oh=n=>{const l=Ub(n);return l.charAt(0).toUpperCase()+l.slice(1)},Rp=(...n)=>n.filter((l,o,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===o).join(" ").trim();/**
66
+ * @license lucide-react v0.486.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var zb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
71
+ * @license lucide-react v0.486.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const Lb=b.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:d,iconNode:m,...p},g)=>b.createElement("svg",{ref:g,...zb,width:l,height:l,stroke:n,strokeWidth:i?Number(o)*24/Number(l):o,className:Rp("lucide",u),...p},[...m.map(([h,y])=>b.createElement(h,y)),...Array.isArray(d)?d:[d]]));/**
76
+ * @license lucide-react v0.486.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const We=(n,l)=>{const o=b.forwardRef(({className:i,...u},d)=>b.createElement(Lb,{ref:d,iconNode:l,className:Rp(`lucide-${Db(Oh(n))}`,`lucide-${n}`,i),...u}));return o.displayName=Oh(n),o};/**
81
+ * @license lucide-react v0.486.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const _b=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ls=We("check",_b);/**
86
+ * @license lucide-react v0.486.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const Pb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Mo=We("chevron-down",Pb);/**
91
+ * @license lucide-react v0.486.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const Hb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Nu=We("chevron-right",Hb);/**
96
+ * @license lucide-react v0.486.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Bb=[["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"}]],Su=We("circle-alert",Bb);/**
101
+ * @license lucide-react v0.486.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const qb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Mp=We("circle-check-big",qb);/**
106
+ * @license lucide-react v0.486.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const Vb=[["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"}]],Op=We("circle-x",Vb);/**
111
+ * @license lucide-react v0.486.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const Gb=[["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"}]],So=We("copy",Gb);/**
116
+ * @license lucide-react v0.486.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Kb=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Fb=We("download",Kb);/**
121
+ * @license lucide-react v0.486.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const $b=[["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"}]],Ib=We("file-code",$b);/**
126
+ * @license lucide-react v0.486.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const Yb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Xb=We("info",Yb);/**
131
+ * @license lucide-react v0.486.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const Qb=[["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"}]],Jb=We("link",Qb);/**
136
+ * @license lucide-react v0.486.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const Zb=[["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"}]],Dp=We("loader",Zb);/**
141
+ * @license lucide-react v0.486.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const Wb=[["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"}]],ev=We("log-out",Wb);/**
146
+ * @license lucide-react v0.486.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const tv=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],av=We("moon",tv);/**
151
+ * @license lucide-react v0.486.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const rv=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Up=We("play",rv);/**
156
+ * @license lucide-react v0.486.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const sv=[["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"}]],nv=We("refresh-cw",sv);/**
161
+ * @license lucide-react v0.486.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const lv=[["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"}]],ov=We("settings",lv);/**
166
+ * @license lucide-react v0.486.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const iv=[["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"}]],Oo=We("square-pen",iv);/**
171
+ * @license lucide-react v0.486.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const cv=[["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"}]],uv=We("sun",cv);/**
176
+ * @license lucide-react v0.486.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const dv=[["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"}]],zp=We("trash",dv);/**
181
+ * @license lucide-react v0.486.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const fv=[["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"}]],mv=We("user",fv);/**
186
+ * @license lucide-react v0.486.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const hv=[["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"}]],pv=We("wrench",hv);/**
191
+ * @license lucide-react v0.486.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const gv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fn=We("x",gv);function Lp(n){var l,o,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(l=0;l<u;l++)n[l]&&(o=Lp(n[l]))&&(i&&(i+=" "),i+=o)}else for(o in n)n[o]&&(i&&(i+=" "),i+=o);return i}function xv(){for(var n,l,o=0,i="",u=arguments.length;o<u;o++)(n=arguments[o])&&(l=Lp(n))&&(i&&(i+=" "),i+=l);return i}const Cu="-",yv=n=>{const l=vv(n),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:m=>{const p=m.split(Cu);return p[0]===""&&p.length!==1&&p.shift(),_p(p,l)||bv(m)},getConflictingClassGroupIds:(m,p)=>{const g=o[m]||[];return p&&i[m]?[...g,...i[m]]:g}}},_p=(n,l)=>{var m;if(n.length===0)return l.classGroupId;const o=n[0],i=l.nextPart.get(o),u=i?_p(n.slice(1),i):void 0;if(u)return u;if(l.validators.length===0)return;const d=n.join(Cu);return(m=l.validators.find(({validator:p})=>p(d)))==null?void 0:m.classGroupId},Dh=/^\[(.+)\]$/,bv=n=>{if(Dh.test(n)){const l=Dh.exec(n)[1],o=l==null?void 0:l.substring(0,l.indexOf(":"));if(o)return"arbitrary.."+o}},vv=n=>{const{theme:l,classGroups:o}=n,i={nextPart:new Map,validators:[]};for(const u in o)nu(o[u],i,u,l);return i},nu=(n,l,o,i)=>{n.forEach(u=>{if(typeof u=="string"){const d=u===""?l:Uh(l,u);d.classGroupId=o;return}if(typeof u=="function"){if(wv(u)){nu(u(i),l,o,i);return}l.validators.push({validator:u,classGroupId:o});return}Object.entries(u).forEach(([d,m])=>{nu(m,Uh(l,d),o,i)})})},Uh=(n,l)=>{let o=n;return l.split(Cu).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},wv=n=>n.isThemeGetter,jv=n=>{if(n<1)return{get:()=>{},set:()=>{}};let l=0,o=new Map,i=new Map;const u=(d,m)=>{o.set(d,m),l++,l>n&&(l=0,i=o,o=new Map)};return{get(d){let m=o.get(d);if(m!==void 0)return m;if((m=i.get(d))!==void 0)return u(d,m),m},set(d,m){o.has(d)?o.set(d,m):u(d,m)}}},lu="!",ou=":",Nv=ou.length,Sv=n=>{const{prefix:l,experimentalParseClassName:o}=n;let i=u=>{const d=[];let m=0,p=0,g=0,h;for(let S=0;S<u.length;S++){let T=u[S];if(m===0&&p===0){if(T===ou){d.push(u.slice(g,S)),g=S+Nv;continue}if(T==="/"){h=S;continue}}T==="["?m++:T==="]"?m--:T==="("?p++:T===")"&&p--}const y=d.length===0?u:u.substring(g),N=Cv(y),C=N!==y,k=h&&h>g?h-g:void 0;return{modifiers:d,hasImportantModifier:C,baseClassName:N,maybePostfixModifierPosition:k}};if(l){const u=l+ou,d=i;i=m=>m.startsWith(u)?d(m.substring(u.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(o){const u=i;i=d=>o({className:d,parseClassName:u})}return i},Cv=n=>n.endsWith(lu)?n.substring(0,n.length-1):n.startsWith(lu)?n.substring(1):n,Ev=n=>{const l=Object.fromEntries(n.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const u=[];let d=[];return i.forEach(m=>{m[0]==="["||l[m]?(u.push(...d.sort(),m),d=[]):d.push(m)}),u.push(...d.sort()),u}},kv=n=>({cache:jv(n.cacheSize),parseClassName:Sv(n),sortModifiers:Ev(n),...yv(n)}),Tv=/\s+/,Av=(n,l)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:u,sortModifiers:d}=l,m=[],p=n.trim().split(Tv);let g="";for(let h=p.length-1;h>=0;h-=1){const y=p[h],{isExternal:N,modifiers:C,hasImportantModifier:k,baseClassName:S,maybePostfixModifierPosition:T}=o(y);if(N){g=y+(g.length>0?" "+g:g);continue}let R=!!T,A=i(R?S.substring(0,T):S);if(!A){if(!R){g=y+(g.length>0?" "+g:g);continue}if(A=i(S),!A){g=y+(g.length>0?" "+g:g);continue}R=!1}const j=d(C).join(":"),O=k?j+lu:j,F=O+A;if(m.includes(F))continue;m.push(F);const Z=u(A,R);for(let re=0;re<Z.length;++re){const te=Z[re];m.push(O+te)}g=y+(g.length>0?" "+g:g)}return g};function Rv(){let n=0,l,o,i="";for(;n<arguments.length;)(l=arguments[n++])&&(o=Pp(l))&&(i&&(i+=" "),i+=o);return i}const Pp=n=>{if(typeof n=="string")return n;let l,o="";for(let i=0;i<n.length;i++)n[i]&&(l=Pp(n[i]))&&(o&&(o+=" "),o+=l);return o};function Mv(n,...l){let o,i,u,d=m;function m(g){const h=l.reduce((y,N)=>N(y),n());return o=kv(h),i=o.cache.get,u=o.cache.set,d=p,p(g)}function p(g){const h=i(g);if(h)return h;const y=Av(g,o);return u(g,y),y}return function(){return d(Rv.apply(null,arguments))}}const ft=n=>{const l=o=>o[n]||[];return l.isThemeGetter=!0,l},Hp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ov=/^\d+\/\d+$/,Dv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Uv=/\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$/,zv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Lv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_v=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ts=n=>Ov.test(n),Oe=n=>!!n&&!Number.isNaN(Number(n)),gr=n=>!!n&&Number.isInteger(Number(n)),Qc=n=>n.endsWith("%")&&Oe(n.slice(0,-1)),Ha=n=>Dv.test(n),Pv=()=>!0,Hv=n=>Uv.test(n)&&!zv.test(n),qp=()=>!1,Bv=n=>Lv.test(n),qv=n=>_v.test(n),Vv=n=>!ge(n)&&!xe(n),Gv=n=>_s(n,Kp,qp),ge=n=>Hp.test(n),_r=n=>_s(n,Fp,Hv),Jc=n=>_s(n,Yv,Oe),zh=n=>_s(n,Vp,qp),Kv=n=>_s(n,Gp,qv),mo=n=>_s(n,$p,Bv),xe=n=>Bp.test(n),Pn=n=>Ps(n,Fp),Fv=n=>Ps(n,Xv),Lh=n=>Ps(n,Vp),$v=n=>Ps(n,Kp),Iv=n=>Ps(n,Gp),ho=n=>Ps(n,$p,!0),_s=(n,l,o)=>{const i=Hp.exec(n);return i?i[1]?l(i[1]):o(i[2]):!1},Ps=(n,l,o=!1)=>{const i=Bp.exec(n);return i?i[1]?l(i[1]):o:!1},Vp=n=>n==="position"||n==="percentage",Gp=n=>n==="image"||n==="url",Kp=n=>n==="length"||n==="size"||n==="bg-size",Fp=n=>n==="length",Yv=n=>n==="number",Xv=n=>n==="family-name",$p=n=>n==="shadow",Qv=()=>{const n=ft("color"),l=ft("font"),o=ft("text"),i=ft("font-weight"),u=ft("tracking"),d=ft("leading"),m=ft("breakpoint"),p=ft("container"),g=ft("spacing"),h=ft("radius"),y=ft("shadow"),N=ft("inset-shadow"),C=ft("text-shadow"),k=ft("drop-shadow"),S=ft("blur"),T=ft("perspective"),R=ft("aspect"),A=ft("ease"),j=ft("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"],Z=()=>[...F(),xe,ge],re=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],I=()=>[xe,ge,g],le=()=>[Ts,"full","auto",...I()],se=()=>[gr,"none","subgrid",xe,ge],U=()=>["auto",{span:["full",gr,xe,ge]},gr,xe,ge],z=()=>[gr,"auto",xe,ge],W=()=>["auto","min","max","fr",xe,ge],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...I()],E=()=>[Ts,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],_=()=>[n,xe,ge],fe=()=>[...F(),Lh,zh,{position:[xe,ge]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Q=()=>["auto","cover","contain",$v,Gv,{size:[xe,ge]}],oe=()=>[Qc,Pn,_r],q=()=>["","none","full",h,xe,ge],G=()=>["",Oe,Pn,_r],ue=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[Oe,Qc,Lh,zh],ce=()=>["","none",S,xe,ge],be=()=>["none",Oe,xe,ge],Ne=()=>["none",Oe,xe,ge],ye=()=>[Oe,xe,ge],Ae=()=>[Ts,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ha],breakpoint:[Ha],color:[Pv],container:[Ha],"drop-shadow":[Ha],ease:["in","out","in-out"],font:[Vv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ha],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ha],shadow:[Ha],spacing:["px",Oe],text:[Ha],"text-shadow":[Ha],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ts,ge,xe,R]}],container:["container"],columns:[{columns:[Oe,ge,xe,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:Z()}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{start:le()}],end:[{end:le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[gr,"auto",xe,ge]}],basis:[{basis:[Ts,"full","auto",p,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Ts,"auto","initial","none",ge]}],grow:[{grow:["",Oe,xe,ge]}],shrink:[{shrink:["",Oe,xe,ge]}],order:[{order:[gr,"first","last","none",xe,ge]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[p,"screen",...E()]}],"min-w":[{"min-w":[p,"screen","none",...E()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",o,Pn,_r]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,xe,Jc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qc,ge]}],"font-family":[{font:[Fv,ge,l]}],"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:[u,xe,ge]}],"line-clamp":[{"line-clamp":[Oe,"none",xe,Jc]}],leading:[{leading:[d,...I()]}],"list-image":[{"list-image":["none",xe,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",xe,_r]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Oe,"auto",xe,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe,ge]}],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",xe,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:fe()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gr,xe,ge],radial:["",xe,ge],conic:[gr,xe,ge]},Iv,Kv]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,xe,ge]}],"outline-w":[{outline:["",Oe,Pn,_r]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",y,ho,mo]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",N,ho,mo]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Oe,_r]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",C,ho,mo]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Oe,xe,ge]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"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":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[xe,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:fe()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,ge]}],filter:[{filter:["","none",xe,ge]}],blur:[{blur:ce()}],brightness:[{brightness:[Oe,xe,ge]}],contrast:[{contrast:[Oe,xe,ge]}],"drop-shadow":[{"drop-shadow":["","none",k,ho,mo]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Oe,xe,ge]}],"hue-rotate":[{"hue-rotate":[Oe,xe,ge]}],invert:[{invert:["",Oe,xe,ge]}],saturate:[{saturate:[Oe,xe,ge]}],sepia:[{sepia:["",Oe,xe,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,ge]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,xe,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,xe,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,xe,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,xe,ge]}],"backdrop-invert":[{"backdrop-invert":["",Oe,xe,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,xe,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,xe,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,xe,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xe,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",xe,ge]}],ease:[{ease:["linear","initial",A,xe,ge]}],delay:[{delay:[Oe,xe,ge]}],animate:[{animate:["none",j,xe,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,xe,ge]}],"perspective-origin":[{"perspective-origin":Z()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[xe,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:Z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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",xe,ge]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",xe,ge]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Oe,Pn,_r,Jc]}],stroke:[{stroke:["none",..._()]}],"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"]}},Jv=Mv(Qv);function qa(...n){return Jv(xv(n))}const Zv=({message:n,type:l="info",duration:o=3e3,onClose:i,visible:u})=>{const{t:d}=we();b.useEffect(()=>{if(u){const h=setTimeout(()=>{i()},o);return()=>clearTimeout(h)}},[u,o,i]);const m={success:r.jsx(Ls,{className:"w-5 h-5 text-green-500"}),error:r.jsx(Fn,{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"})})},p={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"},g={success:"text-green-800",error:"text-red-800",info:"text-blue-800",warning:"text-yellow-800"};return r.jsx("div",{className:qa("fixed top-4 right-4 z-50 max-w-sm p-4 rounded-md shadow-lg border",p[l],"transform transition-all duration-300 ease-in-out",u?"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:m[l]}),r.jsx("div",{className:"ml-3",children:r.jsx("p",{className:qa("text-sm font-medium",g[l]),children:n})}),r.jsx("div",{className:"ml-auto pl-3",children:r.jsx("div",{className:"-mx-1.5 -my-1.5",children:r.jsxs("button",{onClick:i,className:qa("inline-flex rounded-md p-1.5",`hover:bg-${l}-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${l}-500`),children:[r.jsx("span",{className:"sr-only",children:d("common.dismiss")}),r.jsx(Fn,{className:"h-5 w-5"})]})})})]})})},Ip=b.createContext(void 0),Jn=()=>{const n=b.useContext(Ip);if(!n)throw new Error("useToast must be used within a ToastProvider");return n},Wv=({children:n})=>{const[l,o]=b.useState({message:"",type:"info",visible:!1,duration:3e3}),i=b.useCallback((d,m="info",p=3e3)=>{o({message:d,type:m,visible:!0,duration:p})},[]),u=b.useCallback(()=>{o(d=>({...d,visible:!1}))},[]);return r.jsxs(Ip.Provider,{value:{showToast:i},children:[n,r.jsx(Zv,{message:l.message,type:l.type,duration:l.duration,onClose:u,visible:l.visible})]})},Yp=b.createContext(void 0),e1=()=>{const n=b.useContext(Yp);if(!n)throw new Error("useTheme must be used within a ThemeProvider");return n},t1=({children:n})=>{const[l,o]=b.useState(()=>localStorage.getItem("theme")||"system"),[i,u]=b.useState("light"),d=m=>{o(m),localStorage.setItem("theme",m)};return b.useEffect(()=>{const m=()=>{const g=window.document.documentElement,h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",y=l==="system"?h:l;u(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)}},[l]),r.jsx(Yp.Provider,{value:{theme:l,setTheme:d,resolvedTheme:i},children:n})},po={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},Xp=b.createContext(void 0),a1=({children:n})=>{const{t:l}=we(),{auth:o}=Br(),[i,u]=b.useState([]),[d,m]=b.useState(null),[p,g]=b.useState(0),[h,y]=b.useState(!0),[N,C]=b.useState(0),k=b.useRef(null),S=b.useRef(0),T=b.useRef(0),R=3e3,A=()=>{k.current&&(clearInterval(k.current),k.current=null)},j=b.useCallback(se=>{const U=(se==null?void 0:se.immediate)??!0;A();const z=async()=>{try{console.log("[ServerContext] Fetching servers from API...");const W=await Ye("/servers");T.current=Date.now(),W&&W.success&&Array.isArray(W.data)?u(W.data):W&&Array.isArray(W)?u(W):(console.error("Invalid server data format:",W),u([])),m(null)}catch(W){console.error("Error fetching servers during normal polling:",W),navigator.onLine?W instanceof TypeError&&(W.message.includes("NetworkError")||W.message.includes("Failed to fetch"))?m(l("errors.serverConnection")):m(l("errors.serverFetch")):m(l("errors.network"))}};U&&z(),k.current=setInterval(z,po.normal.pollingInterval)},[l]);b.useEffect(()=>{o.isAuthenticated?(console.log("[ServerContext] User authenticated, triggering refresh"),g(se=>se+1)):(console.log("[ServerContext] User not authenticated, clearing data and stopping polling"),A(),u([]),y(!1),m(null))},[o.isAuthenticated]),b.useEffect(()=>{if(!o.isAuthenticated){console.log("[ServerContext] User not authenticated, skipping polling setup");return}p>0&&(S.current=0,C(0));const se=async()=>{try{console.log("[ServerContext] Initial fetch - attempt",S.current+1);const U=await Ye("/servers");return T.current=Date.now(),U&&U.success&&Array.isArray(U.data)?(u(U.data),y(!1),j({immediate:!1}),!0):U&&Array.isArray(U)?(u(U),y(!1),j({immediate:!1}),!0):(console.error("Invalid server data format:",U),u([]),y(!1),j({immediate:!1}),!0)}catch(U){return S.current+=1,console.error(`Initial loading attempt ${S.current} failed:`,U),C(S.current),navigator.onLine?m(l("errors.initialStartup")):m(l("errors.network")),S.current>=po.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),y(!1),A(),j()),!1}};return h?(A(),se(),k.current=setInterval(se,po.startup.pollingInterval),console.log(`Started initial polling with interval: ${po.startup.pollingInterval}ms`)):j(),()=>{A()}},[p,l,h,j]);const O=b.useCallback(()=>{A(),h&&(y(!0),S.current=0,C(0)),g(se=>se+1)},[h]),F=b.useCallback(()=>{const U=Date.now()-T.current;console.log("[ServerContext] refreshIfNeeded called, time since last fetch:",U,"ms"),U>=R?(console.log("[ServerContext] Triggering refresh (exceeded MIN_REFRESH_INTERVAL:",R,"ms)"),O()):console.log("[ServerContext] Skipping refresh (MIN_REFRESH_INTERVAL:",R,"ms, time since last:",U,"ms)")},[O]),Z=b.useCallback(()=>{g(se=>se+1)},[]),re=b.useCallback(async se=>{try{const U=await Ye("/settings");if(U&&U.success&&U.data&&U.data.mcpServers&&U.data.mcpServers[se.name]){const z=U.data.mcpServers[se.name];return{name:se.name,status:se.status,tools:se.tools||[],config:z}}else return console.error("Failed to get server config from settings:",U),m(l("server.invalidConfig",{serverName:se.name})),null}catch(U){return console.error("Error fetching server settings:",U),m(U instanceof Error?U.message:String(U)),null}},[l]),te=b.useCallback(async se=>{try{const U=await Kn(`/servers/${se}`);return!U||!U.success?(m((U==null?void 0:U.message)||l("server.deleteError",{serverName:se})),!1):(g(z=>z+1),!0)}catch(U){return m(l("errors.general")+": "+(U instanceof Error?U.message:String(U))),!1}},[l]),I=b.useCallback(async(se,U)=>{try{const z=await Et(`/servers/${se.name}/toggle`,{enabled:U});return!z||!z.success?(console.error("Failed to toggle server:",z),m((z==null?void 0:z.message)||l("server.toggleError",{serverName:se.name})),!1):(g(W=>W+1),!0)}catch(z){return console.error("Error toggling server:",z),m(z instanceof Error?z.message:String(z)),!1}},[l]),le={servers:i,error:d,setError:m,isLoading:h,fetchAttempts:N,triggerRefresh:O,refreshIfNeeded:F,handleServerAdd:Z,handleServerEdit:re,handleServerRemove:te,handleServerToggle:I};return r.jsx(Xp.Provider,{value:le,children:n})},r1=()=>{const n=b.useContext(Xp);if(n===void 0)throw new Error("useServerContext must be used within a ServerProvider");return n},Qp=()=>{const{t:n}=we(),{theme:l,setTheme:o}=e1(),i=()=>{o(l==="light"?"dark":"light")};return r.jsx("button",{onClick:i,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:n(l==="light"?"theme.dark":"theme.light"),"aria-label":n(l==="light"?"theme.dark":"theme.light"),children:l==="light"?r.jsx(av,{className:"h-5 w-5"}):r.jsx(uv,{className:"h-5 w-5"})})},s1=n=>{const{t:l}=we();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,...n,children:[r.jsx("title",{children:l("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"})]})},Jp=()=>{const{i18n:n}=we(),[l,o]=b.useState(!1),[i,u]=b.useState(n.language),d=[{code:"en",label:"English"},{code:"zh",label:"中文"},{code:"fr",label:"Français"}];b.useEffect(()=>{u(n.language)},[n.language]),b.useEffect(()=>{const g=h=>{h.target.closest(".language-dropdown")||o(!1)};return l&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[l]);const m=g=>{localStorage.setItem("i18nextLng",g),o(!1),window.location.reload()},p=()=>{o(!l)};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(s1,{className:"h-5 w-5"})}),l&&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:d.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 ${i.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))})})]})},n1=n=>{const{t:l}=we();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...n,children:[r.jsx("title",{children:l("common.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"})]})},l1=({onToggleSidebar:n})=>{const{t:l}=we();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:n,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":l("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:l("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.9.13"}),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(n1,{className:"h-5 w-5"})}),r.jsx(Qp,{}),r.jsx(Jp,{})]})]})})},Hn=({permissions:n,fallback:l=null,children:o})=>Zp(n)?r.jsx(r.Fragment,{children:o}):r.jsx(r.Fragment,{children:l}),Zp=n=>{const{auth:l}=Br();if(!l.isAuthenticated||!l.user)return!1;const o=l.user.permissions||[];return n==="x"&&!o.includes("x")?!1:o.includes("*")||l.user.isAdmin?!0:(Array.isArray(n)?n:[n]).some(u=>o.includes(u))},o1="https://registry.npmjs.org",i1="@samanhappy/mcphub",Wp=async()=>{try{const n=await fetch(`${o1}/${i1}/latest`);if(!n.ok)throw new Error(`Failed to fetch latest version: ${n.status}`);return(await n.json()).version||null}catch(n){return console.error("Error checking for latest version:",n),null}},eg=(n,l)=>{if(n==="dev")return-1;const o=n.split(".").map(Number),i=l.split(".").map(Number);for(let u=0;u<3;u++){const d=o[u]||0,m=i[u]||0;if(d>m)return-1;if(d<m)return 1}return 0},c1=({isOpen:n,onClose:l,version:o})=>{const{t:i}=we(),[u,d]=b.useState(!1),[m,p]=b.useState(""),[g,h]=b.useState(!1),y=async()=>{h(!0);try{const N=await Wp();N&&(p(N),d(eg(o,N)>0))}catch(N){console.error("Failed to check for updates:",N)}finally{h(!1)}};return b.useEffect(()=>{n&&y()},[n,o]),n?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:l,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":i("common.close"),children:r.jsx(Fn,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:i("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:[i("about.currentVersion"),":"]}),r.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:o})]}),u&&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:i("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:i("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
196
+ ${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(nv,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),i(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},u1=({open:n,onOpenChange:l})=>{const{i18n:o,t:i}=we();return n?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:()=>l(!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":i("common.close"),children:r.jsx(Fn,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:i("sponsor.title")}),r.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:o.language==="zh"?r.jsx("img",{src:"./assets/reward.png",alt:i("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:i("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:i("sponsor.supportButton")})]})})]})})}):null},d1=({open:n,onOpenChange:l})=>{const{t:o}=we();return n?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:()=>l(!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":o("common.close"),children:r.jsx(Fn,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:o("wechat.title")}),r.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[r.jsx("img",{src:"./assets/wexin.png",alt:o("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:o("wechat.scanMessage")})]})]})})}):null},f1=n=>{const{t:l}=we();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...n,children:[r.jsx("title",{children:l("common.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"})]})},m1=n=>{const{t:l}=we();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...n,children:[r.jsx("title",{children:l("common.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"})]})},h1=n=>{const{t:l}=we();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...n,children:[r.jsx("title",{children:l("sponsor.label")}),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"})]})},p1=({collapsed:n,version:l})=>{var te;const{t:o,i18n:i}=we(),u=Ka(),{auth:d,logout:m}=Br(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[N,C]=b.useState(!1),[k,S]=b.useState(!1),[T,R]=b.useState(!1),A=b.useRef(null);b.useEffect(()=>{(async()=>{try{const le=await Wp();le&&y(eg(l,le)>0)}catch(le){console.error("Error checking for new version:",le)}})()},[l]),b.useEffect(()=>{const I=le=>{A.current&&!A.current.contains(le.target)&&g(!1)};return document.addEventListener("mousedown",I),()=>{document.removeEventListener("mousedown",I)}},[]);const j=()=>{u("/settings"),g(!1)},O=()=>{m(),u("/login")},F=()=>{C(!0),g(!1)},Z=()=>{S(!0),g(!1)},re=()=>{R(!0),g(!1)};return r.jsxs("div",{ref:A,className:"relative",children:[r.jsxs("button",{onClick:()=>g(!p),className:`flex ${n?"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(mv,{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"})]}),!n&&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:((te=d.user)==null?void 0:te.username)||o("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:Z,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(h1,{className:"h-4 w-4 mr-2"}),o("sponsor.label")]}),i.language==="zh"?r.jsxs("button",{onClick:re,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(f1,{className:"h-4 w-4 mr-2"}),o("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(m1,{className:"h-4 w-4 mr-2"}),o("discord.label")]}),r.jsxs("button",{onClick:j,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(ov,{className:"h-4 w-4 mr-2"}),o("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(Xb,{className:"h-4 w-4 mr-2"}),o("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(ev,{className:"h-4 w-4 mr-2"}),o("app.logout")]})]}),r.jsx(c1,{isOpen:N,onClose:()=>C(!1),version:l}),r.jsx(u1,{open:k,onOpenChange:S}),r.jsx(d1,{open:T,onOpenChange:R})]})},g1=({collapsed:n})=>{var d;const{t:l}=we(),{auth:o}=Br(),i="0.9.13",u=[{path:"/",label:l("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:l("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:l("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"})})},...(d=o.user)!=null&&d.isAdmin&&Zp("x")?[{path:"/users",label:l("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:l("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:l("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 ${n?"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:u.map(m=>r.jsxs(Np,{to:m.path,className:({isActive:p})=>`flex items-center px-2.5 py-2 rounded-lg transition-colors duration-200
197
+ ${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}),!n&&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(p1,{collapsed:n,version:i})})]})},x1=({children:n})=>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:n})}),y1=()=>{const[n,l]=Os.useState(!1),o=()=>{l(!n)};return r.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[r.jsx(l1,{onToggleSidebar:o}),r.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[r.jsx(g1,{collapsed:n}),r.jsx(x1,{children:r.jsx(xp,{})})]})]})},b1=({redirectPath:n="/login"})=>{const{t:l}=we(),{auth:o}=Br();return o.loading?r.jsx("div",{className:"flex items-center justify-center h-screen",children:l("app.loading")}):o.isAuthenticated?r.jsx(xp,{}):r.jsx(jo,{to:n,replace:!0})},v1=()=>{const{t:n}=we(),[l,o]=b.useState(""),[i,u]=b.useState(""),[d,m]=b.useState(null),[p,g]=b.useState(!1),{login:h}=Br(),y=Ka(),N=async C=>{C.preventDefault(),m(null),g(!0);try{if(!l||!i){m(n("auth.emptyFields")),g(!1);return}await h(l,i)?y("/"):m(n("auth.loginFailed"))}catch{m(n("auth.loginError"))}finally{g(!1)}};return r.jsxs("div",{className:"relative min-h-screen w-full overflow-hidden bg-gray-50 dark:bg-gray-950",children:[r.jsxs("div",{className:"absolute top-4 right-4 z-20 flex items-center gap-2",children:[r.jsx(Qp,{}),r.jsx(Jp,{})]}),r.jsx("div",{className:"pointer-events-none absolute inset-0 -z-10 opacity-60 dark:opacity-70",style:{backgroundImage:"radial-gradient(60rem 60rem at 20% -10%, rgba(99,102,241,0.25), transparent), radial-gradient(50rem 50rem at 120% 10%, rgba(168,85,247,0.15), transparent)"}}),r.jsx("div",{className:"pointer-events-none absolute inset-0 -z-10",children:r.jsxs("svg",{className:"h-full w-full opacity-[0.08] dark:opacity-[0.12]",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("defs",{children:r.jsx("pattern",{id:"grid",width:"32",height:"32",patternUnits:"userSpaceOnUse",children:r.jsx("path",{d:"M 32 0 L 0 0 0 32",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})})}),r.jsx("rect",{width:"100%",height:"100%",fill:"url(#grid)",className:"text-gray-400 dark:text-gray-300"})]})}),r.jsx("div",{className:"relative mx-auto flex min-h-screen w-full max-w-md items-center justify-center px-6 py-16",children:r.jsxs("div",{className:"w-full space-y-16",children:[r.jsx("div",{className:"flex justify-center w-full",children:r.jsx("h1",{className:"text-5xl sm:text-5xl font-extrabold leading-tight tracking-tight text-gray-900 dark:text-white whitespace-nowrap",children:r.jsx("span",{className:"bg-gradient-to-r from-indigo-400 via-cyan-400 to-emerald-400 bg-clip-text text-transparent",children:n("auth.slogan")})})}),r.jsxs("div",{className:"login-card relative w-full rounded-2xl border border-white/10 bg-white/60 p-8 shadow-xl backdrop-blur-md transition dark:border-white/10 dark:bg-gray-900/60",children:[r.jsx("div",{className:"absolute -top-24 right-12 h-40 w-40 -translate-y-6 rounded-full bg-indigo-500/30 blur-3xl"}),r.jsx("div",{className:"absolute -bottom-24 -left-12 h-40 w-40 translate-y-6 rounded-full bg-cyan-500/20 blur-3xl"}),r.jsxs("form",{className:"mt-4 space-y-4",onSubmit:N,children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"username",className:"sr-only",children:n("auth.username")}),r.jsx("input",{id:"username",name:"username",type:"text",autoComplete:"username",required:!0,className:"login-input appearance-none relative block w-full rounded-md border border-gray-300/60 bg-white/70 px-3 py-3 text-gray-900 shadow-sm outline-none ring-0 transition-all placeholder:text-gray-500 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 dark:border-gray-700/60 dark:bg-gray-800/70 dark:text-white dark:placeholder:text-gray-400",placeholder:n("auth.username"),value:l,onChange:C=>o(C.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"password",className:"sr-only",children:n("auth.password")}),r.jsx("input",{id:"password",name:"password",type:"password",autoComplete:"current-password",required:!0,className:"login-input appearance-none relative block w-full rounded-md border border-gray-300/60 bg-white/70 px-3 py-3 text-gray-900 shadow-sm outline-none ring-0 transition-all placeholder:text-gray-500 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 dark:border-gray-700/60 dark:bg-gray-800/70 dark:text-white dark:placeholder:text-gray-400",placeholder:n("auth.password"),value:i,onChange:C=>u(C.target.value)})]})]}),d&&r.jsx("div",{className:"error-box rounded border border-red-500/20 bg-red-500/10 p-2 text-center text-sm text-red-600 dark:text-red-400",children:d}),r.jsx("div",{children:r.jsx("button",{type:"submit",disabled:p,className:"login-button btn-primary group relative flex w-full items-center justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white transition-all hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-70",children:n(p?"auth.loggingIn":"auth.login")})})]})]})]})})]})},Zn=n=>{const l=r1(),{refreshIfNeeded:o}=l;return b.useEffect(()=>{n!=null&&n.refreshOnMount&&o()},[n==null?void 0:n.refreshOnMount,o]),l},w1=()=>{const{t:n}=we(),{servers:l,error:o,setError:i,isLoading:u}=Zn({refreshOnMount:!0}),d={total:l.length,online:l.filter(p=>p.status==="connected").length,offline:l.filter(p=>p.status==="disconnected").length,connecting:l.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:n("pages.dashboard.title")}),o&&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:n("app.error")}),r.jsx("p",{className:"text-gray-600 mt-1",children:o})]}),r.jsx("button",{onClick:()=>i(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":n("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"})})})]})}),u&&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:n("app.loading")})]})}),!u&&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:n("pages.dashboard.totalServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:d.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:n("pages.dashboard.onlineServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:d.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:n("pages.dashboard.offlineServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:d.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:n("pages.dashboard.connectingServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:d.connecting})]})]})})]}),l.length>0&&!u&&r.jsxs("div",{className:"mt-8",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:n("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:n("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:n("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:n("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:n("server.prompts")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:n("server.enabled")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:l.slice(0,5).map((p,g)=>{var h,y;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:n(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:((y=p.prompts)==null?void 0:y.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)})})]})})]})]})},j1="modulepreload",N1=function(n,l){return new URL(n,l).href},_h={},Ph=function(l,o,i){let u=Promise.resolve();if(o&&o.length>0){let m=function(y){return Promise.all(y.map(N=>Promise.resolve(N).then(C=>({status:"fulfilled",value:C}),C=>({status:"rejected",reason:C}))))};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"));u=m(o.map(y=>{if(y=N1(y,i),y in _h)return;_h[y]=!0;const N=y.endsWith(".css"),C=N?'[rel="stylesheet"]':"";if(!!i)for(let T=p.length-1;T>=0;T--){const R=p[T];if(R.href===y&&(!N||R.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${C}`))return;const S=document.createElement("link");if(S.rel=N?"stylesheet":j1,N||(S.as="script"),S.crossOrigin="",S.href=y,h&&S.setAttribute("nonce",h),document.head.appendChild(S),N)return new Promise((T,R)=>{S.addEventListener("load",T),S.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return u.then(m=>{for(const p of m||[])p.status==="rejected"&&d(p.reason);return l().catch(d)})},S1={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 go({children:n,variant:l="default",className:o,onClick:i}){return r.jsx("span",{className:qa("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",S1[l],i?"cursor-pointer":"",o),onClick:i,children:n})}const C1=({status:n})=>{const{t:l}=we(),o={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline"},i={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 ${o[n]}`,children:l(i[n]||n)})},tg=async(n,l)=>{try{const o=l?`/tools/${l}/${n.toolName}`:"/tools/call",i=await Et(o,n.arguments,{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return i.success===!1?{success:!1,error:i.message||"Tool call failed"}:{success:!0,content:(i==null?void 0:i.content)||[]}}catch(o){return console.error("Error calling tool:",o),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},E1=async(n,l,o)=>{try{const i=await Et(`/servers/${n}/tools/${l}/toggle`,{enabled:o},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:i.success,error:i.success?void 0:i.message}}catch(i){return console.error("Error toggling tool:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}},ag=async(n,l,o)=>{try{const i=await Lt(`/servers/${n}/tools/${l}/description`,{description:o},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:i.success,error:i.success?void 0:i.message}}catch(i){return console.error("Error updating tool description:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}},k1=Object.freeze(Object.defineProperty({__proto__:null,callTool:tg,toggleTool:E1,updateToolDescription:ag},Symbol.toStringTag,{value:"Module"})),qr=()=>{const{t:n}=we(),{showToast:l}=Jn(),[o,i]=b.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!1,bearerAuthKey:"",skipAuth:!1}),[u,d]=b.useState({bearerAuthKey:""}),[m,p]=b.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[g,h]=b.useState({enabled:!1,dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[y,N]=b.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[C,k]=b.useState("-"),[S,T]=b.useState(!1),[R,A]=b.useState(null),[j,O]=b.useState(0),F=b.useCallback(()=>{O(B=>B+1)},[]),Z=b.useCallback(async()=>{var B,w,E,_,fe,M,Q,oe,q,G;T(!0),A(null);try{const ue=await Ye("/settings");ue.success&&((w=(B=ue.data)==null?void 0:B.systemConfig)!=null&&w.routing)&&i({enableGlobalRoute:ue.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:ue.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:ue.data.systemConfig.routing.enableBearerAuth??!1,bearerAuthKey:ue.data.systemConfig.routing.bearerAuthKey||"",skipAuth:ue.data.systemConfig.routing.skipAuth??!1}),ue.success&&((_=(E=ue.data)==null?void 0:E.systemConfig)!=null&&_.install)&&p({pythonIndexUrl:ue.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:ue.data.systemConfig.install.npmRegistry||"",baseUrl:ue.data.systemConfig.install.baseUrl||"http://localhost:3000"}),ue.success&&((M=(fe=ue.data)==null?void 0:fe.systemConfig)!=null&&M.smartRouting)&&h({enabled:ue.data.systemConfig.smartRouting.enabled??!1,dbUrl:ue.data.systemConfig.smartRouting.dbUrl||"",openaiApiBaseUrl:ue.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:ue.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:ue.data.systemConfig.smartRouting.openaiApiEmbeddingModel||""}),ue.success&&((oe=(Q=ue.data)==null?void 0:Q.systemConfig)!=null&&oe.mcpRouter)&&N({apiKey:ue.data.systemConfig.mcpRouter.apiKey||"",referer:ue.data.systemConfig.mcpRouter.referer||"https://www.mcphubx.com",title:ue.data.systemConfig.mcpRouter.title||"MCPHub",baseUrl:ue.data.systemConfig.mcpRouter.baseUrl||"https://api.mcprouter.to/v1"}),ue.success&&((G=(q=ue.data)==null?void 0:q.systemConfig)==null?void 0:G.nameSeparator)!==void 0&&k(ue.data.systemConfig.nameSeparator)}catch(ue){console.error("Failed to fetch settings:",ue),A(ue instanceof Error?ue.message:"Failed to fetch settings"),l(n("errors.failedToFetchSettings"))}finally{T(!1)}},[n]),re=async(B,w)=>{T(!0),A(null);try{const E=await Lt("/system-config",{routing:{[B]:w}});return E.success?(i({...o,[B]:w}),l(n("settings.systemConfigUpdated")),!0):(l(E.message||n("errors.failedToUpdateRouteConfig")),!1)}catch(E){return console.error("Failed to update routing config:",E),A(E instanceof Error?E.message:"Failed to update routing config"),l(n("errors.failedToUpdateRouteConfig")),!1}finally{T(!1)}},te=async(B,w)=>{T(!0),A(null);try{const E=await Lt("/system-config",{install:{[B]:w}});return E.success?(p({...m,[B]:w}),l(n("settings.systemConfigUpdated")),!0):(l(E.message||n("errors.failedToUpdateSystemConfig")),!1)}catch(E){return console.error("Failed to update system config:",E),A(E instanceof Error?E.message:"Failed to update system config"),l(n("errors.failedToUpdateSystemConfig")),!1}finally{T(!1)}},I=async(B,w)=>{T(!0),A(null);try{const E=await Lt("/system-config",{smartRouting:{[B]:w}});return E.success?(h({...g,[B]:w}),l(n("settings.systemConfigUpdated")),!0):(l(E.message||n("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(E){console.error("Failed to update smart routing config:",E);const _=E instanceof Error?E.message:"Failed to update smart routing config";return A(_),l(_),!1}finally{T(!1)}},le=async B=>{T(!0),A(null);try{const w=await Lt("/system-config",{smartRouting:B});return w.success?(h({...g,...B}),l(n("settings.systemConfigUpdated")),!0):(l(w.message||n("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(w){console.error("Failed to update smart routing config:",w);const E=w instanceof Error?w.message:"Failed to update smart routing config";return A(E),l(E),!1}finally{T(!1)}},se=async B=>{T(!0),A(null);try{const w=await Lt("/system-config",{routing:B});return w.success?(i({...o,...B}),l(n("settings.systemConfigUpdated")),!0):(l(w.message||n("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"),l(n("errors.failedToUpdateRouteConfig")),!1}finally{T(!1)}},U=async(B,w)=>{T(!0),A(null);try{const E=await Lt("/system-config",{mcpRouter:{[B]:w}});return E.success?(N({...y,[B]:w}),l(n("settings.systemConfigUpdated")),!0):(l(E.message||n("errors.failedToUpdateSystemConfig")),!1)}catch(E){console.error("Failed to update MCPRouter config:",E);const _=E instanceof Error?E.message:"Failed to update MCPRouter config";return A(_),l(_),!1}finally{T(!1)}},z=async B=>{T(!0),A(null);try{const w=await Lt("/system-config",{mcpRouter:B});return w.success?(N({...y,...B}),l(n("settings.systemConfigUpdated")),!0):(l(w.message||n("errors.failedToUpdateSystemConfig")),!1)}catch(w){console.error("Failed to update MCPRouter config:",w);const E=w instanceof Error?w.message:"Failed to update MCPRouter config";return A(E),l(E),!1}finally{T(!1)}},W=async B=>{T(!0),A(null);try{const w=await Lt("/system-config",{nameSeparator:B});return w.success?(k(B),l(n("settings.restartRequired"),"info"),!0):(l(w.message||n("errors.failedToUpdateSystemConfig")),!1)}catch(w){console.error("Failed to update name separator:",w);const E=w instanceof Error?w.message:"Failed to update name separator";return A(E),l(E),!1}finally{T(!1)}},H=async B=>{T(!0),A(null);try{return await Ye(`/mcp-settings/export?serverName=${B||""}`)}catch(w){console.error("Failed to export MCP settings:",w);const E=w instanceof Error?w.message:"Failed to export MCP settings";A(E),l(E)}finally{T(!1)}};return b.useEffect(()=>{Z()},[Z,j]),b.useEffect(()=>{o&&d({bearerAuthKey:o.bearerAuthKey})},[o]),{routingConfig:o,tempRoutingConfig:u,setTempRoutingConfig:d,installConfig:m,smartRoutingConfig:g,mcpRouterConfig:y,nameSeparator:C,loading:S,error:R,setError:A,triggerRefresh:F,fetchSettings:Z,updateRoutingConfig:re,updateInstallConfig:te,updateSmartRoutingConfig:I,updateSmartRoutingConfigBatch:le,updateRoutingConfigBatch:se,updateMCPRouterConfig:U,updateMCPRouterConfigBatch:z,updateNameSeparator:W,exportMCPSettings:H}},Pr=({checked:n,onCheckedChange:l,disabled:o=!1})=>r.jsx("button",{type:"button",role:"switch","aria-checked":n,disabled:o,className:qa("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",n?"bg-blue-200":"bg-gray-100",o?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!o&&l(!n),children:r.jsx("span",{className:qa("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",n?"translate-x-6":"translate-x-1")})}),rg=({schema:n,onSubmit:l,onCancel:o,loading:i=!1,storageKey:u,title:d})=>{const{t:m}=we(),[p,g]=b.useState({}),[h,y]=b.useState({}),[N,C]=b.useState(!1),[k,S]=b.useState(""),[T,R]=b.useState(""),A=b.useMemo(()=>(z=>{const W=H=>{if(typeof H=="object"&&H!==null){const B=H;return{type:B.type||"string",description:B.description,enum:B.enum,default:B.default,properties:B.properties?Object.fromEntries(Object.entries(B.properties).map(([w,E])=>[w,W(E)])):void 0,required:B.required,items:B.items?W(B.items):void 0}}return{type:"string"}};return{type:z.type,properties:z.properties?Object.fromEntries(Object.entries(z.properties).map(([H,B])=>[H,W(B)])):void 0,required:z.required}})(n),[n]);b.useEffect(()=>{const U=(W,H="")=>{const B={};return W.type==="object"&&W.properties&&Object.entries(W.properties).forEach(([w,E])=>{const _=H?`${H}.${w}`:w;E.default!==void 0?B[w]=E.default:E.type==="string"?B[w]="":E.type==="number"||E.type==="integer"?B[w]=0:E.type==="boolean"?B[w]=!1:E.type==="array"?B[w]=[]:E.type==="object"&&(E.properties?B[w]=U(E,_):B[w]={})}),B};let z=U(A);if(u)try{const W=localStorage.getItem(u);if(W){const H=JSON.parse(W);z={...z,...H}}}catch(W){console.warn("Failed to load saved form data:",W)}g(z)},[A,u]),b.useEffect(()=>{N&&Object.keys(p).length>0&&(S(JSON.stringify(p,null,2)),R(""))},[N,p]);const j=U=>{S(U),R("");try{const z=JSON.parse(U);if(g(z),u)try{localStorage.setItem(u,JSON.stringify(z))}catch(W){console.warn("Failed to save form data to localStorage:",W)}}catch{R(m("tool.invalidJsonFormat"))}},O=()=>{S(JSON.stringify(p,null,2)),R(""),C(!0)},F=()=>{if(k.trim())try{const U=JSON.parse(k);g(U),R(""),C(!1)}catch{R(m("tool.fixJsonBeforeSwitching"));return}else C(!1)},Z=(U,z)=>{g(W=>{const H={...W},B=U.split(".");let w=H;for(let E=0;E<B.length-1;E++)w[B[E]]||(w[B[E]]={}),w=w[B[E]];if(w[B[B.length-1]]=z,u)try{localStorage.setItem(u,JSON.stringify(H))}catch(E){console.warn("Failed to save form data to localStorage:",E)}return H}),h[U]&&y(W=>{const H={...W};return delete H[U],H})},re=()=>{const U={},z=(W,H,B="")=>{W.type==="object"&&W.properties&&Object.entries(W.properties).forEach(([w,E])=>{var M;const _=B?`${B}.${w}`:w,fe=I(H,_);if((M=W.required)!=null&&M.includes(w)&&(fe==null||fe==="")){U[_]=`${w} is required`;return}fe!=null&&fe!==""&&(E.type==="string"&&typeof fe!="string"?U[_]=`${w} must be a string`:E.type==="number"&&typeof fe!="number"?U[_]=`${w} must be a number`:E.type==="integer"&&(!Number.isInteger(fe)||typeof fe!="number")?U[_]=`${w} must be an integer`:E.type==="boolean"&&typeof fe!="boolean"?U[_]=`${w} must be a boolean`:E.type==="array"&&Array.isArray(fe)?E.items&&fe.forEach((Q,oe)=>{var q;((q=E.items)==null?void 0:q.type)==="object"&&E.items.properties&&z(E.items,Q,`${_}.${oe}`)}):E.type==="object"&&typeof fe=="object"&&z(E,fe,_))})};return z(A,p),y(U),Object.keys(U).length===0},te=U=>{U.preventDefault(),re()&&l(p)},I=(U,z)=>z.split(".").reduce((W,H)=>W==null?void 0:W[H],U),le=(U,z,W,H)=>{const B=W==null?void 0:W[U];return z.type==="string"?z.enum?r.jsxs("select",{value:B||"",onChange:w=>H(w.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")}),z.enum.map((w,E)=>r.jsx("option",{value:w,children:w},E))]}):r.jsx("input",{type:"text",value:B||"",onChange:w=>H(w.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:z.description||m("tool.enterKey",{key:U})}):z.type==="number"||z.type==="integer"?r.jsx("input",{type:"number",step:z.type==="integer"?"1":"any",value:B??"",onChange:w=>{const E=w.target.value===""?"":z.type==="integer"?parseInt(w.target.value):parseFloat(w.target.value);H(E)},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"}):z.type==="boolean"?r.jsx("input",{type:"checkbox",checked:B||!1,onChange:w=>H(w.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):r.jsx("input",{type:"text",value:B||"",onChange:w=>H(w.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:z.description||m("tool.enterKey",{key:U})})},se=(U,z,W="")=>{var E,_,fe,M,Q,oe,q,G,ue,J,$,ce,be,Ne;const H=W?`${W}.${U}`:U,B=I(p,H),w=h[H];if(z.type==="array"){const ye=I(p,H)||[];return r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(W?(_=(E=I(A,W))==null?void 0:E.required)==null?void 0:_.includes(U):(fe=A.required)==null?void 0:fe.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),r.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[ye.map((Ae,ie)=>{var Te,et,xt;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:ie+1})}),r.jsx("button",{type:"button",onClick:()=>{const De=[...ye];De.splice(ie,1),Z(H,De)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((Te=z.items)==null?void 0:Te.type)==="string"&&z.items.enum?r.jsxs("select",{value:Ae||"",onChange:De=>{const jt=[...ye];jt[ie]=De.target.value,Z(H,jt)},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")}),z.items.enum.map((De,jt)=>r.jsx("option",{value:De,children:De},jt))]}):((et=z.items)==null?void 0:et.type)==="object"&&z.items.properties?r.jsx("div",{className:"space-y-3",children:Object.entries(z.items.properties).map(([De,jt])=>{var da,fa;return r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[De,((fa=(da=z.items)==null?void 0:da.required)==null?void 0:fa.includes(De))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),le(De,jt,Ae,It=>{const ma=[...ye];ma[ie]={...ma[ie],[De]:It},Z(H,ma)})]},De)})}):r.jsx("input",{type:"text",value:Ae||"",onChange:De=>{const jt=[...ye];jt[ie]=De.target.value,Z(H,jt)},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:((xt=z.items)==null?void 0:xt.type)||"value"})})]},ie)}),r.jsx("button",{type:"button",onClick:()=>{var ie;const Ae=((ie=z.items)==null?void 0:ie.type)==="object"?{}:"";Z(H,[...ye,Ae])},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})})]}),w&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:w})]},H)}return z.type==="object"?z.properties?r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(W?(Q=(M=I(A,W))==null?void 0:M.required)==null?void 0:Q.includes(U):(oe=A.required)==null?void 0:oe.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),r.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(z.properties).map(([ye,Ae])=>se(ye,Ae,H))}),w&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:w})]},H):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(W?(G=(q=I(A,W))==null?void 0:q.required)==null?void 0:G.includes(U):(ue=A.required)==null?void 0:ue.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)"})]}),z.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),r.jsx("textarea",{value:typeof B=="object"?JSON.stringify(B,null,2):B||"{}",onChange:ye=>{try{const Ae=JSON.parse(ye.target.value);Z(H,Ae)}catch{Z(H,ye.target.value)}},placeholder:`{
198
+ "key": "value"
199
+ }`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${w?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),w&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:w})]},H):z.type==="string"?z.enum?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(W?!1:(J=A.required)==null?void 0:J.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),r.jsxs("select",{value:B||"",onChange:ye=>Z(H,ye.target.value),className:`w-full border rounded-md px-3 py-2 ${w?"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")}),z.enum.map((ye,Ae)=>r.jsx("option",{value:ye,children:ye},Ae))]}),w&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:w})]},H):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(W?!1:($=A.required)==null?void 0:$.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),r.jsx("input",{type:"text",value:B||"",onChange:ye=>Z(H,ye.target.value),className:`w-full border rounded-md px-3 py-2 ${w?"border-red":"border-gray-200"} focus:outline-none form-input`}),w&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:w})]},H):z.type==="number"||z.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,(W?!1:(ce=A.required)==null?void 0:ce.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),r.jsx("input",{type:"number",step:z.type==="integer"?"1":"any",value:B??"",onChange:ye=>{const Ae=ye.target.value===""?"":z.type==="integer"?parseInt(ye.target.value):parseFloat(ye.target.value);Z(H,Ae)},className:`w-full border rounded-md px-3 py-2 form-input ${w?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),w&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:w})]},H):z.type==="boolean"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:B||!1,onChange:ye=>Z(H,ye.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,(W?!1:(be=A.required)==null?void 0:be.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),z.description&&r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:z.description}),w&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:w})]},H):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(W?!1:(Ne=A.required)==null?void 0:Ne.includes(U))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",z.type,")"]})]}),z.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),r.jsx("input",{type:"text",value:B||"",onChange:ye=>Z(H,ye.target.value),placeholder:m("tool.enterValue",{type:z.type}),className:`w-full border rounded-md px-3 py-2 ${w?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),w&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:w})]},H)};return A.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:d}),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 ${N?"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 ${N?"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")})]})]}),N?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:k,onChange:U=>j(U.target.value),placeholder:`{
200
+ "key": "value"
201
+ }`,className:`w-full h-64 border rounded-md px-3 py-2 font-mono text-sm resize-y form-input ${T?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]}),r.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[r.jsx("button",{type:"button",onClick:o,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(k);l(U)}catch{R(m("tool.invalidJsonFormat"))}},disabled:i||!!T,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(i?"tool.running":"tool.runTool")})]})]}):r.jsxs("form",{onSubmit:te,className:"space-y-4",children:[Object.entries(A.properties||{}).map(([U,z])=>se(U,z)),r.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[r.jsx("button",{type:"button",onClick:o,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:i,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(i?"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:o,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:()=>l({}),disabled:i,className:"px-4 py-2 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:m(i?"tool.running":"tool.runTool")})]})]})},T1=({result:n,onClose:l})=>{const{t:o}=we(),i=n.content,u=m=>Array.isArray(m)?m.map((p,g)=>r.jsx("div",{className:"mb-3 last:mb-0",children:d(p)},g)):d(m),d=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:o("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:o("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:[n.success?r.jsx(Mp,{size:20,className:"text-status-green"}):r.jsx(Op,{size:20,className:"text-status-red"}),r.jsx("div",{children:r.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[o("tool.execution")," ",n.success?o("tool.successful"):o("tool.failed")]})})]}),r.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),r.jsx("div",{className:"p-4",children:n.success?r.jsx("div",{children:n.content&&n.content.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:o("tool.result")}),u(n.content)]}):r.jsx("div",{className:"text-sm text-gray-500 italic",children:o("tool.noContent")})}):r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[r.jsx(Su,{size:16,className:"text-red-500"}),r.jsx("span",{className:"text-sm font-medium text-red-700",children:o("tool.error")})]}),i&&i.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:o("tool.errorDetails")}),u(i)]}):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:n.error||n.message||o("tool.unknownError")})})]})})]})};function A1(n){return n==null?!0:typeof n=="string"?n.trim()==="":Array.isArray(n)?n.length===0:typeof n=="object"?Object.keys(n).length===0:!1}const R1=({tool:n,server:l,onToggle:o,onDescriptionUpdate:i})=>{const{t:u}=we(),{nameSeparator:d}=qr(),[m,p]=b.useState(!1),[g,h]=b.useState(!1),[y,N]=b.useState(!1),[C,k]=b.useState(null),[S,T]=b.useState(!1),[R,A]=b.useState(n.description||""),j=b.useRef(null),O=b.useRef(null),[F,Z]=b.useState(0);b.useEffect(()=>{S&&j.current&&(j.current.focus(),F>0&&(j.current.style.width=`${F+20}px`))},[S,F]),b.useEffect(()=>{!S&&O.current&&Z(O.current.offsetWidth)},[S,R]);const re=b.useCallback(()=>`mcphub_tool_form_${l?`${l}_`:""}${n.name}`,[n.name,l]),te=b.useCallback(()=>{localStorage.removeItem(re())},[re]),I=w=>{o&&o(n.name,w)},le=()=>{T(!0)},se=async()=>{try{const w=await ag(l,n.name,R);w.success?(T(!1),i&&i(n.name,R)):(A(n.description||""),console.error("Failed to update tool description:",w.error))}catch(w){console.error("Error updating tool description:",w),A(n.description||""),T(!1)}},U=w=>{A(w.target.value)},z=w=>{w.key==="Enter"?se():w.key==="Escape"&&(A(n.description||""),T(!1))},W=async w=>{N(!0);try{w=Object.fromEntries(Object.entries(w).filter(([_,fe])=>!A1(fe)));const E=await tg({toolName:n.name,arguments:w},l);k(E)}catch(E){k({success:!1,error:E instanceof Error?E.message:"Unknown error occurred"})}finally{N(!1)}},H=()=>{h(!1),te(),k(null)},B=()=>{k(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:()=>p(!m),children:[r.jsx("div",{className:"flex-1",children:r.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[n.name.replace(l+d,""),r.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:S?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:R,onChange:U,onKeyDown:z,onClick:w=>w.stopPropagation(),style:{minWidth:"100px",width:F>0?`${F+20}px`:"auto"}}),r.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:w=>{w.stopPropagation(),se()},children:r.jsx(Ls,{size:16})})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:O,children:R||u("tool.noDescription")}),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:w=>{w.stopPropagation(),le()},children:r.jsx(Oo,{size:14})})]})})]})}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("div",{className:"flex items-center space-x-2",onClick:w=>w.stopPropagation(),children:r.jsx(Pr,{checked:n.enabled??!0,onCheckedChange:I,disabled:y})}),r.jsxs("button",{onClick:w=>{w.stopPropagation(),p(!0),h(!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:y||!n.enabled,children:[y?r.jsx(Dp,{size:14,className:"animate-spin"}):r.jsx(Up,{size:14}),r.jsx("span",{children:u(y?"tool.running":"tool.run")})]}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:m?r.jsx(Mo,{size:18}):r.jsx(Nu,{size:18})})]})]}),m&&r.jsxs("div",{className:"mt-4 space-y-4",children:[!g&&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:u("tool.inputSchema")}),r.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(n.inputSchema,null,2)})]}),g&&r.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[r.jsx(rg,{schema:n.inputSchema||{type:"object"},onSubmit:W,onCancel:H,loading:y,storageKey:re(),title:u("tool.runToolWithName",{name:n.name.replace(l+d,"")})}),C&&r.jsx("div",{className:"mt-4",children:r.jsx(T1,{result:C,onClose:B})})]})]})]})},sg=async(n,l)=>{try{const o=await Et(`/mcp/${l}/prompts/${encodeURIComponent(n.promptName)}`,{name:n.promptName,arguments:n.arguments});if(!o.success)throw new Error(`Failed to get prompt: ${o.message||"Unknown error"}`);return{success:!0,data:o.data}}catch(o){return console.error("Error getting prompt:",o),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},M1=async(n,l,o)=>{try{const i=await Et(`/servers/${n}/prompts/${l}/toggle`,{enabled:o});return{success:i.success,error:i.success?void 0:i.message}}catch(i){return console.error("Error toggling prompt:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}},O1=Object.freeze(Object.defineProperty({__proto__:null,getPrompt:sg,togglePrompt:M1},Symbol.toStringTag,{value:"Module"})),Hh=({result:n,onClose:l})=>{const{t:o}=we(),i=u=>{if(typeof u=="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:u})});if(typeof u=="object"&&u!==null){if(u.description||u.messages)return r.jsxs("div",{className:"space-y-4",children:[u.description&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:o("prompt.description")}),r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("p",{className:"text-sm text-gray-800",children:u.description})})]}),u.messages&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:o("prompt.messages")}),r.jsx("div",{className:"space-y-3",children:u.messages.map((d,m)=>r.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[r.jsx("div",{className:"flex items-center mb-2",children:r.jsxs("span",{className:"inline-block w-16 text-xs font-medium text-gray-500",children:[d.role,":"]})}),typeof d.content=="string"?r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d.content}):typeof d.content=="object"&&d.content.type==="text"?r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d.content.text}):r.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(d.content,null,2)})]},m))})]})]});try{const d=typeof u=="string"?JSON.parse(u):u;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:o("prompt.jsonResponse")}),r.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(d,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(u)})})}}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(u)})})};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:[n.success?r.jsx(Mp,{size:20,className:"text-status-green"}):r.jsx(Op,{size:20,className:"text-status-red"}),r.jsx("div",{children:r.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[o("prompt.execution")," ",n.success?o("prompt.successful"):o("prompt.failed")]})})]}),r.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),r.jsx("div",{className:"p-4",children:n.success?r.jsx("div",{children:n.data?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:o("prompt.result")}),i(n.data)]}):r.jsx("div",{className:"text-sm text-gray-500 italic",children:o("prompt.noContent")})}):r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[r.jsx(Su,{size:16,className:"text-red-500"}),r.jsx("span",{className:"text-sm font-medium text-red-700",children:o("prompt.error")})]}),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:n.error||n.message||o("prompt.unknownError")})})]})})]})},D1=({prompt:n,server:l,onToggle:o,onDescriptionUpdate:i})=>{const{t:u}=we(),{nameSeparator:d}=qr(),[m,p]=b.useState(!1),[g,h]=b.useState(!1),[y,N]=b.useState(!1),[C,k]=b.useState(null),[S,T]=b.useState(!1),[R,A]=b.useState(n.description||""),j=b.useRef(null),O=b.useRef(null),[F,Z]=b.useState(0);b.useEffect(()=>{S&&j.current&&(j.current.focus(),F>0&&(j.current.style.width=`${F+20}px`))},[S,F]),b.useEffect(()=>{!S&&O.current&&Z(O.current.offsetWidth)},[S,R]);const re=b.useCallback(()=>`mcphub_prompt_form_${l?`${l}_`:""}${n.name}`,[n.name,l]),te=b.useCallback(()=>{localStorage.removeItem(re())},[re]),I=E=>{o&&o(n.name,E)},le=()=>{T(!0)},se=async()=>{T(!1),i&&i(n.name,R)},U=E=>{A(E.target.value)},z=E=>{E.key==="Enter"?se():E.key==="Escape"&&(A(n.description||""),T(!1))},W=async E=>{N(!0);try{const _=await sg({promptName:n.name,arguments:E},l);console.log("GetPrompt result:",_),k({success:_.success,data:_.data,error:_.error})}catch(_){k({success:!1,error:_ instanceof Error?_.message:"Unknown error occurred"})}finally{N(!1)}},H=()=>{h(!1),te(),k(null)},B=()=>{k(null)},w=()=>{if(!n.arguments||n.arguments.length===0)return{type:"object",properties:{},required:[]};const E={},_=[];return n.arguments.forEach(fe=>{E[fe.name]={type:"string",description:fe.description||""},fe.required&&_.push(fe.name)}),{type:"object",properties:E,required:_}};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:()=>p(!m),children:[r.jsx("div",{className:"flex-1",children:r.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[n.name.replace(l+d,""),n.title&&r.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600",children:n.title}),r.jsx("span",{className:"ml-2 text-sm font-normal text-gray-500 inline-flex items-center",children:S?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:R,onChange:U,onKeyDown:z,onClick:E=>E.stopPropagation(),style:{minWidth:"100px",width:F>0?`${F+20}px`:"auto"}}),r.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:E=>{E.stopPropagation(),se()},children:r.jsx(Ls,{size:16})})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:O,children:R||u("tool.noDescription")}),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:E=>{E.stopPropagation(),le()},children:r.jsx(Oo,{size:14})})]})})]})}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("div",{className:"flex items-center space-x-2",onClick:E=>E.stopPropagation(),children:n.enabled!==void 0&&r.jsx(Pr,{checked:n.enabled,onCheckedChange:I,disabled:y})}),r.jsxs("button",{onClick:E=>{E.stopPropagation(),p(!0),h(!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:y||!n.enabled,children:[y?r.jsx(Dp,{size:14,className:"animate-spin"}):r.jsx(Up,{size:14}),r.jsx("span",{children:u(y?"tool.running":"tool.run")})]}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:m?r.jsx(Mo,{size:18}):r.jsx(Nu,{size:18})})]})]}),m&&r.jsxs("div",{className:"mt-4 space-y-4",children:[g&&r.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[r.jsx(rg,{schema:w(),onSubmit:W,onCancel:H,loading:y,storageKey:re(),title:u("prompt.runPromptWithName",{name:n.name.replace(l+d,"")})}),C&&r.jsx("div",{className:"mt-4",children:r.jsx(Hh,{result:C,onClose:B})})]}),!g&&n.arguments&&n.arguments.length>0&&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:u("tool.parameters")}),r.jsx("div",{className:"space-y-2",children:n.arguments.map((E,_)=>r.jsxs("div",{className:"flex items-start",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("span",{className:"font-medium text-gray-700",children:E.name}),E.required&&r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),E.description&&r.jsx("p",{className:"text-sm text-gray-600 mt-1",children:E.description})]}),r.jsx("div",{className:"text-xs text-gray-500 ml-2",children:E.title||""})]},_))})]}),!g&&C&&r.jsx("div",{className:"mt-4",children:r.jsx(Hh,{result:C,onClose:B})})]})]})},Eu=({isOpen:n,onClose:l,onConfirm:o,serverName:i,isGroup:u=!1,isUser:d=!1})=>{const{t:m}=we();return n?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(d?"users.confirmDelete":u?"groups.confirmDelete":"server.confirmDelete")}),r.jsx("p",{className:"text-gray-500 mb-6",children:d?m("users.deleteWarning",{username:i}):u?m("groups.deleteWarning",{name:i}):m("server.deleteWarning",{name:i})}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),r.jsx("button",{onClick:o,className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger",children:m("common.delete")})]})]})})}):null},U1=({server:n,onRemove:l,onEdit:o,onToggle:i,onRefresh:u})=>{var z,W;const{t:d}=we(),{showToast:m}=Jn(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[N,C]=b.useState(!1),[k,S]=b.useState(!1),[T,R]=b.useState(!1),A=b.useRef(null);b.useEffect(()=>{const H=B=>{A.current&&!A.current.contains(B.target)&&S(!1)};return document.addEventListener("mousedown",H),()=>{document.removeEventListener("mousedown",H)}},[]);const{exportMCPSettings:j}=qr(),O=H=>{H.stopPropagation(),y(!0)},F=H=>{H.stopPropagation(),o(n)},Z=async H=>{if(H.stopPropagation(),!(N||!i)){C(!0);try{await i(n,n.enabled===!1)}finally{C(!1)}}},re=H=>{H.stopPropagation(),S(!k)},te=H=>{if(H.stopPropagation(),!!n.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(n.error).then(()=>{R(!0),m(d("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>R(!1),2e3)});else{const B=document.createElement("textarea");B.value=n.error,B.style.position="fixed",B.style.left="-9999px",document.body.appendChild(B),B.focus(),B.select();try{document.execCommand("copy"),R(!0),m(d("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>R(!1),2e3)}catch(w){m(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",w)}document.body.removeChild(B)}},I=async H=>{H.stopPropagation();try{const B=await j(n.name),w=JSON.stringify(B.data,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(w),m(d("common.copySuccess")||"Copied to clipboard","success");else{const E=document.createElement("textarea");E.value=w,E.style.position="fixed",E.style.left="-9999px",document.body.appendChild(E),E.focus(),E.select();try{document.execCommand("copy"),m(d("common.copySuccess")||"Copied to clipboard","success")}catch(_){m(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",_)}document.body.removeChild(E)}}catch(B){console.error("Error copying server configuration:",B),m(d("common.copyFailed")||"Copy failed","error")}},le=()=>{l(n.name),y(!1)},se=async(H,B)=>{try{const{toggleTool:w}=await Ph(async()=>{const{toggleTool:_}=await Promise.resolve().then(()=>k1);return{toggleTool:_}},[],import.meta.url),E=await w(n.name,H,B);E.success?(m(d(B?"tool.enableSuccess":"tool.disableSuccess",{name:H}),"success"),u&&u()):m(E.error||d("tool.toggleFailed"),"error")}catch(w){console.error("Error toggling tool:",w),m(d("tool.toggleFailed"),"error")}},U=async(H,B)=>{try{const{togglePrompt:w}=await Ph(async()=>{const{togglePrompt:_}=await Promise.resolve().then(()=>O1);return{togglePrompt:_}},void 0,import.meta.url),E=await w(n.name,H,B);E.success?(m(d(B?"tool.enableSuccess":"tool.disableSuccess",{name:H}),"success"),u&&u()):m(E.error||d("tool.toggleFailed"),"error")}catch(w){console.error("Error toggling prompt:",w),m(d("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 ${n.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 ${n.enabled===!1?"text-gray-600":"text-gray-900"}`,children:n.name}),r.jsx(C1,{status:n.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:[((z=n.tools)==null?void 0:z.length)||0," ",d("server.tools")]})]}),r.jsxs("div",{className:"flex items-center px-2 py-1 bg-purple-50 text-purple-700 rounded-full text-sm btn-primary",children:[r.jsxs("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:[r.jsx("path",{d:"M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z"}),r.jsx("path",{d:"M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h2a2 2 0 002-2V9a2 2 0 00-2-2h-1z"})]}),r.jsxs("span",{children:[((W=n.prompts)==null?void 0:W.length)||0," ",d("server.prompts")]})]}),n.error&&r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"cursor-pointer",onClick:re,"aria-label":d("server.viewErrorDetails"),children:r.jsx(Su,{className:"text-red-500 hover:text-red-600",size:18})}),k&&r.jsxs("div",{ref:A,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:H=>H.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:d("server.errorDetails")}),r.jsx("button",{onClick:te,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:d("common.copy"),children:T?r.jsx(Ls,{size:14,className:"text-green-500"}):r.jsx(So,{size:14})})]}),r.jsx("button",{onClick:H=>{H.stopPropagation(),S(!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:n.error})})]})]})]}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx("button",{onClick:I,className:"px-3 py-1 btn-secondary",children:d("server.copy")}),r.jsx("button",{onClick:F,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:d("server.edit")}),r.jsx("div",{className:"flex items-center",children:r.jsx("button",{onClick:Z,className:`px-3 py-1 text-sm rounded transition-colors ${N?"bg-gray-200 text-gray-500":n.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:N,children:N?d("common.processing"):n.enabled!==!1?d("server.disable"):d("server.enable")})}),r.jsx("button",{onClick:O,className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 text-sm btn-danger",children:d("server.delete")}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:p?r.jsx(Mo,{size:18}):r.jsx(Nu,{size:18})})]})]}),p&&r.jsxs(r.Fragment,{children:[n.tools&&r.jsxs("div",{className:"mt-6",children:[r.jsx("h6",{className:`font-medium ${n.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:d("server.tools")}),r.jsx("div",{className:"space-y-4",children:n.tools.map((H,B)=>r.jsx(R1,{server:n.name,tool:H,onToggle:se},B))})]}),n.prompts&&r.jsxs("div",{className:"mt-6",children:[r.jsx("h6",{className:`font-medium ${n.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:d("server.prompts")}),r.jsx("div",{className:"space-y-4",children:n.prompts.map((H,B)=>r.jsx(D1,{server:n.name,prompt:H,onToggle:U},B))})]})]})]}),r.jsx(Eu,{isOpen:h,onClose:()=>y(!1),onConfirm:le,serverName:n.name})]})},Do=({onSubmit:n,onCancel:l,initialData:o=null,modalTitle:i,formError:u=null})=>{var B,w,E,_,fe,M,Q,oe,q,G,ue,J,$,ce,be,Ne,ye,Ae,ie,Te,et,xt,De,jt,da,fa,It,ma,xr,Xe,yr,_t,it,Mt,nt,Vr,Fa,Gr,Pt,ja,Nt,ke,Pe;const{t:d}=we(),m=()=>!o||!o.config?"stdio":o.config.type?o.config.type:o.config.url?"sse":"stdio",[p,g]=b.useState(m()),[h,y]=b.useState({name:o&&o.name||"",url:o&&o.config&&o.config.url||"",command:o&&o.config&&o.config.command||"",arguments:o&&o.config&&o.config.args?Array.isArray(o.config.args)?o.config.args.join(" "):String(o.config.args):"",args:o&&o.config&&o.config.args||[],type:m(),env:[],headers:[],options:{timeout:o&&o.config&&o.config.options&&o.config.options.timeout||6e4,resetTimeoutOnProgress:o&&o.config&&o.config.options&&o.config.options.resetTimeoutOnProgress||!1,maxTotalTimeout:o&&o.config&&o.config.options&&o.config.options.maxTotalTimeout||void 0},openapi:o&&o.config&&o.config.openapi?{url:o.config.openapi.url||"",schema:o.config.openapi.schema?JSON.stringify(o.config.openapi.schema,null,2):"",inputMode:o.config.openapi.url?"url":o.config.openapi.schema?"schema":"url",version:o.config.openapi.version||"3.1.0",securityType:((B=o.config.openapi.security)==null?void 0:B.type)||"none",apiKeyName:((E=(w=o.config.openapi.security)==null?void 0:w.apiKey)==null?void 0:E.name)||"",apiKeyIn:((fe=(_=o.config.openapi.security)==null?void 0:_.apiKey)==null?void 0:fe.in)||"header",apiKeyValue:((Q=(M=o.config.openapi.security)==null?void 0:M.apiKey)==null?void 0:Q.value)||"",httpScheme:((q=(oe=o.config.openapi.security)==null?void 0:oe.http)==null?void 0:q.scheme)||"bearer",httpCredentials:((ue=(G=o.config.openapi.security)==null?void 0:G.http)==null?void 0:ue.credentials)||"",oauth2Token:(($=(J=o.config.openapi.security)==null?void 0:J.oauth2)==null?void 0:$.token)||"",openIdConnectUrl:((be=(ce=o.config.openapi.security)==null?void 0:ce.openIdConnect)==null?void 0:be.url)||"",openIdConnectToken:((ye=(Ne=o.config.openapi.security)==null?void 0:Ne.openIdConnect)==null?void 0:ye.token)||"",passthroughHeaders:o.config.openapi.passthroughHeaders?o.config.openapi.passthroughHeaders.join(", "):""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none",passthroughHeaders:""}}),[N,C]=b.useState(o&&o.config&&o.config.env?Object.entries(o.config.env).map(([me,de])=>({key:me,value:de})):[]),[k,S]=b.useState(o&&o.config&&o.config.headers?Object.entries(o.config.headers).map(([me,de])=>({key:me,value:de})):[]),[T,R]=b.useState(!1),[A,j]=b.useState(null),O=!!o,F=me=>{const{name:de,value:he}=me.target;y({...h,[de]:he})},Z=me=>{const de=me.split(" ").filter(he=>he.trim()!=="");y({...h,arguments:me,args:de})},re=me=>{g(me),y(de=>({...de,type:me}))},te=(me,de,he)=>{const Yt=[...N];Yt[me][de]=he,C(Yt)},I=()=>{C([...N,{key:"",value:""}])},le=me=>{const de=[...N];de.splice(me,1),C(de)},se=(me,de,he)=>{const Yt=[...k];Yt[me][de]=he,S(Yt)},U=()=>{S([...k,{key:"",value:""}])},z=me=>{const de=[...k];de.splice(me,1),S(de)},W=(me,de)=>{y(he=>({...he,options:{...he.options,[me]:de}}))},H=async me=>{var de,he,Yt;me.preventDefault(),j(null);try{const Ht={};N.forEach(({key:Tt,value:ha})=>{Tt.trim()&&(Ht[Tt.trim()]=ha)});const br={};k.forEach(({key:Tt,value:ha})=>{Tt.trim()&&(br[Tt.trim()]=ha)});const $a={};(de=h.options)!=null&&de.timeout&&h.options.timeout!==6e4&&($a.timeout=h.options.timeout),(he=h.options)!=null&&he.resetTimeoutOnProgress&&($a.resetTimeoutOnProgress=h.options.resetTimeoutOnProgress),(Yt=h.options)!=null&&Yt.maxTotalTimeout&&($a.maxTotalTimeout=h.options.maxTotalTimeout);const Wn={name:h.name,config:{type:p,...p==="openapi"?{openapi:(()=>{var ha,Hs,el,la,ct,yt,Na;const Tt={version:((ha=h.openapi)==null?void 0:ha.version)||"3.1.0"};if(((Hs=h.openapi)==null?void 0:Hs.inputMode)==="url")Tt.url=((el=h.openapi)==null?void 0:el.url)||"";else if(((la=h.openapi)==null?void 0:la.inputMode)==="schema"&&((ct=h.openapi)!=null&&ct.schema))try{Tt.schema=JSON.parse(h.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(yt=h.openapi)!=null&&yt.securityType&&h.openapi.securityType!=="none"&&(Tt.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||""}}}),(Na=h.openapi)!=null&&Na.passthroughHeaders&&h.openapi.passthroughHeaders.trim()&&(Tt.passthroughHeaders=h.openapi.passthroughHeaders.split(",").map(Ia=>Ia.trim()).filter(Ia=>Ia.length>0)),Tt})(),...Object.keys(br).length>0?{headers:br}:{}}:p==="sse"||p==="streamable-http"?{url:h.url,...Object.keys(br).length>0?{headers:br}:{}}:{command:h.command,args:h.args,env:Object.keys(Ht).length>0?Ht:void 0},...Object.keys($a).length>0?{options:$a}:{}}};n(Wn)}catch(Ht){j(`Error: ${Ht instanceof Error?Ht.message:String(Ht)}`)}};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:i}),r.jsx("button",{onClick:l,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(A||u)&&r.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:u||A}),r.jsxs("form",{onSubmit:H,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:d("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:d("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:()=>re("stdio"),className:"mr-1"}),r.jsx("label",{htmlFor:"command",children:d("server.typeStdio")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>re("sse"),className:"mr-1"}),r.jsx("label",{htmlFor:"url",children:d("server.typeSse")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>re("streamable-http"),className:"mr-1"}),r.jsx("label",{htmlFor:"streamable-http",children:d("server.typeStreamableHttp")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>re("openapi"),className:"mr-1"}),r.jsx("label",{htmlFor:"openapi",children:d("server.typeOpenapi")})]})]})]}),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:d("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:((Ae=h.openapi)==null?void 0:Ae.inputMode)==="url",onChange:()=>y(me=>({...me,openapi:{...me.openapi,inputMode:"url"}})),className:"mr-1"}),r.jsx("label",{htmlFor:"input-mode-url",children:d("server.openapi.inputModeUrl")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((ie=h.openapi)==null?void 0:ie.inputMode)==="schema",onChange:()=>y(me=>({...me,openapi:{...me.openapi,inputMode:"schema"}})),className:"mr-1"}),r.jsx("label",{htmlFor:"input-mode-schema",children:d("server.openapi.inputModeSchema")})]})]})]}),((Te=h.openapi)==null?void 0:Te.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:d("server.openapi.specUrl")}),r.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((et=h.openapi)==null?void 0:et.url)||"",onChange:me=>y(de=>({...de,openapi:{...de.openapi,url:me.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"&&((xt=h.openapi)==null?void 0:xt.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:d("server.openapi.schema")}),r.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((jt=h.openapi)==null?void 0:jt.schema)||"",onChange:me=>y(de=>({...de,openapi:{...de.openapi,schema:me.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:`{
202
+ "openapi": "3.1.0",
203
+ "info": {
204
+ "title": "API",
205
+ "version": "1.0.0"
206
+ },
207
+ "servers": [
208
+ {
209
+ "url": "https://api.example.com"
210
+ }
211
+ ],
212
+ "paths": {
213
+ ...
214
+ }
215
+ }`,required:p==="openapi"&&((da=h.openapi)==null?void 0:da.inputMode)==="schema"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("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:d("server.openapi.security")}),r.jsxs("select",{value:((fa=h.openapi)==null?void 0:fa.securityType)||"none",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,securityType:me.target.value,url:((he=de.openapi)==null?void 0:he.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:d("server.openapi.securityNone")}),r.jsx("option",{value:"apiKey",children:d("server.openapi.securityApiKey")}),r.jsx("option",{value:"http",children:d("server.openapi.securityHttp")}),r.jsx("option",{value:"oauth2",children:d("server.openapi.securityOAuth2")}),r.jsx("option",{value:"openIdConnect",children:d("server.openapi.securityOpenIdConnect")})]})]}),((It=h.openapi)==null?void 0:It.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:d("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:d("server.openapi.apiKeyName")}),r.jsx("input",{type:"text",value:((ma=h.openapi)==null?void 0:ma.apiKeyName)||"",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,apiKeyName:me.target.value,url:((he=de.openapi)==null?void 0:he.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:d("server.openapi.apiKeyIn")}),r.jsxs("select",{value:((xr=h.openapi)==null?void 0:xr.apiKeyIn)||"header",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,apiKeyIn:me.target.value,url:((he=de.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[r.jsx("option",{value:"header",children:d("server.openapi.apiKeyInHeader")}),r.jsx("option",{value:"query",children:d("server.openapi.apiKeyInQuery")}),r.jsx("option",{value:"cookie",children:d("server.openapi.apiKeyInCookie")})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyValue")}),r.jsx("input",{type:"password",value:((Xe=h.openapi)==null?void 0:Xe.apiKeyValue)||"",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,apiKeyValue:me.target.value,url:((he=de.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),((yr=h.openapi)==null?void 0:yr.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:d("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:d("server.openapi.httpScheme")}),r.jsxs("select",{value:((_t=h.openapi)==null?void 0:_t.httpScheme)||"bearer",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,httpScheme:me.target.value,url:((he=de.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[r.jsx("option",{value:"basic",children:d("server.openapi.httpSchemeBasic")}),r.jsx("option",{value:"bearer",children:d("server.openapi.httpSchemeBearer")}),r.jsx("option",{value:"digest",children:d("server.openapi.httpSchemeDigest")})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.httpCredentials")}),r.jsx("input",{type:"password",value:((it=h.openapi)==null?void 0:it.httpCredentials)||"",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,httpCredentials:me.target.value,url:((he=de.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((Mt=h.openapi)==null?void 0:Mt.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((nt=h.openapi)==null?void 0:nt.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:d("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:d("server.openapi.oauth2Token")}),r.jsx("input",{type:"password",value:((Vr=h.openapi)==null?void 0:Vr.oauth2Token)||"",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,oauth2Token:me.target.value,url:((he=de.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})})]}),((Fa=h.openapi)==null?void 0:Fa.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:d("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:d("server.openapi.openIdConnectUrl")}),r.jsx("input",{type:"url",value:((Gr=h.openapi)==null?void 0:Gr.openIdConnectUrl)||"",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,openIdConnectUrl:me.target.value,url:((he=de.openapi)==null?void 0:he.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:d("server.openapi.openIdConnectToken")}),r.jsx("input",{type:"password",value:((Pt=h.openapi)==null?void 0:Pt.openIdConnectToken)||"",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,openIdConnectToken:me.target.value,url:((he=de.openapi)==null?void 0:he.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.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.passthroughHeaders")}),r.jsx("input",{type:"text",value:((ja=h.openapi)==null?void 0:ja.passthroughHeaders)||"",onChange:me=>y(de=>{var he;return{...de,openapi:{...de.openapi,passthroughHeaders:me.target.value,url:((he=de.openapi)==null?void 0:he.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",placeholder:"Authorization, X-API-Key, X-Custom-Header"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.openapi.passthroughHeadersHelp")})]}),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:d("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:"+"})]}),k.map((me,de)=>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:me.key,onChange:he=>se(de,"key",he.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:me.value,onChange:he=>se(de,"value",he.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:()=>z(de),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:"-"})]},de))]})]}):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:d("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:d("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:"+"})]}),k.map((me,de)=>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:me.key,onChange:he=>se(de,"key",he.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:me.value,onChange:he=>se(de,"value",he.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:()=>z(de),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:"-"})]},de))]})]}):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:d("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:d("server.arguments")}),r.jsx("input",{type:"text",name:"arguments",id:"arguments",value:h.arguments,onChange:me=>Z(me.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:d("server.envVars")}),r.jsx("button",{type:"button",onClick:I,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:"+"})]}),N.map((me,de)=>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:me.key,onChange:he=>te(de,"key",he.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:d("server.key")}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:me.value,onChange:he=>te(de,"value",he.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:d("server.value")})]}),r.jsx("button",{type:"button",onClick:()=>le(de),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:"-"})]},de))]})]}),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(!T),children:[r.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.requestOptions")}),r.jsx("span",{className:"text-gray-500 text-sm",children:T?"▼":"▶"})]}),T&&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:d("server.timeout")}),r.jsx("input",{type:"number",id:"timeout",value:((Nt=h.options)==null?void 0:Nt.timeout)||6e4,onChange:me=>W("timeout",parseInt(me.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:d("server.timeoutDescription")})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:d("server.maxTotalTimeout")}),r.jsx("input",{type:"number",id:"maxTotalTimeout",value:((ke=h.options)==null?void 0:ke.maxTotalTimeout)||"",onChange:me=>W("maxTotalTimeout",me.target.value?parseInt(me.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:d("server.maxTotalTimeoutDescription")})]})]}),r.jsxs("div",{className:"mt-3",children:[r.jsxs("label",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:((Pe=h.options)==null?void 0:Pe.resetTimeoutOnProgress)||!1,onChange:me=>W("resetTimeoutOnProgress",me.target.checked),className:"mr-2"}),r.jsx("span",{className:"text-gray-600 text-sm",children:d("server.resetTimeoutOnProgress")})]}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:d("server.resetTimeoutOnProgressDescription")})]})]})]}),r.jsxs("div",{className:"flex justify-end mt-6",children:[r.jsx("button",{type:"button",onClick:l,className:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-medium py-2 px-4 rounded mr-2 btn-secondary",children:d("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:d(O?"server.save":"server.add")})]})]})]})},ng=n=>{const l=new Set,o=/\$\{([^}]+)\}/g,i=d=>{let m;for(;(m=o.exec(d))!==null;)l.add(m[1])},u=(d,m="")=>{typeof d=="string"?i(d):Array.isArray(d)?d.forEach((p,g)=>u(p,`${m}[${g}]`)):d&&typeof d=="object"&&Object.entries(d).forEach(([p,g])=>{u(g,m?`${m}.${p}`:p)})};return u(n),Array.from(l)},z1=({onAdd:n})=>{const{t:l}=we(),[o,i]=b.useState(!1),[u,d]=b.useState(null),[m,p]=b.useState(!1),[g,h]=b.useState(null),[y,N]=b.useState([]),C=()=>{i(!o),d(null),p(!1),h(null)},k=async()=>{g&&(await S(g),p(!1),h(null))},S=async R=>{try{d(null);const A=await Et("/servers",R);if(!A.success){A&&A.message?d(A.message):d(l("server.addError"));return}i(!1),n()}catch(A){console.error("Error adding server:",A),navigator.onLine?A instanceof TypeError&&(A.message.includes("NetworkError")||A.message.includes("Failed to fetch"))?d(l("errors.serverConnection")):d(l("errors.serverAdd")):d(l("errors.network"))}},T=async R=>{try{const A=ng(R);A.length>0?(N(A),h(R),p(!0)):await S(R)}catch(A){console.error("Error processing server submission:",A),d(l("errors.serverAdd"))}};return r.jsxs("div",{children:[r.jsxs("button",{onClick:C,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"})}),l("server.add")]}),o&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Do,{onSubmit:T,onCancel:C,modalTitle:l("server.addServer"),formError:u})}),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:l("server.confirmVariables")}),r.jsx("p",{className:"text-gray-600 mb-4",children:l("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:[l("server.detectedVariables"),":"]}),r.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:y.map((R,A)=>r.jsxs("li",{className:"font-mono",children:["$",`{${R}}`]},A))})]})]})}),r.jsx("p",{className:"text-gray-600 text-sm mb-6",children:l("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:l("common.cancel")}),r.jsx("button",{onClick:k,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:l("server.confirmAndAdd")})]})]})})]})},L1=({server:n,onEdit:l,onCancel:o})=>{const{t:i}=we(),[u,d]=b.useState(null),m=async p=>{try{d(null);const g=await Lt(`/servers/${n.name}`,p);if(!g.success){g&&g.message?d(g.message):d(i("server.updateError",{serverName:n.name}));return}l()}catch(g){console.error("Error updating server:",g),navigator.onLine?g instanceof TypeError&&(g.message.includes("NetworkError")||g.message.includes("Failed to fetch"))?d(i("errors.serverConnection")):d(i("errors.serverUpdate",{serverName:n.name})):d(i("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(Do,{onSubmit:m,onCancel:o,initialData:n,modalTitle:i("server.editTitle",{serverName:n.name}),formError:u})})},_1=({isOpen:n,onClose:l,onConfirm:o,title:i,message:u,confirmText:d,cancelText:m,variant:p="warning"})=>{const{t:g}=we();if(!n)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:N}=h(),C=S=>{S.target===S.currentTarget&&l()},k=S=>{S.key==="Escape"?l():S.key==="Enter"&&o()};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:C,onKeyDown:k,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:[i&&r.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:i}),r.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:u})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{onClick:l,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:o,className:`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${N} ${p==="danger"?"btn-danger":p==="warning"?"btn-warning":"btn-primary"}`,children:d||g("common.confirm")})]})]})})})},P1=({onSuccess:n,onCancel:l})=>{const{t:o}=we(),[i,u]=b.useState(!1),[d,m]=b.useState(!1),[p,g]=b.useState(null),[h,y]=b.useState(null),[N,C]=b.useState(!1),[k,S]=b.useState(null),[T,R]=b.useState(""),[A,j]=b.useState(!1),[O,F]=b.useState(""),Z=H=>{H.preventDefault(),u(!0)},re=H=>{H.preventDefault(),u(!1)},te=H=>{H.preventDefault(),u(!1);const B=H.dataTransfer.files;if(B.length>0){const w=B[0];w.name.endsWith(".dxt")?(y(w),g(null)):g(o("dxt.invalidFileType"))}},I=H=>{const B=H.target.files;if(B&&B.length>0){const w=B[0];w.name.endsWith(".dxt")?(y(w),g(null)):g(o("dxt.invalidFileType"))}},le=async()=>{if(!h){g(o("dxt.noFileSelected"));return}m(!0),g(null);try{const H=new FormData;H.append("dxtFile",h);const B=await wu(vu("/dxt/upload"),{method:"POST",body:H}),w=await B.json();if(!B.ok)throw new Error(w.message||`HTTP error! Status: ${B.status}`);if(w.success&&w.data)S(w.data.manifest),R(w.data.extractDir),C(!0);else throw new Error(w.message||o("dxt.uploadFailed"))}catch(H){console.error("DXT upload error:",H),g(H instanceof Error?H.message:o("dxt.uploadFailed"))}finally{m(!1)}},se=async(H,B=!1)=>{var w;m(!0),g(null);try{const E=W(k,T,H);if(!B){const fe=await Ye("/servers");if(fe.success&&((w=fe.data)==null?void 0:w.find(Q=>Q.name===H))){F(H),j(!0),m(!1);return}}let _;if(B?_=await Lt(`/servers/${encodeURIComponent(H)}`,{name:H,config:E}):_=await Et("/servers",{name:H,config:E}),_.success)n(E);else throw new Error(_.message||o("dxt.installFailed"))}catch(E){console.error("DXT install error:",E),g(E instanceof Error?E.message:o("dxt.installFailed")),m(!1)}},U=()=>{j(!1),O&&se(O,!0)},z=()=>{j(!1),F(""),m(!1)},W=(H,B,w)=>{var fe;const E=((fe=H.server)==null?void 0:fe.mcp_config)||{},_={type:"stdio",command:E.command||"node",args:(E.args||[]).map(M=>M.replace("${__dirname}",B))};return E.env&&Object.keys(E.env).length>0&&(_.env={...E.env},Object.keys(_.env).forEach(M=>{typeof _.env[M]=="string"&&(_.env[M]=_.env[M].replace("${__dirname}",B))})),_};return N&&k?r.jsxs(r.Fragment,{children:[r.jsx(_1,{isOpen:A,onClose:z,onConfirm:U,title:o("dxt.serverExistsTitle"),message:o("dxt.serverExistsConfirm",{serverName:O}),confirmText:o("dxt.override"),cancelText:o("common.cancel"),variant:"warning"}),r.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${A?"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:o("dxt.installServer")}),r.jsx("button",{onClick:l,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:o("dxt.extensionInfo")}),r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs("div",{children:[r.jsxs("strong",{children:[o("dxt.name"),":"]})," ",k.display_name||k.name]}),r.jsxs("div",{children:[r.jsxs("strong",{children:[o("dxt.version"),":"]})," ",k.version]}),r.jsxs("div",{children:[r.jsxs("strong",{children:[o("dxt.description"),":"]})," ",k.description]}),k.author&&r.jsxs("div",{children:[r.jsxs("strong",{children:[o("dxt.author"),":"]})," ",k.author.name]}),k.tools&&k.tools.length>0&&r.jsxs("div",{children:[r.jsxs("strong",{children:[o("dxt.tools"),":"]}),r.jsx("ul",{className:"list-disc list-inside ml-4",children:k.tools.map((H,B)=>r.jsxs("li",{children:[H.name," - ",H.description]},B))})]})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:o("dxt.serverName")}),r.jsx("input",{type:"text",id:"serverName",defaultValue:k.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:o("dxt.serverNamePlaceholder")})]}),r.jsxs("div",{className:"flex justify-end space-x-4",children:[r.jsx("button",{onClick:l,disabled:d,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:o("common.cancel")}),r.jsx("button",{onClick:()=>{const H=document.getElementById("serverName"),B=(H==null?void 0:H.value.trim())||k.name;se(B)},disabled:d,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:d?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"})]}),o("dxt.installing")]}):o("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:o("dxt.uploadTitle")}),r.jsx("button",{onClick:l,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 ${i?"border-blue-500 bg-blue-50":h?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:Z,onDragLeave:re,onDrop:te,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:o("dxt.dropFileHere")}),r.jsx("p",{className:"text-xs text-gray-500",children:o("dxt.orClickToSelect")})]})]}),r.jsx("input",{type:"file",accept:".dxt",onChange:I,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:l,disabled:d,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:o("common.cancel")}),r.jsx("button",{onClick:le,disabled:!h||d,className:"px-4 py-2 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:d?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"})]}),o("dxt.uploading")]}):o("dxt.upload")})]})]})})},H1=()=>{const{t:n}=we(),l=Ka(),{servers:o,error:i,setError:u,isLoading:d,handleServerAdd:m,handleServerEdit:p,handleServerRemove:g,handleServerToggle:h,triggerRefresh:y}=Zn({refreshOnMount:!0}),[N,C]=b.useState(null),[k,S]=b.useState(!1),[T,R]=b.useState(!1),A=async Z=>{const re=await p(Z);re&&C(re)},j=()=>{C(null),y()},O=async()=>{S(!0);try{y(),await new Promise(Z=>setTimeout(Z,500))}finally{S(!1)}},F=Z=>{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:n("pages.servers.title")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("button",{onClick:()=>l("/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"})}),n("nav.market")]}),r.jsx(z1,{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"})}),n("dxt.upload")]}),r.jsxs("button",{onClick:O,disabled:k,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 ${k?"opacity-70 cursor-not-allowed":""}`,children:[k?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"})}),n("common.refresh")]})]})]}),i&&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:i})}),r.jsx("button",{onClick:()=>u(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":n("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:n("app.loading")})]})}):o.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:r.jsx("p",{className:"text-gray-600",children:n("app.noServers")})}):r.jsx("div",{className:"space-y-6",children:o.map((Z,re)=>r.jsx(U1,{server:Z,onRemove:g,onEdit:A,onToggle:h,onRefresh:y},re))}),N&&r.jsx(L1,{server:N,onEdit:j,onCancel:()=>C(null)}),T&&r.jsx(P1,{onSuccess:F,onCancel:()=>R(!1)})]})},ku=()=>{const{t:n}=we(),[l,o]=b.useState([]),[i,u]=b.useState(!0),[d,m]=b.useState(null),[p,g]=b.useState(0),h=b.useCallback(async()=>{try{u(!0);const A=await Ye("/groups");A&&A.success&&Array.isArray(A.data)?o(A.data):(console.error("Invalid group data format:",A),o([])),m(null)}catch(A){console.error("Error fetching groups:",A),m(A instanceof Error?A.message:"Failed to fetch groups"),o([])}finally{u(!1)}},[]),y=b.useCallback(()=>{g(A=>A+1)},[]),N=async(A,j,O=[])=>{try{const F=await Et("/groups",{name:A,description:j,servers:O});return console.log("Group created successfully:",F),!F||!F.success?(m((F==null?void 0:F.message)||n("groups.createError")),F):(y(),F||null)}catch(F){return m(F instanceof Error?F.message:"Failed to create group"),null}},C=async(A,j)=>{try{const O=await Lt(`/groups/${A}`,j);return!O||!O.success?(m((O==null?void 0:O.message)||n("groups.updateError")),O):(y(),O||null)}catch(O){return m(O instanceof Error?O.message:"Failed to update group"),null}},k=async(A,j)=>{try{const O=await Lt(`/groups/${A}/servers/batch`,{servers:j});return!O||!O.success?(m((O==null?void 0:O.message)||n("groups.updateError")),null):(y(),O.data||null)}catch(O){return m(O instanceof Error?O.message:"Failed to update group servers"),null}},S=async A=>{try{const j=await Kn(`/groups/${A}`);return!j||!j.success?(m((j==null?void 0:j.message)||n("groups.deleteError")),j):(y(),j)}catch(j){return m(j instanceof Error?j.message:"Failed to delete group"),null}},T=async(A,j)=>{try{const O=await Et(`/groups/${A}/servers`,{serverName:j});return!O||!O.success?(m((O==null?void 0:O.message)||n("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(A,j)=>{try{const O=await Kn(`/groups/${A}/servers/${j}`);return!O||!O.success?(m((O==null?void 0:O.message)||n("groups.serverRemoveError")),null):(y(),O.data||null)}catch(O){return m(O instanceof Error?O.message:"Failed to remove server from group"),null}};return b.useEffect(()=>{h()},[h,p]),{groups:l,loading:i,error:d,setError:m,triggerRefresh:y,createGroup:N,updateGroup:C,updateGroupServers:k,deleteGroup:S,addServerToGroup:T,removeServerFromGroup:R}},lg=({servers:n,value:l,onChange:o,className:i})=>{const{t:u}=we(),{nameSeparator:d}=qr(),[m,p]=b.useState(new Set),g=Os.useMemo(()=>l.map(j=>typeof j=="string"?{name:j,tools:"all"}:{...j,tools:j.tools||"all"}),[l]),h=Os.useMemo(()=>n.filter(j=>j.enabled!==!1),[n]);Os.useEffect(()=>{const j=new Set(g.map(F=>F.name)),O=new Set(h.map(F=>F.name));p(F=>{const Z=new Set;return F.forEach(re=>{(j.has(re)||O.has(re))&&Z.add(re)}),Z})},[g,h]);const y=j=>{if(g.findIndex(F=>F.name===j)>=0){const F=g.filter(Z=>Z.name!==j);o(F)}else{const F=[...g,{name:j,tools:"all"}];o(F)}},N=j=>{p(O=>{const F=new Set(O);return F.has(j)?F.delete(j):F.add(j),F})},C=(j,O,F=!1)=>{if(Array.isArray(O)&&O.length===0){const Z=g.filter(re=>re.name!==j);o(Z),F||p(re=>{const te=new Set(re);return te.delete(j),te})}else if(g.findIndex(re=>re.name===j)>=0){const re=g.map(te=>te.name===j?{...te,tools:O}:te);o(re)}else{const re=[...g,{name:j,tools:O}];o(re)}},k=(j,O)=>{var te;const F=h.find(I=>I.name===j);if(!F)return;const Z=((te=F.tools)==null?void 0:te.map(I=>I.name.replace(`${j}${d}`,"")))||[],re=g.find(I=>I.name===j);if(!re){const I=[...g,{name:j,tools:[O]}];o(I);return}if(re.tools==="all"){const I=Z.filter(le=>le!==O);C(j,I)}else if(Array.isArray(re.tools)){const I=re.tools;if(I.includes(O)){const le=I.filter(se=>se!==O);C(j,le)}else{const le=[...I,O];le.length===Z.length?C(j,"all"):C(j,le)}}},S=j=>{const O=g.find(F=>F.name===j);return O?O.tools==="all":!1},T=j=>{const O=g.find(F=>F.name===j);return O?Array.isArray(O.tools)&&O.tools.length>0:!1},R=(j,O)=>{const F=g.find(Z=>Z.name===j);return F?F.tools==="all"?!0:Array.isArray(F.tools)?F.tools.includes(O):!1:!1},A=j=>{const O=h.find(F=>F.name===j);return(O==null?void 0:O.tools)||[]};return r.jsxs("div",{className:qa("space-y-4",i),children:[r.jsx("div",{className:"space-y-3",children:h.map(j=>{const O=S(j.name),F=T(j.name),Z=m.has(j.name),re=A(j.name),te=g.find(I=>I.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:()=>N(j.name),children:[r.jsxs("div",{className:"flex items-center space-x-3",onClick:I=>{I.stopPropagation(),y(j.name)},children:[r.jsx("input",{type:"checkbox",checked:O||F,onChange:()=>y(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:[te&&te.tools!=="all"&&Array.isArray(te.tools)&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",u("groups.toolsSelected")," ",te.tools.length,"/",re.length,")"]}),te&&te.tools==="all"&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",u("groups.allTools")," ",re.length,"/",re.length,")"]}),re.length>0&&r.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:r.jsx("svg",{className:qa("w-5 h-5 transition-transform",Z&&"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"})})})]})]}),Z&&re.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:u("groups.toolSelection")}),r.jsx("button",{type:"button",onClick:()=>{(te==null?void 0:te.tools)==="all"||Array.isArray(te==null?void 0:te.tools)&&te.tools.length===re.length?C(j.name,[],!0):C(j.name,"all")},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:(te==null?void 0:te.tools)==="all"||Array.isArray(te==null?void 0:te.tools)&&te.tools.length===re.length?u("groups.selectNone"):u("groups.selectAll")})]}),r.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:re.map(I=>{const le=I.name.replace(`${j.name}${d}`,""),se=R(j.name,le);return r.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:se,onChange:()=>k(j.name,le),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:le}),I.description&&r.jsx("span",{className:"text-gray-400 text-xs truncate",children:I.description})]},I.name)})})]})]},j.name)})}),h.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:u("groups.noServerOptions")})]})},B1=({onAdd:n,onCancel:l})=>{const{t:o}=we(),{createGroup:i}=ku(),{servers:u}=Zn(),[d,m]=b.useState([]),[p,g]=b.useState(null),[h,y]=b.useState(!1),[N,C]=b.useState({name:"",description:"",servers:[]});b.useEffect(()=>{m(u.filter(T=>T.enabled!==!1))},[u]);const k=T=>{const{name:R,value:A}=T.target;C(j=>({...j,[R]:A}))},S=async T=>{T.preventDefault(),y(!0),g(null);try{if(!N.name.trim()){g(o("groups.nameRequired")),y(!1);return}const R=await i(N.name,N.description,N.servers);if(!R||!R.success){g((R==null?void 0:R.message)||o("groups.createError")),y(!1);return}n()}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:o("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:S,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:[o("groups.name")," *"]}),r.jsx("input",{type:"text",id:"name",name:"name",value:N.name,onChange:k,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:o("groups.namePlaceholder"),required:!0})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:o("groups.configureTools")}),r.jsx(lg,{servers:d,value:N.servers,onChange:T=>C(R=>({...R,servers:T})),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:h,children:o("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:o(h?"common.submitting":"common.create")})]})]})]})})},q1=({group:n,onEdit:l,onCancel:o})=>{const{t:i}=we(),{updateGroup:u}=ku(),{servers:d}=Zn(),[m,p]=b.useState([]),[g,h]=b.useState(null),[y,N]=b.useState(!1),[C,k]=b.useState({name:n.name,description:n.description||"",servers:n.servers||[]});b.useEffect(()=>{p(d.filter(R=>R.enabled!==!1))},[d]);const S=R=>{const{name:A,value:j}=R.target;k(O=>({...O,[A]:j}))},T=async R=>{R.preventDefault(),N(!0),h(null);try{if(!C.name.trim()){h(i("groups.nameRequired")),N(!1);return}const A=await u(n.id,{name:C.name,description:C.description,servers:C.servers});if(!A||!A.success){h((A==null?void 0:A.message)||i("groups.updateError")),N(!1);return}l()}catch(A){h(A instanceof Error?A.message:String(A)),N(!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:i("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:T,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:[i("groups.name")," *"]}),r.jsx("input",{type:"text",id:"name",name:"name",value:C.name,onChange:S,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:i("groups.namePlaceholder"),required:!0})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:i("groups.configureTools")}),r.jsx(lg,{servers:m,value:C.servers,onChange:R=>k(A=>({...A,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:o,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:i("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:i(y?"common.submitting":"common.save")})]})]})]})})},V1=({group:n,servers:l,onEdit:o,onDelete:i})=>{const{t:u}=we(),{showToast:d}=Jn(),{installConfig:m}=qr(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[N,C]=b.useState(!1),[k,S]=b.useState(null),T=b.useRef(null);b.useEffect(()=>{const U=z=>{T.current&&!T.current.contains(z.target)&&C(!1)};return document.addEventListener("mousedown",U),()=>{document.removeEventListener("mousedown",U)}},[]);const R=()=>{o(n)},A=()=>{g(!0)},j=()=>{i(n.id),g(!1)},O=U=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(U).then(()=>{y(!0),C(!1),d(u("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)});else{const z=document.createElement("textarea");z.value=U,z.style.position="fixed",z.style.left="-9999px",document.body.appendChild(z),z.focus(),z.select();try{document.execCommand("copy"),y(!0),C(!1),d(u("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)}catch(W){d(u("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",W)}document.body.removeChild(z)}},F=()=>{O(n.id)},Z=()=>{O(`${m.baseUrl}/mcp/${n.id}`)},re=()=>{const U={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${n.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};O(JSON.stringify(U,null,2))},te=U=>U.map(z=>typeof z=="string"?z:z.name),I=U=>{const z=n.servers.find(W=>typeof W=="string"?W===U:W.name===U);return typeof z=="string"?{name:z,tools:"all"}:z},le=te(n.servers),se=l.filter(U=>le.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:n.name}),r.jsxs("div",{className:"flex items-center ml-3",children:[r.jsx("span",{className:"text-xs text-gray-500 mr-1",children:n.id}),r.jsxs("div",{className:"relative",ref:T,children:[r.jsxs("button",{onClick:()=>C(!N),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:u("common.copy"),children:[h?r.jsx(Ls,{size:14,className:"text-green-500"}):r.jsx(So,{size:14}),r.jsx(Mo,{size:12,className:"ml-1"})]}),N&&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(So,{size:12,className:"mr-2"}),u("common.copyId")]}),r.jsxs("button",{onClick:Z,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(Jb,{size:12,className:"mr-2"}),u("common.copyUrl")]}),r.jsxs("button",{onClick:re,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(Ib,{size:12,className:"mr-2"}),u("common.copyJson")]})]})]})]})]}),n.description&&r.jsx("p",{className:"text-gray-600 text-sm mt-1",children:n.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:u("groups.serverCount",{count:n.servers.length})}),r.jsx("button",{onClick:R,className:"text-gray-500 hover:text-gray-700",title:u("groups.edit"),children:r.jsx(Oo,{size:18})}),r.jsx("button",{onClick:A,className:"text-gray-500 hover:text-red-600",title:u("groups.delete"),children:r.jsx(zp,{size:18})})]})]}),r.jsx("div",{className:"mt-4",children:se.length===0?r.jsx("p",{className:"text-gray-500 italic",children:u("groups.noServers")}):r.jsx("div",{className:"flex flex-wrap gap-2",children:se.map(U=>{var _;const z=I(U.name),W=z&&z.tools!=="all"&&Array.isArray(z.tools),H=W&&Array.isArray(z==null?void 0:z.tools)?z.tools.length:((_=U.tools)==null?void 0:_.length)||0,B=k===U.name,w=()=>W&&Array.isArray(z==null?void 0:z.tools)?z.tools:U.tools&&U.tools.length>0?U.tools.map(fe=>fe.name):[],E=()=>{S(B?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:E,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"}`}),H>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(pv,{size:12}),H]})]}),B&&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:[u(W?"groups.selectedTools":"groups.allTools"),":"]}),r.jsx("div",{className:"flex flex-wrap gap-1",children:w().map((fe,M)=>r.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:fe},M))})]})]},U.name)})})}),r.jsx(Eu,{isOpen:p,onClose:()=>g(!1),onConfirm:j,serverName:n.name,isGroup:!0})]})},G1=()=>{const{t:n}=we(),{groups:l,loading:o,error:i,setError:u,deleteGroup:d,triggerRefresh:m}=ku(),{servers:p}=Zn({refreshOnMount:!0}),[g,h]=b.useState(null),[y,N]=b.useState(!1),C=A=>{h(A)},k=()=>{h(null),m()},S=async A=>{const j=await d(A);(!j||!j.success)&&u((j==null?void 0:j.message)||n("groups.deleteError"))},T=()=>{N(!0)},R=()=>{N(!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:n("pages.groups.title")}),r.jsx("div",{className:"flex space-x-4",children:r.jsxs("button",{onClick:T,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"})}),n("groups.add")]})})]}),i&&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:i})}),o?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:n("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:n("groups.noGroups")})}):r.jsx("div",{className:"space-y-6",children:l.map(A=>r.jsx(V1,{group:A,servers:p,onEdit:C,onDelete:S},A.id))}),y&&r.jsx(B1,{onAdd:R,onCancel:R}),g&&r.jsx(q1,{group:g,onEdit:k,onCancel:()=>h(null)})]})},Tu=()=>{const{t:n}=we(),[l,o]=b.useState([]),[i,u]=b.useState(!0),[d,m]=b.useState(null),[p,g]=b.useState(0),h=b.useCallback(async()=>{try{u(!0);const S=await Ye("/users");if(!S.success){m(S.message||n("users.fetchError"));return}S&&S.success&&Array.isArray(S.data)?o(S.data):(console.error("Invalid user data format:",S),o([])),m(null)}catch(S){console.error("Error fetching users:",S),m(S instanceof Error?S.message:"Failed to fetch users"),o([])}finally{u(!1)}},[]),y=b.useCallback(()=>{g(S=>S+1)},[]),N=async S=>{try{const T=await Et("/users",S);return y(),T}catch(T){return m(T instanceof Error?T.message:"Failed to create user"),null}},C=async(S,T)=>{try{const R=await Lt(`/users/${S}`,T);return y(),R||null}catch(R){return m(R instanceof Error?R.message:"Failed to update user"),null}},k=async S=>{try{const T=await Kn(`/users/${S}`);return T!=null&&T.success?(y(),T):(m((T==null?void 0:T.message)||n("users.deleteError")),T)}catch(T){return m(T instanceof Error?T.message:"Failed to delete user"),!1}};return b.useEffect(()=>{h()},[h,p]),{users:l,loading:i,error:d,setError:m,triggerRefresh:y,createUser:N,updateUser:C,deleteUser:k}},K1=({onAdd:n,onCancel:l})=>{const{t:o}=we(),{createUser:i}=Tu(),[u,d]=b.useState(null),[m,p]=b.useState(!1),[g,h]=b.useState({username:"",password:"",isAdmin:!1}),y=async C=>{if(C.preventDefault(),d(null),!g.username.trim()){d(o("users.usernameRequired"));return}if(!g.password.trim()){d(o("users.passwordRequired"));return}if(g.password.length<6){d(o("users.passwordTooShort"));return}p(!0);try{const k=await i(g);k!=null&&k.success?n():d((k==null?void 0:k.message)||o("users.createError"))}catch(k){d(k instanceof Error?k.message:o("users.createError"))}finally{p(!1)}},N=C=>{const{name:k,value:S,type:T,checked:R}=C.target;h(A=>({...A,[k]:T==="checkbox"?R:S}))};return r.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full flex items-center justify-center z-50",children:r.jsx("div",{className:"bg-white p-8 rounded-lg shadow-xl max-w-md w-full mx-4",children:r.jsxs("form",{onSubmit:y,children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:o("users.addNew")}),u&&r.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-3 mb-4",children:r.jsx("p",{className:"text-sm",children:u})}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsxs("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-1",children:[o("users.username")," *"]}),r.jsx("input",{type:"text",id:"username",name:"username",value:g.username,onChange:N,placeholder:o("users.usernamePlaceholder"),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:!0,disabled:m})]}),r.jsxs("div",{children:[r.jsxs("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:[o("users.password")," *"]}),r.jsx("input",{type:"password",id:"password",name:"password",value:g.password,onChange:N,placeholder:o("users.passwordPlaceholder"),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:!0,disabled:m,minLength:6})]}),r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",id:"isAdmin",name:"isAdmin",checked:g.isAdmin,onChange:N,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded",disabled:m}),r.jsx("label",{htmlFor:"isAdmin",className:"ml-2 block text-sm text-gray-700",children:o("users.adminRole")})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 transition-colors duration-200",disabled:m,children:o("common.cancel")}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:m,children:o(m?"common.creating":"users.create")})]})]})})})},F1=({user:n,onEdit:l,onCancel:o})=>{const{t:i}=we(),{updateUser:u}=Tu(),[d,m]=b.useState(null),[p,g]=b.useState(!1),[h,y]=b.useState({isAdmin:n.isAdmin,newPassword:"",confirmPassword:""}),N=async k=>{if(k.preventDefault(),m(null),h.newPassword&&h.newPassword!==h.confirmPassword){m(i("users.passwordMismatch"));return}if(h.newPassword&&h.newPassword.length<6){m(i("users.passwordTooShort"));return}g(!0);try{const S={isAdmin:h.isAdmin};h.newPassword&&(S.newPassword=h.newPassword);const T=await u(n.username,S);T!=null&&T.success?l():m((T==null?void 0:T.message)||i("users.updateError"))}catch(S){m(S instanceof Error?S.message:i("users.updateError"))}finally{g(!1)}},C=k=>{const{name:S,value:T,type:R,checked:A}=k.target;y(j=>({...j,[S]:R==="checkbox"?A:T}))};return r.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full flex items-center justify-center z-50",children:r.jsx("div",{className:"bg-white p-8 rounded-lg shadow-xl max-w-md w-full mx-4",children:r.jsxs("form",{onSubmit:N,children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:[i("users.edit")," - ",n.username]}),d&&r.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-3 mb-4",children:r.jsx("p",{className:"text-sm",children:d})}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",id:"isAdmin",name:"isAdmin",checked:h.isAdmin,onChange:C,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded",disabled:p}),r.jsx("label",{htmlFor:"isAdmin",className:"ml-2 block text-sm text-gray-700",children:i("users.adminRole")})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"newPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:i("users.newPassword")}),r.jsx("input",{type:"password",id:"newPassword",name:"newPassword",value:h.newPassword,onChange:C,placeholder:i("users.newPasswordPlaceholder"),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",disabled:p,minLength:6})]}),h.newPassword&&r.jsxs("div",{children:[r.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:i("users.confirmPassword")}),r.jsx("input",{type:"password",id:"confirmPassword",name:"confirmPassword",value:h.confirmPassword,onChange:C,placeholder:i("users.confirmPasswordPlaceholder"),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",disabled:p,minLength:6})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 transition-colors duration-200",disabled:p,children:i("common.cancel")}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:p,children:i(p?"common.updating":"users.update")})]})]})})})},$1=({user:n,currentUser:l,onEdit:o,onDelete:i})=>{const{t:u}=we(),[d,m]=b.useState(!1),p=()=>{m(!0)},g=()=>{i(n.username),m(!1)},h=(l==null?void 0:l.username)===n.username,y=!h;return r.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[r.jsxs("div",{className:"flex justify-between items-start",children:[r.jsx("div",{className:"flex-1",children:r.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[r.jsx("div",{className:"w-10 h-10 bg-blue-500 rounded-full flex items-center justify-center",children:r.jsx("span",{className:"text-white font-medium text-sm",children:n.username.charAt(0).toUpperCase()})}),r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:[n.username,h&&r.jsx("span",{className:"ml-2 px-2 py-1 text-xs bg-blue-100 text-blue-800 rounded",children:u("users.currentUser")})]}),r.jsx("div",{className:"flex items-center space-x-2",children:r.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${n.isAdmin?"bg-red-100 text-red-800":"bg-gray-100 text-gray-800"}`,children:n.isAdmin?u("users.admin"):u("users.user")})})]})]})}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx("button",{onClick:()=>o(n),className:"text-gray-500 hover:text-gray-700",title:u("users.edit"),children:r.jsx(Oo,{size:18})}),y&&r.jsx("button",{onClick:p,className:"text-gray-500 hover:text-red-600",title:u("users.delete"),children:r.jsx(zp,{size:18})})]})]}),r.jsx(Eu,{isOpen:d,onClose:()=>m(!1),onConfirm:g,serverName:n.username,isGroup:!1,isUser:!0})]})},I1=()=>{const{t:n}=we(),{auth:l}=Br(),o=l.user,{users:i,loading:u,error:d,setError:m,deleteUser:p,triggerRefresh:g}=Tu(),[h,y]=b.useState(null),[N,C]=b.useState(!1);if(!(o!=null&&o.isAdmin))return r.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:r.jsx("p",{className:"text-red-600",children:n("users.adminRequired")})});const k=j=>{y(j)},S=()=>{y(null),g()},T=async j=>{const O=await p(j);O!=null&&O.success||m((O==null?void 0:O.message)||n("users.deleteError"))},R=()=>{C(!0)},A=()=>{C(!1),g()};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:n("pages.users.title")}),r.jsx("div",{className:"flex space-x-4",children:r.jsxs("button",{onClick:R,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"})}),n("users.add")]})})]}),d&&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:d})}),u?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:n("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:n("users.noUsers")})}):r.jsx("div",{className:"space-y-6",children:i.map(j=>r.jsx($1,{user:j,currentUser:o,onEdit:k,onDelete:T},j.username))}),N&&r.jsx(K1,{onAdd:A,onCancel:A}),h&&r.jsx(F1,{user:h,onEdit:S,onCancel:()=>y(null)})]})},Y1=({onSuccess:n,onCancel:l})=>{const{t:o}=we(),[i,u]=b.useState({currentPassword:"",newPassword:""}),[d,m]=b.useState(""),[p,g]=b.useState(!1),[h,y]=b.useState(null),[N,C]=b.useState(!1),k=T=>{const{name:R,value:A}=T.target;R==="confirmPassword"?m(A):u(j=>({...j,[R]:A}))},S=async T=>{if(T.preventDefault(),y(null),i.newPassword!==d){y(o("auth.passwordsNotMatch"));return}g(!0);try{const R=await mb(i);R.success?(C(!0),n&&n()):y(R.message||o("auth.changePasswordError"))}catch{y(o("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:o("auth.changePassword")}),N?r.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:o("auth.changePasswordSuccess")}):r.jsxs("form",{onSubmit:S,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:o("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:i.currentPassword,onChange:k,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:o("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:i.newPassword,onChange:k,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:o("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:d,onChange:k,required:!0,minLength:6})]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[l&&r.jsx("button",{type:"button",onClick:l,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:o("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"})]}),o("common.save")]}):o("common.save")})]})]})]})};function X1(n=32){const l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=new Uint8Array(n);return crypto.getRandomValues(o),Array.from(o).map(i=>l.charAt(i%l.length)).join("")}const Bn={SETTINGS_SMART_ROUTING:"settings:smart_routing",SETTINGS_SKIP_AUTH:"settings:skip_auth",SETTINGS_INSTALL_CONFIG:"settings:install_config",SETTINGS_EXPORT_CONFIG:"settings:export_config"},Q1=()=>{const{t:n}=we(),l=Ka(),{showToast:o}=Jn(),[i,u]=b.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[d,m]=b.useState({dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[p,g]=b.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[h,y]=b.useState("-"),{routingConfig:N,tempRoutingConfig:C,setTempRoutingConfig:k,installConfig:S,smartRoutingConfig:T,mcpRouterConfig:R,nameSeparator:A,loading:j,updateRoutingConfig:O,updateRoutingConfigBatch:F,updateInstallConfig:Z,updateSmartRoutingConfig:re,updateSmartRoutingConfigBatch:te,updateMCPRouterConfig:I,updateNameSeparator:le,exportMCPSettings:se}=qr();b.useEffect(()=>{S&&u(S)},[S]),b.useEffect(()=>{T&&m({dbUrl:T.dbUrl||"",openaiApiBaseUrl:T.openaiApiBaseUrl||"",openaiApiKey:T.openaiApiKey||"",openaiApiEmbeddingModel:T.openaiApiEmbeddingModel||""})},[T]),b.useEffect(()=>{R&&g({apiKey:R.apiKey||"",referer:R.referer||"https://www.mcphubx.com",title:R.title||"MCPHub",baseUrl:R.baseUrl||"https://api.mcprouter.to/v1"})},[R]),b.useEffect(()=>{y(A)},[A]);const[U,z]=b.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,mcpRouterConfig:!1,nameSeparator:!1,password:!1,exportConfig:!1}),W=ie=>{z(Te=>({...Te,[ie]:!Te[ie]}))},H=async(ie,Te)=>{if(ie==="enableBearerAuth"&&Te===!0&&!C.bearerAuthKey&&!N.bearerAuthKey){const et=X1();B(et),await F({enableBearerAuth:!0,bearerAuthKey:et})&&k(De=>({...De,bearerAuthKey:et}));return}await O(ie,Te)},B=ie=>{k(Te=>({...Te,bearerAuthKey:ie}))},w=async()=>{await O("bearerAuthKey",C.bearerAuthKey)},E=(ie,Te)=>{u({...i,[ie]:Te})},_=async ie=>{await Z(ie,i[ie])},fe=(ie,Te)=>{m({...d,[ie]:Te})},M=async ie=>{await re(ie,d[ie])},Q=(ie,Te)=>{g({...p,[ie]:Te})},oe=async ie=>{await I(ie,p[ie])},q=async()=>{await le(h)},G=async ie=>{if(ie){const Te=d.dbUrl||T.dbUrl,et=d.openaiApiKey||T.openaiApiKey;if(!Te||!et){const De=[];Te||De.push(n("settings.dbUrl")),et||De.push(n("settings.openaiApiKey")),o(n("settings.smartRoutingValidationError",{fields:De.join(", ")}));return}const xt={enabled:ie};d.dbUrl!==T.dbUrl&&(xt.dbUrl=d.dbUrl),d.openaiApiBaseUrl!==T.openaiApiBaseUrl&&(xt.openaiApiBaseUrl=d.openaiApiBaseUrl),d.openaiApiKey!==T.openaiApiKey&&(xt.openaiApiKey=d.openaiApiKey),d.openaiApiEmbeddingModel!==T.openaiApiEmbeddingModel&&(xt.openaiApiEmbeddingModel=d.openaiApiEmbeddingModel),await te(xt)}else await re("enabled",ie)},ue=()=>{setTimeout(()=>{l("/")},2e3)},[J,$]=b.useState(!1),[ce,be]=b.useState(""),Ne=async()=>{try{const ie=await se();console.log("Fetched MCP settings:",ie);const Te=JSON.stringify(ie,null,2);be(Te)}catch(ie){console.error("Error fetching MCP settings:",ie),o(n("settings.exportError")||"Failed to fetch settings","error")}};b.useEffect(()=>{U.exportConfig&&!ce&&Ne()},[U.exportConfig]);const ye=async()=>{if(ce)try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(ce),$(!0),o(n("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>$(!1),2e3);else{const ie=document.createElement("textarea");ie.value=ce,ie.style.position="fixed",ie.style.left="-9999px",document.body.appendChild(ie),ie.focus(),ie.select();try{document.execCommand("copy"),$(!0),o(n("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>$(!1),2e3)}catch(Te){o(n("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",Te)}document.body.removeChild(ie)}}catch(ie){console.error("Error copying configuration:",ie),o(n("common.copyFailed")||"Copy failed","error")}},Ae=()=>{if(!ce)return;const ie=new Blob([ce],{type:"application/json"}),Te=URL.createObjectURL(ie),et=document.createElement("a");et.href=Te,et.download="mcp_settings.json",document.body.appendChild(et),et.click(),document.body.removeChild(et),URL.revokeObjectURL(Te),o(n("settings.exportSuccess")||"Settings exported successfully","success")};return r.jsxs("div",{className:"container mx-auto",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:n("pages.settings.title")}),r.jsx(Hn,{permissions:Bn.SETTINGS_SMART_ROUTING,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>W("smartRoutingConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:n("pages.settings.smartRouting")}),r.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:U.smartRoutingConfig?"▼":"►"})]}),U.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:n("settings.enableSmartRouting")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.enableSmartRoutingDescription")})]}),r.jsx(Pr,{disabled:j,checked:T.enabled,onCheckedChange:ie=>G(ie)})]}),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:"*"}),n("settings.dbUrl")]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:d.dbUrl,onChange:ie=>fe("dbUrl",ie.target.value),placeholder:n("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:j}),r.jsx("button",{onClick:()=>M("dbUrl"),disabled:j,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:n("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:"*"}),n("settings.openaiApiKey")]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"password",value:d.openaiApiKey,onChange:ie=>fe("openaiApiKey",ie.target.value),placeholder:n("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:j}),r.jsx("button",{onClick:()=>M("openaiApiKey"),disabled:j,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:n("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:n("settings.openaiApiBaseUrl")})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:d.openaiApiBaseUrl,onChange:ie=>fe("openaiApiBaseUrl",ie.target.value),placeholder:n("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:j}),r.jsx("button",{onClick:()=>M("openaiApiBaseUrl"),disabled:j,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:n("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:n("settings.openaiApiEmbeddingModel")})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:d.openaiApiEmbeddingModel,onChange:ie=>fe("openaiApiEmbeddingModel",ie.target.value),placeholder:n("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:j}),r.jsx("button",{onClick:()=>M("openaiApiEmbeddingModel"),disabled:j,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:n("common.save")})]})]})]})]})}),r.jsx(Hn,{permissions:Bn.SETTINGS_INSTALL_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>W("mcpRouterConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:n("settings.mcpRouterConfig")}),r.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:U.mcpRouterConfig?"▼":"►"})]}),U.mcpRouterConfig&&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:n("settings.mcpRouterApiKey")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.mcpRouterApiKeyDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"password",value:p.apiKey,onChange:ie=>Q("apiKey",ie.target.value),placeholder:n("settings.mcpRouterApiKeyPlaceholder"),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:j}),r.jsx("button",{onClick:()=>oe("apiKey"),disabled:j,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:n("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:n("settings.mcpRouterBaseUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.mcpRouterBaseUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:p.baseUrl,onChange:ie=>Q("baseUrl",ie.target.value),placeholder:n("settings.mcpRouterBaseUrlPlaceholder"),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:j}),r.jsx("button",{onClick:()=>oe("baseUrl"),disabled:j,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:n("common.save")})]})]})]})]})}),r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>W("nameSeparator"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:n("settings.systemSettings")}),r.jsx("span",{className:"text-gray-500",children:U.nameSeparator?"▼":"►"})]}),U.nameSeparator&&r.jsx("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:n("settings.nameSeparatorLabel")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.nameSeparatorDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:h,onChange:ie=>y(ie.target.value),placeholder:"-",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:j,maxLength:5}),r.jsx("button",{onClick:q,disabled:j,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:n("common.save")})]})]})})]}),r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>W("routingConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:n("pages.settings.routeConfig")}),r.jsx("span",{className:"text-gray-500",children:U.routingConfig?"▼":"►"})]}),U.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:n("settings.enableBearerAuth")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.enableBearerAuthDescription")})]}),r.jsx(Pr,{disabled:j,checked:N.enableBearerAuth,onCheckedChange:ie=>H("enableBearerAuth",ie)})]}),N.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:n("settings.bearerAuthKey")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.bearerAuthKeyDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:C.bearerAuthKey,onChange:ie=>B(ie.target.value),placeholder:n("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:j||!N.enableBearerAuth}),r.jsx("button",{onClick:w,disabled:j||!N.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:n("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:n("settings.enableGlobalRoute")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.enableGlobalRouteDescription")})]}),r.jsx(Pr,{disabled:j,checked:N.enableGlobalRoute,onCheckedChange:ie=>H("enableGlobalRoute",ie)})]}),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:n("settings.enableGroupNameRoute")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.enableGroupNameRouteDescription")})]}),r.jsx(Pr,{disabled:j,checked:N.enableGroupNameRoute,onCheckedChange:ie=>H("enableGroupNameRoute",ie)})]}),r.jsx(Hn,{permissions:Bn.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:n("settings.skipAuth")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.skipAuthDescription")})]}),r.jsx(Pr,{disabled:j,checked:N.skipAuth,onCheckedChange:ie=>H("skipAuth",ie)})]})})]})]}),r.jsx(Hn,{permissions:Bn.SETTINGS_INSTALL_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>W("installConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:n("settings.installConfig")}),r.jsx("span",{className:"text-gray-500",children:U.installConfig?"▼":"►"})]}),U.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:n("settings.baseUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.baseUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:i.baseUrl,onChange:ie=>E("baseUrl",ie.target.value),placeholder:n("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:j}),r.jsx("button",{onClick:()=>_("baseUrl"),disabled:j,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:n("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:n("settings.pythonIndexUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.pythonIndexUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:i.pythonIndexUrl,onChange:ie=>E("pythonIndexUrl",ie.target.value),placeholder:n("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:j}),r.jsx("button",{onClick:()=>_("pythonIndexUrl"),disabled:j,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:n("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:n("settings.npmRegistry")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.npmRegistryDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:i.npmRegistry,onChange:ie=>E("npmRegistry",ie.target.value),placeholder:n("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:j}),r.jsx("button",{onClick:()=>_("npmRegistry"),disabled:j,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:n("common.save")})]})]})]})]})}),r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>W("password"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:n("auth.changePassword")}),r.jsx("span",{className:"text-gray-500",children:U.password?"▼":"►"})]}),U.password&&r.jsx("div",{className:"max-w-lg mt-4",children:r.jsx(Y1,{onSuccess:ue})})]}),r.jsx(Hn,{permissions:Bn.SETTINGS_EXPORT_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>W("exportConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:n("settings.exportMcpSettings")}),r.jsx("span",{className:"text-gray-500",children:U.exportConfig?"▼":"►"})]}),U.exportConfig&&r.jsx("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-4",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:n("settings.mcpSettingsJson")}),r.jsx("p",{className:"text-sm text-gray-500",children:n("settings.mcpSettingsJsonDescription")})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("button",{onClick:ye,disabled:!ce,className:"flex items-center gap-2 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:[J?r.jsx(Ls,{size:16}):r.jsx(So,{size:16}),n(J?"common.copied":"settings.copyToClipboard")]}),r.jsxs("button",{onClick:Ae,disabled:!ce,className:"flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:[r.jsx(Fb,{size:16}),n("settings.downloadJson")]})]}),ce&&r.jsx("div",{className:"mt-3",children:r.jsx("pre",{className:"bg-gray-900 text-gray-100 p-4 rounded-md overflow-x-auto text-xs max-h-96",children:ce})})]})]})})]})})]})},J1=()=>{const{t:n}=we(),[l,o]=b.useState([]),[i,u]=b.useState([]),[d,m]=b.useState([]),[p,g]=b.useState([]),[h,y]=b.useState(""),[N,C]=b.useState(""),[k,S]=b.useState(""),[T,R]=b.useState(!0),[A,j]=b.useState(null),[O,F]=b.useState(null),[Z,re]=b.useState([]),[te,I]=b.useState(1),[le,se]=b.useState(9),[U,z]=b.useState(1),W=b.useCallback(async()=>{try{R(!0);const J=await Ye("/market/servers");J&&J.success&&Array.isArray(J.data)?(u(J.data),H(J.data,te)):(console.error("Invalid market servers data format:",J),j(n("market.fetchError")))}catch(J){console.error("Error fetching market servers:",J),j(J instanceof Error?J.message:String(J))}finally{R(!1)}},[n]),H=b.useCallback((J,$,ce=le)=>{const be=J.length,Ne=Math.ceil(be/ce);z(Ne);const ye=Math.max(1,Math.min($,Ne));ye!==$&&I(ye);const Ae=(ye-1)*ce,ie=J.slice(Ae,Ae+ce);o(ie)},[le]),B=b.useCallback(J=>{I(J),H(i,J,le)},[i,H,le]),w=b.useCallback(async()=>{try{const J=await Ye("/market/categories");J&&J.success&&Array.isArray(J.data)?m(J.data):console.error("Invalid categories data format:",J)}catch(J){console.error("Error fetching categories:",J)}},[]),E=b.useCallback(async()=>{try{const J=await Ye("/market/tags");J&&J.success&&Array.isArray(J.data)?g(J.data):console.error("Invalid tags data format:",J)}catch(J){console.error("Error fetching tags:",J)}},[]),_=b.useCallback(async J=>{try{R(!0);const $=await Ye(`/market/servers/${J}`);return $&&$.success&&$.data?(F($.data),$.data):(console.error("Invalid server data format:",$),j(n("market.serverNotFound")),null)}catch($){return console.error(`Error fetching server ${J}:`,$),j($ instanceof Error?$.message:String($)),null}finally{R(!1)}},[n]),fe=b.useCallback(async J=>{try{if(R(!0),S(J),!J.trim()){W();return}const $=await Ye(`/market/servers/search?query=${encodeURIComponent(J)}`);$&&$.success&&Array.isArray($.data)?(u($.data),I(1),H($.data,1)):(console.error("Invalid search results format:",$),j(n("market.searchError")))}catch($){console.error("Error searching servers:",$),j($ instanceof Error?$.message:String($))}finally{R(!1)}},[n,i,H,W]),M=b.useCallback(async J=>{try{if(R(!0),y(J),C(""),!J){W();return}const $=await Ye(`/market/categories/${encodeURIComponent(J)}`);$&&$.success&&Array.isArray($.data)?(u($.data),I(1),H($.data,1)):(console.error("Invalid category filter results format:",$),j(n("market.filterError")))}catch($){console.error("Error filtering servers by category:",$),j($ instanceof Error?$.message:String($))}finally{R(!1)}},[n,W,H]),Q=b.useCallback(async J=>{try{if(R(!0),C(J),y(""),!J){W();return}const $=await Ye(`/market/tags/${encodeURIComponent(J)}`);$&&$.success&&Array.isArray($.data)?(u($.data),I(1),H($.data,1)):(console.error("Invalid tag filter results format:",$),j(n("market.tagFilterError")))}catch($){console.error("Error filtering servers by tag:",$),j($ instanceof Error?$.message:String($))}finally{R(!1)}},[n,W,H]),oe=b.useCallback(async()=>{try{const J=await Ye("/servers");if(J&&J.success&&Array.isArray(J.data)){const $=J.data.map(ce=>ce.name);re($)}}catch(J){console.error("Error fetching installed servers:",J)}},[]),q=b.useCallback(J=>Z.includes(J),[Z]),G=b.useCallback(async(J,$)=>{var ce,be;try{const Ne=(ce=J.installations)!=null&&ce.npm?"npm":Object.keys(J.installations||{}).length>0?Object.keys(J.installations)[0]:null;if(!Ne||!((be=J.installations)!=null&&be[Ne]))return j(n("market.noInstallationMethod")),!1;const ye=J.installations[Ne],Ae={name:J.name,config:$.type==="stdio"?{command:$.command||ye.command||"",args:$.args||ye.args||[],env:{...ye.env,...$.env}}:$},ie=await Et("/servers",Ae);if(!ie.success)throw new Error(ie.message||"Failed to install server");return await oe(),!0}catch(Ne){return console.error("Error installing server:",Ne),j(Ne instanceof Error?Ne.message:String(Ne)),!1}},[n,oe]),ue=b.useCallback(J=>{se(J),I(1),H(i,1,J)},[i,H]);return b.useEffect(()=>{W(),w(),E(),oe()},[W,w,E,oe]),{servers:l,allServers:i,categories:d,tags:p,selectedCategory:h,selectedTag:N,searchQuery:k,loading:T,error:A,setError:j,currentServer:O,fetchMarketServers:W,fetchServerByName:_,searchServers:fe,filterByCategory:M,filterByTag:Q,installServer:G,currentPage:te,totalPages:U,serversPerPage:le,changePage:B,changeServersPerPage:ue,isServerInstalled:q}},Z1=()=>{const{t:n}=we(),[l,o]=b.useState([]),[i,u]=b.useState([]),[d,m]=b.useState([]),[p,g]=b.useState([]),[h,y]=b.useState(""),[N,C]=b.useState(""),[k,S]=b.useState(""),[T,R]=b.useState(!0),[A,j]=b.useState(null),[O,F]=b.useState(null),[Z,re]=b.useState(1),[te,I]=b.useState(9),[le,se]=b.useState(1),U=b.useCallback(async()=>{try{R(!0);const q=await Ye("/cloud/servers");q&&q.success&&Array.isArray(q.data)?(u(q.data),z(q.data,Z)):(console.error("Invalid cloud market servers data format:",q),j(n("cloud.fetchError")))}catch(q){console.error("Error fetching cloud market servers:",q);const G=q instanceof Error?q.message:String(q);G==="MCPROUTER_API_KEY_NOT_CONFIGURED"||G.toLowerCase().includes("mcprouter api key not configured"),j(G)}finally{R(!1)}},[n]),z=b.useCallback((q,G,ue=te)=>{const J=q.length,$=Math.ceil(J/ue);se($);const ce=Math.max(1,Math.min(G,$));ce!==G&&re(ce);const be=(ce-1)*ue,Ne=q.slice(be,be+ue);o(Ne)},[te]),W=b.useCallback(q=>{re(q),z(i,q,te)},[i,z,te]),H=b.useCallback(async()=>{try{const q=await Ye("/cloud/categories");q&&q.success&&Array.isArray(q.data)?m(q.data):console.error("Invalid cloud market categories data format:",q)}catch(q){console.error("Error fetching cloud market categories:",q)}},[]),B=b.useCallback(async()=>{try{const q=await Ye("/cloud/tags");q&&q.success&&Array.isArray(q.data)?g(q.data):console.error("Invalid cloud market tags data format:",q)}catch(q){console.error("Error fetching cloud market tags:",q)}},[]),w=b.useCallback(async q=>{try{R(!0);const G=await Ye(`/cloud/servers/${q}`);return G&&G.success&&G.data?(F(G.data),G.data):(console.error("Invalid cloud server data format:",G),j(n("cloud.serverNotFound")),null)}catch(G){console.error(`Error fetching cloud server ${q}:`,G);const ue=G instanceof Error?G.message:String(G);return ue==="MCPROUTER_API_KEY_NOT_CONFIGURED"||ue.toLowerCase().includes("mcprouter api key not configured"),j(ue),null}finally{R(!1)}},[n]),E=b.useCallback(async q=>{try{if(R(!0),S(q),!q.trim()){U();return}const G=await Ye(`/cloud/servers/search?query=${encodeURIComponent(q)}`);G&&G.success&&Array.isArray(G.data)?(u(G.data),re(1),z(G.data,1)):(console.error("Invalid cloud search results format:",G),j(n("cloud.searchError")))}catch(G){console.error("Error searching cloud servers:",G),j(G instanceof Error?G.message:String(G))}finally{R(!1)}},[n,i,z,U]),_=b.useCallback(async q=>{try{if(R(!0),y(q),C(""),!q){U();return}const G=await Ye(`/cloud/categories/${encodeURIComponent(q)}`);G&&G.success&&Array.isArray(G.data)?(u(G.data),re(1),z(G.data,1)):(console.error("Invalid cloud category filter results format:",G),j(n("cloud.filterError")))}catch(G){console.error("Error filtering cloud servers by category:",G),j(G instanceof Error?G.message:String(G))}finally{R(!1)}},[n,U,z]),fe=b.useCallback(async q=>{try{if(R(!0),C(q),y(""),!q){U();return}const G=await Ye(`/cloud/tags/${encodeURIComponent(q)}`);G&&G.success&&Array.isArray(G.data)?(u(G.data),re(1),z(G.data,1)):(console.error("Invalid cloud tag filter results format:",G),j(n("cloud.tagFilterError")))}catch(G){console.error("Error filtering cloud servers by tag:",G),j(G instanceof Error?G.message:String(G))}finally{R(!1)}},[n,U,z]),M=b.useCallback(async q=>{try{const G=await Ye(`/cloud/servers/${q}/tools`);if(!G.success)throw console.error("Failed to fetch cloud server tools:",G),new Error(G.message||"Failed to fetch cloud server tools");return G&&G.success&&Array.isArray(G.data)?G.data:(console.error("Invalid cloud server tools data format:",G),[])}catch(G){console.error(`Error fetching tools for cloud server ${q}:`,G);const ue=G instanceof Error?G.message:String(G);if(ue==="MCPROUTER_API_KEY_NOT_CONFIGURED"||ue.toLowerCase().includes("mcprouter api key not configured"))throw G;return[]}},[]),Q=b.useCallback(async(q,G,ue)=>{try{const J=await Et(`/cloud/servers/${q}/tools/${G}/call`,{arguments:ue});if(J&&J.success)return J.data;throw new Error(J.message||"Failed to call tool")}catch(J){throw console.error(`Error calling tool ${G} on cloud server ${q}:`,J),J}},[]),oe=b.useCallback(q=>{I(q),re(1),z(i,1,q)},[i,z]);return b.useEffect(()=>{U(),H(),B()},[U,H,B]),{servers:l,allServers:i,categories:d,tags:p,selectedCategory:h,selectedTag:N,searchQuery:k,loading:T,error:A,setError:j,currentServer:O,fetchCloudServers:U,fetchServerByName:w,searchServers:E,filterByCategory:_,filterByTag:fe,fetchServerTools:M,callServerTool:Q,currentPage:Z,totalPages:le,serversPerPage:te,changePage:W,changeServersPerPage:oe}},W1=({server:n,onClick:l})=>{var g,h,y,N;const{t:o}=we(),i=C=>C.split(" ").map(k=>k.charAt(0)).join("").toUpperCase().slice(0,2),u=()=>{if(!n.tags||n.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const C=28,k=O=>O.length+3;let S=0,T=0;const R=[...n.tags].sort((O,F)=>O.length-F.length);for(T=0;T<R.length;T++){const O=k(R[T]);if(S+O>C)break;if(S+=O,T===R.length-1)return{tagsToShow:R,hasMore:!1,moreCount:0}}T===0&&R.length>0&&(T=1);const A=R.length-T,j=3+String(A).length+o("market.moreTags").length;return S+j<=C||T<1?{tagsToShow:R.slice(0,T),hasMore:!0,moreCount:A}:{tagsToShow:R.slice(0,Math.max(1,T-1)),hasMore:!0,moreCount:A+1}},{tagsToShow:d,hasMore:m,moreCount:p}=u();return r.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:shadow-lg hover:border-blue-400 hover:-translate-y-1 transition-all duration-300 cursor-pointer group relative overflow-hidden h-full flex flex-col",onClick:()=>l(n),children:[r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-50/0 to-purple-50/0 group-hover:from-blue-50/30 group-hover:to-purple-50/30 transition-all duration-300 pointer-events-none"}),r.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between mb-2",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-lg font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200 mb-1 line-clamp-1 mr-2",children:n.display_name}),r.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[r.jsx("div",{className:"w-6 h-6 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white text-xs font-semibold",children:i(((g=n.author)==null?void 0:g.name)||o("market.unknown"))}),r.jsx("div",{children:r.jsx("p",{className:"text-xs font-medium text-gray-700",children:((h=n.author)==null?void 0:h.name)||o("market.unknown")})})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:n.is_official&&r.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:o("market.official")})})]}),r.jsx("div",{className:"mb-2 flex-1",children:r.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2 min-h-[36px]",children:n.description})}),r.jsx("div",{className:"mb-2",children:r.jsx("div",{className:"flex flex-wrap gap-1 min-h-[24px]",children:((y=n.categories)==null?void 0:y.length)>0?n.categories.map((C,k)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded whitespace-nowrap",children:C},k)):r.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})}),r.jsx("div",{className:"mb-2",children:r.jsx("div",{className:"relative min-h-[24px] overflow-x-auto",children:((N=n.tags)==null?void 0:N.length)>0?r.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[d.map((C,k)=>r.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0",children:["#",C]},k)),m&&r.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",p," ",o("market.moreTags")]})]}):r.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})})]})]})},e2=({server:n,onBack:l,onInstall:o,installing:i=!1,isInstalled:u=!1})=>{var le,se;const{t:d}=we(),[m,p]=b.useState(!1),[g,h]=b.useState(null),[y,N]=b.useState(!1),[C,k]=b.useState(null),[S,T]=b.useState([]),R=()=>u?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:d("market.installed")}:i?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:d("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:d("market.install")},A=()=>{p(!m),h(null),N(!1),k(null)},j=async()=>{C&&(await O(C),N(!1),k(null))},O=async U=>{try{h(null),o(n,U.config),p(!1)}catch(z){console.error("Error installing server:",z),h(d("errors.serverInstall"))}},F=()=>{u||A()},Z=()=>{if(!n.installations)return;if(n.installations.npm)return n.installations.npm;if(n.installations.uvx)return n.installations.uvx;if(n.installations.default)return n.installations.default;const U=Object.keys(n.installations);if(U.length>0)return n.installations[U[0]]},re=async U=>{try{const z=ng(U);z.length>0?(T(z),k(U),N(!0)):await O(U)}catch(z){console.error("Error processing server installation:",z),h(d("errors.serverInstall"))}},te=R(),I=Z();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:l,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"})}),d("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:[n.display_name,r.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",n.name,")"]}),r.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[d("market.author"),": ",n.author.name," • ",d("market.license"),": ",n.license," •",r.jsx("a",{href:n.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:d("market.repository")})]})]})}),r.jsxs("div",{className:"flex items-center",children:[n.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:d("market.official")}),r.jsx("button",{onClick:F,disabled:te.disabled,className:te.className,children:te.text})]})]}),r.jsx("p",{className:"text-gray-700 mb-6",children:n.description}),r.jsxs("div",{className:"mb-6",children:[r.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[d("market.categories")," & ",d("market.tags")]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[(le=n.categories)==null?void 0:le.map((U,z)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:U},`cat-${z}`)),n.tags&&n.tags.map((U,z)=>r.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",U]},`tag-${z}`))]})]}),n.arguments&&Object.keys(n.arguments).length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("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:d("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:d("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:d("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:d("market.example")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(n.arguments).map(([U,z],W)=>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:z.description}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:z.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:z.example})})]},W))})]})})]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.tools")}),r.jsx("div",{className:"space-y-4",children:(se=n.tools)==null?void 0:se.map((U,z)=>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 W=document.getElementById(`schema-${z}`);W&&W.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:d("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-${z}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(U.inputSchema,null,2)})})]},z))})]}),n.examples&&n.examples.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.examples")}),r.jsx("div",{className:"space-y-4",children:n.examples.map((U,z)=>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})]},z))})]}),r.jsx("div",{className:"mt-6 flex justify-end",children:r.jsx("button",{onClick:F,disabled:te.disabled,className:te.className,children:te.text})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Do,{onSubmit:re,onCancel:A,modalTitle:d("market.installServer",{name:n.display_name}),formError:g,initialData:{name:n.name,status:"disconnected",config:I?{command:I.command||"",args:I.args||[],env:I.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:d("server.confirmVariables")}),r.jsx("p",{className:"text-gray-600 mb-4",children:d("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:[d("server.detectedVariables"),":"]}),r.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:S.map((U,z)=>r.jsxs("li",{className:"font-mono",children:["$",`{${U}}`]},z))})]})]})}),r.jsx("p",{className:"text-gray-600 text-sm mb-6",children:d("market.confirmVariablesMessage")}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:()=>{N(!1),k(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:d("common.cancel")}),r.jsx("button",{onClick:j,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:d("market.confirmAndInstall")})]})]})})]})},t2=({server:n,onClick:l})=>{const{t:o}=we(),i=()=>{l(n)},u=()=>{if(n.description&&n.description.length<=150)return n.description;if(n.content){const p=n.content.split(`
216
+ `).filter(g=>g.trim());for(const g of p)if(g.length>50&&g.length<=150)return g}return n.description?n.description.slice(0,150)+"...":o("cloud.noDescription")},d=p=>{try{const g=new Date(p),h=g.getFullYear(),y=(g.getMonth()+1).toString().padStart(2,"0"),N=g.getDate().toString().padStart(2,"0");return`${h}/${y}/${N}`}catch{return""}},m=p=>p.split(" ").map(g=>g.charAt(0)).join("").toUpperCase().slice(0,2);return r.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:shadow-lg hover:border-blue-400 hover:-translate-y-1 transition-all duration-300 cursor-pointer group relative overflow-hidden h-full flex flex-col",onClick:i,children:[r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-50/0 to-purple-50/0 group-hover:from-blue-50/30 group-hover:to-purple-50/30 transition-all duration-300 pointer-events-none"}),r.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-lg font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200 mb-2 line-clamp-2",children:n.title||n.name}),r.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[r.jsx("div",{className:"w-7 h-7 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white text-xs font-semibold",children:m(n.author_name)}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-gray-700",children:n.author_name}),n.updated_at&&r.jsxs("p",{className:"text-xs text-gray-500",children:[o("cloud.updated")," ",d(n.updated_at)]})]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:"MCP Server"})})]}),r.jsx("div",{className:"mb-3 flex-1",children:r.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2",children:u()})}),n.tools&&n.tools.length>0&&r.jsx("div",{className:"mb-3",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),r.jsxs("span",{className:"text-sm text-gray-600 font-medium",children:[n.tools.length," ",n.tools.length===1?o("cloud.tool"):o("cloud.tools")]})]})}),r.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[r.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:[r.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"})}),r.jsx("span",{children:d(n.created_at)})]}),r.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[r.jsx("span",{children:o("cloud.viewDetails")}),r.jsx("svg",{className:"w-4 h-4 ml-1 transform group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},iu=()=>{const{t:n}=we(),l=Ka(),o=()=>{l("/settings")},i=()=>{window.open("https://mcprouter.co","_blank","noopener,noreferrer")};return r.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-6 mb-6",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-amber-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 flex-1",children:[r.jsx("h3",{className:"text-sm font-medium text-amber-800",children:n("cloud.apiKeyNotConfigured")}),r.jsx("div",{className:"mt-2 text-sm text-amber-700",children:r.jsx("p",{children:n("cloud.apiKeyNotConfiguredDescription")})}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsxs("button",{onClick:i,className:"inline-flex items-center px-3 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200",children:[r.jsx("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),n("cloud.getApiKey")]}),r.jsxs("button",{onClick:o,className:"inline-flex items-center px-3 py-2 text-sm font-medium text-amber-800 bg-amber-100 border border-amber-300 rounded-md hover:bg-amber-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-amber-500 transition-colors duration-200",children:[r.jsxs("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),n("cloud.configureInSettings")]})]})]})]})})},a2=({serverName:n,onBack:l,onCallTool:o,fetchServerTools:i,onInstall:u,installing:d=!1,isInstalled:m=!1})=>{const{t:p}=we(),{mcpRouterConfig:g}=qr(),[h,y]=b.useState(null),[N,C]=b.useState(!0),[k,S]=b.useState(null),[T,R]=b.useState([]),[A,j]=b.useState(!1),[O,F]=b.useState(!1),[Z,re]=b.useState(null),[te,I]=b.useState({}),[le,se]=b.useState({}),[U,z]=b.useState({}),[W,H]=b.useState(!1),[B,w]=b.useState(null),E=$=>(console.error("Checking for MCPRouter API key error:",$),$==="MCPROUTER_API_KEY_NOT_CONFIGURED"||$.toLowerCase().includes("mcprouter api key not configured")),_=()=>m?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:p("market.installed")}:d?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:p("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white transition-colors",disabled:!1,text:p("market.install")},fe=()=>{!m&&u&&(H(!0),w(null))},M=()=>{H(!1),w(null)},Q=async $=>{try{if(!h||!u)return;w(null),u(h,$.config),H(!1)}catch(ce){console.error("Error installing server:",ce),w(p("errors.serverInstall"))}};b.useEffect(()=>{(async()=>{try{C(!0),S(null);const ce=await Ye(`/cloud/servers/${n}`);ce&&ce.success&&ce.data?(y(ce.data),R(ce.data.tools||[])):S(p("cloud.serverNotFound"))}catch(ce){console.error("Failed to load server details:",ce),S(ce instanceof Error?ce.message:String(ce))}finally{C(!1)}})()},[n,p]),b.useEffect(()=>{(async()=>{if(h&&(!h.tools||h.tools.length===0)&&i){j(!0),F(!1);try{const ce=await i(h.name);R(ce)}catch(ce){console.error("Failed to load tools:",ce);const be=ce instanceof Error?ce.message:String(ce);E(be)&&F(!0)}finally{j(!1)}}})()},[h==null?void 0:h.name,h==null?void 0:h.tools,i]);const oe=$=>{try{const ce=new Date($),be=ce.getFullYear(),Ne=String(ce.getMonth()+1).padStart(2,"0"),ye=String(ce.getDate()).padStart(2,"0"),Ae=String(ce.getHours()).padStart(2,"0"),ie=String(ce.getMinutes()).padStart(2,"0"),Te=String(ce.getSeconds()).padStart(2,"0");return`${be}-${Ne}-${ye} ${Ae}:${ie}:${Te}`}catch{return $}},q=($,ce,be)=>{se(Ne=>({...Ne,[$]:{...Ne[$],[ce]:be}}))},G=async $=>{if(!(!o||!h)){re($);try{const ce=le[$]||{},be=await o(h.server_key,$,ce);I(Ne=>({...Ne,[$]:be}))}catch(ce){console.error("Tool call failed:",ce);const be=ce instanceof Error?ce.message:String(ce);I(Ne=>({...Ne,[$]:{error:be}}))}finally{re(null)}}},ue=$=>{z(ce=>({...ce,[$]:!ce[$]}))},J=($,ce,be)=>{var Ae;const Ne=((Ae=le[$.name])==null?void 0:Ae[ce])||"",ye=ie=>{let Te=ie.target.value;be.type==="number"||be.type==="integer"?Te=Te===""?void 0:Number(Te):be.type==="boolean"&&(Te=ie.target.value==="true"),q($.name,ce,Te)};return be.type==="boolean"?r.jsxs("select",{value:Ne===!0?"true":Ne===!1?"false":"",onChange:ye,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",children:[r.jsx("option",{value:""}),r.jsx("option",{value:"true",children:p("common.true")}),r.jsx("option",{value:"false",children:p("common.false")})]}):be.type==="number"||be.type==="integer"?r.jsx("input",{type:"number",step:be.type==="integer"?"1":"any",value:Ne||"",onChange:ye,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"}):r.jsx("input",{type:"text",value:Ne||"",onChange:ye,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"})};return r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[r.jsx("div",{className:"mb-6",children:r.jsxs("button",{onClick:l,className:"inline-flex items-center text-gray-600 hover:text-gray-900 transition-colors group",children:[r.jsx("svg",{className:"h-5 w-5 mr-2 transform group-hover:-translate-x-1 transition-transform",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"})}),p("cloud.backToList")]})}),N?r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-12 w-12 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 text-lg",children:p("app.loading")})]})}):k&&!E(k)?r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-6",children:r.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-red-400 mr-3",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),r.jsx("p",{className:"text-red-700",children:k})]})})}):h?r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden",children:r.jsx("div",{className:"bg-gradient-to-r from-gray-100 to-gray-200 px-6 py-4",children:r.jsxs("div",{className:"flex justify-between items-end",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-800 mb-2",children:h.title||h.name}),r.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[r.jsx("span",{className:"text-sm bg-white/60 text-gray-700 px-3 py-1 rounded-full",children:h.name}),r.jsxs("div",{className:"flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})}),p("cloud.by")," ",h.author_name]})]})]}),r.jsxs("div",{className:"text-right flex flex-col items-end gap-3",children:[r.jsxs("div",{className:"text-xs text-gray-500",children:[p("cloud.updated"),": ",oe(h.updated_at)]}),u&&!E(k||"")&&!O&&r.jsx("button",{onClick:fe,disabled:_().disabled,className:_().className,children:_().text})]})]})})}),r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",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"})}),p("cloud.description")]}),r.jsx("p",{className:"text-gray-700 leading-relaxed",children:h.description})]}),h.content&&r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),p("cloud.details")]}),r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:r.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:h.content})})]}),r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsxs("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),p("cloud.tools"),T.length>0&&r.jsx("span",{className:"ml-2 bg-blue-100 text-blue-800 text-sm font-medium px-2.5 py-0.5 rounded-full",children:T.length})]}),O&&r.jsx(iu,{}),A?r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsxs("svg",{className:"animate-spin h-8 w-8 text-blue-500 mr-3",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("span",{className:"text-gray-600",children:p("cloud.loadingTools")})]}):T.length===0&&!O?r.jsxs("div",{className:"text-center py-12",children:[r.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),r.jsx("p",{className:"text-gray-600",children:p("cloud.noTools")})]}):T.length>0?r.jsx("div",{className:"space-y-4",children:T.map(($,ce)=>r.jsxs("div",{className:"border border-gray-200 rounded-lg p-6 hover:border-gray-300 transition-colors",children:[r.jsxs("div",{className:"flex justify-between items-start mb-4",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-2 flex items-center",children:[r.jsx("span",{className:"bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded mr-3",children:"TOOL"}),$.name]}),r.jsx("p",{className:"text-gray-600 leading-relaxed whitespace-pre-wrap",children:$.description})]}),o&&r.jsx("button",{onClick:()=>G($.name),disabled:Z===$.name,className:"ml-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center min-w-[100px] justify-center",children:Z===$.name?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"})]}),p("cloud.calling")]}):r.jsxs(r.Fragment,{children:[r.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h6m2 8l4-4H7l4 4z"})}),p("cloud.callTool")]})})]}),$.inputSchema&&$.inputSchema.properties&&Object.keys($.inputSchema.properties).length>0&&r.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700",children:p("cloud.parameters")}),r.jsxs("button",{onClick:()=>ue($.name),className:"text-sm text-blue-600 hover:text-blue-800 focus:outline-none flex items-center gap-1 transition-colors",children:[p("cloud.viewSchema"),r.jsx("svg",{className:`h-3 w-3 transition-transform duration-200 ${U[$.name]?"rotate-90":"rotate-0"}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]}),U[$.name]&&r.jsx("div",{className:"mb-4",children:r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-3 overflow-auto",children:r.jsx("pre",{className:"text-sm text-gray-800",children:JSON.stringify($.inputSchema,null,2)})})}),r.jsx("div",{className:"space-y-4",children:Object.entries($.inputSchema.properties).map(([be,Ne])=>{var ye;return r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[be,((ye=$.inputSchema.required)==null?void 0:ye.includes(be))&&r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),Ne.description&&r.jsx("p",{className:"text-xs text-gray-500",children:Ne.description}),J($,be,Ne)]},be)})})]}),te[$.name]&&r.jsx("div",{className:"border-t border-gray-100 pt-4 mt-4",children:te[$.name].error?r.jsx(r.Fragment,{children:E(te[$.name].error)?r.jsx(iu,{}):r.jsxs(r.Fragment,{children:[r.jsxs("h4",{className:"text-sm font-medium text-red-600 mb-3 flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 text-red-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),p("cloud.error")]}),r.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:r.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap overflow-auto",children:te[$.name].error})})]})}):r.jsxs(r.Fragment,{children:[r.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-3 flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),p("cloud.result")]}),r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:r.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap overflow-auto",children:JSON.stringify(te[$.name],null,2)})})]})})]},ce))}):null]})]}):r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 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 text-lg",children:p("cloud.serverNotFound")})]})}),W&&h&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Do,{onSubmit:Q,onCancel:M,modalTitle:p("cloud.installServer",{name:h.title||h.name}),formError:B,initialData:{name:h.name,status:"disconnected",config:{type:"streamable-http",url:h.server_url,headers:{Authorization:`Bearer ${g.apiKey||"<MCPROUTER_API_KEY>"}`,"HTTP-Referer":g.referer||"<YOUR_APP_URL>","X-Title":g.title||"<YOUR_APP_NAME>"}}}})})]})},r2=({currentPage:n,totalPages:l,onPageChange:o})=>{const i=()=>{const u=[];u.push(r.jsx("button",{onClick:()=>o(1),className:`px-3 py-1 mx-1 rounded ${n===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,n-Math.floor(5/2));m>2&&u.push(r.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let p=m;p<=Math.min(l-1,m+5-3);p++)u.push(r.jsx("button",{onClick:()=>o(p),className:`px-3 py-1 mx-1 rounded ${n===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<l-1&&u.push(r.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),l>1&&u.push(r.jsx("button",{onClick:()=>o(l),className:`px-3 py-1 mx-1 rounded ${n===l?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:l},"last")),u};return l<=1?null:r.jsxs("div",{className:"flex justify-center items-center my-6",children:[r.jsx("button",{onClick:()=>o(Math.max(1,n-1)),disabled:n===1,className:`px-3 py-1 rounded mr-2 ${n===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:i()}),r.jsx("button",{onClick:()=>o(Math.min(l,n+1)),disabled:n===l,className:`px-3 py-1 rounded ml-2 ${n===l?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"Next »"})]})},Bh=()=>{const{t:n}=we(),l=Ka(),{serverName:o}=hp(),{showToast:i}=Jn(),[u,d]=Zy(),m=u.get("tab")||"cloud",{servers:p,allServers:g,categories:h,loading:y,error:N,setError:C,searchServers:k,filterByCategory:S,filterByTag:T,selectedCategory:R,selectedTag:A,installServer:j,fetchServerByName:O,isServerInstalled:F,currentPage:Z,totalPages:re,changePage:te,serversPerPage:I,changeServersPerPage:le}=J1(),{servers:se,allServers:U,loading:z,error:W,setError:H,fetchServerTools:B,callServerTool:w,currentPage:E,totalPages:_,changePage:fe,serversPerPage:M,changeServersPerPage:Q}=Z1(),[oe,q]=b.useState(null),[G,ue]=b.useState(null),[J,$]=b.useState(""),[ce,be]=b.useState(!1),[Ne,ye]=b.useState(new Set);b.useEffect(()=>{(async()=>{if(o)if(m==="cloud"){const Pe=se.find(me=>me.name===o);Pe?ue(Pe):l("/market?tab=cloud")}else{const Pe=await O(o);Pe?q(Pe):l("/market?tab=local")}else q(null),ue(null)})()},[o,m,se,O,l]);const Ae=ke=>{const Pe=new URLSearchParams(u);Pe.set("tab",ke),d(Pe),o&&l("/market?"+Pe.toString())},ie=ke=>{ke.preventDefault(),m==="local"&&k(J)},Te=ke=>{m==="local"&&S(ke)},et=()=>{$(""),m==="local"&&(S(""),T(""))},xt=ke=>{l(m==="cloud"?`/market/${ke.name}?tab=cloud`:`/market/${ke.name}?tab=local`)},De=()=>{l(`/market?tab=${m}`)},jt=async(ke,Pe)=>{try{be(!0),await j(ke,Pe)&&i(n("market.installSuccess",{serverName:ke.display_name}),"success")}finally{be(!1)}},da=async(ke,Pe)=>{try{be(!0);const me={name:ke.name,config:Pe},de=await Et("/servers",me);if(!de.success){const he=(de==null?void 0:de.message)||n("server.addError");i(he,"error");return}ye(he=>new Set(he).add(ke.name)),i(n("cloud.installSuccess",{name:ke.title||ke.name}),"success")}catch(me){console.error("Error installing cloud server:",me);const de=me instanceof Error?me.message:String(me);i(n("cloud.installError",{error:de}),"error")}finally{be(!1)}},fa=async(ke,Pe,me)=>{try{const de=await w(ke,Pe,me);return i(n("cloud.toolCallSuccess",{toolName:Pe}),"success"),de}catch(de){const he=de instanceof Error?de.message:String(de);throw It(he)||i(n("cloud.toolCallError",{toolName:Pe,error:he}),"error"),de}},It=ke=>ke==="MCPROUTER_API_KEY_NOT_CONFIGURED"||ke.toLowerCase().includes("mcprouter api key not configured"),ma=ke=>{m==="local"?te(ke):fe(ke),window.scrollTo({top:0,behavior:"smooth"})},xr=ke=>{const Pe=parseInt(ke.target.value,10);m==="local"?le(Pe):Q(Pe)};if(oe)return r.jsx(e2,{server:oe,onBack:De,onInstall:jt,installing:ce,isInstalled:F(oe.name)});if(G)return r.jsx(a2,{serverName:G.name,onBack:De,onCallTool:fa,fetchServerTools:B,onInstall:da,installing:ce,isInstalled:Ne.has(G.name)});const Xe=m==="local",yr=Xe?p:se,_t=Xe?g:U,it=Xe?h:[],Mt=Xe?y:z,nt=Xe?N:W,Vr=Xe?C:H,Fa=Xe?R:"",Gr=Xe?A:"",Pt=Xe?Z:E,ja=Xe?re:_,Nt=Xe?I:M;return r.jsxs("div",{children:[r.jsx("div",{className:"mb-6",children:r.jsx("div",{className:"border-b border-gray-200",children:r.jsxs("nav",{className:"-mb-px flex space-x-3",children:[r.jsxs("button",{onClick:()=>Ae("cloud"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Xe?"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300":"border-blue-500 text-blue-600"}`,children:[n("cloud.title"),r.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",r.jsx("a",{href:"https://mcprouter.co",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPRouter"}),")"]})]}),r.jsxs("button",{onClick:()=>Ae("local"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Xe?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[n("market.title"),r.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",r.jsx("a",{href:"https://mcpm.sh",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPM"}),")"]})]})]})})}),nt&&r.jsx(r.Fragment,{children:!Xe&&It(nt)?r.jsx(iu,{}):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:nt}),r.jsx("button",{onClick:()=>Vr(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"})})})]})})}),Xe&&r.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:r.jsxs("form",{onSubmit:ie,className:"flex space-x-4 mb-0",children:[r.jsx("div",{className:"flex-grow",children:r.jsx("input",{type:"text",value:J,onChange:ke=>$(ke.target.value),placeholder:n("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:n("market.search")}),(J||Fa||Gr)&&r.jsx("button",{type:"button",onClick:et,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:n("market.clearFilters")})]})}),r.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[Xe&&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:it.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:n("market.categories")}),Fa&&r.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>S(""),children:n("market.clearCategoryFilter")})]}),r.jsx("div",{className:"flex flex-col gap-2",children:it.map(ke=>r.jsx("button",{onClick:()=>Te(ke),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${Fa===ke?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:ke},ke))})]}):Mt?r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"mb-3",children:r.jsx("h3",{className:"font-medium text-gray-900",children:n("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:n("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:n("market.categories")})}),r.jsx("p",{className:"text-sm text-gray-600 py-2",children:n("market.noCategories")})]})})}),r.jsx("div",{className:"flex-grow",children:Mt?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:n("app.loading")})]})}):yr.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:r.jsx("p",{className:"text-gray-600",children:n(Xe?"market.noServers":"cloud.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:yr.map((ke,Pe)=>Xe?r.jsx(W1,{server:ke,onClick:xt},Pe):r.jsx(t2,{server:ke,onClick:xt},Pe))}),r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("div",{className:"text-sm text-gray-500",children:Xe?n("market.showing",{from:(Pt-1)*Nt+1,to:Math.min(Pt*Nt,_t.length),total:_t.length}):n("cloud.showing",{from:(Pt-1)*Nt+1,to:Math.min(Pt*Nt,_t.length),total:_t.length})}),r.jsx(r2,{currentPage:Pt,totalPages:ja,onPageChange:ma}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[n(Xe?"market.perPage":"cloud.perPage"),":"]}),r.jsxs("select",{id:"perPage",value:Nt,onChange:xr,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"})]})})]})]})},s2={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"},n2={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 l2({variant:n="default",size:l="default",className:o,disabled:i,children:u,...d}){return r.jsx("button",{className:qa("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",s2[n],n2[l],o),disabled:i,...d,children:u})}const o2=({logs:n,isLoading:l=!1,error:o=null,onClear:i})=>{const{t:u}=we(),d=b.useRef(null),[m,p]=b.useState(!0),[g,h]=b.useState(""),[y,N]=b.useState(["info","error","warn","debug"]),[C,k]=b.useState(["main","child"]);b.useEffect(()=>{m&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[n,m]);const S=n.filter(j=>{const O=g?j.message.toLowerCase().includes(g.toLowerCase()):!0,F=y.includes(j.type),Z=C.includes(j.source);return O&&F&&Z}),T=j=>new Date(j).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),R=j=>{switch(j){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"}},A=j=>{switch(j){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:[u("logs.filters"),":"]}),r.jsx("input",{type:"text",placeholder:u("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:j=>h(j.target.value)}),r.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(j=>r.jsx(go,{variant:y.includes(j)?"default":"outline",className:`cursor-pointer ${y.includes(j)?R(j):""}`,onClick:()=>{y.includes(j)?N(O=>O.filter(F=>F!==j)):N(O=>[...O,j])},children:j},j))}),r.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(j=>r.jsx(go,{variant:C.includes(j)?"default":"outline",className:`cursor-pointer ${C.includes(j)?A(j):""}`,onClick:()=>{C.includes(j)?k(O=>O.filter(F=>F!==j)):k(O=>[...O,j])},children:u(j==="main"?"logs.mainProcess":"logs.childProcess")},j))})]}),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"}),u("logs.autoScroll")]}),r.jsx(l2,{variant:"outline",size:"sm",onClick:i,className:"btn-secondary",disabled:l||n.length===0,children:u("logs.clearLogs")})]})]}),r.jsx("div",{ref:d,className:"flex-grow p-2 overflow-auto bg-card rounded-b-md font-mono text-sm",style:{maxHeight:"calc(100vh - 300px)"},children:l?r.jsx("div",{className:"flex justify-center items-center h-full",children:r.jsx("span",{children:u("logs.loading")})}):o?r.jsx("div",{className:"text-red-500 p-2",children:o.message}):S.length===0?r.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||y.length<4||C.length<2?u("logs.noMatch"):u("logs.noLogs")}):S.map((j,O)=>r.jsxs("div",{className:`py-1 ${j.type==="error"?"text-red-500":j.type==="warn"?"text-yellow-500":""}`,children:[r.jsxs("span",{className:"text-gray-400",children:["[",T(j.timestamp),"]"]}),r.jsx(go,{className:`ml-2 mr-1 ${R(j.type)}`,children:j.type}),r.jsxs(go,{variant:"default",className:`mr-2 ${A(j.source)}`,children:[j.source==="main"?u("logs.main"):u("logs.child"),j.processId?` (${j.processId})`:""]}),r.jsx("span",{className:"whitespace-pre-wrap",children:j.message})]},`${j.timestamp}-${O}`))})]})},i2=async()=>{try{const n=await Kn("/logs");if(!n.success)throw new Error(n.error||"Failed to clear logs")}catch(n){throw console.error("Error clearing logs:",n),n}},c2=()=>{const[n,l]=b.useState([]),[o,i]=b.useState(!0),[u,d]=b.useState(null);return b.useEffect(()=>{let p=null,g=!0;const h=()=>{try{p&&p.close();const y=Qn();p=new EventSource(vu(`/logs/stream?token=${y}`)),p.onmessage=N=>{if(g)try{const C=JSON.parse(N.data);C.type==="initial"?(l(C.logs),i(!1)):C.type==="log"&&l(k=>[...k,C.log])}catch(C){console.error("Error parsing SSE message:",C)}},p.onerror=()=>{g&&(p&&(p.close(),setTimeout(h,5e3)),d(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(y){if(!g)return;d(y instanceof Error?y:new Error("Failed to connect to log stream")),i(!1)}};return h(),()=>{g=!1,p&&p.close()}},[]),{logs:n,loading:o,error:u,clearLogs:async()=>{try{await i2(),l([])}catch(p){d(p instanceof Error?p:new Error("Failed to clear logs"))}}}},u2=()=>{const{t:n}=we(),{logs:l,loading:o,error:i,clearLogs:u}=c2();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:n("pages.logs.title")})}),r.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:r.jsx(o2,{logs:l,isLoading:o,error:i,onClear:u})})]})},d2=()=>{const{serverName:n}=hp();return r.jsx(jo,{to:`/market/${n}?tab=cloud`,replace:!0})};function qh(){const n=bu();return r.jsx(t1,{children:r.jsx(gb,{children:r.jsx(a1,{children:r.jsx(Wv,{children:r.jsx(Yy,{basename:n,children:r.jsxs(Sy,{children:[r.jsx(Rt,{path:"/login",element:r.jsx(v1,{})}),r.jsx(Rt,{element:r.jsx(b1,{}),children:r.jsxs(Rt,{element:r.jsx(y1,{}),children:[r.jsx(Rt,{path:"/",element:r.jsx(w1,{})}),r.jsx(Rt,{path:"/servers",element:r.jsx(H1,{})}),r.jsx(Rt,{path:"/groups",element:r.jsx(G1,{})}),r.jsx(Rt,{path:"/users",element:r.jsx(I1,{})}),r.jsx(Rt,{path:"/market",element:r.jsx(Bh,{})}),r.jsx(Rt,{path:"/market/:serverName",element:r.jsx(Bh,{})}),r.jsx(Rt,{path:"/cloud",element:r.jsx(jo,{to:"/market?tab=cloud",replace:!0})}),r.jsx(Rt,{path:"/cloud/:serverName",element:r.jsx(d2,{})}),r.jsx(Rt,{path:"/logs",element:r.jsx(u2,{})}),r.jsx(Rt,{path:"/settings",element:r.jsx(Q1,{})})]})}),r.jsx(Rt,{path:"*",element:r.jsx(jo,{to:"/"})})]})})})})})})}const Ee=n=>typeof n=="string",qn=()=>{let n,l;const o=new Promise((i,u)=>{n=i,l=u});return o.resolve=n,o.reject=l,o},Vh=n=>n==null?"":""+n,f2=(n,l,o)=>{n.forEach(i=>{l[i]&&(o[i]=l[i])})},m2=/###/g,Gh=n=>n&&n.indexOf("###")>-1?n.replace(m2,"."):n,Kh=n=>!n||Ee(n),Vn=(n,l,o)=>{const i=Ee(l)?l.split("."):l;let u=0;for(;u<i.length-1;){if(Kh(n))return{};const d=Gh(i[u]);!n[d]&&o&&(n[d]=new o),Object.prototype.hasOwnProperty.call(n,d)?n=n[d]:n={},++u}return Kh(n)?{}:{obj:n,k:Gh(i[u])}},Fh=(n,l,o)=>{const{obj:i,k:u}=Vn(n,l,Object);if(i!==void 0||l.length===1){i[u]=o;return}let d=l[l.length-1],m=l.slice(0,l.length-1),p=Vn(n,m,Object);for(;p.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),p=Vn(n,m,Object),p!=null&&p.obj&&typeof p.obj[`${p.k}.${d}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${d}`]=o},h2=(n,l,o,i)=>{const{obj:u,k:d}=Vn(n,l,Object);u[d]=u[d]||[],u[d].push(o)},Co=(n,l)=>{const{obj:o,k:i}=Vn(n,l);if(o&&Object.prototype.hasOwnProperty.call(o,i))return o[i]},p2=(n,l,o)=>{const i=Co(n,o);return i!==void 0?i:Co(l,o)},og=(n,l,o)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in n?Ee(n[i])||n[i]instanceof String||Ee(l[i])||l[i]instanceof String?o&&(n[i]=l[i]):og(n[i],l[i],o):n[i]=l[i]);return n},As=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var g2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const x2=n=>Ee(n)?n.replace(/[&<>"'\/]/g,l=>g2[l]):n;class y2{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const o=this.regExpMap.get(l);if(o!==void 0)return o;const i=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,i),this.regExpQueue.push(l),i}}const b2=[" ",",","?","!",";"],v2=new y2(20),w2=(n,l,o)=>{l=l||"",o=o||"";const i=b2.filter(m=>l.indexOf(m)<0&&o.indexOf(m)<0);if(i.length===0)return!0;const u=v2.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let d=!u.test(n);if(!d){const m=n.indexOf(o);m>0&&!u.test(n.substring(0,m))&&(d=!0)}return d},cu=(n,l,o=".")=>{if(!n)return;if(n[l])return Object.prototype.hasOwnProperty.call(n,l)?n[l]:void 0;const i=l.split(o);let u=n;for(let d=0;d<i.length;){if(!u||typeof u!="object")return;let m,p="";for(let g=d;g<i.length;++g)if(g!==d&&(p+=o),p+=i[g],m=u[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;d+=g-d+1;break}u=m}return u},$n=n=>n==null?void 0:n.replace("_","-"),j2={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,l){var o,i;(i=(o=console==null?void 0:console[n])==null?void 0:o.apply)==null||i.call(o,console,l)}};class Eo{constructor(l,o={}){this.init(l,o)}init(l,o={}){this.prefix=o.prefix||"i18next:",this.logger=l||j2,this.options=o,this.debug=o.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,o,i,u){return u&&!this.debug?null:(Ee(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[o](l))}create(l){return new Eo(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new Eo(this.logger,l)}}var wa=new Eo;class Uo{constructor(){this.observers={}}on(l,o){return l.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const u=this.observers[i].get(o)||0;this.observers[i].set(o,u+1)}),this}off(l,o){if(this.observers[l]){if(!o){delete this.observers[l];return}this.observers[l].delete(o)}}emit(l,...o){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([u,d])=>{for(let m=0;m<d;m++)u(...o)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([u,d])=>{for(let m=0;m<d;m++)u.apply(u,[l,...o])})}}class $h extends Uo{constructor(l,o={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const o=this.options.ns.indexOf(l);o>-1&&this.options.ns.splice(o,1)}getResource(l,o,i,u={}){var h,y;const d=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator,m=u.ignoreJSONStructure!==void 0?u.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;l.indexOf(".")>-1?p=l.split("."):(p=[l,o],i&&(Array.isArray(i)?p.push(...i):Ee(i)&&d?p.push(...i.split(d)):p.push(i)));const g=Co(this.data,p);return!g&&!o&&!i&&l.indexOf(".")>-1&&(l=p[0],o=p[1],i=p.slice(2).join(".")),g||!m||!Ee(i)?g:cu((y=(h=this.data)==null?void 0:h[l])==null?void 0:y[o],i,d)}addResource(l,o,i,u,d={silent:!1}){const m=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let p=[l,o];i&&(p=p.concat(m?i.split(m):i)),l.indexOf(".")>-1&&(p=l.split("."),u=o,o=p[1]),this.addNamespaces(o),Fh(this.data,p,u),d.silent||this.emit("added",l,o,i,u)}addResources(l,o,i,u={silent:!1}){for(const d in i)(Ee(i[d])||Array.isArray(i[d]))&&this.addResource(l,o,d,i[d],{silent:!0});u.silent||this.emit("added",l,o,i)}addResourceBundle(l,o,i,u,d,m={silent:!1,skipCopy:!1}){let p=[l,o];l.indexOf(".")>-1&&(p=l.split("."),u=i,i=o,o=p[1]),this.addNamespaces(o);let g=Co(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),u?og(g,i,d):g={...g,...i},Fh(this.data,p,g),m.silent||this.emit("added",l,o,i)}removeResourceBundle(l,o){this.hasResourceBundle(l,o)&&delete this.data[l][o],this.removeNamespaces(o),this.emit("removed",l,o)}hasResourceBundle(l,o){return this.getResource(l,o)!==void 0}getResourceBundle(l,o){return o||(o=this.options.defaultNS),this.getResource(l,o)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const o=this.getDataByLanguage(l);return!!(o&&Object.keys(o)||[]).find(u=>o[u]&&Object.keys(o[u]).length>0)}toJSON(){return this.data}}var ig={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,l,o,i,u){return n.forEach(d=>{var m;l=((m=this.processors[d])==null?void 0:m.process(l,o,i,u))??l}),l}};const cg=Symbol("i18next/PATH_KEY");function N2(){const n=[],l=Object.create(null);let o;return l.get=(i,u)=>{var d;return(d=o==null?void 0:o.revoke)==null||d.call(o),u===cg?n:(n.push(u),o=Proxy.revocable(i,l),o.proxy)},Proxy.revocable(Object.create(null),l).proxy}function uu(n,l){const{[cg]:o}=n(N2());return o.join((l==null?void 0:l.keySeparator)??".")}const Ih={},Yh=n=>!Ee(n)&&typeof n!="boolean"&&typeof n!="number";class ko extends Uo{constructor(l,o={}){super(),f2(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wa.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,o={interpolation:{}}){const i={...o};if(l==null)return!1;const u=this.resolve(l,i);return(u==null?void 0:u.res)!==void 0}extractFromKey(l,o){let i=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let d=o.ns||this.options.defaultNS||[];const m=i&&l.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!w2(l,i,u);if(m&&!p){const g=l.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:l,namespaces:Ee(d)?[d]:d};const h=l.split(i);(i!==u||i===u&&this.options.ns.indexOf(h[0])>-1)&&(d=h.shift()),l=h.join(u)}return{key:l,namespaces:Ee(d)?[d]:d}}translate(l,o,i){let u=typeof o=="object"?{...o}:o;if(typeof u!="object"&&this.options.overloadTranslationOptionHandler&&(u=this.options.overloadTranslationOptionHandler(arguments)),typeof u=="object"&&(u={...u}),u||(u={}),l==null)return"";typeof l=="function"&&(l=uu(l,{...this.options,...u})),Array.isArray(l)||(l=[String(l)]);const d=u.returnDetails!==void 0?u.returnDetails:this.options.returnDetails,m=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator,{key:p,namespaces:g}=this.extractFromKey(l[l.length-1],u),h=g[g.length-1];let y=u.nsSeparator!==void 0?u.nsSeparator:this.options.nsSeparator;y===void 0&&(y=":");const N=u.lng||this.language,C=u.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((N==null?void 0:N.toLowerCase())==="cimode")return C?d?{res:`${h}${y}${p}`,usedKey:p,exactUsedKey:p,usedLng:N,usedNS:h,usedParams:this.getUsedParamsDetails(u)}:`${h}${y}${p}`:d?{res:p,usedKey:p,exactUsedKey:p,usedLng:N,usedNS:h,usedParams:this.getUsedParamsDetails(u)}:p;const k=this.resolve(l,u);let S=k==null?void 0:k.res;const T=(k==null?void 0:k.usedKey)||p,R=(k==null?void 0:k.exactUsedKey)||p,A=["[object Number]","[object Function]","[object RegExp]"],j=u.joinArrays!==void 0?u.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,F=u.count!==void 0&&!Ee(u.count),Z=ko.hasDefaultValue(u),re=F?this.pluralResolver.getSuffix(N,u.count,u):"",te=u.ordinal&&F?this.pluralResolver.getSuffix(N,u.count,{ordinal:!1}):"",I=F&&!u.ordinal&&u.count===0,le=I&&u[`defaultValue${this.options.pluralSeparator}zero`]||u[`defaultValue${re}`]||u[`defaultValue${te}`]||u.defaultValue;let se=S;O&&!S&&Z&&(se=le);const U=Yh(se),z=Object.prototype.toString.apply(se);if(O&&se&&U&&A.indexOf(z)<0&&!(Ee(j)&&Array.isArray(se))){if(!u.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,se,{...u,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return d?(k.res=W,k.usedParams=this.getUsedParamsDetails(u),k):W}if(m){const W=Array.isArray(se),H=W?[]:{},B=W?R:T;for(const w in se)if(Object.prototype.hasOwnProperty.call(se,w)){const E=`${B}${m}${w}`;Z&&!S?H[w]=this.translate(E,{...u,defaultValue:Yh(le)?le[w]:void 0,joinArrays:!1,ns:g}):H[w]=this.translate(E,{...u,joinArrays:!1,ns:g}),H[w]===E&&(H[w]=se[w])}S=H}}else if(O&&Ee(j)&&Array.isArray(S))S=S.join(j),S&&(S=this.extendTranslation(S,l,u,i));else{let W=!1,H=!1;!this.isValidLookup(S)&&Z&&(W=!0,S=le),this.isValidLookup(S)||(H=!0,S=p);const w=(u.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:S,E=Z&&le!==S&&this.options.updateMissing;if(H||W||E){if(this.logger.log(E?"updateKey":"missingKey",N,h,p,E?le:S),m){const Q=this.resolve(p,{...u,keySeparator:!1});Q&&Q.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 _=[];const fe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,u.lng||this.language);if(this.options.saveMissingTo==="fallback"&&fe&&fe[0])for(let Q=0;Q<fe.length;Q++)_.push(fe[Q]);else this.options.saveMissingTo==="all"?_=this.languageUtils.toResolveHierarchy(u.lng||this.language):_.push(u.lng||this.language);const M=(Q,oe,q)=>{var ue;const G=Z&&q!==S?q:w;this.options.missingKeyHandler?this.options.missingKeyHandler(Q,h,oe,G,E,u):(ue=this.backendConnector)!=null&&ue.saveMissing&&this.backendConnector.saveMissing(Q,h,oe,G,E,u),this.emit("missingKey",Q,h,oe,S)};this.options.saveMissing&&(this.options.saveMissingPlurals&&F?_.forEach(Q=>{const oe=this.pluralResolver.getSuffixes(Q,u);I&&u[`defaultValue${this.options.pluralSeparator}zero`]&&oe.indexOf(`${this.options.pluralSeparator}zero`)<0&&oe.push(`${this.options.pluralSeparator}zero`),oe.forEach(q=>{M([Q],p+q,u[`defaultValue${q}`]||le)})}):M(_,p,le))}S=this.extendTranslation(S,l,u,k,i),H&&S===p&&this.options.appendNamespaceToMissingKey&&(S=`${h}${y}${p}`),(H||W)&&this.options.parseMissingKeyHandler&&(S=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${y}${p}`:p,W?S:void 0,u))}return d?(k.res=S,k.usedParams=this.getUsedParamsDetails(u),k):S}extendTranslation(l,o,i,u,d){var g,h;if((g=this.i18nFormat)!=null&&g.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||u.usedLng,u.usedNS,u.usedKey,{resolved:u});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const y=Ee(l)&&(((h=i==null?void 0:i.interpolation)==null?void 0:h.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let N;if(y){const k=l.match(this.interpolator.nestingRegexp);N=k&&k.length}let C=i.replace&&!Ee(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(C={...this.options.interpolation.defaultVariables,...C}),l=this.interpolator.interpolate(l,C,i.lng||this.language||u.usedLng,i),y){const k=l.match(this.interpolator.nestingRegexp),S=k&&k.length;N<S&&(i.nest=!1)}!i.lng&&u&&u.res&&(i.lng=this.language||u.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...k)=>(d==null?void 0:d[0])===k[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${k[0]} in key: ${o[0]}`),null):this.translate(...k,o),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=Ee(m)?[m]:m;return l!=null&&(p!=null&&p.length)&&i.applyPostProcessor!==!1&&(l=ig.handle(p,l,o,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...u,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),l}resolve(l,o={}){let i,u,d,m,p;return Ee(l)&&(l=[l]),l.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,o),y=h.key;u=y;let N=h.namespaces;this.options.fallbackNS&&(N=N.concat(this.options.fallbackNS));const C=o.count!==void 0&&!Ee(o.count),k=C&&!o.ordinal&&o.count===0,S=o.context!==void 0&&(Ee(o.context)||typeof o.context=="number")&&o.context!=="",T=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);N.forEach(R=>{var A,j;this.isValidLookup(i)||(p=R,!Ih[`${T[0]}-${R}`]&&((A=this.utils)!=null&&A.hasLoadedNamespace)&&!((j=this.utils)!=null&&j.hasLoadedNamespace(p))&&(Ih[`${T[0]}-${R}`]=!0,this.logger.warn(`key "${u}" for languages "${T.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!!!")),T.forEach(O=>{var re;if(this.isValidLookup(i))return;m=O;const F=[y];if((re=this.i18nFormat)!=null&&re.addLookupKeys)this.i18nFormat.addLookupKeys(F,y,O,R,o);else{let te;C&&(te=this.pluralResolver.getSuffix(O,o.count,o));const I=`${this.options.pluralSeparator}zero`,le=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(C&&(o.ordinal&&te.indexOf(le)===0&&F.push(y+te.replace(le,this.options.pluralSeparator)),F.push(y+te),k&&F.push(y+I)),S){const se=`${y}${this.options.contextSeparator||"_"}${o.context}`;F.push(se),C&&(o.ordinal&&te.indexOf(le)===0&&F.push(se+te.replace(le,this.options.pluralSeparator)),F.push(se+te),k&&F.push(se+I))}}let Z;for(;Z=F.pop();)this.isValidLookup(i)||(d=Z,i=this.getResource(O,R,Z,o))}))})}),{res:i,usedKey:u,exactUsedKey:d,usedLng:m,usedNS:p}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,o,i,u={}){var d;return(d=this.i18nFormat)!=null&&d.getResource?this.i18nFormat.getResource(l,o,i,u):this.resourceStore.getResource(l,o,i,u)}getUsedParamsDetails(l={}){const o=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=l.replace&&!Ee(l.replace);let u=i?l.replace:l;if(i&&typeof l.count<"u"&&(u.count=l.count),this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),!i){u={...u};for(const d of o)delete u[d]}return u}static hasDefaultValue(l){const o="defaultValue";for(const i in l)if(Object.prototype.hasOwnProperty.call(l,i)&&o===i.substring(0,o.length)&&l[i]!==void 0)return!0;return!1}}class Xh{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wa.create("languageUtils")}getScriptPartFromCode(l){if(l=$n(l),!l||l.indexOf("-")<0)return null;const o=l.split("-");return o.length===2||(o.pop(),o[o.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(o.join("-"))}getLanguagePartFromCode(l){if(l=$n(l),!l||l.indexOf("-")<0)return l;const o=l.split("-");return this.formatLanguageCode(o[0])}formatLanguageCode(l){if(Ee(l)&&l.indexOf("-")>-1){let o;try{o=Intl.getCanonicalLocales(l)[0]}catch{}return o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let o;return l.forEach(i=>{if(o)return;const u=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(u))&&(o=u)}),!o&&this.options.supportedLngs&&l.forEach(i=>{if(o)return;const u=this.getScriptPartFromCode(i);if(this.isSupportedCode(u))return o=u;const d=this.getLanguagePartFromCode(i);if(this.isSupportedCode(d))return o=d;o=this.options.supportedLngs.find(m=>{if(m===d)return m;if(!(m.indexOf("-")<0&&d.indexOf("-")<0)&&(m.indexOf("-")>0&&d.indexOf("-")<0&&m.substring(0,m.indexOf("-"))===d||m.indexOf(d)===0&&d.length>1))return m})}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}getFallbackCodes(l,o){if(!l)return[];if(typeof l=="function"&&(l=l(o)),Ee(l)&&(l=[l]),Array.isArray(l))return l;if(!o)return l.default||[];let i=l[o];return i||(i=l[this.getScriptPartFromCode(o)]),i||(i=l[this.formatLanguageCode(o)]),i||(i=l[this.getLanguagePartFromCode(o)]),i||(i=l.default),i||[]}toResolveHierarchy(l,o){const i=this.getFallbackCodes((o===!1?[]:o)||this.options.fallbackLng||[],l),u=[],d=m=>{m&&(this.isSupportedCode(m)?u.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return Ee(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(l))):Ee(l)&&d(this.formatLanguageCode(l)),i.forEach(m=>{u.indexOf(m)<0&&d(this.formatLanguageCode(m))}),u}}const Qh={zero:0,one:1,two:2,few:3,many:4,other:5},Jh={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class S2{constructor(l,o={}){this.languageUtils=l,this.options=o,this.logger=wa.create("pluralResolver"),this.pluralRulesCache={}}addRule(l,o){this.rules[l]=o}clearCache(){this.pluralRulesCache={}}getRule(l,o={}){const i=$n(l==="dev"?"en":l),u=o.ordinal?"ordinal":"cardinal",d=JSON.stringify({cleanedCode:i,type:u});if(d in this.pluralRulesCache)return this.pluralRulesCache[d];let m;try{m=new Intl.PluralRules(i,{type:u})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Jh;if(!l.match(/-|_/))return Jh;const g=this.languageUtils.getLanguagePartFromCode(l);m=this.getRule(g,o)}return this.pluralRulesCache[d]=m,m}needsPlural(l,o={}){let i=this.getRule(l,o);return i||(i=this.getRule("dev",o)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(l,o,i={}){return this.getSuffixes(l,i).map(u=>`${o}${u}`)}getSuffixes(l,o={}){let i=this.getRule(l,o);return i||(i=this.getRule("dev",o)),i?i.resolvedOptions().pluralCategories.sort((u,d)=>Qh[u]-Qh[d]).map(u=>`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${u}`):[]}getSuffix(l,o,i={}){const u=this.getRule(l,i);return u?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${u.select(o)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",o,i))}}const Zh=(n,l,o,i=".",u=!0)=>{let d=p2(n,l,o);return!d&&u&&Ee(o)&&(d=cu(n,o,i),d===void 0&&(d=cu(l,o,i))),d},Zc=n=>n.replace(/\$/g,"$$$$");class C2{constructor(l={}){var o;this.logger=wa.create("interpolator"),this.options=l,this.format=((o=l==null?void 0:l.interpolation)==null?void 0:o.format)||(i=>i),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:o,escapeValue:i,useRawValueToEscape:u,prefix:d,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:y,unescapePrefix:N,nestingPrefix:C,nestingPrefixEscaped:k,nestingSuffix:S,nestingSuffixEscaped:T,nestingOptionsSeparator:R,maxReplaces:A,alwaysFormat:j}=l.interpolation;this.escape=o!==void 0?o:x2,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=u!==void 0?u:!1,this.prefix=d?As(d):m||"{{",this.suffix=p?As(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=y?"":N||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=C?As(C):k||As("$t("),this.nestingSuffix=S?As(S):T||As(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=A||1e3,this.alwaysFormat=j!==void 0?j:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(o,i)=>(o==null?void 0:o.source)===i?(o.lastIndex=0,o):new RegExp(i,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,o,i,u){var k;let d,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=S=>{if(S.indexOf(this.formatSeparator)<0){const j=Zh(o,g,S,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(j,void 0,i,{...u,...o,interpolationkey:S}):j}const T=S.split(this.formatSeparator),R=T.shift().trim(),A=T.join(this.formatSeparator).trim();return this.format(Zh(o,g,R,this.options.keySeparator,this.options.ignoreJSONStructure),A,i,{...u,...o,interpolationkey:R})};this.resetRegExp();const y=(u==null?void 0:u.missingInterpolationHandler)||this.options.missingInterpolationHandler,N=((k=u==null?void 0:u.interpolation)==null?void 0:k.skipOnVariables)!==void 0?u.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:S=>Zc(S)},{regex:this.regexp,safeValue:S=>this.escapeValue?Zc(this.escape(S)):Zc(S)}].forEach(S=>{for(p=0;d=S.regex.exec(l);){const T=d[1].trim();if(m=h(T),m===void 0)if(typeof y=="function"){const A=y(l,d,u);m=Ee(A)?A:""}else if(u&&Object.prototype.hasOwnProperty.call(u,T))m="";else if(N){m=d[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${l}`),m="";else!Ee(m)&&!this.useRawValueToEscape&&(m=Vh(m));const R=S.safeValue(m);if(l=l.replace(d[0],R),N?(S.regex.lastIndex+=m.length,S.regex.lastIndex-=d[0].length):S.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),l}nest(l,o,i={}){let u,d,m;const p=(g,h)=>{const y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;const N=g.split(new RegExp(`${y}[ ]*{`));let C=`{${N[1]}`;g=N[0],C=this.interpolate(C,m);const k=C.match(/'/g),S=C.match(/"/g);(((k==null?void 0:k.length)??0)%2===0&&!S||S.length%2!==0)&&(C=C.replace(/'/g,'"'));try{m=JSON.parse(C),h&&(m={...h,...m})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${y}${C}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;u=this.nestingRegexp.exec(l);){let g=[];m={...i},m=m.replace&&!Ee(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;const h=/{.*}/.test(u[1])?u[1].lastIndexOf("}")+1:u[1].indexOf(this.formatSeparator);if(h!==-1&&(g=u[1].slice(h).split(this.formatSeparator).map(y=>y.trim()).filter(Boolean),u[1]=u[1].slice(0,h)),d=o(p.call(this,u[1].trim(),m),m),d&&u[0]===l&&!Ee(d))return d;Ee(d)||(d=Vh(d)),d||(this.logger.warn(`missed to resolve ${u[1]} for nesting ${l}`),d=""),g.length&&(d=g.reduce((y,N)=>this.format(y,N,i.lng,{...i,interpolationkey:u[1].trim()}),d.trim())),l=l.replace(u[0],d),this.regexp.lastIndex=0}return l}}const E2=n=>{let l=n.toLowerCase().trim();const o={};if(n.indexOf("(")>-1){const i=n.split("(");l=i[0].toLowerCase().trim();const u=i[1].substring(0,i[1].length-1);l==="currency"&&u.indexOf(":")<0?o.currency||(o.currency=u.trim()):l==="relativetime"&&u.indexOf(":")<0?o.range||(o.range=u.trim()):u.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),y=p.trim();o[y]||(o[y]=h),h==="false"&&(o[y]=!1),h==="true"&&(o[y]=!0),isNaN(h)||(o[y]=parseInt(h,10))}})}return{formatName:l,formatOptions:o}},Wh=n=>{const l={};return(o,i,u)=>{let d=u;u&&u.interpolationkey&&u.formatParams&&u.formatParams[u.interpolationkey]&&u[u.interpolationkey]&&(d={...d,[u.interpolationkey]:void 0});const m=i+JSON.stringify(d);let p=l[m];return p||(p=n($n(i),u),l[m]=p),p(o)}},k2=n=>(l,o,i)=>n($n(o),i)(l);class T2{constructor(l={}){this.logger=wa.create("formatter"),this.options=l,this.init(l)}init(l,o={interpolation:{}}){this.formatSeparator=o.interpolation.formatSeparator||",";const i=o.cacheInBuiltFormats?Wh:k2;this.formats={number:i((u,d)=>{const m=new Intl.NumberFormat(u,{...d});return p=>m.format(p)}),currency:i((u,d)=>{const m=new Intl.NumberFormat(u,{...d,style:"currency"});return p=>m.format(p)}),datetime:i((u,d)=>{const m=new Intl.DateTimeFormat(u,{...d});return p=>m.format(p)}),relativetime:i((u,d)=>{const m=new Intl.RelativeTimeFormat(u,{...d});return p=>m.format(p,d.range||"day")}),list:i((u,d)=>{const m=new Intl.ListFormat(u,{...d});return p=>m.format(p)})}}add(l,o){this.formats[l.toLowerCase().trim()]=o}addCached(l,o){this.formats[l.toLowerCase().trim()]=Wh(o)}format(l,o,i,u={}){const d=o.split(this.formatSeparator);if(d.length>1&&d[0].indexOf("(")>1&&d[0].indexOf(")")<0&&d.find(p=>p.indexOf(")")>-1)){const p=d.findIndex(g=>g.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,p)].join(this.formatSeparator)}return d.reduce((p,g)=>{var N;const{formatName:h,formatOptions:y}=E2(g);if(this.formats[h]){let C=p;try{const k=((N=u==null?void 0:u.formatParams)==null?void 0:N[u.interpolationkey])||{},S=k.locale||k.lng||u.locale||u.lng||i;C=this.formats[h](p,S,{...y,...u,...k})}catch(k){this.logger.warn(k)}return C}else this.logger.warn(`there was no format function for ${h}`);return p},l)}}const A2=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class R2 extends Uo{constructor(l,o,i,u={}){var d,m;super(),this.backend=l,this.store=o,this.services=i,this.languageUtils=i.languageUtils,this.options=u,this.logger=wa.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=u.maxParallelReads||10,this.readingCalls=0,this.maxRetries=u.maxRetries>=0?u.maxRetries:5,this.retryTimeout=u.retryTimeout>=1?u.retryTimeout:350,this.state={},this.queue=[],(m=(d=this.backend)==null?void 0:d.init)==null||m.call(d,i,u.backend,u)}queueLoad(l,o,i,u){const d={},m={},p={},g={};return l.forEach(h=>{let y=!0;o.forEach(N=>{const C=`${h}|${N}`;!i.reload&&this.store.hasResourceBundle(h,N)?this.state[C]=2:this.state[C]<0||(this.state[C]===1?m[C]===void 0&&(m[C]=!0):(this.state[C]=1,y=!1,m[C]===void 0&&(m[C]=!0),d[C]===void 0&&(d[C]=!0),g[N]===void 0&&(g[N]=!0)))}),y||(p[h]=!0)}),(Object.keys(d).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:u}),{toLoad:Object.keys(d),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(l,o,i){const u=l.split("|"),d=u[0],m=u[1];o&&this.emit("failedLoading",d,m,o),!o&&i&&this.store.addResourceBundle(d,m,i,void 0,void 0,{skipCopy:!0}),this.state[l]=o?-1:2,o&&i&&(this.state[l]=0);const p={};this.queue.forEach(g=>{h2(g.loaded,[d],m),A2(g,l),o&&g.errors.push(o),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const y=g.loaded[h];y.length&&y.forEach(N=>{p[h][N]===void 0&&(p[h][N]=!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(l,o,i,u=0,d=this.retryTimeout,m){if(!l.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:o,fcName:i,tried:u,wait:d,callback:m});return}this.readingCalls++;const p=(h,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const N=this.waitingReads.shift();this.read(N.lng,N.ns,N.fcName,N.tried,N.wait,N.callback)}if(h&&y&&u<this.maxRetries){setTimeout(()=>{this.read.call(this,l,o,i,u+1,d*2,m)},d);return}m(h,y)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(l,o);h&&typeof h.then=="function"?h.then(y=>p(null,y)).catch(p):p(null,h)}catch(h){p(h)}return}return g(l,o,p)}prepareLoading(l,o,i={},u){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();Ee(l)&&(l=this.languageUtils.toResolveHierarchy(l)),Ee(o)&&(o=[o]);const d=this.queueLoad(l,o,i,u);if(!d.toLoad.length)return d.pending.length||u(),null;d.toLoad.forEach(m=>{this.loadOne(m)})}load(l,o,i){this.prepareLoading(l,o,{},i)}reload(l,o,i){this.prepareLoading(l,o,{reload:!0},i)}loadOne(l,o=""){const i=l.split("|"),u=i[0],d=i[1];this.read(u,d,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${o}loading namespace ${d} for language ${u} failed`,m),!m&&p&&this.logger.log(`${o}loaded namespace ${d} for language ${u}`,p),this.loaded(l,m,p)})}saveMissing(l,o,i,u,d,m={},p=()=>{}){var g,h,y,N,C;if((h=(g=this.services)==null?void 0:g.utils)!=null&&h.hasLoadedNamespace&&!((N=(y=this.services)==null?void 0:y.utils)!=null&&N.hasLoadedNamespace(o))){this.logger.warn(`did not save key "${i}" as the namespace "${o}" 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(!(i==null||i==="")){if((C=this.backend)!=null&&C.create){const k={...m,isUpdate:d},S=this.backend.create.bind(this.backend);if(S.length<6)try{let T;S.length===5?T=S(l,o,i,u,k):T=S(l,o,i,u),T&&typeof T.then=="function"?T.then(R=>p(null,R)).catch(p):p(null,T)}catch(T){p(T)}else S(l,o,i,u,p,k)}!l||!l[0]||this.store.addResource(l[0],o,i,u)}}}const ep=()=>({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:n=>{let l={};if(typeof n[1]=="object"&&(l=n[1]),Ee(n[1])&&(l.defaultValue=n[1]),Ee(n[2])&&(l.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const o=n[3]||n[2];Object.keys(o).forEach(i=>{l[i]=o[i]})}return l},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),tp=n=>{var l,o;return Ee(n.ns)&&(n.ns=[n.ns]),Ee(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Ee(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),((o=(l=n.supportedLngs)==null?void 0:l.indexOf)==null?void 0:o.call(l,"cimode"))<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n},xo=()=>{},M2=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(o=>{typeof n[o]=="function"&&(n[o]=n[o].bind(n))})};class In extends Uo{constructor(l={},o){if(super(),this.options=tp(l),this.services={},this.logger=wa,this.modules={external:[]},M2(this),o&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,o),this;setTimeout(()=>{this.init(l,o)},0)}}init(l={},o){this.isInitializing=!0,typeof l=="function"&&(o=l,l={}),l.defaultNS==null&&l.ns&&(Ee(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=ep();this.options={...i,...this.options,...tp(l)},this.options.interpolation={...i.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator);const u=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?wa.init(u(this.modules.logger),this.options):wa.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=T2;const y=new Xh(this.options);this.store=new $h(this.options.resources,this.options);const N=this.services;N.logger=wa,N.resourceStore=this.store,N.languageUtils=y,N.pluralResolver=new S2(y,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(N.formatter=u(h),N.formatter.init&&N.formatter.init(N,this.options),this.options.interpolation.format=N.formatter.format.bind(N.formatter)),N.interpolator=new C2(this.options),N.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},N.backendConnector=new R2(u(this.modules.backend),N.resourceStore,N,this.options),N.backendConnector.on("*",(k,...S)=>{this.emit(k,...S)}),this.modules.languageDetector&&(N.languageDetector=u(this.modules.languageDetector),N.languageDetector.init&&N.languageDetector.init(N,this.options.detection,this.options)),this.modules.i18nFormat&&(N.i18nFormat=u(this.modules.i18nFormat),N.i18nFormat.init&&N.i18nFormat.init(this)),this.translator=new ko(this.services,this.options),this.translator.on("*",(k,...S)=>{this.emit(k,...S)}),this.modules.external.forEach(k=>{k.init&&k.init(this)})}if(this.format=this.options.interpolation.format,o||(o=xo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[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(h=>{this[h]=(...y)=>this.store[h](...y)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...y)=>(this.store[h](...y),this)});const p=qn(),g=()=>{const h=(y,N)=>{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),p.resolve(N),o(y,N)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),p}loadResources(l,o=xo){var d,m;let i=o;const u=Ee(l)?l:this.language;if(typeof l=="function"&&(i=l),!this.options.resources||this.options.partialBundledLanguages){if((u==null?void 0:u.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const p=[],g=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(N=>{N!=="cimode"&&p.indexOf(N)<0&&p.push(N)})};u?g(u):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>g(y)),(m=(d=this.options.preload)==null?void 0:d.forEach)==null||m.call(d,h=>g(h)),this.services.backendConnector.load(p,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(h)})}else i(null)}reloadResources(l,o,i){const u=qn();return typeof l=="function"&&(i=l,l=void 0),typeof o=="function"&&(i=o,o=void 0),l||(l=this.languages),o||(o=this.options.ns),i||(i=xo),this.services.backendConnector.reload(l,o,d=>{u.resolve(),i(d)}),u}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&ig.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let o=0;o<this.languages.length;o++){const i=this.languages[o];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,o){this.isLanguageChangingTo=l;const i=qn();this.emit("languageChanging",l);const u=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},d=(p,g)=>{g?this.isLanguageChangingTo===l&&(u(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,i.resolve((...h)=>this.t(...h)),o&&o(p,(...h)=>this.t(...h))},m=p=>{var y,N;!l&&!p&&this.services.languageDetector&&(p=[]);const g=Ee(p)?p:p&&p[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(Ee(p)?[p]:p);h&&(this.language||u(h),this.translator.language||this.translator.changeLanguage(h),(N=(y=this.services.languageDetector)==null?void 0:y.cacheUserLanguage)==null||N.call(y,h)),this.loadResources(h,C=>{d(C,h)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(l),i}getFixedT(l,o,i){const u=(d,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([d,m].concat(p)):g={...m},g.lng=g.lng||u.lng,g.lngs=g.lngs||u.lngs,g.ns=g.ns||u.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||u.keyPrefix);const h=this.options.keySeparator||".";let y;return g.keyPrefix&&Array.isArray(d)?y=d.map(N=>(typeof N=="function"&&(N=uu(N,{...this.options,...m})),`${g.keyPrefix}${h}${N}`)):(typeof d=="function"&&(d=uu(d,{...this.options,...m})),y=g.keyPrefix?`${g.keyPrefix}${h}${d}`:d),this.t(y,g)};return Ee(l)?u.lng=l:u.lngs=l,u.ns=o,u.keyPrefix=i,u}t(...l){var o;return(o=this.translator)==null?void 0:o.translate(...l)}exists(...l){var o;return(o=this.translator)==null?void 0:o.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,o={}){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 i=o.lng||this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,d=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(o.precheck){const p=o.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(i,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,l)&&(!u||m(d,l)))}loadNamespaces(l,o){const i=qn();return this.options.ns?(Ee(l)&&(l=[l]),l.forEach(u=>{this.options.ns.indexOf(u)<0&&this.options.ns.push(u)}),this.loadResources(u=>{i.resolve(),o&&o(u)}),i):(o&&o(),Promise.resolve())}loadLanguages(l,o){const i=qn();Ee(l)&&(l=[l]);const u=this.options.preload||[],d=l.filter(m=>u.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return d.length?(this.options.preload=u.concat(d),this.loadResources(m=>{i.resolve(),o&&o(m)}),i):(o&&o(),Promise.resolve())}dir(l){var u,d;if(l||(l=this.resolvedLanguage||(((u=this.languages)==null?void 0:u.length)>0?this.languages[0]:this.language)),!l)return"rtl";try{const m=new Intl.Locale(l);if(m&&m.getTextInfo){const p=m.getTextInfo();if(p&&p.direction)return p.direction}}catch{}const o=["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"],i=((d=this.services)==null?void 0:d.languageUtils)||new Xh(ep());return l.toLowerCase().indexOf("-latn")>1?"ltr":o.indexOf(i.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},o){return new In(l,o)}cloneInstance(l={},o=xo){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const u={...this.options,...l,isClone:!0},d=new In(u);if((l.debug!==void 0||l.prefix!==void 0)&&(d.logger=d.logger.clone(l)),["store","services","language"].forEach(p=>{d[p]=this[p]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},i){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},g[h]=Object.keys(g[h]).reduce((y,N)=>(y[N]={...g[h][N]},y),g[h]),g),{});d.store=new $h(p,u),d.services.resourceStore=d.store}return d.translator=new ko(d.services,u),d.translator.on("*",(p,...g)=>{d.emit(p,...g)}),d.init(u,o),d.translator.options=u,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const kt=In.createInstance();kt.createInstance=In.createInstance;kt.createInstance;kt.dir;kt.init;kt.loadResources;kt.reloadResources;kt.use;kt.changeLanguage;kt.getFixedT;kt.t;kt.exists;kt.setDefaultNamespace;kt.hasLoadedNamespace;kt.loadNamespaces;kt.loadLanguages;const{slice:O2,forEach:D2}=[];function U2(n){return D2.call(O2.call(arguments,1),l=>{if(l)for(const o in l)n[o]===void 0&&(n[o]=l[o])}),n}function z2(n){return typeof n!="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(o=>o.test(n))}const ap=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,L2=function(n,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},u=encodeURIComponent(l);let d=`${n}=${u}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");d+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!ap.test(i.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${i.domain}`}if(i.path){if(!ap.test(i.path))throw new TypeError("option path is invalid");d+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");d+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(d+="; HttpOnly"),i.secure&&(d+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(d+="; Partitioned"),d},rp={create(n,l,o,i){let u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};o&&(u.expires=new Date,u.expires.setTime(u.expires.getTime()+o*60*1e3)),i&&(u.domain=i),document.cookie=L2(n,l,u)},read(n){const l=`${n}=`,o=document.cookie.split(";");for(let i=0;i<o.length;i++){let u=o[i];for(;u.charAt(0)===" ";)u=u.substring(1,u.length);if(u.indexOf(l)===0)return u.substring(l.length,u.length)}return null},remove(n,l){this.create(n,"",-1,l)}};var _2={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return rp.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:o,cookieMinutes:i,cookieDomain:u,cookieOptions:d}=l;o&&typeof document<"u"&&rp.create(o,n,i,u,d)}},P2={name:"querystring",lookup(n){var i;let{lookupQuerystring:l}=n,o;if(typeof window<"u"){let{search:u}=window.location;!window.location.search&&((i=window.location.hash)==null?void 0:i.indexOf("?"))>-1&&(u=window.location.hash.substring(window.location.hash.indexOf("?")));const m=u.substring(1).split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===l&&(o=m[p].substring(g+1))}}return o}},H2={name:"hash",lookup(n){var u;let{lookupHash:l,lookupFromHashIndex:o}=n,i;if(typeof window<"u"){const{hash:d}=window.location;if(d&&d.length>2){const m=d.substring(1);if(l){const p=m.split("&");for(let g=0;g<p.length;g++){const h=p[g].indexOf("=");h>0&&p[g].substring(0,h)===l&&(i=p[g].substring(h+1))}}if(i)return i;if(!i&&o>-1){const p=d.match(/\/([a-zA-Z-]*)/g);return Array.isArray(p)?(u=p[typeof o=="number"?o:0])==null?void 0:u.replace("/",""):void 0}}}return i}};let Rs=null;const sp=()=>{if(Rs!==null)return Rs;try{if(Rs=typeof window<"u"&&window.localStorage!==null,!Rs)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{Rs=!1}return Rs};var B2={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&sp())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:o}=l;o&&sp()&&window.localStorage.setItem(o,n)}};let Ms=null;const np=()=>{if(Ms!==null)return Ms;try{if(Ms=typeof window<"u"&&window.sessionStorage!==null,!Ms)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Ms=!1}return Ms};var q2={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&np())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:o}=l;o&&np()&&window.sessionStorage.setItem(o,n)}},V2={name:"navigator",lookup(n){const l=[];if(typeof navigator<"u"){const{languages:o,userLanguage:i,language:u}=navigator;if(o)for(let d=0;d<o.length;d++)l.push(o[d]);i&&l.push(i),u&&l.push(u)}return l.length>0?l:void 0}},G2={name:"htmlTag",lookup(n){let{htmlTag:l}=n,o;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(o=i.getAttribute("lang")),o}},K2={name:"path",lookup(n){var u;let{lookupFromPathIndex:l}=n;if(typeof window>"u")return;const o=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?(u=o[typeof l=="number"?l:0])==null?void 0:u.replace("/",""):void 0}},F2={name:"subdomain",lookup(n){var u,d;let{lookupFromSubdomainIndex:l}=n;const o=typeof l=="number"?l+1:1,i=typeof window<"u"&&((d=(u=window.location)==null?void 0:u.hostname)==null?void 0:d.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(i)return i[o]}};let ug=!1;try{document.cookie,ug=!0}catch{}const dg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ug||dg.splice(1,1);const $2=()=>({order:dg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class fg{constructor(l){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,o)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=U2(o,this.options||{},$2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=u=>u.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(_2),this.addDetector(P2),this.addDetector(B2),this.addDetector(q2),this.addDetector(V2),this.addDetector(G2),this.addDetector(K2),this.addDetector(F2),this.addDetector(H2)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,o=[];return l.forEach(i=>{if(this.detectors[i]){let u=this.detectors[i].lookup(this.options);u&&typeof u=="string"&&(u=[u]),u&&(o=o.concat(u))}}),o=o.filter(i=>i!=null&&!z2(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}cacheUserLanguage(l){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;o&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||o.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(l,this.options)}))}}fg.type="languageDetector";const I2={title:"MCPHub 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:"MCPHub"},Y2={title:"About",versionInfo:"MCPHub 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..."},X2={viewProfile:"View profile",userCenter:"User Center"},Q2={label:"Sponsor",title:"Support the Project",rewardAlt:"Reward QR Code",supportMessage:"Support the development of MCPHub by buying me a coffee!",supportButton:"Support on Ko-fi"},J2={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},Z2={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},W2={title:"Theme",light:"Light",dark:"Dark",system:"System"},ew={login:"Login",loginTitle:"Login to MCPHub",slogan:"The Unified Hub for MCP Servers",subtitle:"Centralized management platform for Model Context Protocol servers. Organize, monitor, and scale multiple MCP servers with flexible routing strategies.",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"},tw={addServer:"Add Server",add:"Add",edit:"Edit",copy:"Copy",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",prompts:"Prompts",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",typeStdio:"STDIO",typeSse:"SSE",typeStreamableHttp:"Streamable HTTP",typeOpenapi:"OpenAPI",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",copyConfig:"Copy Configuration",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",httpSchemeBasic:"Basic",httpSchemeBearer:"Bearer",httpSchemeDigest:"Digest",oauth2Config:"OAuth 2.0 Configuration",oauth2Token:"Access Token",openIdConnectConfig:"OpenID Connect Configuration",openIdConnectUrl:"Discovery URL",openIdConnectToken:"ID Token",apiKeyInHeader:"Header",apiKeyInQuery:"Query",apiKeyInCookie:"Cookie",passthroughHeaders:"Passthrough Headers",passthroughHeadersHelp:"Comma-separated list of header names to pass through from tool call requests to upstream OpenAPI endpoints (e.g., Authorization, X-API-Key)"}},aw={online:"Online",offline:"Offline",connecting:"Connecting"},rw={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"},sw={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",copied:"Copied",close:"Close",confirm:"Confirm",language:"Language",true:"True",false:"False",dismiss:"Dismiss",github:"GitHub",wechat:"WeChat",discord:"Discord"},nw={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",cloud:"Cloud Market",logs:"Logs"},lw={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:"Market Hub - Local and Cloud Markets"},logs:{title:"System Logs"}},ow={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"},iw={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"},cw={title:"Local Installation",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"},uw={title:"Cloud Support",subtitle:"Powered by MCPRouter",by:"By",server:"Server",config:"Config",created:"Created",updated:"Updated",available:"Available",description:"Description",details:"Details",tools:"Tools",tool:"tool",toolsAvailable:"{{count}} tool available||{{count}} tools available",loadingTools:"Loading tools...",noTools:"No tools available for this server",noDescription:"No description available",viewDetails:"View Details",parameters:"Parameters",result:"Result",error:"Error",callTool:"Call",calling:"Calling...",toolCallSuccess:"Tool {{toolName}} executed successfully",toolCallError:"Failed to call tool {{toolName}}: {{error}}",viewSchema:"View Schema",backToList:"Back to Cloud Market",search:"Search",searchPlaceholder:"Search cloud servers by name, title, or author",clearFilters:"Clear Filters",clearCategoryFilter:"Clear",clearTagFilter:"Clear",categories:"Categories",tags:"Tags",noCategories:"No categories found",noTags:"No tags found",noServers:"No cloud servers found",fetchError:"Error fetching cloud servers",serverNotFound:"Cloud server not found",searchError:"Error searching cloud servers",filterError:"Error filtering cloud servers by category",tagFilterError:"Error filtering cloud servers by tag",showing:"Showing {{from}}-{{to}} of {{total}} cloud servers",perPage:"Per page",apiKeyNotConfigured:"MCPRouter API key not configured",apiKeyNotConfiguredDescription:"To use cloud servers, you need to configure your MCPRouter API key.",getApiKey:"Get API Key",configureInSettings:"Configure in Settings",installServer:"Install {{name}}",installSuccess:"Server {{name}} installed successfully",installError:"Failed to install server: {{error}}"},dw={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}}"},fw={run:"Get",running:"Getting...",result:"Prompt Result",error:"Prompt Error",execution:"Prompt Execution",successful:"Successful",failed:"Failed",errorDetails:"Error Details:",noContent:"Prompt executed successfully but returned no content.",unknownError:"Unknown error occurred",jsonResponse:"JSON Response:",description:"Description",messages:"Messages",noDescription:"No description available",runPromptWithName:"Get Prompt: {{name}}"},mw={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}}",mcpRouterConfig:"Cloud Market",mcpRouterApiKey:"MCPRouter API Key",mcpRouterApiKeyDescription:"API key for accessing MCPRouter cloud market services",mcpRouterApiKeyPlaceholder:"Enter MCPRouter API key",mcpRouterReferer:"Referer",mcpRouterRefererDescription:"Referer header for MCPRouter API requests",mcpRouterRefererPlaceholder:"https://www.mcphubx.com",mcpRouterTitle:"Title",mcpRouterTitleDescription:"Title header for MCPRouter API requests",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"Base URL",mcpRouterBaseUrlDescription:"Base URL for MCPRouter API",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1",systemSettings:"System Settings",nameSeparatorLabel:"Name Separator",nameSeparatorDescription:"Character used to separate server name and tool/prompt name (default: -)",restartRequired:"Configuration saved. It is recommended to restart the application to ensure all services load the new settings correctly.",exportMcpSettings:"Export Settings",mcpSettingsJson:"MCP Settings JSON",mcpSettingsJsonDescription:"View, copy, or download your current mcp_settings.json configuration for backup or migration to other tools",copyToClipboard:"Copy to Clipboard",downloadJson:"Download JSON",exportSuccess:"Settings exported successfully",exportError:"Failed to fetch settings"},hw={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"},pw={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."},gw={errors:{readonly:"Readonly for demo environment",invalid_credentials:"Invalid username or password",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"}},xw={app:I2,about:Y2,profile:X2,sponsor:Q2,wechat:J2,discord:Z2,theme:W2,auth:ew,server:tw,status:aw,errors:rw,common:sw,nav:nw,pages:lw,logs:ow,groups:iw,market:cw,cloud:uw,tool:dw,prompt:fw,settings:mw,dxt:hw,users:pw,api:gw},yw={title:"MCPHub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCPHub"},bw={title:"关于",versionInfo:"MCPHub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},vw={viewProfile:"查看个人中心",userCenter:"个人中心"},ww={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCPHub 的开发!",supportButton:"在 Ko-fi 上支持"},jw={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},Nw={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},Sw={title:"主题",light:"浅色",dark:"深色",system:"系统"},Cw={login:"登录",loginTitle:"登录 MCPHub",slogan:"统一的 MCP 服务器管理平台",subtitle:"模型上下文协议服务器的集中管理平台,通过灵活的路由策略组织、监控和扩展多个 MCP 服务器。",username:"用户名",password:"密码",loggingIn:"登录中...",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败"},Ew={addServer:"添加服务器",add:"添加",edit:"编辑",copy:"复制",delete:"删除",confirmDelete:"您确定要删除此服务器吗?",deleteWarning:"删除服务器 '{{name}}' 将会移除该服务器及其所有数据。此操作无法撤销。",status:"状态",tools:"工具",prompts:"提示词",name:"服务器名称",url:"服务器 URL",apiKey:"API 密钥",save:"保存",cancel:"取消",addError:"添加服务器失败",editError:"编辑服务器 {{serverName}} 失败",invalidConfig:"无法找到 {{serverName}} 的配置数据",deleteError:"删除服务器 {{serverName}} 失败",updateError:"更新服务器失败",editTitle:"编辑服务器: {{serverName}}",type:"服务器类型",typeStdio:"STDIO",typeSse:"SSE",typeStreamableHttp:"流式 HTTP",typeOpenapi:"OpenAPI",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:"查看错误详情",copyConfig:"复制配置",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:"凭据",httpSchemeBasic:"Basic",httpSchemeBearer:"Bearer",httpSchemeDigest:"Digest",oauth2Config:"OAuth 2.0 配置",oauth2Token:"访问令牌",openIdConnectConfig:"OpenID Connect 配置",openIdConnectUrl:"发现 URL",openIdConnectToken:"ID 令牌",apiKeyInHeader:"请求头",apiKeyInQuery:"查询",apiKeyInCookie:"Cookie",passthroughHeaders:"透传请求头",passthroughHeadersHelp:"要从工具调用请求透传到上游OpenAPI接口的请求头名称列表,用逗号分隔(如:Authorization, X-API-Key)"}},kw={online:"在线",offline:"离线",connecting:"连接中"},Tw={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},Aw={processing:"处理中...",save:"保存",cancel:"取消",refresh:"刷新",create:"创建",creating:"创建中...",update:"更新",updating:"更新中...",submitting:"提交中...",delete:"删除",remove:"移除",copy:"复制",copyId:"复制ID",copyUrl:"复制URL",copyJson:"复制JSON",copySuccess:"已复制到剪贴板",copyFailed:"复制失败",copied:"已复制",close:"关闭",confirm:"确认",language:"语言",true:"是",false:"否",dismiss:"忽略",github:"GitHub",wechat:"微信",discord:"Discord"},Rw={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",cloud:"云端市场",logs:"日志"},Mw={dashboard:{title:"仪表盘",totalServers:"总数",onlineServers:"在线",offlineServers:"离线",connectingServers:"连接中",recentServers:"最近的服务器"},servers:{title:"服务器管理"},settings:{title:"设置",language:"语言",account:"账户设置",password:"修改密码",appearance:"外观",routeConfig:"安全配置",installConfig:"安装",smartRouting:"智能路由"},groups:{title:"分组管理"},users:{title:"用户管理"},market:{title:"市场中心 - 本地市场和云端市场"},logs:{title:"系统日志"}},Ow={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},Dw={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:"配置工具"},Uw={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:"确认并安装"},zw={title:"云端支持",subtitle:"由 MCPRouter 提供支持",by:"作者",server:"服务器",config:"配置",created:"创建时间",updated:"更新时间",available:"可用",description:"描述",details:"详细信息",tools:"工具",tool:"个工具",toolsAvailable:"{{count}} 个工具可用",loadingTools:"加载工具中...",noTools:"该服务器没有可用工具",noDescription:"无描述信息",viewDetails:"查看详情",parameters:"参数",result:"结果",error:"错误",callTool:"调用",calling:"调用中...",toolCallSuccess:"工具 {{toolName}} 执行成功",toolCallError:"调用工具 {{toolName}} 失败:{{error}}",viewSchema:"查看结构",backToList:"返回云端市场",search:"搜索",searchPlaceholder:"搜索云端服务器名称、标题或作者",clearFilters:"清除筛选",clearCategoryFilter:"清除",clearTagFilter:"清除",categories:"分类",tags:"标签",noCategories:"未找到分类",noTags:"未找到标签",noServers:"未找到云端服务器",fetchError:"获取云端服务器失败",serverNotFound:"未找到云端服务器",searchError:"搜索云端服务器失败",filterError:"按分类筛选云端服务器失败",tagFilterError:"按标签筛选云端服务器失败",showing:"显示 {{from}}-{{to}}/{{total}} 个云端服务器",perPage:"每页显示",apiKeyNotConfigured:"MCPRouter API 密钥未配置",apiKeyNotConfiguredDescription:"要使用云端服务器,您需要配置 MCPRouter API 密钥。",getApiKey:"获取 API 密钥",configureInSettings:"在设置中配置",installServer:"安装 {{name}}",installSuccess:"服务器 {{name}} 安装成功",installError:"安装服务器失败:{{error}}"},Lw={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}}"},_w={run:"获取",running:"获取中...",result:"提示词结果",error:"提示词错误",execution:"提示词执行",successful:"成功",failed:"失败",errorDetails:"错误详情:",noContent:"提示词执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",description:"描述",messages:"消息",noDescription:"无描述信息",runPromptWithName:"获取提示词: {{name}}"},Pw={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}}",mcpRouterConfig:"云端市场",mcpRouterApiKey:"MCPRouter API 密钥",mcpRouterApiKeyDescription:"用于访问 MCPRouter 云端市场服务的 API 密钥",mcpRouterApiKeyPlaceholder:"请输入 MCPRouter API 密钥",mcpRouterReferer:"引用地址",mcpRouterRefererDescription:"MCPRouter API 请求的引用地址头",mcpRouterRefererPlaceholder:"https://www.mcphubx.com",mcpRouterTitle:"标题",mcpRouterTitleDescription:"MCPRouter API 请求的标题头",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"基础地址",mcpRouterBaseUrlDescription:"MCPRouter API 的基础地址",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1",systemSettings:"系统设置",nameSeparatorLabel:"名称分隔符",nameSeparatorDescription:"用于分隔服务器名称和工具/提示名称(默认:-)",restartRequired:"配置已保存。为确保所有服务正确加载新设置,建议重启应用。",exportMcpSettings:"导出配置",mcpSettingsJson:"MCP 配置 JSON",mcpSettingsJsonDescription:"查看、复制或下载当前的 mcp_settings.json 配置,可用于备份或迁移到其他工具",copyToClipboard:"复制到剪贴板",downloadJson:"下载 JSON",exportSuccess:"配置导出成功",exportError:"获取配置失败"},Hw={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:"覆盖"},Bw={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}}' 吗?此操作无法撤消。"},qw={errors:{readonly:"演示环境无法修改数据",invalid_credentials:"用户名或密码错误",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:"服务器工具更新成功"}},Vw={app:yw,about:bw,profile:vw,sponsor:ww,wechat:jw,discord:Nw,theme:Sw,auth:Cw,server:Ew,status:kw,errors:Tw,common:Aw,nav:Rw,pages:Mw,logs:Ow,groups:Dw,market:Uw,cloud:zw,tool:Lw,prompt:_w,settings:Pw,dxt:Hw,users:Bw,api:qw},Gw={title:"Tableau de bord MCPHub",error:"Erreur",closeButton:"Fermer",noServers:"Aucun serveur MCP disponible",loading:"Chargement...",logout:"Déconnexion",profile:"Profil",changePassword:"Changer le mot de passe",toggleSidebar:"Basculer la barre latérale",welcomeUser:"Bienvenue, {{username}}",name:"MCPHub"},Kw={title:"À propos",versionInfo:"Version MCPHub : {{version}}",newVersion:"Nouvelle version disponible !",currentVersion:"Version actuelle",newVersionAvailable:"La nouvelle version {{version}} est disponible",viewOnGitHub:"Voir sur GitHub",checkForUpdates:"Vérifier les mises à jour",checking:"Vérification des mises à jour..."},Fw={viewProfile:"Voir le profil",userCenter:"Centre utilisateur"},$w={label:"Sponsor",title:"Soutenir le projet",rewardAlt:"QR Code de récompense",supportMessage:"Soutenez le développement de MCPHub en m'offrant un café !",supportButton:"Soutenir sur Ko-fi"},Iw={label:"WeChat",title:"Se connecter via WeChat",qrCodeAlt:"QR Code WeChat",scanMessage:"Scannez ce QR code pour nous contacter sur WeChat"},Yw={label:"Discord",title:"Rejoignez notre serveur Discord",community:"Rejoignez notre communauté grandissante sur Discord pour du support, des discussions et des mises à jour !"},Xw={title:"Thème",light:"Clair",dark:"Sombre",system:"Système"},Qw={login:"Connexion",loginTitle:"Se connecter à MCPHub",slogan:"Le Hub unifié pour les serveurs MCP",subtitle:"Plateforme de gestion centralisée pour les serveurs Model Context Protocol. Organisez, surveillez et mettez à l'échelle plusieurs serveurs MCP avec des stratégies de routage flexibles.",username:"Nom d'utilisateur",password:"Mot de passe",loggingIn:"Connexion en cours...",emptyFields:"Le nom d'utilisateur et le mot de passe ne peuvent pas être vides",loginFailed:"Échec de la connexion, veuillez vérifier votre nom d'utilisateur et votre mot de passe",loginError:"Une erreur est survenue lors de la connexion",currentPassword:"Mot de passe actuel",newPassword:"Nouveau mot de passe",confirmPassword:"Confirmer le mot de passe",passwordsNotMatch:"Le nouveau mot de passe et la confirmation ne correspondent pas",changePasswordSuccess:"Mot de passe changé avec succès",changePasswordError:"Échec du changement de mot de passe",changePassword:"Changer le mot de passe",passwordChanged:"Mot de passe changé avec succès",passwordChangeError:"Échec du changement de mot de passe"},Jw={addServer:"Ajouter un serveur",add:"Ajouter",edit:"Modifier",copy:"Copier",delete:"Supprimer",confirmDelete:"Êtes-vous sûr de vouloir supprimer ce serveur ?",deleteWarning:"La suppression du serveur '{{name}}' le supprimera ainsi que toutes ses données. Cette action est irréversible.",status:"Statut",tools:"Outils",prompts:"Invites",name:"Nom du serveur",url:"URL du serveur",apiKey:"Clé API",save:"Enregistrer",cancel:"Annuler",invalidConfig:"Impossible de trouver les données de configuration pour {{serverName}}",addError:"Échec de l'ajout du serveur",editError:"Échec de la modification du serveur {{serverName}}",deleteError:"Échec de la suppression du serveur {{serverName}}",updateError:"Échec de la mise à jour du serveur",editTitle:"Modifier le serveur : {{serverName}}",type:"Type de serveur",typeStdio:"STDIO",typeSse:"SSE",typeStreamableHttp:"HTTP diffusable",typeOpenapi:"OpenAPI",command:"Commande",arguments:"Arguments",envVars:"Variables d'environnement",headers:"En-têtes HTTP",key:"clé",value:"valeur",enabled:"Activé",enable:"Activer",disable:"Désactiver",requestOptions:"Configuration",timeout:"Délai d'attente de la requête",timeoutDescription:"Délai d'attente pour les requêtes vers le serveur MCP (ms)",maxTotalTimeout:"Délai d'attente total maximum",maxTotalTimeoutDescription:"Délai d'attente total maximum pour les requêtes envoyées au serveur MCP (ms) (à utiliser avec les notifications de progression)",resetTimeoutOnProgress:"Réinitialiser le délai d'attente en cas de progression",resetTimeoutOnProgressDescription:"Réinitialiser le délai d'attente lors des notifications de progression",remove:"Retirer",toggleError:"Échec du basculement du serveur {{serverName}}",alreadyExists:"Le serveur {{serverName}} existe déjà",invalidData:"Données de serveur invalides fournies",notFound:"Serveur {{serverName}} non trouvé",namePlaceholder:"Entrez le nom du serveur",urlPlaceholder:"Entrez l'URL du serveur",commandPlaceholder:"Entrez la commande",argumentsPlaceholder:"Entrez les arguments",errorDetails:"Détails de l'erreur",viewErrorDetails:"Voir les détails de l'erreur",copyConfig:"Copier la configuration",confirmVariables:"Confirmer la configuration des variables",variablesDetected:"Variables détectées dans la configuration. Veuillez confirmer que ces variables sont correctement configurées :",detectedVariables:"Variables détectées",confirmVariablesMessage:"Veuillez vous assurer que ces variables sont correctement définies dans votre environnement d'exécution. Continuer l'ajout du serveur ?",confirmAndAdd:"Confirmer et ajouter",openapi:{inputMode:"Mode de saisie",inputModeUrl:"URL de la spécification",inputModeSchema:"Schéma JSON",specUrl:"URL de la spécification OpenAPI",schema:"Schéma JSON OpenAPI",schemaHelp:"Collez votre schéma JSON OpenAPI complet ici",security:"Type de sécurité",securityNone:"Aucun",securityApiKey:"Clé API",securityHttp:"Authentification HTTP",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"Configuration de la clé API",apiKeyName:"Nom de l'en-tête/paramètre",apiKeyIn:"Emplacement",apiKeyValue:"Valeur de la clé API",httpAuthConfig:"Configuration de l'authentification HTTP",httpScheme:"Schéma d'authentification",httpCredentials:"Identifiants",httpSchemeBasic:"Basic",httpSchemeBearer:"Bearer",httpSchemeDigest:"Digest",oauth2Config:"Configuration OAuth 2.0",oauth2Token:"Jeton d'accès",openIdConnectConfig:"Configuration OpenID Connect",openIdConnectUrl:"URL de découverte",openIdConnectToken:"Jeton d'identification",apiKeyInHeader:"En-tête",apiKeyInQuery:"Requête",apiKeyInCookie:"Cookie",passthroughHeaders:"En-têtes de transmission",passthroughHeadersHelp:"Liste séparée par des virgules des noms d'en-têtes à transmettre des requêtes d'appel d'outils vers les points de terminaison OpenAPI en amont (par ex. : Authorization, X-API-Key)"}},Zw={online:"En ligne",offline:"Hors ligne",connecting:"Connexion en cours"},Ww={general:"Une erreur est survenue",network:"Erreur de connexion réseau. Veuillez vérifier votre connexion Internet",serverConnection:"Impossible de se connecter au serveur. Veuillez vérifier si le serveur est en cours d'exécution",serverAdd:"Échec de l'ajout du serveur. Veuillez vérifier l'état du serveur",serverUpdate:"Échec de la modification du serveur {{serverName}}. Veuillez vérifier l'état du serveur",serverFetch:"Échec de la récupération des données du serveur. Veuillez réessayer plus tard",initialStartup:"Le serveur est peut-être en cours de démarrage. Veuillez patienter un instant car ce processus peut prendre du temps au premier lancement...",serverInstall:"Échec de l'installation du serveur",failedToFetchSettings:"Échec de la récupération des paramètres",failedToUpdateRouteConfig:"Échec de la mise à jour de la configuration de routage",failedToUpdateSmartRoutingConfig:"Échec de la mise à jour de la configuration du routage intelligent"},ej={processing:"En cours de traitement...",save:"Enregistrer",cancel:"Annuler",refresh:"Actualiser",create:"Créer",creating:"Création en cours...",update:"Mettre à jour",updating:"Mise à jour en cours...",submitting:"Envoi en cours...",delete:"Supprimer",remove:"Retirer",copy:"Copier",copyId:"Copier l'ID",copyUrl:"Copier l'URL",copyJson:"Copier le JSON",copySuccess:"Copié dans le presse-papiers",copyFailed:"Échec de la copie",copied:"Copié",close:"Fermer",confirm:"Confirmer",language:"Langue",true:"Vrai",false:"Faux",dismiss:"Rejeter",github:"GitHub",wechat:"WeChat",discord:"Discord"},tj={dashboard:"Tableau de bord",servers:"Serveurs",groups:"Groupes",users:"Utilisateurs",settings:"Paramètres",changePassword:"Changer le mot de passe",market:"Marché",cloud:"Marché Cloud",logs:"Journaux"},aj={dashboard:{title:"Tableau de bord",totalServers:"Total",onlineServers:"En ligne",offlineServers:"Hors ligne",connectingServers:"En connexion",recentServers:"Serveurs récents"},servers:{title:"Gestion des serveurs"},groups:{title:"Gestion des groupes"},users:{title:"Gestion des utilisateurs"},settings:{title:"Paramètres",language:"Langue",account:"Paramètres du compte",password:"Changer le mot de passe",appearance:"Apparence",routeConfig:"Sécurité",installConfig:"Installation",smartRouting:"Routage intelligent"},market:{title:"Marché Hub - Marchés locaux et Cloud"},logs:{title:"Journaux système"}},rj={filters:"Filtres",search:"Rechercher dans les journaux...",autoScroll:"Défilement automatique",clearLogs:"Effacer les journaux",loading:"Chargement des journaux...",noLogs:"Aucun journal disponible.",noMatch:"Aucun journal ne correspond aux filtres actuels.",mainProcess:"Processus principal",childProcess:"Processus enfant",main:"Principal",child:"Enfant"},sj={add:"Ajouter",addNew:"Ajouter un nouveau groupe",edit:"Modifier le groupe",delete:"Supprimer",confirmDelete:"Êtes-vous sûr de vouloir supprimer ce groupe ?",deleteWarning:"La suppression du groupe '{{name}}' le supprimera ainsi que toutes ses associations de serveurs. Cette action est irréversible.",name:"Nom du groupe",namePlaceholder:"Entrez le nom du groupe",nameRequired:"Le nom du groupe est requis",description:"Description",descriptionPlaceholder:"Entrez la description du groupe (facultatif)",createError:"Échec de la création du groupe",updateError:"Échec de la mise à jour du groupe",deleteError:"Échec de la suppression du groupe",serverAddError:"Échec de l'ajout du serveur au groupe",serverRemoveError:"Échec de la suppression du serveur du groupe",addServer:"Ajouter un serveur au groupe",selectServer:"Sélectionnez un serveur à ajouter",servers:"Serveurs dans le groupe",remove:"Retirer",noGroups:"Aucun groupe disponible. Créez un nouveau groupe pour commencer.",noServers:"Aucun serveur dans ce groupe.",noServerOptions:"Aucun serveur disponible",serverCount:"{{count}} serveurs",toolSelection:"Sélection d'outils",toolsSelected:"Sélectionné",allTools:"Tous",selectedTools:"Outils sélectionnés",selectAll:"Tout sélectionner",selectNone:"Ne rien sélectionner",configureTools:"Configurer les outils"},nj={title:"Installation locale",official:"Officiel",by:"Par",unknown:"Inconnu",tools:"outils",search:"Rechercher",searchPlaceholder:"Rechercher des serveurs par nom, catégorie ou tags",clearFilters:"Effacer",clearCategoryFilter:"",clearTagFilter:"",categories:"Catégories",tags:"Tags",showTags:"Afficher les tags",hideTags:"Masquer les tags",moreTags:"",noServers:"Aucun serveur trouvé correspondant à votre recherche",backToList:"Retour à la liste",install:"Installer",installing:"Installation en cours...",installed:"Installé",installServer:"Installer le serveur : {{name}}",installSuccess:"Serveur {{serverName}} installé avec succès",author:"Auteur",license:"Licence",repository:"Dépôt",examples:"Exemples",arguments:"Arguments",argumentName:"Nom",description:"Description",required:"Requis",example:"Exemple",viewSchema:"Voir le schéma",fetchError:"Erreur lors de la récupération des serveurs du marché",serverNotFound:"Serveur non trouvé",searchError:"Erreur lors de la recherche de serveurs",filterError:"Erreur lors du filtrage des serveurs par catégorie",tagFilterError:"Erreur lors du filtrage des serveurs par tag",noInstallationMethod:"Aucune méthode d'installation disponible pour ce serveur",showing:"Affichage de {{from}}-{{to}} sur {{total}} serveurs",perPage:"Par page",confirmVariablesMessage:"Veuillez vous assurer que ces variables sont correctement définies dans votre environnement d'exécution. Continuer l'installation du serveur ?",confirmAndInstall:"Confirmer et installer"},lj={title:"Support Cloud",subtitle:"Propulsé par MCPRouter",by:"Par",server:"Serveur",config:"Config",created:"Créé",updated:"Mis à jour",available:"Disponible",description:"Description",details:"Détails",tools:"Outils",tool:"outil",toolsAvailable:"{{count}} outil disponible||{{count}} outils disponibles",loadingTools:"Chargement des outils...",noTools:"Aucun outil disponible pour ce serveur",noDescription:"Aucune description disponible",viewDetails:"Voir les détails",parameters:"Paramètres",result:"Résultat",error:"Erreur",callTool:"Appeler",calling:"Appel en cours...",toolCallSuccess:"L'outil {{toolName}} a été exécuté avec succès",toolCallError:"Échec de l'appel de l'outil {{toolName}} : {{error}}",viewSchema:"Voir le schéma",backToList:"Retour au marché Cloud",search:"Rechercher",searchPlaceholder:"Rechercher des serveurs cloud par nom, titre ou auteur",clearFilters:"Effacer les filtres",clearCategoryFilter:"Effacer",clearTagFilter:"Effacer",categories:"Catégories",tags:"Tags",noCategories:"Aucune catégorie trouvée",noTags:"Aucun tag trouvé",noServers:"Aucun serveur cloud trouvé",fetchError:"Erreur lors de la récupération des serveurs cloud",serverNotFound:"Serveur cloud non trouvé",searchError:"Erreur lors de la recherche de serveurs cloud",filterError:"Erreur lors du filtrage des serveurs cloud par catégorie",tagFilterError:"Erreur lors du filtrage des serveurs cloud par tag",showing:"Affichage de {{from}}-{{to}} sur {{total}} serveurs cloud",perPage:"Par page",apiKeyNotConfigured:"Clé API MCPRouter non configurée",apiKeyNotConfiguredDescription:"Pour utiliser les serveurs cloud, vous devez configurer votre clé API MCPRouter.",getApiKey:"Obtenir une clé API",configureInSettings:"Configurer dans les paramètres",installServer:"Installer {{name}}",installSuccess:"Serveur {{name}} installé avec succès",installError:"Échec de l'installation du serveur : {{error}}"},oj={run:"Exécuter",running:"Exécution en cours...",runTool:"Exécuter l'outil",cancel:"Annuler",noDescription:"Aucune description disponible",inputSchema:"Schéma d'entrée :",runToolWithName:"Exécuter l'outil : {{name}}",execution:"Exécution de l'outil",successful:"Réussi",failed:"Échoué",result:"Résultat :",error:"Erreur",errorDetails:"Détails de l'erreur :",noContent:"L'outil a été exécuté avec succès mais n'a renvoyé aucun contenu.",unknownError:"Une erreur inconnue est survenue",jsonResponse:"Réponse JSON :",toolResult:"Résultat de l'outil",noParameters:"Cet outil ne nécessite aucun paramètre.",selectOption:"Sélectionnez une option",enterValue:"Entrez la valeur {{type}}",enabled:"Activé",enableSuccess:"Outil {{name}} activé avec succès",disableSuccess:"Outil {{name}} désactivé avec succès",toggleFailed:"Échec du basculement de l'état de l'outil",parameters:"Paramètres de l'outil",formMode:"Mode formulaire",jsonMode:"Mode JSON",jsonConfiguration:"Configuration JSON",invalidJsonFormat:"Format JSON invalide",fixJsonBeforeSwitching:"Veuillez corriger le format JSON avant de passer en mode formulaire",item:"Élément {{index}}",addItem:"Ajouter un élément {{key}}",enterKey:"Entrez {{key}}"},ij={run:"Obtenir",running:"Obtention en cours...",result:"Résultat de l'invite",error:"Erreur de l'invite",execution:"Exécution de l'invite",successful:"Réussi",failed:"Échoué",errorDetails:"Détails de l'erreur :",noContent:"L'invite a été exécutée avec succès mais n'a renvoyé aucun contenu.",unknownError:"Une erreur inconnue est survenue",jsonResponse:"Réponse JSON :",description:"Description",messages:"Messages",noDescription:"Aucune description disponible",runPromptWithName:"Obtenir l'invite : {{name}}"},cj={enableGlobalRoute:"Activer la route globale",enableGlobalRouteDescription:"Autoriser les connexions au point de terminaison /sse sans spécifier d'ID de groupe",enableGroupNameRoute:"Activer la route par nom de groupe",enableGroupNameRouteDescription:"Autoriser les connexions au point de terminaison /sse en utilisant les noms de groupe au lieu des ID de groupe",enableBearerAuth:"Activer l'authentification Bearer",enableBearerAuthDescription:"Exiger une authentification par jeton Bearer pour les requêtes MCP",bearerAuthKey:"Clé d'authentification Bearer",bearerAuthKeyDescription:"La clé d'authentification qui sera requise dans le jeton Bearer",bearerAuthKeyPlaceholder:"Entrez la clé d'authentification Bearer",skipAuth:"Ignorer l'authentification",skipAuthDescription:"Contourner l'exigence de connexion pour l'accès au frontend et à l'API (DÉSACTIVÉ PAR DÉFAUT pour des raisons de sécurité)",pythonIndexUrl:"URL du dépôt de paquets Python",pythonIndexUrlDescription:"Définir la variable d'environnement UV_DEFAULT_INDEX pour l'installation de paquets Python",pythonIndexUrlPlaceholder:"ex. https://pypi.org/simple",npmRegistry:"URL du registre NPM",npmRegistryDescription:"Définir la variable d'environnement npm_config_registry pour l'installation de paquets NPM",npmRegistryPlaceholder:"ex. https://registry.npmjs.org/",baseUrl:"URL de base",baseUrlDescription:"URL de base pour les requêtes MCP",baseUrlPlaceholder:"ex. http://localhost:3000",installConfig:"Installation",systemConfigUpdated:"Configuration système mise à jour avec succès",enableSmartRouting:"Activer le routage intelligent",enableSmartRoutingDescription:"Activer la fonctionnalité de routage intelligent pour rechercher l'outil le plus approprié en fonction de l'entrée (en utilisant le nom de groupe $smart)",dbUrl:"URL PostgreSQL (nécessite le support de pgvector)",dbUrlPlaceholder:"ex. postgresql://user:password@localhost:5432/dbname",openaiApiBaseUrl:"URL de base de l'API OpenAI",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"Clé API OpenAI",openaiApiKeyPlaceholder:"Entrez la clé API OpenAI",openaiApiEmbeddingModel:"Modèle d'intégration OpenAI",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"Configuration du routage intelligent mise à jour avec succès",smartRoutingRequiredFields:"L'URL de la base de données et la clé API OpenAI sont requises pour activer le routage intelligent",smartRoutingValidationError:"Veuillez remplir les champs obligatoires avant d'activer le routage intelligent : {{fields}}",mcpRouterConfig:"Marché Cloud",mcpRouterApiKey:"Clé API MCPRouter",mcpRouterApiKeyDescription:"Clé API pour accéder aux services du marché cloud MCPRouter",mcpRouterApiKeyPlaceholder:"Entrez la clé API MCPRouter",mcpRouterReferer:"Référent",mcpRouterRefererDescription:"En-tête Referer pour les requêtes API MCPRouter",mcpRouterRefererPlaceholder:"https://www.mcphubx.com",mcpRouterTitle:"Titre",mcpRouterTitleDescription:"En-tête Title pour les requêtes API MCPRouter",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"URL de base",mcpRouterBaseUrlDescription:"URL de base pour l'API MCPRouter",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1",systemSettings:"Paramètres système",nameSeparatorLabel:"Séparateur de noms",nameSeparatorDescription:"Caractère utilisé pour séparer le nom du serveur et le nom de l'outil/prompt (par défaut : -)",restartRequired:"Configuration enregistrée. Il est recommandé de redémarrer l'application pour s'assurer que tous les services chargent correctement les nouveaux paramètres.",exportMcpSettings:"Exporter les paramètres",mcpSettingsJson:"JSON des paramètres MCP",mcpSettingsJsonDescription:"Afficher, copier ou télécharger votre configuration mcp_settings.json actuelle pour la sauvegarde ou la migration vers d'autres outils",copyToClipboard:"Copier dans le presse-papiers",downloadJson:"Télécharger JSON",exportSuccess:"Paramètres exportés avec succès",exportError:"Échec de la récupération des paramètres"},uj={upload:"Télécharger",uploadTitle:"Télécharger l'extension DXT",dropFileHere:"Déposez votre fichier .dxt ici",orClickToSelect:"ou cliquez pour sélectionner depuis votre ordinateur",invalidFileType:"Veuillez sélectionner un fichier .dxt valide",noFileSelected:"Veuillez sélectionner un fichier .dxt à télécharger",uploading:"Téléchargement en cours...",uploadFailed:"Échec du téléchargement du fichier DXT",installServer:"Installer le serveur MCP depuis DXT",extensionInfo:"Informations sur l'extension",name:"Nom",version:"Version",description:"Description",author:"Auteur",tools:"Outils",serverName:"Nom du serveur",serverNamePlaceholder:"Entrez un nom pour ce serveur",install:"Installer",installing:"Installation en cours...",installFailed:"Échec de l'installation du serveur depuis DXT",serverExistsTitle:"Le serveur existe déjà",serverExistsConfirm:"Le serveur '{{serverName}}' existe déjà. Voulez-vous le remplacer par la nouvelle version ?",override:"Remplacer"},dj={add:"Ajouter un utilisateur",addNew:"Ajouter un nouvel utilisateur",edit:"Modifier l'utilisateur",delete:"Supprimer l'utilisateur",create:"Créer un utilisateur",update:"Mettre à jour l'utilisateur",username:"Nom d'utilisateur",password:"Mot de passe",newPassword:"Nouveau mot de passe",confirmPassword:"Confirmer le mot de passe",adminRole:"Administrateur",admin:"Admin",user:"Utilisateur",permissions:"Permissions",adminPermissions:"Accès complet au système",userPermissions:"Accès limité",currentUser:"Vous",noUsers:"Aucun utilisateur trouvé",adminRequired:"Un accès administrateur est requis pour gérer les utilisateurs",usernameRequired:"Le nom d'utilisateur est requis",passwordRequired:"Le mot de passe est requis",passwordTooShort:"Le mot de passe doit comporter au moins 6 caractères",passwordMismatch:"Les mots de passe ne correspondent pas",usernamePlaceholder:"Entrez le nom d'utilisateur",passwordPlaceholder:"Entrez le mot de passe",newPasswordPlaceholder:"Laissez vide pour conserver le mot de passe actuel",confirmPasswordPlaceholder:"Confirmez le nouveau mot de passe",createError:"Échec de la création de l'utilisateur",updateError:"Échec de la mise à jour de l'utilisateur",deleteError:"Échec de la suppression de l'utilisateur",statsError:"Échec de la récupération des statistiques utilisateur",deleteConfirmation:"Êtes-vous sûr de vouloir supprimer l'utilisateur '{{username}}' ? Cette action est irréversible.",confirmDelete:"Supprimer l'utilisateur",deleteWarning:"Êtes-vous sûr de vouloir supprimer l'utilisateur '{{username}}' ? Cette action est irréversible."},fj={errors:{readonly:"Lecture seule pour l'environnement de démonstration",invalid_credentials:"Nom d'utilisateur ou mot de passe invalide",serverNameRequired:"Le nom du serveur est requis",serverConfigRequired:"La configuration du serveur est requise",serverConfigInvalid:"La configuration du serveur doit inclure une URL, une URL de spécification OpenAPI ou un schéma, ou une commande avec des arguments",serverTypeInvalid:"Le type de serveur doit être l'un des suivants : stdio, sse, streamable-http, openapi",urlRequiredForType:"L'URL est requise pour le type de serveur {{type}}",openapiSpecRequired:"L'URL de la spécification OpenAPI ou le schéma est requis pour le type de serveur openapi",headersInvalidFormat:"Les en-têtes doivent être un objet",headersNotSupportedForStdio:"Les en-têtes ne sont pas pris en charge pour le type de serveur stdio",serverNotFound:"Serveur non trouvé",failedToRemoveServer:"Serveur non trouvé ou échec de la suppression",internalServerError:"Erreur interne du serveur",failedToGetServers:"Échec de la récupération des informations sur les serveurs",failedToGetServerSettings:"Échec de la récupération des paramètres du serveur",failedToGetServerConfig:"Échec de la récupération de la configuration du serveur",failedToSaveSettings:"Échec de l'enregistrement des paramètres",toolNameRequired:"Le nom du serveur et le nom de l'outil sont requis",descriptionMustBeString:"La description doit être une chaîne de caractères",groupIdRequired:"L'ID de groupe est requis",groupNameRequired:"Le nom du groupe est requis",groupNotFound:"Groupe non trouvé",groupIdAndServerNameRequired:"L'ID de groupe和le nom du serveur sont requis",groupOrServerNotFound:"Groupe ou serveur non trouvé",toolsMustBeAllOrArray:'Les outils doivent être "all" ou un tableau de chaînes de caractères',serverNameAndToolNameRequired:"Le nom du serveur et le nom de l'outil sont requis",usernameRequired:"Le nom d'utilisateur est requis",userNotFound:"Utilisateur non trouvé",failedToGetUsers:"Échec de la récupération des informations sur les utilisateurs",failedToGetUserInfo:"Échec de la récupération des informations sur l'utilisateur",failedToGetUserStats:"Échec de la récupération des statistiques de l'utilisateur",marketServerNameRequired:"Le nom du serveur du marché est requis",marketServerNotFound:"Serveur du marché non trouvé",failedToGetMarketServers:"Échec de la récupération des informations sur les serveurs du marché",failedToGetMarketServer:"Échec de la récupération des informations sur le serveur du marché",failedToGetMarketCategories:"Échec de la récupération des catégories du marché",failedToGetMarketTags:"Échec de la récupération des tags du marché",failedToSearchMarketServers:"Échec de la recherche des serveurs du marché",failedToFilterMarketServers:"Échec du filtrage des serveurs du marché",failedToProcessDxtFile:"Échec du traitement du fichier DXT"},success:{serverCreated:"Serveur créé avec succès",serverUpdated:"Serveur mis à jour avec succès",serverRemoved:"Serveur supprimé avec succès",serverToggled:"État du serveur basculé avec succès",toolToggled:"Outil {{name}} {{action}} avec succès",toolDescriptionUpdated:"Description de l'outil {{name}} mise à jour avec succès",systemConfigUpdated:"Configuration système mise à jour avec succès",groupCreated:"Groupe créé avec succès",groupUpdated:"Groupe mis à jour avec succès",groupDeleted:"Groupe supprimé avec succès",serverAddedToGroup:"Serveur ajouté au groupe avec succès",serverRemovedFromGroup:"Serveur supprimé du groupe avec succès",serverToolsUpdated:"Outils du serveur mis à jour avec succès"}},mj={app:Gw,about:Kw,profile:Fw,sponsor:$w,wechat:Iw,discord:Yw,theme:Xw,auth:Qw,server:Jw,status:Zw,errors:Ww,common:ej,nav:tj,pages:aj,logs:rj,groups:sj,market:nj,cloud:lj,tool:oj,prompt:ij,settings:cj,dxt:uj,users:dj,api:fj};kt.use(fg).use(Tb).init({resources:{en:{translation:xw},zh:{translation:Vw},fr:{translation:mj}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const hj=()=>{cb()};hj();async function pj(){try{console.log("Loading runtime configuration...");const n=await lb();console.log("Runtime configuration loaded:",n),window.__MCPHUB_CONFIG__=n,Sh.createRoot(document.getElementById("root")).render(r.jsx(Os.StrictMode,{children:r.jsx(qh,{})}))}catch(n){console.error("Failed to initialize app:",n),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},Sh.createRoot(document.getElementById("root")).render(r.jsx(Os.StrictMode,{children:r.jsx(qh,{})}))}}pj();
217
+ //# sourceMappingURL=index-DtD23pxb.js.map