@samanhappy/mcphub 0.9.13 → 0.9.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.js +10 -6
- package/dist/config/index.js.map +1 -1
- package/dist/controllers/registryController.js +143 -0
- package/dist/controllers/registryController.js.map +1 -0
- package/dist/routes/index.js +6 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/server.js +24 -44
- package/dist/server.js.map +1 -1
- package/dist/utils/moduleDir.js +11 -0
- package/dist/utils/moduleDir.js.map +1 -0
- package/dist/utils/path.js +160 -8
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/version.js +11 -2
- package/dist/utils/version.js.map +1 -1
- package/frontend/dist/assets/index-BLUhSkL4.js +217 -0
- package/frontend/dist/assets/index-BLUhSkL4.js.map +1 -0
- package/frontend/dist/assets/index-D8hgHrZ3.css +1 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/index-C-W1MdoW.css +0 -1
- package/frontend/dist/assets/index-DtD23pxb.js +0 -217
- package/frontend/dist/assets/index-DtD23pxb.js.map +0 -1
|
@@ -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 ip(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ic={exports:{}},Vn={};/**
|
|
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 gh;function Nx(){if(gh)return Vn;gh=1;var a=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 h in u)h!=="key"&&(d[h]=u[h])}else d=u;return u=d.ref,{$$typeof:a,type:i,key:m,ref:u!==void 0?u:null,props:d}}return Vn.Fragment=l,Vn.jsx=o,Vn.jsxs=o,Vn}var xh;function Sx(){return xh||(xh=1,Ic.exports=Nx()),Ic.exports}var s=Sx(),Yc={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 yh;function Cx(){if(yh)return Re;yh=1;var a=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"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),w=Symbol.iterator;function k(S){return S===null||typeof S!="object"?null:(S=w&&S[w]||S["@@iterator"],typeof S=="function"?S:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,A={};function O(S,_,Z){this.props=S,this.context=_,this.refs=A,this.updater=Z||T}O.prototype.isReactComponent={},O.prototype.setState=function(S,_){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,_,"setState")},O.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function R(){}R.prototype=O.prototype;function N(S,_,Z){this.props=S,this.context=_,this.refs=A,this.updater=Z||T}var M=N.prototype=new R;M.constructor=N,E(M,O.prototype),M.isPureReactComponent=!0;var G=Array.isArray,W={H:null,A:null,T:null,S:null,V:null},re=Object.prototype.hasOwnProperty;function te(S,_,Z,H,I,de){return Z=de.ref,{$$typeof:a,type:S,key:_,ref:Z!==void 0?Z:null,props:de}}function $(S,_){return te(S.type,_,void 0,void 0,void 0,S.props)}function se(S){return typeof S=="object"&&S!==null&&S.$$typeof===a}function le(S){var _={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Z){return _[Z]})}var U=/\/+/g;function z(S,_){return typeof S=="object"&&S!==null&&S.key!=null?le(""+S.key):_.toString(36)}function Q(){}function B(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(Q,Q):(S.status="pending",S.then(function(_){S.status==="pending"&&(S.status="fulfilled",S.value=_)},function(_){S.status==="pending"&&(S.status="rejected",S.reason=_)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function V(S,_,Z,H,I){var de=typeof S;(de==="undefined"||de==="boolean")&&(S=null);var ee=!1;if(S===null)ee=!0;else switch(de){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(S.$$typeof){case a:case l:ee=!0;break;case x:return ee=S._init,V(ee(S._payload),_,Z,H,I)}}if(ee)return I=I(S),ee=H===""?"."+z(S,0):H,G(I)?(Z="",ee!=null&&(Z=ee.replace(U,"$&/")+"/"),V(I,_,Z,"",function(je){return je})):I!=null&&(se(I)&&(I=$(I,Z+(I.key==null||S&&S.key===I.key?"":(""+I.key).replace(U,"$&/")+"/")+ee)),_.push(I)),1;ee=0;var Y=H===""?".":H+":";if(G(S))for(var ue=0;ue<S.length;ue++)H=S[ue],de=Y+z(H,ue),ee+=V(H,_,Z,de,I);else if(ue=k(S),typeof ue=="function")for(S=ue.call(S),ue=0;!(H=S.next()).done;)H=H.value,de=Y+z(H,ue++),ee+=V(H,_,Z,de,I);else if(de==="object"){if(typeof S.then=="function")return V(B(S),_,Z,H,I);throw _=String(S),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return ee}function b(S,_,Z){if(S==null)return S;var H=[],I=0;return V(S,H,"","",function(de){return _.call(Z,de,I++)}),H}function C(S){if(S._status===-1){var _=S._result;_=_(),_.then(function(Z){(S._status===0||S._status===-1)&&(S._status=1,S._result=Z)},function(Z){(S._status===0||S._status===-1)&&(S._status=2,S._result=Z)}),S._status===-1&&(S._status=0,S._result=_)}if(S._status===1)return S._result.default;throw S._result}var L=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)};function oe(){}return Re.Children={map:b,forEach:function(S,_,Z){b(S,function(){_.apply(this,arguments)},Z)},count:function(S){var _=0;return b(S,function(){_++}),_},toArray:function(S){return b(S,function(_){return _})||[]},only:function(S){if(!se(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},Re.Component=O,Re.Fragment=o,Re.Profiler=u,Re.PureComponent=N,Re.StrictMode=i,Re.Suspense=p,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,Re.__COMPILER_RUNTIME={__proto__:null,c:function(S){return W.H.useMemoCache(S)}},Re.cache=function(S){return function(){return S.apply(null,arguments)}},Re.cloneElement=function(S,_,Z){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var H=E({},S.props),I=S.key,de=void 0;if(_!=null)for(ee in _.ref!==void 0&&(de=void 0),_.key!==void 0&&(I=""+_.key),_)!re.call(_,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&_.ref===void 0||(H[ee]=_[ee]);var ee=arguments.length-2;if(ee===1)H.children=Z;else if(1<ee){for(var Y=Array(ee),ue=0;ue<ee;ue++)Y[ue]=arguments[ue+2];H.children=Y}return te(S.type,I,void 0,void 0,de,H)},Re.createContext=function(S){return S={$$typeof:m,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:d,_context:S},S},Re.createElement=function(S,_,Z){var H,I={},de=null;if(_!=null)for(H in _.key!==void 0&&(de=""+_.key),_)re.call(_,H)&&H!=="key"&&H!=="__self"&&H!=="__source"&&(I[H]=_[H]);var ee=arguments.length-2;if(ee===1)I.children=Z;else if(1<ee){for(var Y=Array(ee),ue=0;ue<ee;ue++)Y[ue]=arguments[ue+2];I.children=Y}if(S&&S.defaultProps)for(H in ee=S.defaultProps,ee)I[H]===void 0&&(I[H]=ee[H]);return te(S,de,void 0,void 0,null,I)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(S){return{$$typeof:h,render:S}},Re.isValidElement=se,Re.lazy=function(S){return{$$typeof:x,_payload:{_status:-1,_result:S},_init:C}},Re.memo=function(S,_){return{$$typeof:g,type:S,compare:_===void 0?null:_}},Re.startTransition=function(S){var _=W.T,Z={};W.T=Z;try{var H=S(),I=W.S;I!==null&&I(Z,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(oe,L)}catch(de){L(de)}finally{W.T=_}},Re.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},Re.use=function(S){return W.H.use(S)},Re.useActionState=function(S,_,Z){return W.H.useActionState(S,_,Z)},Re.useCallback=function(S,_){return W.H.useCallback(S,_)},Re.useContext=function(S){return W.H.useContext(S)},Re.useDebugValue=function(){},Re.useDeferredValue=function(S,_){return W.H.useDeferredValue(S,_)},Re.useEffect=function(S,_,Z){var H=W.H;if(typeof Z=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return H.useEffect(S,_)},Re.useId=function(){return W.H.useId()},Re.useImperativeHandle=function(S,_,Z){return W.H.useImperativeHandle(S,_,Z)},Re.useInsertionEffect=function(S,_){return W.H.useInsertionEffect(S,_)},Re.useLayoutEffect=function(S,_){return W.H.useLayoutEffect(S,_)},Re.useMemo=function(S,_){return W.H.useMemo(S,_)},Re.useOptimistic=function(S,_){return W.H.useOptimistic(S,_)},Re.useReducer=function(S,_,Z){return W.H.useReducer(S,_,Z)},Re.useRef=function(S){return W.H.useRef(S)},Re.useState=function(S){return W.H.useState(S)},Re.useSyncExternalStore=function(S,_,Z){return W.H.useSyncExternalStore(S,_,Z)},Re.useTransition=function(){return W.H.useTransition()},Re.version="19.1.1",Re}var vh;function gu(){return vh||(vh=1,Yc.exports=Cx()),Yc.exports}var v=gu();const Va=ip(v);var Xc={exports:{}},Gn={},Qc={exports:{}},Jc={};/**
|
|
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 bh;function Ex(){return bh||(bh=1,(function(a){function l(b,C){var L=b.length;b.push(C);e:for(;0<L;){var oe=L-1>>>1,S=b[oe];if(0<u(S,C))b[oe]=C,b[L]=S,L=oe;else break e}}function o(b){return b.length===0?null:b[0]}function i(b){if(b.length===0)return null;var C=b[0],L=b.pop();if(L!==C){b[0]=L;e:for(var oe=0,S=b.length,_=S>>>1;oe<_;){var Z=2*(oe+1)-1,H=b[Z],I=Z+1,de=b[I];if(0>u(H,L))I<S&&0>u(de,H)?(b[oe]=de,b[I]=L,oe=I):(b[oe]=H,b[Z]=L,oe=Z);else if(I<S&&0>u(de,L))b[oe]=de,b[I]=L,oe=I;else break e}}return C}function u(b,C){var L=b.sortIndex-C.sortIndex;return L!==0?L:b.id-C.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var m=Date,h=m.now();a.unstable_now=function(){return m.now()-h}}var p=[],g=[],x=1,w=null,k=3,T=!1,E=!1,A=!1,O=!1,R=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function G(b){for(var C=o(g);C!==null;){if(C.callback===null)i(g);else if(C.startTime<=b)i(g),C.sortIndex=C.expirationTime,l(p,C);else break;C=o(g)}}function W(b){if(A=!1,G(b),!E)if(o(p)!==null)E=!0,re||(re=!0,z());else{var C=o(g);C!==null&&V(W,C.startTime-b)}}var re=!1,te=-1,$=5,se=-1;function le(){return O?!0:!(a.unstable_now()-se<$)}function U(){if(O=!1,re){var b=a.unstable_now();se=b;var C=!0;try{e:{E=!1,A&&(A=!1,N(te),te=-1),T=!0;var L=k;try{t:{for(G(b),w=o(p);w!==null&&!(w.expirationTime>b&&le());){var oe=w.callback;if(typeof oe=="function"){w.callback=null,k=w.priorityLevel;var S=oe(w.expirationTime<=b);if(b=a.unstable_now(),typeof S=="function"){w.callback=S,G(b),C=!0;break t}w===o(p)&&i(p),G(b)}else i(p);w=o(p)}if(w!==null)C=!0;else{var _=o(g);_!==null&&V(W,_.startTime-b),C=!1}}break e}finally{w=null,k=L,T=!1}C=void 0}}finally{C?z():re=!1}}}var z;if(typeof M=="function")z=function(){M(U)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,B=Q.port2;Q.port1.onmessage=U,z=function(){B.postMessage(null)}}else z=function(){R(U,0)};function V(b,C){te=R(function(){b(a.unstable_now())},C)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(b){b.callback=null},a.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<b?Math.floor(1e3/b):5},a.unstable_getCurrentPriorityLevel=function(){return k},a.unstable_next=function(b){switch(k){case 1:case 2:case 3:var C=3;break;default:C=k}var L=k;k=C;try{return b()}finally{k=L}},a.unstable_requestPaint=function(){O=!0},a.unstable_runWithPriority=function(b,C){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var L=k;k=b;try{return C()}finally{k=L}},a.unstable_scheduleCallback=function(b,C,L){var oe=a.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?oe+L:oe):L=oe,b){case 1:var S=-1;break;case 2:S=250;break;case 5:S=1073741823;break;case 4:S=1e4;break;default:S=5e3}return S=L+S,b={id:x++,callback:C,priorityLevel:b,startTime:L,expirationTime:S,sortIndex:-1},L>oe?(b.sortIndex=L,l(g,b),o(p)===null&&b===o(g)&&(A?(N(te),te=-1):A=!0,V(W,L-oe))):(b.sortIndex=S,l(p,b),E||T||(E=!0,re||(re=!0,z()))),b},a.unstable_shouldYield=le,a.unstable_wrapCallback=function(b){var C=k;return function(){var L=k;k=C;try{return b.apply(this,arguments)}finally{k=L}}}})(Jc)),Jc}var jh;function kx(){return jh||(jh=1,Qc.exports=Ex()),Qc.exports}var Zc={exports:{}},Rt={};/**
|
|
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 wh;function Ax(){if(wh)return Rt;wh=1;var a=gu();function l(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+p+"; visit "+g+" 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(p,g,x){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:w==null?null:""+w,children:p,containerInfo:g,implementation:x}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Rt.createPortal=function(p,g){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return d(p,g,null,x)},Rt.flushSync=function(p){var g=m.T,x=i.p;try{if(m.T=null,i.p=2,p)return p()}finally{m.T=g,i.p=x,i.d.f()}},Rt.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(p,g))},Rt.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},Rt.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var x=g.as,w=h(x,g.crossOrigin),k=typeof g.integrity=="string"?g.integrity:void 0,T=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?i.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:w,integrity:k,fetchPriority:T}):x==="script"&&i.d.X(p,{crossOrigin:w,integrity:k,fetchPriority:T,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Rt.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var x=h(g.as,g.crossOrigin);i.d.M(p,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(p)},Rt.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,w=h(x,g.crossOrigin);i.d.L(p,x,{crossOrigin:w,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Rt.preloadModule=function(p,g){if(typeof p=="string")if(g){var x=h(g.as,g.crossOrigin);i.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(p)},Rt.requestFormReset=function(p){i.d.r(p)},Rt.unstable_batchedUpdates=function(p,g){return p(g)},Rt.useFormState=function(p,g,x){return m.H.useFormState(p,g,x)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.1.1",Rt}var Nh;function Tx(){if(Nh)return Zc.exports;Nh=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Zc.exports=Ax(),Zc.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 Sh;function Rx(){if(Sh)return Gn;Sh=1;var a=kx(),l=gu(),o=Tx();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}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,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r: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 h(e){if(d(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var r=e,n=t;;){var c=r.return;if(c===null)break;var f=c.alternate;if(f===null){if(n=c.return,n!==null){r=n;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===r)return h(c),e;if(f===n)return h(c),t;f=f.sibling}throw Error(i(188))}if(r.return!==n.return)r=c,n=f;else{for(var y=!1,j=c.child;j;){if(j===r){y=!0,r=c,n=f;break}if(j===n){y=!0,n=c,r=f;break}j=j.sibling}if(!y){for(j=f.child;j;){if(j===r){y=!0,r=f,n=c;break}if(j===n){y=!0,n=f,r=c;break}j=j.sibling}if(!y)throw Error(i(189))}}if(r.alternate!==n)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,w=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),N=Symbol.for("react.consumer"),M=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),le=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 Q=Symbol.for("react.client.reference");function B(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case O:return"Profiler";case A:return"StrictMode";case W:return"Suspense";case re:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case M:return(e.displayName||"Context")+".Provider";case N:return(e._context.displayName||"Context")+".Consumer";case G: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:B(e.type)||"Memo";case $:t=e._payload,e=e._init;try{return B(e(t))}catch{}}return null}var V=Array.isArray,b=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},oe=[],S=-1;function _(e){return{current:e}}function Z(e){0>S||(e.current=oe[S],oe[S]=null,S--)}function H(e,t){S++,oe[S]=e.current,e.current=t}var I=_(null),de=_(null),ee=_(null),Y=_(null);function ue(e,t){switch(H(ee,t),H(de,e),H(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Fm(t),e=$m(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Z(I),H(I,e)}function je(){Z(I),Z(de),Z(ee)}function Se(e){e.memoizedState!==null&&H(Y,e);var t=I.current,r=$m(t,e.type);t!==r&&(H(de,e),H(I,r))}function ye(e){de.current===e&&(Z(I),Z(de)),Y.current===e&&(Z(Y),Pn._currentValue=L)}var Me=Object.prototype.hasOwnProperty,ce=a.unstable_scheduleCallback,Ae=a.unstable_cancelCallback,nt=a.unstable_shouldYield,Ct=a.unstable_requestPaint,ze=a.unstable_now,Et=a.unstable_getCurrentPriorityLevel,br=a.unstable_ImmediatePriority,Yt=a.unstable_UserBlockingPriority,Xt=a.unstable_NormalPriority,Qt=a.unstable_LowPriority,rs=a.unstable_IdlePriority,ss=a.log,Rs=a.unstable_setDisableYieldValue,Jt=null,ft=null;function Ot(e){if(typeof ss=="function"&&Rs(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Jt,e)}catch{}}var mt=Math.clz32?Math.clz32:ea,as=Math.log,fr=Math.LN2;function ea(e){return e>>>=0,e===0?32:31-(as(e)/fr|0)|0}var Or=256,Dr=4194304;function Zt(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 mr(e,t,r){var n=e.pendingLanes;if(n===0)return 0;var c=0,f=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var j=n&134217727;return j!==0?(n=j&~f,n!==0?c=Zt(n):(y&=j,y!==0?c=Zt(y):r||(r=j&~e,r!==0&&(c=Zt(r))))):(j=n&~f,j!==0?c=Zt(j):y!==0?c=Zt(y):r||(r=n&~e,r!==0&&(c=Zt(r)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,r=t&-t,f>=r||f===32&&(r&4194048)!==0)?t:c}function jr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ta(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 me(){var e=Or;return Or<<=1,(Or&4194048)===0&&(Or=256),e}function fe(){var e=Dr;return Dr<<=1,(Dr&62914560)===0&&(Dr=4194304),e}function he(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function kt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hr(e,t,r,n,c,f){var y=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var j=e.entanglements,D=e.expirationTimes,K=e.hiddenUpdates;for(r=y&~r;0<r;){var ae=31-mt(r),ie=1<<ae;j[ae]=0,D[ae]=-1;var X=K[ae];if(X!==null)for(K[ae]=null,ae=0;ae<X.length;ae++){var J=X[ae];J!==null&&(J.lane&=-536870913)}r&=~ie}n!==0&&wr(e,n,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(y&~t))}function wr(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-mt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|r&4194090}function Nr(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-mt(r),c=1<<n;c&t|e[n]&t&&(e[n]|=t),r&=~c}}function ns(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 bt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pr(){var e=C.p;return e!==0?e:(e=window.event,e===void 0?32:uh(e.type))}function Je(e,t){var r=C.p;try{return C.p=e,t()}finally{C.p=r}}var He=Math.random().toString(36).slice(2),tt="__reactFiber$"+He,rt="__reactProps$"+He,Wt="__reactContainer$"+He,Ur="__reactEvents$"+He,Sr="__reactListeners$"+He,Bo="__reactHandles$"+He,ra="__reactResources$"+He,Ms="__reactMarker$"+He;function er(e){delete e[tt],delete e[rt],delete e[Ur],delete e[Sr],delete e[Bo]}function ls(e){var t=e[tt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Wt]||r[tt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Xm(e);e!==null;){if(r=e[tt])return r;e=Xm(e)}return t}e=r,r=e.parentNode}return null}function Lt(e){if(e=e[tt]||e[Wt]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function we(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Oe(e){var t=e[ra];return t||(t=e[ra]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Te(e){e[Ms]=!0}var Xe=new Set,At={};function Os(e,t){sa(e,t),sa(e+"Capture",t)}function sa(e,t){for(At[e]=t,e=0;e<t.length;e++)Xe.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]*$"),Uu={},Lu={};function gg(e){return Me.call(Lu,e)?!0:Me.call(Uu,e)?!1:pg.test(e)?Lu[e]=!0:(Uu[e]=!0,!1)}function ol(e,t,r){if(gg(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function il(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Lr(e,t,r,n){if(n===null)e.removeAttribute(r);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+n)}}var qo,zu;function aa(e){if(qo===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);qo=t&&t[1]||"",zu=-1<r.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+qo+e+zu}var Vo=!1;function Go(e,t){if(!e||Vo)return"";Vo=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(J){var X=J}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(J){X=J}e.call(ie.prototype)}}else{try{throw Error()}catch(J){X=J}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(J){if(J&&X&&typeof J.stack=="string")return[J.stack,X.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=n.DetermineComponentFrameRoot(),y=f[0],j=f[1];if(y&&j){var D=y.split(`
|
|
44
|
+
`),K=j.split(`
|
|
45
|
+
`);for(c=n=0;n<D.length&&!D[n].includes("DetermineComponentFrameRoot");)n++;for(;c<K.length&&!K[c].includes("DetermineComponentFrameRoot");)c++;if(n===D.length||c===K.length)for(n=D.length-1,c=K.length-1;1<=n&&0<=c&&D[n]!==K[c];)c--;for(;1<=n&&0<=c;n--,c--)if(D[n]!==K[c]){if(n!==1||c!==1)do if(n--,c--,0>c||D[n]!==K[c]){var ae=`
|
|
46
|
+
`+D[n].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=n&&0<=c);break}}}finally{Vo=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?aa(r):""}function xg(e){switch(e.tag){case 26:case 27:case 5:return aa(e.type);case 16:return aa("Lazy");case 13:return aa("Suspense");case 19:return aa("SuspenseList");case 0:case 15:return Go(e.type,!1);case 11:return Go(e.type.render,!1);case 1:return Go(e.type,!0);case 31:return aa("Activity");default:return""}}function Pu(e){try{var t="";do t+=xg(e),e=e.return;while(e);return t}catch(r){return`
|
|
47
|
+
Error generating stack: `+r.message+`
|
|
48
|
+
`+r.stack}}function tr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _u(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yg(e){var t=_u(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(y){n=""+y,f.call(this,y)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(y){n=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cl(e){e._valueTracker||(e._valueTracker=yg(e))}function Hu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=_u(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ul(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 vg=/[\n"\\]/g;function rr(e){return e.replace(vg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Fo(e,t,r,n,c,f,y,j){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+tr(t)):e.value!==""+tr(t)&&(e.value=""+tr(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?$o(e,y,tr(t)):r!=null?$o(e,y,tr(r)):n!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+tr(j):e.removeAttribute("name")}function Bu(e,t,r,n,c,f,y,j){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||t!=null))return;r=r!=null?""+tr(r):"",t=t!=null?""+tr(t):r,j||t===e.value||(e.value=t),e.defaultValue=t}n=n??c,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=j?e.checked:!!n,e.defaultChecked=!!n,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y)}function $o(e,t,r){t==="number"&&ul(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function na(e,t,r,n){if(e=e.options,t){t={};for(var c=0;c<r.length;c++)t["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=t.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&n&&(e[r].defaultSelected=!0)}else{for(r=""+tr(r),t=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,n&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function qu(e,t,r){if(t!=null&&(t=""+tr(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+tr(r):""}function Vu(e,t,r,n){if(t==null){if(n!=null){if(r!=null)throw Error(i(92));if(V(n)){if(1<n.length)throw Error(i(93));n=n[0]}r=n}r==null&&(r=""),t=r}r=tr(t),e.defaultValue=r,n=e.textContent,n===r&&n!==""&&n!==null&&(e.value=n)}function la(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var bg=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 Gu(e,t,r){var n=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,r):typeof r!="number"||r===0||bg.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Fu(e,t,r){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,r!=null){for(var n in r)!r.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var c in t)n=t[c],t.hasOwnProperty(c)&&r[c]!==n&&Gu(e,c,n)}else for(var f in t)t.hasOwnProperty(f)&&Gu(e,f,t[f])}function Ko(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 jg=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"]]),wg=/^[\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 dl(e){return wg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Io=null;function Yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var oa=null,ia=null;function $u(e){var t=Lt(e);if(t&&(e=t.stateNode)){var r=e[rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Fo(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+rr(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var c=n[rt]||null;if(!c)throw Error(i(90));Fo(n,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<r.length;t++)n=r[t],n.form===e.form&&Hu(n)}break e;case"textarea":qu(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&na(e,!!r.multiple,t,!1)}}}var Xo=!1;function Ku(e,t,r){if(Xo)return e(t,r);Xo=!0;try{var n=e(t);return n}finally{if(Xo=!1,(oa!==null||ia!==null)&&(Ql(),oa&&(t=oa,e=ia,ia=oa=null,$u(t),e)))for(t=0;t<e.length;t++)$u(e[t])}}function Xa(e,t){var r=e.stateNode;if(r===null)return null;var n=r[rt]||null;if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(i(231,t,typeof r));return r}var zr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qo=!1;if(zr)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Qo=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Qo=!1}var os=null,Jo=null,fl=null;function Iu(){if(fl)return fl;var e,t=Jo,r=t.length,n,c="value"in os?os.value:os.textContent,f=c.length;for(e=0;e<r&&t[e]===c[e];e++);var y=r-e;for(n=1;n<=y&&t[r-n]===c[f-n];n++);return fl=c.slice(e,1<n?1-n:void 0)}function ml(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 hl(){return!0}function Yu(){return!1}function zt(e){function t(r,n,c,f,y){this._reactName=r,this._targetInst=c,this.type=n,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(r=e[j],this[j]=r?r(f):f[j]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?hl:Yu,this.isPropagationStopped=Yu,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=hl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=hl)},persist:function(){},isPersistent:hl}),t}var Ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pl=zt(Ds),Ja=x({},Ds,{view:0,detail:0}),Ng=zt(Ja),Zo,Wo,Za,gl=x({},Ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ti,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!==Za&&(Za&&e.type==="mousemove"?(Zo=e.screenX-Za.screenX,Wo=e.screenY-Za.screenY):Wo=Zo=0,Za=e),Zo)},movementY:function(e){return"movementY"in e?e.movementY:Wo}}),Xu=zt(gl),Sg=x({},gl,{dataTransfer:0}),Cg=zt(Sg),Eg=x({},Ja,{relatedTarget:0}),ei=zt(Eg),kg=x({},Ds,{animationName:0,elapsedTime:0,pseudoElement:0}),Ag=zt(kg),Tg=x({},Ds,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Rg=zt(Tg),Mg=x({},Ds,{data:0}),Qu=zt(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 Lg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ug[e])?!!t[e]:!1}function ti(){return Lg}var zg=x({},Ja,{key:function(e){if(e.key){var t=Og[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ml(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:ti,charCode:function(e){return e.type==="keypress"?ml(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ml(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pg=zt(zg),_g=x({},gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ju=zt(_g),Hg=x({},Ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ti}),Bg=zt(Hg),qg=x({},Ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vg=zt(qg),Gg=x({},gl,{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}),Fg=zt(Gg),$g=x({},Ds,{newState:0,oldState:0}),Kg=zt($g),Ig=[9,13,27,32],ri=zr&&"CompositionEvent"in window,Wa=null;zr&&"documentMode"in document&&(Wa=document.documentMode);var Yg=zr&&"TextEvent"in window&&!Wa,Zu=zr&&(!ri||Wa&&8<Wa&&11>=Wa),Wu=" ",ed=!1;function td(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 rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ca=!1;function Xg(e,t){switch(e){case"compositionend":return rd(t);case"keypress":return t.which!==32?null:(ed=!0,Wu);case"textInput":return e=t.data,e===Wu&&ed?null:e;default:return null}}function Qg(e,t){if(ca)return e==="compositionend"||!ri&&td(e,t)?(e=Iu(),fl=Jo=os=null,ca=!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 Zu&&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 sd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jg[e.type]:t==="textarea"}function ad(e,t,r,n){oa?ia?ia.push(n):ia=[n]:oa=n,t=ro(t,"onChange"),0<t.length&&(r=new pl("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var en=null,tn=null;function Zg(e){Hm(e,0)}function xl(e){var t=we(e);if(Hu(t))return e}function nd(e,t){if(e==="change")return t}var ld=!1;if(zr){var si;if(zr){var ai="oninput"in document;if(!ai){var od=document.createElement("div");od.setAttribute("oninput","return;"),ai=typeof od.oninput=="function"}si=ai}else si=!1;ld=si&&(!document.documentMode||9<document.documentMode)}function id(){en&&(en.detachEvent("onpropertychange",cd),tn=en=null)}function cd(e){if(e.propertyName==="value"&&xl(tn)){var t=[];ad(t,tn,e,Yo(e)),Ku(Zg,t)}}function Wg(e,t,r){e==="focusin"?(id(),en=t,tn=r,en.attachEvent("onpropertychange",cd)):e==="focusout"&&id()}function e0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xl(tn)}function t0(e,t){if(e==="click")return xl(t)}function r0(e,t){if(e==="input"||e==="change")return xl(t)}function s0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:s0;function rn(e,t){if(qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var c=r[n];if(!Me.call(t,c)||!qt(e[c],t[c]))return!1}return!0}function ud(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dd(e,t){var r=ud(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ud(r)}}function fd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function md(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ul(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ul(e.document)}return t}function ni(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 a0=zr&&"documentMode"in document&&11>=document.documentMode,ua=null,li=null,sn=null,oi=!1;function hd(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;oi||ua==null||ua!==ul(n)||(n=ua,"selectionStart"in n&&ni(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),sn&&rn(sn,n)||(sn=n,n=ro(li,"onSelect"),0<n.length&&(t=new pl("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=ua)))}function Us(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var da={animationend:Us("Animation","AnimationEnd"),animationiteration:Us("Animation","AnimationIteration"),animationstart:Us("Animation","AnimationStart"),transitionrun:Us("Transition","TransitionRun"),transitionstart:Us("Transition","TransitionStart"),transitioncancel:Us("Transition","TransitionCancel"),transitionend:Us("Transition","TransitionEnd")},ii={},pd={};zr&&(pd=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);function Ls(e){if(ii[e])return ii[e];if(!da[e])return e;var t=da[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in pd)return ii[e]=t[r];return e}var gd=Ls("animationend"),xd=Ls("animationiteration"),yd=Ls("animationstart"),n0=Ls("transitionrun"),l0=Ls("transitionstart"),o0=Ls("transitioncancel"),vd=Ls("transitionend"),bd=new Map,ci="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(" ");ci.push("scrollEnd");function gr(e,t){bd.set(e,t),Os(t,[e])}var jd=new WeakMap;function sr(e,t){if(typeof e=="object"&&e!==null){var r=jd.get(e);return r!==void 0?r:(t={value:e,source:t,stack:Pu(t)},jd.set(e,t),t)}return{value:e,source:t,stack:Pu(t)}}var ar=[],fa=0,ui=0;function yl(){for(var e=fa,t=ui=fa=0;t<e;){var r=ar[t];ar[t++]=null;var n=ar[t];ar[t++]=null;var c=ar[t];ar[t++]=null;var f=ar[t];if(ar[t++]=null,n!==null&&c!==null){var y=n.pending;y===null?c.next=c:(c.next=y.next,y.next=c),n.pending=c}f!==0&&wd(r,c,f)}}function vl(e,t,r,n){ar[fa++]=e,ar[fa++]=t,ar[fa++]=r,ar[fa++]=n,ui|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function di(e,t,r,n){return vl(e,t,r,n),bl(e)}function ma(e,t){return vl(e,null,null,t),bl(e)}function wd(e,t,r){e.lanes|=r;var n=e.alternate;n!==null&&(n.lanes|=r);for(var c=!1,f=e.return;f!==null;)f.childLanes|=r,n=f.alternate,n!==null&&(n.childLanes|=r),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-mt(r),e=f.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=r|536870912),f):null}function bl(e){if(50<Tn)throw Tn=0,xc=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ha={};function i0(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,r,n){return new i0(e,t,r,n)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pr(e,t){var r=e.alternate;return r===null?(r=Vt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Nd(e,t){e.flags&=65011714;var r=e.alternate;return r===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=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function jl(e,t,r,n,c,f){var y=0;if(n=e,typeof e=="function")fi(e)&&(y=1);else if(typeof e=="string")y=ux(e,r,I.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case se:return e=Vt(31,r,t,c),e.elementType=se,e.lanes=f,e;case E:return zs(r.children,c,f,t);case A:y=8,c|=24;break;case O:return e=Vt(12,r,t,c|2),e.elementType=O,e.lanes=f,e;case W:return e=Vt(13,r,t,c),e.elementType=W,e.lanes=f,e;case re:return e=Vt(19,r,t,c),e.elementType=re,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:case M:y=10;break e;case N:y=9;break e;case G:y=11;break e;case te:y=14;break e;case $:y=16,n=null;break e}y=29,r=Error(i(130,e===null?"null":typeof e,"")),n=null}return t=Vt(y,r,t,c),t.elementType=e,t.type=n,t.lanes=f,t}function zs(e,t,r,n){return e=Vt(7,e,n,t),e.lanes=r,e}function mi(e,t,r){return e=Vt(6,e,null,t),e.lanes=r,e}function hi(e,t,r){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pa=[],ga=0,wl=null,Nl=0,nr=[],lr=0,Ps=null,_r=1,Hr="";function _s(e,t){pa[ga++]=Nl,pa[ga++]=wl,wl=e,Nl=t}function Sd(e,t,r){nr[lr++]=_r,nr[lr++]=Hr,nr[lr++]=Ps,Ps=e;var n=_r;e=Hr;var c=32-mt(n)-1;n&=~(1<<c),r+=1;var f=32-mt(t)+c;if(30<f){var y=c-c%5;f=(n&(1<<y)-1).toString(32),n>>=y,c-=y,_r=1<<32-mt(t)+c|r<<c|n,Hr=f+e}else _r=1<<f|r<<c|n,Hr=e}function pi(e){e.return!==null&&(_s(e,1),Sd(e,1,0))}function gi(e){for(;e===wl;)wl=pa[--ga],pa[ga]=null,Nl=pa[--ga],pa[ga]=null;for(;e===Ps;)Ps=nr[--lr],nr[lr]=null,Hr=nr[--lr],nr[lr]=null,_r=nr[--lr],nr[lr]=null}var Dt=null,lt=null,Ve=!1,Hs=null,Cr=!1,xi=Error(i(519));function Bs(e){var t=Error(i(418,""));throw ln(sr(t,e)),xi}function Cd(e){var t=e.stateNode,r=e.type,n=e.memoizedProps;switch(t[tt]=e,t[rt]=n,r){case"dialog":_e("cancel",t),_e("close",t);break;case"iframe":case"object":case"embed":_e("load",t);break;case"video":case"audio":for(r=0;r<Mn.length;r++)_e(Mn[r],t);break;case"source":_e("error",t);break;case"img":case"image":case"link":_e("error",t),_e("load",t);break;case"details":_e("toggle",t);break;case"input":_e("invalid",t),Bu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),cl(t);break;case"select":_e("invalid",t);break;case"textarea":_e("invalid",t),Vu(t,n.value,n.defaultValue,n.children),cl(t)}r=n.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||n.suppressHydrationWarning===!0||Gm(t.textContent,r)?(n.popover!=null&&(_e("beforetoggle",t),_e("toggle",t)),n.onScroll!=null&&_e("scroll",t),n.onScrollEnd!=null&&_e("scrollend",t),n.onClick!=null&&(t.onclick=so),t=!0):t=!1,t||Bs(e)}function Ed(e){for(Dt=e.return;Dt;)switch(Dt.tag){case 5:case 13:Cr=!1;return;case 27:case 3:Cr=!0;return;default:Dt=Dt.return}}function an(e){if(e!==Dt)return!1;if(!Ve)return Ed(e),Ve=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Dc(e.type,e.memoizedProps)),r=!r),r&<&&Bs(e),Ed(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(r=e.data,r==="/$"){if(t===0){lt=yr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++;e=e.nextSibling}lt=null}}else t===27?(t=lt,Ns(e.type)?(e=Pc,Pc=null,lt=e):lt=t):lt=Dt?yr(e.stateNode.nextSibling):null;return!0}function nn(){lt=Dt=null,Ve=!1}function kd(){var e=Hs;return e!==null&&(Ht===null?Ht=e:Ht.push.apply(Ht,e),Hs=null),e}function ln(e){Hs===null?Hs=[e]:Hs.push(e)}var yi=_(null),qs=null,Br=null;function is(e,t,r){H(yi,t._currentValue),t._currentValue=r}function qr(e){e._currentValue=yi.current,Z(yi)}function vi(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function bi(e,t,r,n){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var y=c.child;f=f.firstContext;e:for(;f!==null;){var j=f;f=c;for(var D=0;D<t.length;D++)if(j.context===t[D]){f.lanes|=r,j=f.alternate,j!==null&&(j.lanes|=r),vi(f.return,r,e),n||(y=null);break e}f=j.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(i(341));y.lanes|=r,f=y.alternate,f!==null&&(f.lanes|=r),vi(y,r,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function on(e,t,r,n){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 y=c.alternate;if(y===null)throw Error(i(387));if(y=y.memoizedProps,y!==null){var j=c.type;qt(c.pendingProps.value,y.value)||(e!==null?e.push(j):e=[j])}}else if(c===Y.current){if(y=c.alternate,y===null)throw Error(i(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Pn):e=[Pn])}c=c.return}e!==null&&bi(t,e,r,n),t.flags|=262144}function Sl(e){for(e=e.firstContext;e!==null;){if(!qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Vs(e){qs=e,Br=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return Ad(qs,e)}function Cl(e,t){return qs===null&&Vs(e),Ad(e,t)}function Ad(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Br===null){if(e===null)throw Error(i(308));Br=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Br=Br.next=t;return r}var c0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},u0=a.unstable_scheduleCallback,d0=a.unstable_NormalPriority,ht={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ji(){return{controller:new c0,data:new Map,refCount:0}}function cn(e){e.refCount--,e.refCount===0&&u0(d0,function(){e.controller.abort()})}var un=null,wi=0,xa=0,ya=null;function f0(e,t){if(un===null){var r=un=[];wi=0,xa=Sc(),ya={status:"pending",value:void 0,then:function(n){r.push(n)}}}return wi++,t.then(Td,Td),t}function Td(){if(--wi===0&&un!==null){ya!==null&&(ya.status="fulfilled");var e=un;un=null,xa=0,ya=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function m0(e,t){var r=[],n={status:"pending",value:null,reason:null,then:function(c){r.push(c)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var c=0;c<r.length;c++)(0,r[c])(t)},function(c){for(n.status="rejected",n.reason=c,c=0;c<r.length;c++)(0,r[c])(void 0)}),n}var Rd=b.S;b.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&f0(e,t),Rd!==null&&Rd(e,t)};var Gs=_(null);function Ni(){var e=Gs.current;return e!==null?e:Ze.pooledCache}function El(e,t){t===null?H(Gs,Gs.current):H(Gs,t.pool)}function Md(){var e=Ni();return e===null?null:{parent:ht._currentValue,pool:e}}var dn=Error(i(460)),Od=Error(i(474)),kl=Error(i(542)),Si={then:function(){}};function Dd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Al(){}function Ud(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Al,Al),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zd(e),e;default:if(typeof t.status=="string")t.then(Al,Al);else{if(e=Ze,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=n}},function(n){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zd(e),e}throw fn=t,dn}}var fn=null;function Ld(){if(fn===null)throw Error(i(459));var e=fn;return fn=null,e}function zd(e){if(e===dn||e===kl)throw Error(i(483))}var cs=!1;function Ci(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ei(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 us(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ds(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Fe&2)!==0){var c=n.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),n.pending=t,t=bl(e),wd(e,null,r),t}return vl(e,n,t,r),bl(e)}function mn(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Nr(e,r)}}function ki(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var c=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};f===null?c=f=y:f=f.next=y,r=r.next}while(r!==null);f===null?c=f=t:f=f.next=t}else c=f=t;r={baseState:n.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:n.shared,callbacks:n.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Ai=!1;function hn(){if(Ai){var e=ya;if(e!==null)throw e}}function pn(e,t,r,n){Ai=!1;var c=e.updateQueue;cs=!1;var f=c.firstBaseUpdate,y=c.lastBaseUpdate,j=c.shared.pending;if(j!==null){c.shared.pending=null;var D=j,K=D.next;D.next=null,y===null?f=K:y.next=K,y=D;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,j=ae.lastBaseUpdate,j!==y&&(j===null?ae.firstBaseUpdate=K:j.next=K,ae.lastBaseUpdate=D))}if(f!==null){var ie=c.baseState;y=0,ae=K=D=null,j=f;do{var X=j.lane&-536870913,J=X!==j.lane;if(J?(Be&X)===X:(n&X)===X){X!==0&&X===xa&&(Ai=!0),ae!==null&&(ae=ae.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Ee=e,Ne=j;X=t;var Ye=r;switch(Ne.tag){case 1:if(Ee=Ne.payload,typeof Ee=="function"){ie=Ee.call(Ye,ie,X);break e}ie=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Ne.payload,X=typeof Ee=="function"?Ee.call(Ye,ie,X):Ee,X==null)break e;ie=x({},ie,X);break e;case 2:cs=!0}}X=j.callback,X!==null&&(e.flags|=64,J&&(e.flags|=8192),J=c.callbacks,J===null?c.callbacks=[X]:J.push(X))}else J={lane:X,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ae===null?(K=ae=J,D=ie):ae=ae.next=J,y|=X;if(j=j.next,j===null){if(j=c.shared.pending,j===null)break;J=j,j=J.next,J.next=null,c.lastBaseUpdate=J,c.shared.pending=null}}while(!0);ae===null&&(D=ie),c.baseState=D,c.firstBaseUpdate=K,c.lastBaseUpdate=ae,f===null&&(c.shared.lanes=0),vs|=y,e.lanes=y,e.memoizedState=ie}}function Pd(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function _d(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Pd(r[e],t)}var va=_(null),Tl=_(0);function Hd(e,t){e=Yr,H(Tl,e),H(va,t),Yr=e|t.baseLanes}function Ti(){H(Tl,Yr),H(va,va.current)}function Ri(){Yr=Tl.current,Z(va),Z(Tl)}var fs=0,De=null,Ke=null,ut=null,Rl=!1,ba=!1,Fs=!1,Ml=0,gn=0,ja=null,h0=0;function it(){throw Error(i(321))}function Mi(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!qt(e[r],t[r]))return!1;return!0}function Oi(e,t,r,n,c,f){return fs=f,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,b.H=e===null||e.memoizedState===null?Nf:Sf,Fs=!1,f=r(n,c),Fs=!1,ba&&(f=qd(t,r,n,c)),Bd(e),f}function Bd(e){b.H=Pl;var t=Ke!==null&&Ke.next!==null;if(fs=0,ut=Ke=De=null,Rl=!1,gn=0,ja=null,t)throw Error(i(300));e===null||xt||(e=e.dependencies,e!==null&&Sl(e)&&(xt=!0))}function qd(e,t,r,n){De=e;var c=0;do{if(ba&&(ja=null),gn=0,ba=!1,25<=c)throw Error(i(301));if(c+=1,ut=Ke=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}b.H=j0,f=t(r,n)}while(ba);return f}function p0(){var e=b.H,t=e.useState()[0];return t=typeof t.then=="function"?xn(t):t,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(De.flags|=1024),t}function Di(){var e=Ml!==0;return Ml=0,e}function Ui(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Li(e){if(Rl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Rl=!1}fs=0,ut=Ke=De=null,ba=!1,gn=Ml=0,ja=null}function Pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?De.memoizedState=ut=e:ut=ut.next=e,ut}function dt(){if(Ke===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=ut===null?De.memoizedState:ut.next;if(t!==null)ut=t,Ke=e;else{if(e===null)throw De.alternate===null?Error(i(467)):Error(i(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},ut===null?De.memoizedState=ut=e:ut=ut.next=e}return ut}function zi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xn(e){var t=gn;return gn+=1,ja===null&&(ja=[]),e=Ud(ja,e,t),t=De,(ut===null?t.memoizedState:ut.next)===null&&(t=t.alternate,b.H=t===null||t.memoizedState===null?Nf:Sf),e}function Ol(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xn(e);if(e.$$typeof===M)return Tt(e)}throw Error(i(438,String(e)))}function Pi(e){var t=null,r=De.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var n=De.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=zi(),De.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),n=0;n<e;n++)r[n]=le;return t.index++,r}function Vr(e,t){return typeof t=="function"?t(e):t}function Dl(e){var t=dt();return _i(t,Ke,e)}function _i(e,t,r){var n=e.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=r;var c=e.baseQueue,f=n.pending;if(f!==null){if(c!==null){var y=c.next;c.next=f.next,f.next=y}t.baseQueue=c=f,n.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var j=y=null,D=null,K=t,ae=!1;do{var ie=K.lane&-536870913;if(ie!==K.lane?(Be&ie)===ie:(fs&ie)===ie){var X=K.revertLane;if(X===0)D!==null&&(D=D.next={lane:0,revertLane:0,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ie===xa&&(ae=!0);else if((fs&X)===X){K=K.next,X===xa&&(ae=!0);continue}else ie={lane:0,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(j=D=ie,y=f):D=D.next=ie,De.lanes|=X,vs|=X;ie=K.action,Fs&&r(f,ie),f=K.hasEagerState?K.eagerState:r(f,ie)}else X={lane:ie,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(j=D=X,y=f):D=D.next=X,De.lanes|=ie,vs|=ie;K=K.next}while(K!==null&&K!==t);if(D===null?y=f:D.next=j,!qt(f,e.memoizedState)&&(xt=!0,ae&&(r=ya,r!==null)))throw r;e.memoizedState=f,e.baseState=y,e.baseQueue=D,n.lastRenderedState=f}return c===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Hi(e){var t=dt(),r=t.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var n=r.dispatch,c=r.pending,f=t.memoizedState;if(c!==null){r.pending=null;var y=c=c.next;do f=e(f,y.action),y=y.next;while(y!==c);qt(f,t.memoizedState)||(xt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),r.lastRenderedState=f}return[f,n]}function Vd(e,t,r){var n=De,c=dt(),f=Ve;if(f){if(r===void 0)throw Error(i(407));r=r()}else r=t();var y=!qt((Ke||c).memoizedState,r);y&&(c.memoizedState=r,xt=!0),c=c.queue;var j=$d.bind(null,n,c,e);if(yn(2048,8,j,[e]),c.getSnapshot!==t||y||ut!==null&&ut.memoizedState.tag&1){if(n.flags|=2048,wa(9,Ul(),Fd.bind(null,n,c,r,t),null),Ze===null)throw Error(i(349));f||(fs&124)!==0||Gd(n,t,r)}return r}function Gd(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=De.updateQueue,t===null?(t=zi(),De.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Fd(e,t,r,n){t.value=r,t.getSnapshot=n,Kd(t)&&Id(e)}function $d(e,t,r){return r(function(){Kd(t)&&Id(e)})}function Kd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!qt(e,r)}catch{return!0}}function Id(e){var t=ma(e,2);t!==null&&It(t,e,2)}function Bi(e){var t=Pt();if(typeof e=="function"){var r=e;if(e=r(),Fs){Ot(!0);try{r()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:e},t}function Yd(e,t,r,n){return e.baseState=r,_i(e,Ke,typeof n=="function"?n:Vr)}function g0(e,t,r,n,c){if(zl(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(y){f.listeners.push(y)}};b.T!==null?r(!0):f.isTransition=!1,n(f),r=t.pending,r===null?(f.next=t.pending=f,Xd(t,f)):(f.next=r.next,t.pending=r.next=f)}}function Xd(e,t){var r=t.action,n=t.payload,c=e.state;if(t.isTransition){var f=b.T,y={};b.T=y;try{var j=r(c,n),D=b.S;D!==null&&D(y,j),Qd(e,t,j)}catch(K){qi(e,t,K)}finally{b.T=f}}else try{f=r(c,n),Qd(e,t,f)}catch(K){qi(e,t,K)}}function Qd(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(n){Jd(e,t,n)},function(n){return qi(e,t,n)}):Jd(e,t,r)}function Jd(e,t,r){t.status="fulfilled",t.value=r,Zd(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,Xd(e,r)))}function qi(e,t,r){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=r,Zd(t),t=t.next;while(t!==n)}e.action=null}function Zd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Wd(e,t){return t}function ef(e,t){if(Ve){var r=Ze.formState;if(r!==null){e:{var n=De;if(Ve){if(lt){t:{for(var c=lt,f=Cr;c.nodeType!==8;){if(!f){c=null;break t}if(c=yr(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){lt=yr(c.nextSibling),n=c.data==="F!";break e}}Bs(n)}n=!1}n&&(t=r[0])}}return r=Pt(),r.memoizedState=r.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wd,lastRenderedState:t},r.queue=n,r=bf.bind(null,De,n),n.dispatch=r,n=Bi(!1),f=Ki.bind(null,De,!1,n.queue),n=Pt(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,r=g0.bind(null,De,c,f,r),c.dispatch=r,n.memoizedState=e,[t,r,!1]}function tf(e){var t=dt();return rf(t,Ke,e)}function rf(e,t,r){if(t=_i(e,t,Wd)[0],e=Dl(Vr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=xn(t)}catch(y){throw y===dn?kl:y}else n=t;t=dt();var c=t.queue,f=c.dispatch;return r!==t.memoizedState&&(De.flags|=2048,wa(9,Ul(),x0.bind(null,c,r),null)),[n,f,e]}function x0(e,t){e.action=t}function sf(e){var t=dt(),r=Ke;if(r!==null)return rf(t,r,e);dt(),t=t.memoizedState,r=dt();var n=r.queue.dispatch;return r.memoizedState=e,[t,n,!1]}function wa(e,t,r,n){return e={tag:e,create:r,deps:n,inst:t,next:null},t=De.updateQueue,t===null&&(t=zi(),De.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Ul(){return{destroy:void 0,resource:void 0}}function af(){return dt().memoizedState}function Ll(e,t,r,n){var c=Pt();n=n===void 0?null:n,De.flags|=e,c.memoizedState=wa(1|t,Ul(),r,n)}function yn(e,t,r,n){var c=dt();n=n===void 0?null:n;var f=c.memoizedState.inst;Ke!==null&&n!==null&&Mi(n,Ke.memoizedState.deps)?c.memoizedState=wa(t,f,r,n):(De.flags|=e,c.memoizedState=wa(1|t,f,r,n))}function nf(e,t){Ll(8390656,8,e,t)}function lf(e,t){yn(2048,8,e,t)}function of(e,t){return yn(4,2,e,t)}function cf(e,t){return yn(4,4,e,t)}function uf(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function df(e,t,r){r=r!=null?r.concat([e]):null,yn(4,4,uf.bind(null,t,e),r)}function Vi(){}function ff(e,t){var r=dt();t=t===void 0?null:t;var n=r.memoizedState;return t!==null&&Mi(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function mf(e,t){var r=dt();t=t===void 0?null:t;var n=r.memoizedState;if(t!==null&&Mi(t,n[1]))return n[0];if(n=e(),Fs){Ot(!0);try{e()}finally{Ot(!1)}}return r.memoizedState=[n,t],n}function Gi(e,t,r){return r===void 0||(fs&1073741824)!==0?e.memoizedState=t:(e.memoizedState=r,e=gm(),De.lanes|=e,vs|=e,r)}function hf(e,t,r,n){return qt(r,t)?r:va.current!==null?(e=Gi(e,r,n),qt(e,t)||(xt=!0),e):(fs&42)===0?(xt=!0,e.memoizedState=r):(e=gm(),De.lanes|=e,vs|=e,t)}function pf(e,t,r,n,c){var f=C.p;C.p=f!==0&&8>f?f:8;var y=b.T,j={};b.T=j,Ki(e,!1,t,r);try{var D=c(),K=b.S;if(K!==null&&K(j,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ae=m0(D,n);vn(e,t,ae,Kt(e))}else vn(e,t,n,Kt(e))}catch(ie){vn(e,t,{then:function(){},status:"rejected",reason:ie},Kt())}finally{C.p=f,b.T=y}}function y0(){}function Fi(e,t,r,n){if(e.tag!==5)throw Error(i(476));var c=gf(e).queue;pf(e,c,t,L,r===null?y0:function(){return xf(e),r(n)})}function gf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:L},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xf(e){var t=gf(e).next.queue;vn(e,t,{},Kt())}function $i(){return Tt(Pn)}function yf(){return dt().memoizedState}function vf(){return dt().memoizedState}function v0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Kt();e=us(r);var n=ds(t,e,r);n!==null&&(It(n,t,r),mn(n,t,r)),t={cache:ji()},e.payload=t;return}t=t.return}}function b0(e,t,r){var n=Kt();r={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},zl(e)?jf(t,r):(r=di(e,t,r,n),r!==null&&(It(r,e,n),wf(r,t,n)))}function bf(e,t,r){var n=Kt();vn(e,t,r,n)}function vn(e,t,r,n){var c={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(zl(e))jf(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var y=t.lastRenderedState,j=f(y,r);if(c.hasEagerState=!0,c.eagerState=j,qt(j,y))return vl(e,t,c,0),Ze===null&&yl(),!1}catch{}finally{}if(r=di(e,t,c,n),r!==null)return It(r,e,n),wf(r,t,n),!0}return!1}function Ki(e,t,r,n){if(n={lane:2,revertLane:Sc(),action:n,hasEagerState:!1,eagerState:null,next:null},zl(e)){if(t)throw Error(i(479))}else t=di(e,r,n,2),t!==null&&It(t,e,2)}function zl(e){var t=e.alternate;return e===De||t!==null&&t===De}function jf(e,t){ba=Rl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function wf(e,t,r){if((r&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Nr(e,r)}}var Pl={readContext:Tt,use:Ol,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it},Nf={readContext:Tt,use:Ol,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:nf,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Ll(4194308,4,uf.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ll(4194308,4,e,t)},useInsertionEffect:function(e,t){Ll(4,2,e,t)},useMemo:function(e,t){var r=Pt();t=t===void 0?null:t;var n=e();if(Fs){Ot(!0);try{e()}finally{Ot(!1)}}return r.memoizedState=[n,t],n},useReducer:function(e,t,r){var n=Pt();if(r!==void 0){var c=r(t);if(Fs){Ot(!0);try{r(t)}finally{Ot(!1)}}}else c=t;return n.memoizedState=n.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},n.queue=e,e=e.dispatch=b0.bind(null,De,e),[n.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=Bi(e);var t=e.queue,r=bf.bind(null,De,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:Vi,useDeferredValue:function(e,t){var r=Pt();return Gi(r,e,t)},useTransition:function(){var e=Bi(!1);return e=pf.bind(null,De,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var n=De,c=Pt();if(Ve){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),Ze===null)throw Error(i(349));(Be&124)!==0||Gd(n,t,r)}c.memoizedState=r;var f={value:r,getSnapshot:t};return c.queue=f,nf($d.bind(null,n,f,e),[e]),n.flags|=2048,wa(9,Ul(),Fd.bind(null,n,f,r,t),null),r},useId:function(){var e=Pt(),t=Ze.identifierPrefix;if(Ve){var r=Hr,n=_r;r=(n&~(1<<32-mt(n)-1)).toString(32)+r,t="«"+t+"R"+r,r=Ml++,0<r&&(t+="H"+r.toString(32)),t+="»"}else r=h0++,t="«"+t+"r"+r.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:$i,useFormState:ef,useActionState:ef,useOptimistic:function(e){var t=Pt();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=Ki.bind(null,De,!0,r),r.dispatch=t,[e,t]},useMemoCache:Pi,useCacheRefresh:function(){return Pt().memoizedState=v0.bind(null,De)}},Sf={readContext:Tt,use:Ol,useCallback:ff,useContext:Tt,useEffect:lf,useImperativeHandle:df,useInsertionEffect:of,useLayoutEffect:cf,useMemo:mf,useReducer:Dl,useRef:af,useState:function(){return Dl(Vr)},useDebugValue:Vi,useDeferredValue:function(e,t){var r=dt();return hf(r,Ke.memoizedState,e,t)},useTransition:function(){var e=Dl(Vr)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:xn(e),t]},useSyncExternalStore:Vd,useId:yf,useHostTransitionStatus:$i,useFormState:tf,useActionState:tf,useOptimistic:function(e,t){var r=dt();return Yd(r,Ke,e,t)},useMemoCache:Pi,useCacheRefresh:vf},j0={readContext:Tt,use:Ol,useCallback:ff,useContext:Tt,useEffect:lf,useImperativeHandle:df,useInsertionEffect:of,useLayoutEffect:cf,useMemo:mf,useReducer:Hi,useRef:af,useState:function(){return Hi(Vr)},useDebugValue:Vi,useDeferredValue:function(e,t){var r=dt();return Ke===null?Gi(r,e,t):hf(r,Ke.memoizedState,e,t)},useTransition:function(){var e=Hi(Vr)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:xn(e),t]},useSyncExternalStore:Vd,useId:yf,useHostTransitionStatus:$i,useFormState:sf,useActionState:sf,useOptimistic:function(e,t){var r=dt();return Ke!==null?Yd(r,Ke,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Pi,useCacheRefresh:vf},Na=null,bn=0;function _l(e){var t=bn;return bn+=1,Na===null&&(Na=[]),Ud(Na,e,t)}function jn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Hl(e,t){throw t.$$typeof===w?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Cf(e){var t=e._init;return t(e._payload)}function Ef(e){function t(q,P){if(e){var F=q.deletions;F===null?(q.deletions=[P],q.flags|=16):F.push(P)}}function r(q,P){if(!e)return null;for(;P!==null;)t(q,P),P=P.sibling;return null}function n(q){for(var P=new Map;q!==null;)q.key!==null?P.set(q.key,q):P.set(q.index,q),q=q.sibling;return P}function c(q,P){return q=Pr(q,P),q.index=0,q.sibling=null,q}function f(q,P,F){return q.index=F,e?(F=q.alternate,F!==null?(F=F.index,F<P?(q.flags|=67108866,P):F):(q.flags|=67108866,P)):(q.flags|=1048576,P)}function y(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function j(q,P,F,ne){return P===null||P.tag!==6?(P=mi(F,q.mode,ne),P.return=q,P):(P=c(P,F),P.return=q,P)}function D(q,P,F,ne){var pe=F.type;return pe===E?ae(q,P,F.props.children,ne,F.key):P!==null&&(P.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===$&&Cf(pe)===P.type)?(P=c(P,F.props),jn(P,F),P.return=q,P):(P=jl(F.type,F.key,F.props,null,q.mode,ne),jn(P,F),P.return=q,P)}function K(q,P,F,ne){return P===null||P.tag!==4||P.stateNode.containerInfo!==F.containerInfo||P.stateNode.implementation!==F.implementation?(P=hi(F,q.mode,ne),P.return=q,P):(P=c(P,F.children||[]),P.return=q,P)}function ae(q,P,F,ne,pe){return P===null||P.tag!==7?(P=zs(F,q.mode,ne,pe),P.return=q,P):(P=c(P,F),P.return=q,P)}function ie(q,P,F){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=mi(""+P,q.mode,F),P.return=q,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case k:return F=jl(P.type,P.key,P.props,null,q.mode,F),jn(F,P),F.return=q,F;case T:return P=hi(P,q.mode,F),P.return=q,P;case $:var ne=P._init;return P=ne(P._payload),ie(q,P,F)}if(V(P)||z(P))return P=zs(P,q.mode,F,null),P.return=q,P;if(typeof P.then=="function")return ie(q,_l(P),F);if(P.$$typeof===M)return ie(q,Cl(q,P),F);Hl(q,P)}return null}function X(q,P,F,ne){var pe=P!==null?P.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return pe!==null?null:j(q,P,""+F,ne);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case k:return F.key===pe?D(q,P,F,ne):null;case T:return F.key===pe?K(q,P,F,ne):null;case $:return pe=F._init,F=pe(F._payload),X(q,P,F,ne)}if(V(F)||z(F))return pe!==null?null:ae(q,P,F,ne,null);if(typeof F.then=="function")return X(q,P,_l(F),ne);if(F.$$typeof===M)return X(q,P,Cl(q,F),ne);Hl(q,F)}return null}function J(q,P,F,ne,pe){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return q=q.get(F)||null,j(P,q,""+ne,pe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case k:return q=q.get(ne.key===null?F:ne.key)||null,D(P,q,ne,pe);case T:return q=q.get(ne.key===null?F:ne.key)||null,K(P,q,ne,pe);case $:var Le=ne._init;return ne=Le(ne._payload),J(q,P,F,ne,pe)}if(V(ne)||z(ne))return q=q.get(F)||null,ae(P,q,ne,pe,null);if(typeof ne.then=="function")return J(q,P,F,_l(ne),pe);if(ne.$$typeof===M)return J(q,P,F,Cl(P,ne),pe);Hl(P,ne)}return null}function Ee(q,P,F,ne){for(var pe=null,Le=null,be=P,Ce=P=0,vt=null;be!==null&&Ce<F.length;Ce++){be.index>Ce?(vt=be,be=null):vt=be.sibling;var qe=X(q,be,F[Ce],ne);if(qe===null){be===null&&(be=vt);break}e&&be&&qe.alternate===null&&t(q,be),P=f(qe,P,Ce),Le===null?pe=qe:Le.sibling=qe,Le=qe,be=vt}if(Ce===F.length)return r(q,be),Ve&&_s(q,Ce),pe;if(be===null){for(;Ce<F.length;Ce++)be=ie(q,F[Ce],ne),be!==null&&(P=f(be,P,Ce),Le===null?pe=be:Le.sibling=be,Le=be);return Ve&&_s(q,Ce),pe}for(be=n(be);Ce<F.length;Ce++)vt=J(be,q,Ce,F[Ce],ne),vt!==null&&(e&&vt.alternate!==null&&be.delete(vt.key===null?Ce:vt.key),P=f(vt,P,Ce),Le===null?pe=vt:Le.sibling=vt,Le=vt);return e&&be.forEach(function(As){return t(q,As)}),Ve&&_s(q,Ce),pe}function Ne(q,P,F,ne){if(F==null)throw Error(i(151));for(var pe=null,Le=null,be=P,Ce=P=0,vt=null,qe=F.next();be!==null&&!qe.done;Ce++,qe=F.next()){be.index>Ce?(vt=be,be=null):vt=be.sibling;var As=X(q,be,qe.value,ne);if(As===null){be===null&&(be=vt);break}e&&be&&As.alternate===null&&t(q,be),P=f(As,P,Ce),Le===null?pe=As:Le.sibling=As,Le=As,be=vt}if(qe.done)return r(q,be),Ve&&_s(q,Ce),pe;if(be===null){for(;!qe.done;Ce++,qe=F.next())qe=ie(q,qe.value,ne),qe!==null&&(P=f(qe,P,Ce),Le===null?pe=qe:Le.sibling=qe,Le=qe);return Ve&&_s(q,Ce),pe}for(be=n(be);!qe.done;Ce++,qe=F.next())qe=J(be,q,Ce,qe.value,ne),qe!==null&&(e&&qe.alternate!==null&&be.delete(qe.key===null?Ce:qe.key),P=f(qe,P,Ce),Le===null?pe=qe:Le.sibling=qe,Le=qe);return e&&be.forEach(function(wx){return t(q,wx)}),Ve&&_s(q,Ce),pe}function Ye(q,P,F,ne){if(typeof F=="object"&&F!==null&&F.type===E&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case k:e:{for(var pe=F.key;P!==null;){if(P.key===pe){if(pe=F.type,pe===E){if(P.tag===7){r(q,P.sibling),ne=c(P,F.props.children),ne.return=q,q=ne;break e}}else if(P.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===$&&Cf(pe)===P.type){r(q,P.sibling),ne=c(P,F.props),jn(ne,F),ne.return=q,q=ne;break e}r(q,P);break}else t(q,P);P=P.sibling}F.type===E?(ne=zs(F.props.children,q.mode,ne,F.key),ne.return=q,q=ne):(ne=jl(F.type,F.key,F.props,null,q.mode,ne),jn(ne,F),ne.return=q,q=ne)}return y(q);case T:e:{for(pe=F.key;P!==null;){if(P.key===pe)if(P.tag===4&&P.stateNode.containerInfo===F.containerInfo&&P.stateNode.implementation===F.implementation){r(q,P.sibling),ne=c(P,F.children||[]),ne.return=q,q=ne;break e}else{r(q,P);break}else t(q,P);P=P.sibling}ne=hi(F,q.mode,ne),ne.return=q,q=ne}return y(q);case $:return pe=F._init,F=pe(F._payload),Ye(q,P,F,ne)}if(V(F))return Ee(q,P,F,ne);if(z(F)){if(pe=z(F),typeof pe!="function")throw Error(i(150));return F=pe.call(F),Ne(q,P,F,ne)}if(typeof F.then=="function")return Ye(q,P,_l(F),ne);if(F.$$typeof===M)return Ye(q,P,Cl(q,F),ne);Hl(q,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,P!==null&&P.tag===6?(r(q,P.sibling),ne=c(P,F),ne.return=q,q=ne):(r(q,P),ne=mi(F,q.mode,ne),ne.return=q,q=ne),y(q)):r(q,P)}return function(q,P,F,ne){try{bn=0;var pe=Ye(q,P,F,ne);return Na=null,pe}catch(be){if(be===dn||be===kl)throw be;var Le=Vt(29,be,null,q.mode);return Le.lanes=ne,Le.return=q,Le}finally{}}}var Sa=Ef(!0),kf=Ef(!1),or=_(null),Er=null;function ms(e){var t=e.alternate;H(pt,pt.current&1),H(or,e),Er===null&&(t===null||va.current!==null||t.memoizedState!==null)&&(Er=e)}function Af(e){if(e.tag===22){if(H(pt,pt.current),H(or,e),Er===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Er=e)}}else hs()}function hs(){H(pt,pt.current),H(or,or.current)}function Gr(e){Z(or),Er===e&&(Er=null),Z(pt)}var pt=_(0);function Bl(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||zc(r)))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 Ii(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:x({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Yi={enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Kt(),c=us(n);c.payload=t,r!=null&&(c.callback=r),t=ds(e,c,n),t!==null&&(It(t,e,n),mn(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Kt(),c=us(n);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=ds(e,c,n),t!==null&&(It(t,e,n),mn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Kt(),n=us(r);n.tag=2,t!=null&&(n.callback=t),t=ds(e,n,r),t!==null&&(It(t,e,r),mn(t,e,r))}};function Tf(e,t,r,n,c,f,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,f,y):t.prototype&&t.prototype.isPureReactComponent?!rn(r,n)||!rn(c,f):!0}function Rf(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Yi.enqueueReplaceState(t,t.state,null)}function $s(e,t){var r=t;if("ref"in t){r={};for(var n in t)n!=="ref"&&(r[n]=t[n])}if(e=e.defaultProps){r===t&&(r=x({},r));for(var c in e)r[c]===void 0&&(r[c]=e[c])}return r}var ql=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 Mf(e){ql(e)}function Of(e){console.error(e)}function Df(e){ql(e)}function Vl(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Uf(e,t,r){try{var n=e.onCaughtError;n(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Xi(e,t,r){return r=us(r),r.tag=3,r.payload={element:null},r.callback=function(){Vl(e,t)},r}function Lf(e){return e=us(e),e.tag=3,e}function zf(e,t,r,n){var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var f=n.value;e.payload=function(){return c(f)},e.callback=function(){Uf(t,r,n)}}var y=r.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Uf(t,r,n),typeof c!="function"&&(bs===null?bs=new Set([this]):bs.add(this));var j=n.stack;this.componentDidCatch(n.value,{componentStack:j!==null?j:""})})}function w0(e,t,r,n,c){if(r.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=r.alternate,t!==null&&on(t,r,c,!0),r=or.current,r!==null){switch(r.tag){case 13:return Er===null?vc():r.alternate===null&&ot===0&&(ot=3),r.flags&=-257,r.flags|=65536,r.lanes=c,n===Si?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([n]):t.add(n),jc(e,n,c)),!1;case 22:return r.flags|=65536,n===Si?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([n]):r.add(n)),jc(e,n,c)),!1}throw Error(i(435,r.tag))}return jc(e,n,c),vc(),!1}if(Ve)return t=or.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==xi&&(e=Error(i(422),{cause:n}),ln(sr(e,r)))):(n!==xi&&(t=Error(i(423),{cause:n}),ln(sr(t,r))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=sr(n,r),c=Xi(e.stateNode,n,c),ki(e,c),ot!==4&&(ot=2)),!1;var f=Error(i(520),{cause:n});if(f=sr(f,r),An===null?An=[f]:An.push(f),ot!==4&&(ot=2),t===null)return!0;n=sr(n,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=c&-c,r.lanes|=e,e=Xi(r.stateNode,n,e),ki(r,e),!1;case 1:if(t=r.type,f=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(bs===null||!bs.has(f))))return r.flags|=65536,c&=-c,r.lanes|=c,c=Lf(c),zf(c,e,r,n),ki(r,c),!1}r=r.return}while(r!==null);return!1}var Pf=Error(i(461)),xt=!1;function jt(e,t,r,n){t.child=e===null?kf(t,null,r,n):Sa(t,e.child,r,n)}function _f(e,t,r,n,c){r=r.render;var f=t.ref;if("ref"in n){var y={};for(var j in n)j!=="ref"&&(y[j]=n[j])}else y=n;return Vs(t),n=Oi(e,t,r,y,f,c),j=Di(),e!==null&&!xt?(Ui(e,t,c),Fr(e,t,c)):(Ve&&j&&pi(t),t.flags|=1,jt(e,t,n,c),t.child)}function Hf(e,t,r,n,c){if(e===null){var f=r.type;return typeof f=="function"&&!fi(f)&&f.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=f,Bf(e,t,f,n,c)):(e=jl(r.type,null,n,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!sc(e,c)){var y=f.memoizedProps;if(r=r.compare,r=r!==null?r:rn,r(y,n)&&e.ref===t.ref)return Fr(e,t,c)}return t.flags|=1,e=Pr(f,n),e.ref=t.ref,e.return=t,t.child=e}function Bf(e,t,r,n,c){if(e!==null){var f=e.memoizedProps;if(rn(f,n)&&e.ref===t.ref)if(xt=!1,t.pendingProps=n=f,sc(e,c))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,Fr(e,t,c)}return Qi(e,t,r,n,c)}function qf(e,t,r){var n=t.pendingProps,c=n.children,f=e!==null?e.memoizedState:null;if(n.mode==="hidden"){if((t.flags&128)!==0){if(n=f!==null?f.baseLanes|r:r,e!==null){for(c=t.child=e.child,f=0;c!==null;)f=f|c.lanes|c.childLanes,c=c.sibling;t.childLanes=f&~n}else t.childLanes=0,t.child=null;return Vf(e,t,n,r)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&El(t,f!==null?f.cachePool:null),f!==null?Hd(t,f):Ti(),Af(t);else return t.lanes=t.childLanes=536870912,Vf(e,t,f!==null?f.baseLanes|r:r,r)}else f!==null?(El(t,f.cachePool),Hd(t,f),hs(),t.memoizedState=null):(e!==null&&El(t,null),Ti(),hs());return jt(e,t,c,r),t.child}function Vf(e,t,r,n){var c=Ni();return c=c===null?null:{parent:ht._currentValue,pool:c},t.memoizedState={baseLanes:r,cachePool:c},e!==null&&El(t,null),Ti(),Af(t),e!==null&&on(e,t,n,!0),null}function Gl(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(i(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function Qi(e,t,r,n,c){return Vs(t),r=Oi(e,t,r,n,void 0,c),n=Di(),e!==null&&!xt?(Ui(e,t,c),Fr(e,t,c)):(Ve&&n&&pi(t),t.flags|=1,jt(e,t,r,c),t.child)}function Gf(e,t,r,n,c,f){return Vs(t),t.updateQueue=null,r=qd(t,n,r,c),Bd(e),n=Di(),e!==null&&!xt?(Ui(e,t,f),Fr(e,t,f)):(Ve&&n&&pi(t),t.flags|=1,jt(e,t,r,f),t.child)}function Ff(e,t,r,n,c){if(Vs(t),t.stateNode===null){var f=ha,y=r.contextType;typeof y=="object"&&y!==null&&(f=Tt(y)),f=new r(n,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Yi,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=n,f.state=t.memoizedState,f.refs={},Ci(t),y=r.contextType,f.context=typeof y=="object"&&y!==null?Tt(y):ha,f.state=t.memoizedState,y=r.getDerivedStateFromProps,typeof y=="function"&&(Ii(t,r,y,n),f.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&Yi.enqueueReplaceState(f,f.state,null),pn(t,n,f,c),hn(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){f=t.stateNode;var j=t.memoizedProps,D=$s(r,j);f.props=D;var K=f.context,ae=r.contextType;y=ha,typeof ae=="object"&&ae!==null&&(y=Tt(ae));var ie=r.getDerivedStateFromProps;ae=typeof ie=="function"||typeof f.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,ae||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(j||K!==y)&&Rf(t,f,n,y),cs=!1;var X=t.memoizedState;f.state=X,pn(t,n,f,c),hn(),K=t.memoizedState,j||X!==K||cs?(typeof ie=="function"&&(Ii(t,r,ie,n),K=t.memoizedState),(D=cs||Tf(t,r,D,n,X,K,y))?(ae||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=n,t.memoizedState=K),f.props=n,f.state=K,f.context=y,n=D):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{f=t.stateNode,Ei(e,t),y=t.memoizedProps,ae=$s(r,y),f.props=ae,ie=t.pendingProps,X=f.context,K=r.contextType,D=ha,typeof K=="object"&&K!==null&&(D=Tt(K)),j=r.getDerivedStateFromProps,(K=typeof j=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==ie||X!==D)&&Rf(t,f,n,D),cs=!1,X=t.memoizedState,f.state=X,pn(t,n,f,c),hn();var J=t.memoizedState;y!==ie||X!==J||cs||e!==null&&e.dependencies!==null&&Sl(e.dependencies)?(typeof j=="function"&&(Ii(t,r,j,n),J=t.memoizedState),(ae=cs||Tf(t,r,ae,n,X,J,D)||e!==null&&e.dependencies!==null&&Sl(e.dependencies))?(K||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(n,J,D),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(n,J,D)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=J),f.props=n,f.state=J,f.context=D,n=ae):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),n=!1)}return f=n,Gl(e,t),n=(t.flags&128)!==0,f||n?(f=t.stateNode,r=n&&typeof r.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&n?(t.child=Sa(t,e.child,null,c),t.child=Sa(t,null,r,c)):jt(e,t,r,c),t.memoizedState=f.state,e=t.child):e=Fr(e,t,c),e}function $f(e,t,r,n){return nn(),t.flags|=256,jt(e,t,r,n),t.child}var Ji={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zi(e){return{baseLanes:e,cachePool:Md()}}function Wi(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=ir),e}function Kf(e,t,r){var n=t.pendingProps,c=!1,f=(t.flags&128)!==0,y;if((y=f)||(y=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),y&&(c=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ve){if(c?ms(t):hs(),Ve){var j=lt,D;if(D=j){e:{for(D=j,j=Cr;D.nodeType!==8;){if(!j){j=null;break e}if(D=yr(D.nextSibling),D===null){j=null;break e}}j=D}j!==null?(t.memoizedState={dehydrated:j,treeContext:Ps!==null?{id:_r,overflow:Hr}:null,retryLane:536870912,hydrationErrors:null},D=Vt(18,null,null,0),D.stateNode=j,D.return=t,t.child=D,Dt=t,lt=null,D=!0):D=!1}D||Bs(t)}if(j=t.memoizedState,j!==null&&(j=j.dehydrated,j!==null))return zc(j)?t.lanes=32:t.lanes=536870912,null;Gr(t)}return j=n.children,n=n.fallback,c?(hs(),c=t.mode,j=Fl({mode:"hidden",children:j},c),n=zs(n,c,r,null),j.return=t,n.return=t,j.sibling=n,t.child=j,c=t.child,c.memoizedState=Zi(r),c.childLanes=Wi(e,y,r),t.memoizedState=Ji,n):(ms(t),ec(t,j))}if(D=e.memoizedState,D!==null&&(j=D.dehydrated,j!==null)){if(f)t.flags&256?(ms(t),t.flags&=-257,t=tc(e,t,r)):t.memoizedState!==null?(hs(),t.child=e.child,t.flags|=128,t=null):(hs(),c=n.fallback,j=t.mode,n=Fl({mode:"visible",children:n.children},j),c=zs(c,j,r,null),c.flags|=2,n.return=t,c.return=t,n.sibling=c,t.child=n,Sa(t,e.child,null,r),n=t.child,n.memoizedState=Zi(r),n.childLanes=Wi(e,y,r),t.memoizedState=Ji,t=c);else if(ms(t),zc(j)){if(y=j.nextSibling&&j.nextSibling.dataset,y)var K=y.dgst;y=K,n=Error(i(419)),n.stack="",n.digest=y,ln({value:n,source:null,stack:null}),t=tc(e,t,r)}else if(xt||on(e,t,r,!1),y=(r&e.childLanes)!==0,xt||y){if(y=Ze,y!==null&&(n=r&-r,n=(n&42)!==0?1:ns(n),n=(n&(y.suspendedLanes|r))!==0?0:n,n!==0&&n!==D.retryLane))throw D.retryLane=n,ma(e,n),It(y,e,n),Pf;j.data==="$?"||vc(),t=tc(e,t,r)}else j.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,lt=yr(j.nextSibling),Dt=t,Ve=!0,Hs=null,Cr=!1,e!==null&&(nr[lr++]=_r,nr[lr++]=Hr,nr[lr++]=Ps,_r=e.id,Hr=e.overflow,Ps=t),t=ec(t,n.children),t.flags|=4096);return t}return c?(hs(),c=n.fallback,j=t.mode,D=e.child,K=D.sibling,n=Pr(D,{mode:"hidden",children:n.children}),n.subtreeFlags=D.subtreeFlags&65011712,K!==null?c=Pr(K,c):(c=zs(c,j,r,null),c.flags|=2),c.return=t,n.return=t,n.sibling=c,t.child=n,n=c,c=t.child,j=e.child.memoizedState,j===null?j=Zi(r):(D=j.cachePool,D!==null?(K=ht._currentValue,D=D.parent!==K?{parent:K,pool:K}:D):D=Md(),j={baseLanes:j.baseLanes|r,cachePool:D}),c.memoizedState=j,c.childLanes=Wi(e,y,r),t.memoizedState=Ji,n):(ms(t),r=e.child,e=r.sibling,r=Pr(r,{mode:"visible",children:n.children}),r.return=t,r.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=r,t.memoizedState=null,r)}function ec(e,t){return t=Fl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Fl(e,t){return e=Vt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function tc(e,t,r){return Sa(t,e.child,null,r),e=ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function If(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),vi(e.return,t,r)}function rc(e,t,r,n,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=r,f.tailMode=c)}function Yf(e,t,r){var n=t.pendingProps,c=n.revealOrder,f=n.tail;if(jt(e,t,n.children,r),n=pt.current,(n&2)!==0)n=n&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&If(e,r,t);else if(e.tag===19)If(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}switch(H(pt,n),c){case"forwards":for(r=t.child,c=null;r!==null;)e=r.alternate,e!==null&&Bl(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=t.child,t.child=null):(c=r.sibling,r.sibling=null),rc(t,!1,c,r,f);break;case"backwards":for(r=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Bl(e)===null){t.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}rc(t,!0,r,null,f);break;case"together":rc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),vs|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(on(e,t,r,!1),(r&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,r=Pr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Pr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function sc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Sl(e)))}function N0(e,t,r){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),is(t,ht,e.memoizedState.cache),nn();break;case 27:case 5:Se(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:is(t,t.type,t.memoizedProps.value);break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ms(t),t.flags|=128,null):(r&t.child.childLanes)!==0?Kf(e,t,r):(ms(t),e=Fr(e,t,r),e!==null?e.sibling:null);ms(t);break;case 19:var c=(e.flags&128)!==0;if(n=(r&t.childLanes)!==0,n||(on(e,t,r,!1),n=(r&t.childLanes)!==0),c){if(n)return Yf(e,t,r);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),H(pt,pt.current),n)break;return null;case 22:case 23:return t.lanes=0,qf(e,t,r);case 24:is(t,ht,e.memoizedState.cache)}return Fr(e,t,r)}function Xf(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!sc(e,r)&&(t.flags&128)===0)return xt=!1,N0(e,t,r);xt=(e.flags&131072)!==0}else xt=!1,Ve&&(t.flags&1048576)!==0&&Sd(t,Nl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var n=t.elementType,c=n._init;if(n=c(n._payload),t.type=n,typeof n=="function")fi(n)?(e=$s(n,e),t.tag=1,t=Ff(null,t,n,e,r)):(t.tag=0,t=Qi(null,t,n,e,r));else{if(n!=null){if(c=n.$$typeof,c===G){t.tag=11,t=_f(null,t,n,e,r);break e}else if(c===te){t.tag=14,t=Hf(null,t,n,e,r);break e}}throw t=B(n)||n,Error(i(306,t,""))}}return t;case 0:return Qi(e,t,t.type,t.pendingProps,r);case 1:return n=t.type,c=$s(n,t.pendingProps),Ff(e,t,n,c,r);case 3:e:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));n=t.pendingProps;var f=t.memoizedState;c=f.element,Ei(e,t),pn(t,n,null,r);var y=t.memoizedState;if(n=y.cache,is(t,ht,n),n!==f.cache&&bi(t,[ht],r,!0),hn(),n=y.element,f.isDehydrated)if(f={element:n,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=$f(e,t,n,r);break e}else if(n!==c){c=sr(Error(i(424)),t),ln(c),t=$f(e,t,n,r);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(lt=yr(e.firstChild),Dt=t,Ve=!0,Hs=null,Cr=!0,r=kf(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(nn(),n===c){t=Fr(e,t,r);break e}jt(e,t,n,r)}t=t.child}return t;case 26:return Gl(e,t),e===null?(r=Wm(t.type,null,t.pendingProps,null))?t.memoizedState=r:Ve||(r=t.type,e=t.pendingProps,n=ao(ee.current).createElement(r),n[tt]=t,n[rt]=e,Nt(n,r,e),Te(n),t.stateNode=n):t.memoizedState=Wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&Ve&&(n=t.stateNode=Qm(t.type,t.pendingProps,ee.current),Dt=t,Cr=!0,c=lt,Ns(t.type)?(Pc=c,lt=yr(n.firstChild)):lt=c),jt(e,t,t.pendingProps.children,r),Gl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ve&&((c=n=lt)&&(n=J0(n,t.type,t.pendingProps,Cr),n!==null?(t.stateNode=n,Dt=t,lt=yr(n.firstChild),Cr=!1,c=!0):c=!1),c||Bs(t)),Se(t),c=t.type,f=t.pendingProps,y=e!==null?e.memoizedProps:null,n=f.children,Dc(c,f)?n=null:y!==null&&Dc(c,y)&&(t.flags|=32),t.memoizedState!==null&&(c=Oi(e,t,p0,null,null,r),Pn._currentValue=c),Gl(e,t),jt(e,t,n,r),t.child;case 6:return e===null&&Ve&&((e=r=lt)&&(r=Z0(r,t.pendingProps,Cr),r!==null?(t.stateNode=r,Dt=t,lt=null,e=!0):e=!1),e||Bs(t)),null;case 13:return Kf(e,t,r);case 4:return ue(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Sa(t,null,n,r):jt(e,t,n,r),t.child;case 11:return _f(e,t,t.type,t.pendingProps,r);case 7:return jt(e,t,t.pendingProps,r),t.child;case 8:return jt(e,t,t.pendingProps.children,r),t.child;case 12:return jt(e,t,t.pendingProps.children,r),t.child;case 10:return n=t.pendingProps,is(t,t.type,n.value),jt(e,t,n.children,r),t.child;case 9:return c=t.type._context,n=t.pendingProps.children,Vs(t),c=Tt(c),n=n(c),t.flags|=1,jt(e,t,n,r),t.child;case 14:return Hf(e,t,t.type,t.pendingProps,r);case 15:return Bf(e,t,t.type,t.pendingProps,r);case 19:return Yf(e,t,r);case 31:return n=t.pendingProps,r=t.mode,n={mode:n.mode,children:n.children},e===null?(r=Fl(n,r),r.ref=t.ref,t.child=r,r.return=t,t=r):(r=Pr(e.child,n),r.ref=t.ref,t.child=r,r.return=t,t=r),t;case 22:return qf(e,t,r);case 24:return Vs(t),n=Tt(ht),e===null?(c=Ni(),c===null&&(c=Ze,f=ji(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=r),c=f),t.memoizedState={parent:n,cache:c},Ci(t),is(t,ht,c)):((e.lanes&r)!==0&&(Ei(e,t),pn(t,null,null,r),hn()),c=e.memoizedState,f=t.memoizedState,c.parent!==n?(c={parent:n,cache:n},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),is(t,ht,n)):(n=f.cache,is(t,ht,n),n!==c.cache&&bi(t,[ht],r,!0))),jt(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function $r(e){e.flags|=4}function Qf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t)){if(t=or.current,t!==null&&((Be&4194048)===Be?Er!==null:(Be&62914560)!==Be&&(Be&536870912)===0||t!==Er))throw fn=Si,Od;e.flags|=8192}}function $l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?fe():536870912,e.lanes|=t,Aa|=t)}function wn(e,t){if(!Ve)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var c=e.child;c!==null;)r|=c.lanes|c.childLanes,n|=c.subtreeFlags&65011712,n|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)r|=c.lanes|c.childLanes,n|=c.subtreeFlags,n|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function S0(e,t,r){var n=t.pendingProps;switch(gi(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return r=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qr(ht),je(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(an(t)?$r(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,kd())),st(t),null;case 26:return r=t.memoizedState,e===null?($r(t),r!==null?(st(t),Qf(t,r)):(st(t),t.flags&=-16777217)):r?r!==e.memoizedState?($r(t),st(t),Qf(t,r)):(st(t),t.flags&=-16777217):(e.memoizedProps!==n&&$r(t),st(t),t.flags&=-16777217),null;case 27:ye(t),r=ee.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$r(t);else{if(!n){if(t.stateNode===null)throw Error(i(166));return st(t),null}e=I.current,an(t)?Cd(t):(e=Qm(c,n,r),t.stateNode=e,$r(t))}return st(t),null;case 5:if(ye(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$r(t);else{if(!n){if(t.stateNode===null)throw Error(i(166));return st(t),null}if(e=I.current,an(t))Cd(t);else{switch(c=ao(ee.current),e){case 1:e=c.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:e=c.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":e=c.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":e=c.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof n.is=="string"?c.createElement("select",{is:n.is}):c.createElement("select"),n.multiple?e.multiple=!0:n.size&&(e.size=n.size);break;default:e=typeof n.is=="string"?c.createElement(r,{is:n.is}):c.createElement(r)}}e[tt]=t,e[rt]=n;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(Nt(e,r,n),r){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&$r(t)}}return st(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&$r(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(i(166));if(e=ee.current,an(t)){if(e=t.stateNode,r=t.memoizedProps,n=null,c=Dt,c!==null)switch(c.tag){case 27:case 5:n=c.memoizedProps}e[tt]=t,e=!!(e.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||Gm(e.nodeValue,r)),e||Bs(t)}else e=ao(e).createTextNode(n),e[tt]=t,t.stateNode=e}return st(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=an(t),n!==null&&n.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[tt]=t}else nn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),c=!1}else c=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Gr(t),t):(Gr(t),null)}if(Gr(t),(t.flags&128)!==0)return t.lanes=r,t;if(r=n!==null,e=e!==null&&e.memoizedState!==null,r){n=t.child,c=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(c=n.alternate.memoizedState.cachePool.pool);var f=null;n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(f=n.memoizedState.cachePool.pool),f!==c&&(n.flags|=2048)}return r!==e&&r&&(t.child.flags|=8192),$l(t,t.updateQueue),st(t),null;case 4:return je(),e===null&&Ac(t.stateNode.containerInfo),st(t),null;case 10:return qr(t.type),st(t),null;case 19:if(Z(pt),c=t.memoizedState,c===null)return st(t),null;if(n=(t.flags&128)!==0,f=c.rendering,f===null)if(n)wn(c,!1);else{if(ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Bl(e),f!==null){for(t.flags|=128,wn(c,!1),e=f.updateQueue,t.updateQueue=e,$l(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Nd(r,e),r=r.sibling;return H(pt,pt.current&1|2),t.child}e=e.sibling}c.tail!==null&&ze()>Yl&&(t.flags|=128,n=!0,wn(c,!1),t.lanes=4194304)}else{if(!n)if(e=Bl(f),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,$l(t,e),wn(c,!0),c.tail===null&&c.tailMode==="hidden"&&!f.alternate&&!Ve)return st(t),null}else 2*ze()-c.renderingStartTime>Yl&&r!==536870912&&(t.flags|=128,n=!0,wn(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=ze(),t.sibling=null,e=pt.current,H(pt,n?e&1|2:e&1),t):(st(t),null);case 22:case 23:return Gr(t),Ri(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(r&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),r=t.updateQueue,r!==null&&$l(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==r&&(t.flags|=2048),e!==null&&Z(Gs),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qr(ht),st(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function C0(e,t){switch(gi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qr(ht),je(),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(Gr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));nn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Z(pt),null;case 4:return je(),null;case 10:return qr(t.type),null;case 22:case 23:return Gr(t),Ri(),e!==null&&Z(Gs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qr(ht),null;case 25:return null;default:return null}}function Jf(e,t){switch(gi(t),t.tag){case 3:qr(ht),je();break;case 26:case 27:case 5:ye(t);break;case 4:je();break;case 13:Gr(t);break;case 19:Z(pt);break;case 10:qr(t.type);break;case 22:case 23:Gr(t),Ri(),e!==null&&Z(Gs);break;case 24:qr(ht)}}function Nn(e,t){try{var r=t.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var c=n.next;r=c;do{if((r.tag&e)===e){n=void 0;var f=r.create,y=r.inst;n=f(),y.destroy=n}r=r.next}while(r!==c)}}catch(j){Qe(t,t.return,j)}}function ps(e,t,r){try{var n=t.updateQueue,c=n!==null?n.lastEffect:null;if(c!==null){var f=c.next;n=f;do{if((n.tag&e)===e){var y=n.inst,j=y.destroy;if(j!==void 0){y.destroy=void 0,c=t;var D=r,K=j;try{K()}catch(ae){Qe(c,D,ae)}}}n=n.next}while(n!==f)}}catch(ae){Qe(t,t.return,ae)}}function Zf(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{_d(t,r)}catch(n){Qe(e,e.return,n)}}}function Wf(e,t,r){r.props=$s(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(n){Qe(e,t,n)}}function Sn(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof r=="function"?e.refCleanup=r(n):r.current=n}}catch(c){Qe(e,t,c)}}function kr(e,t){var r=e.ref,n=e.refCleanup;if(r!==null)if(typeof n=="function")try{n()}catch(c){Qe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){Qe(e,t,c)}else r.current=null}function em(e){var t=e.type,r=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break e;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(c){Qe(e,e.return,c)}}function ac(e,t,r){try{var n=e.stateNode;K0(n,e.type,r,t),n[rt]=t}catch(c){Qe(e,e.return,c)}}function tm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ns(e.type)||e.tag===4}function nc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tm(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&&Ns(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 lc(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=so));else if(n!==4&&(n===27&&Ns(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(lc(e,t,r),e=e.sibling;e!==null;)lc(e,t,r),e=e.sibling}function Kl(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(n===27&&Ns(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Kl(e,t,r),e=e.sibling;e!==null;)Kl(e,t,r),e=e.sibling}function rm(e){var t=e.stateNode,r=e.memoizedProps;try{for(var n=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Nt(t,n,r),t[tt]=e,t[rt]=r}catch(f){Qe(e,e.return,f)}}var Kr=!1,ct=!1,oc=!1,sm=typeof WeakSet=="function"?WeakSet:Set,yt=null;function E0(e,t){if(e=e.containerInfo,Mc=uo,e=md(e),ni(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var c=n.anchorOffset,f=n.focusNode;n=n.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var y=0,j=-1,D=-1,K=0,ae=0,ie=e,X=null;t:for(;;){for(var J;ie!==r||c!==0&&ie.nodeType!==3||(j=y+c),ie!==f||n!==0&&ie.nodeType!==3||(D=y+n),ie.nodeType===3&&(y+=ie.nodeValue.length),(J=ie.firstChild)!==null;)X=ie,ie=J;for(;;){if(ie===e)break t;if(X===r&&++K===c&&(j=y),X===f&&++ae===n&&(D=y),(J=ie.nextSibling)!==null)break;ie=X,X=ie.parentNode}ie=J}r=j===-1||D===-1?null:{start:j,end:D}}else r=null}r=r||{start:0,end:0}}else r=null;for(Oc={focusedElem:e,selectionRange:r},uo=!1,yt=t;yt!==null;)if(t=yt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,yt=e;else for(;yt!==null;){switch(t=yt,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,r=t,c=f.memoizedProps,f=f.memoizedState,n=r.stateNode;try{var Ee=$s(r.type,c,r.elementType===r.type);e=n.getSnapshotBeforeUpdate(Ee,f),n.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){Qe(r,r.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)Lc(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lc(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,yt=e;break}yt=t.return}}function am(e,t,r){var n=r.flags;switch(r.tag){case 0:case 11:case 15:gs(e,r),n&4&&Nn(5,r);break;case 1:if(gs(e,r),n&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(y){Qe(r,r.return,y)}else{var c=$s(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Qe(r,r.return,y)}}n&64&&Zf(r),n&512&&Sn(r,r.return);break;case 3:if(gs(e,r),n&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{_d(e,t)}catch(y){Qe(r,r.return,y)}}break;case 27:t===null&&n&4&&rm(r);case 26:case 5:gs(e,r),t===null&&n&4&&em(r),n&512&&Sn(r,r.return);break;case 12:gs(e,r);break;case 13:gs(e,r),n&4&&om(e,r),n&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=L0.bind(null,r),W0(e,r))));break;case 22:if(n=r.memoizedState!==null||Kr,!n){t=t!==null&&t.memoizedState!==null||ct,c=Kr;var f=ct;Kr=n,(ct=t)&&!f?xs(e,r,(r.subtreeFlags&8772)!==0):gs(e,r),Kr=c,ct=f}break;case 30:break;default:gs(e,r)}}function nm(e){var t=e.alternate;t!==null&&(e.alternate=null,nm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&er(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 We=null,_t=!1;function Ir(e,t,r){for(r=r.child;r!==null;)lm(e,t,r),r=r.sibling}function lm(e,t,r){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Jt,r)}catch{}switch(r.tag){case 26:ct||kr(r,t),Ir(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ct||kr(r,t);var n=We,c=_t;Ns(r.type)&&(We=r.stateNode,_t=!1),Ir(e,t,r),Dn(r.stateNode),We=n,_t=c;break;case 5:ct||kr(r,t);case 6:if(n=We,c=_t,We=null,Ir(e,t,r),We=n,_t=c,We!==null)if(_t)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(r.stateNode)}catch(f){Qe(r,t,f)}else try{We.removeChild(r.stateNode)}catch(f){Qe(r,t,f)}break;case 18:We!==null&&(_t?(e=We,Ym(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),qn(e)):Ym(We,r.stateNode));break;case 4:n=We,c=_t,We=r.stateNode.containerInfo,_t=!0,Ir(e,t,r),We=n,_t=c;break;case 0:case 11:case 14:case 15:ct||ps(2,r,t),ct||ps(4,r,t),Ir(e,t,r);break;case 1:ct||(kr(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"&&Wf(r,t,n)),Ir(e,t,r);break;case 21:Ir(e,t,r);break;case 22:ct=(n=ct)||r.memoizedState!==null,Ir(e,t,r),ct=n;break;default:Ir(e,t,r)}}function om(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qn(e)}catch(r){Qe(t,t.return,r)}}function k0(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sm),t;default:throw Error(i(435,e.tag))}}function ic(e,t){var r=k0(e);t.forEach(function(n){var c=z0.bind(null,e,n);r.has(n)||(r.add(n),n.then(c,c))})}function Gt(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var c=r[n],f=e,y=t,j=y;e:for(;j!==null;){switch(j.tag){case 27:if(Ns(j.type)){We=j.stateNode,_t=!1;break e}break;case 5:We=j.stateNode,_t=!1;break e;case 3:case 4:We=j.stateNode.containerInfo,_t=!0;break e}j=j.return}if(We===null)throw Error(i(160));lm(f,y,c),We=null,_t=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)im(t,e),t=t.sibling}var xr=null;function im(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Ft(e),n&4&&(ps(3,e,e.return),Nn(3,e),ps(5,e,e.return));break;case 1:Gt(t,e),Ft(e),n&512&&(ct||r===null||kr(r,r.return)),n&64&&Kr&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?n:r.concat(n))));break;case 26:var c=xr;if(Gt(t,e),Ft(e),n&512&&(ct||r===null||kr(r,r.return)),n&4){var f=r!==null?r.memoizedState:null;if(n=e.memoizedState,r===null)if(n===null)if(e.stateNode===null){e:{n=e.type,r=e.memoizedProps,c=c.ownerDocument||c;t:switch(n){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Ms]||f[tt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(n),c.head.insertBefore(f,c.querySelector("head > title"))),Nt(f,n,r),f[tt]=e,Te(f),n=f;break e;case"link":var y=rh("link","href",c).get(n+(r.href||""));if(y){for(var j=0;j<y.length;j++)if(f=y[j],f.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&f.getAttribute("rel")===(r.rel==null?null:r.rel)&&f.getAttribute("title")===(r.title==null?null:r.title)&&f.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){y.splice(j,1);break t}}f=c.createElement(n),Nt(f,n,r),c.head.appendChild(f);break;case"meta":if(y=rh("meta","content",c).get(n+(r.content||""))){for(j=0;j<y.length;j++)if(f=y[j],f.getAttribute("content")===(r.content==null?null:""+r.content)&&f.getAttribute("name")===(r.name==null?null:r.name)&&f.getAttribute("property")===(r.property==null?null:r.property)&&f.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&f.getAttribute("charset")===(r.charSet==null?null:r.charSet)){y.splice(j,1);break t}}f=c.createElement(n),Nt(f,n,r),c.head.appendChild(f);break;default:throw Error(i(468,n))}f[tt]=e,Te(f),n=f}e.stateNode=n}else sh(c,e.type,e.stateNode);else e.stateNode=th(c,n,e.memoizedProps);else f!==n?(f===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):f.count--,n===null?sh(c,e.type,e.stateNode):th(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&ac(e,e.memoizedProps,r.memoizedProps)}break;case 27:Gt(t,e),Ft(e),n&512&&(ct||r===null||kr(r,r.return)),r!==null&&n&4&&ac(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Gt(t,e),Ft(e),n&512&&(ct||r===null||kr(r,r.return)),e.flags&32){c=e.stateNode;try{la(c,"")}catch(J){Qe(e,e.return,J)}}n&4&&e.stateNode!=null&&(c=e.memoizedProps,ac(e,c,r!==null?r.memoizedProps:c)),n&1024&&(oc=!0);break;case 6:if(Gt(t,e),Ft(e),n&4){if(e.stateNode===null)throw Error(i(162));n=e.memoizedProps,r=e.stateNode;try{r.nodeValue=n}catch(J){Qe(e,e.return,J)}}break;case 3:if(oo=null,c=xr,xr=no(t.containerInfo),Gt(t,e),xr=c,Ft(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{qn(t.containerInfo)}catch(J){Qe(e,e.return,J)}oc&&(oc=!1,cm(e));break;case 4:n=xr,xr=no(e.stateNode.containerInfo),Gt(t,e),Ft(e),xr=n;break;case 12:Gt(t,e),Ft(e);break;case 13:Gt(t,e),Ft(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hc=ze()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ic(e,n)));break;case 22:c=e.memoizedState!==null;var D=r!==null&&r.memoizedState!==null,K=Kr,ae=ct;if(Kr=K||c,ct=ae||D,Gt(t,e),ct=ae,Kr=K,Ft(e),n&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(r===null||D||Kr||ct||Ks(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){D=r=t;try{if(f=D.stateNode,c)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{j=D.stateNode;var ie=D.memoizedProps.style,X=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;j.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(J){Qe(D,D.return,J)}}}else if(t.tag===6){if(r===null){D=t;try{D.stateNode.nodeValue=c?"":D.memoizedProps}catch(J){Qe(D,D.return,J)}}}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;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(r=n.retryQueue,r!==null&&(n.retryQueue=null,ic(e,r))));break;case 19:Gt(t,e),Ft(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ic(e,n)));break;case 30:break;case 21:break;default:Gt(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{for(var r,n=e.return;n!==null;){if(tm(n)){r=n;break}n=n.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var c=r.stateNode,f=nc(e);Kl(e,f,c);break;case 5:var y=r.stateNode;r.flags&32&&(la(y,""),r.flags&=-33);var j=nc(e);Kl(e,j,y);break;case 3:case 4:var D=r.stateNode.containerInfo,K=nc(e);lc(e,K,D);break;default:throw Error(i(161))}}catch(ae){Qe(e,e.return,ae)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;cm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)am(e,t.alternate,t),t=t.sibling}function Ks(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ps(4,t,t.return),Ks(t);break;case 1:kr(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&Wf(t,t.return,r),Ks(t);break;case 27:Dn(t.stateNode);case 26:case 5:kr(t,t.return),Ks(t);break;case 22:t.memoizedState===null&&Ks(t);break;case 30:Ks(t);break;default:Ks(t)}e=e.sibling}}function xs(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,c=e,f=t,y=f.flags;switch(f.tag){case 0:case 11:case 15:xs(c,f,r),Nn(4,f);break;case 1:if(xs(c,f,r),n=f,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(K){Qe(n,n.return,K)}if(n=f,c=n.updateQueue,c!==null){var j=n.stateNode;try{var D=c.shared.hiddenCallbacks;if(D!==null)for(c.shared.hiddenCallbacks=null,c=0;c<D.length;c++)Pd(D[c],j)}catch(K){Qe(n,n.return,K)}}r&&y&64&&Zf(f),Sn(f,f.return);break;case 27:rm(f);case 26:case 5:xs(c,f,r),r&&n===null&&y&4&&em(f),Sn(f,f.return);break;case 12:xs(c,f,r);break;case 13:xs(c,f,r),r&&y&4&&om(c,f);break;case 22:f.memoizedState===null&&xs(c,f,r),Sn(f,f.return);break;case 30:break;default:xs(c,f,r)}t=t.sibling}}function cc(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&cn(r))}function uc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&cn(e))}function Ar(e,t,r,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)um(e,t,r,n),t=t.sibling}function um(e,t,r,n){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Ar(e,t,r,n),c&2048&&Nn(9,t);break;case 1:Ar(e,t,r,n);break;case 3:Ar(e,t,r,n),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&cn(e)));break;case 12:if(c&2048){Ar(e,t,r,n),e=t.stateNode;try{var f=t.memoizedProps,y=f.id,j=f.onPostCommit;typeof j=="function"&&j(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Qe(t,t.return,D)}}else Ar(e,t,r,n);break;case 13:Ar(e,t,r,n);break;case 23:break;case 22:f=t.stateNode,y=t.alternate,t.memoizedState!==null?f._visibility&2?Ar(e,t,r,n):Cn(e,t):f._visibility&2?Ar(e,t,r,n):(f._visibility|=2,Ca(e,t,r,n,(t.subtreeFlags&10256)!==0)),c&2048&&cc(y,t);break;case 24:Ar(e,t,r,n),c&2048&&uc(t.alternate,t);break;default:Ar(e,t,r,n)}}function Ca(e,t,r,n,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var f=e,y=t,j=r,D=n,K=y.flags;switch(y.tag){case 0:case 11:case 15:Ca(f,y,j,D,c),Nn(8,y);break;case 23:break;case 22:var ae=y.stateNode;y.memoizedState!==null?ae._visibility&2?Ca(f,y,j,D,c):Cn(f,y):(ae._visibility|=2,Ca(f,y,j,D,c)),c&&K&2048&&cc(y.alternate,y);break;case 24:Ca(f,y,j,D,c),c&&K&2048&&uc(y.alternate,y);break;default:Ca(f,y,j,D,c)}t=t.sibling}}function Cn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,n=t,c=n.flags;switch(n.tag){case 22:Cn(r,n),c&2048&&cc(n.alternate,n);break;case 24:Cn(r,n),c&2048&&uc(n.alternate,n);break;default:Cn(r,n)}t=t.sibling}}var En=8192;function Ea(e){if(e.subtreeFlags&En)for(e=e.child;e!==null;)dm(e),e=e.sibling}function dm(e){switch(e.tag){case 26:Ea(e),e.flags&En&&e.memoizedState!==null&&fx(xr,e.memoizedState,e.memoizedProps);break;case 5:Ea(e);break;case 3:case 4:var t=xr;xr=no(e.stateNode.containerInfo),Ea(e),xr=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=En,En=16777216,Ea(e),En=t):Ea(e));break;default:Ea(e)}}function fm(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 kn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var n=t[r];yt=n,hm(n,e)}fm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)mm(e),e=e.sibling}function mm(e){switch(e.tag){case 0:case 11:case 15:kn(e),e.flags&2048&&ps(9,e,e.return);break;case 3:kn(e);break;case 12:kn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Il(e)):kn(e);break;default:kn(e)}}function Il(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var n=t[r];yt=n,hm(n,e)}fm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ps(8,t,t.return),Il(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,Il(t));break;default:Il(t)}e=e.sibling}}function hm(e,t){for(;yt!==null;){var r=yt;switch(r.tag){case 0:case 11:case 15:ps(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var n=r.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:cn(r.memoizedState.cache)}if(n=r.child,n!==null)n.return=r,yt=n;else e:for(r=e;yt!==null;){n=yt;var c=n.sibling,f=n.return;if(nm(n),n===r){yt=null;break e}if(c!==null){c.return=f,yt=c;break e}yt=f}}}var A0={getCacheForType:function(e){var t=Tt(ht),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r}},T0=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Ze=null,Pe=null,Be=0,$e=0,$t=null,ys=!1,ka=!1,dc=!1,Yr=0,ot=0,vs=0,Is=0,fc=0,ir=0,Aa=0,An=null,Ht=null,mc=!1,hc=0,Yl=1/0,Xl=null,bs=null,wt=0,js=null,Ta=null,Ra=0,pc=0,gc=null,pm=null,Tn=0,xc=null;function Kt(){if((Fe&2)!==0&&Be!==0)return Be&-Be;if(b.T!==null){var e=xa;return e!==0?e:Sc()}return pr()}function gm(){ir===0&&(ir=(Be&536870912)===0||Ve?me():536870912);var e=or.current;return e!==null&&(e.flags|=32),ir}function It(e,t,r){(e===Ze&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(Ma(e,0),ws(e,Be,ir,!1)),kt(e,r),((Fe&2)===0||e!==Ze)&&(e===Ze&&((Fe&2)===0&&(Is|=r),ot===4&&ws(e,Be,ir,!1)),Tr(e))}function xm(e,t,r){if((Fe&6)!==0)throw Error(i(327));var n=!r&&(t&124)===0&&(t&e.expiredLanes)===0||jr(e,t),c=n?O0(e,t):bc(e,t,!0),f=n;do{if(c===0){ka&&!n&&ws(e,t,0,!1);break}else{if(r=e.current.alternate,f&&!R0(r)){c=bc(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var j=e;c=An;var D=j.current.memoizedState.isDehydrated;if(D&&(Ma(j,y).flags|=256),y=bc(j,y,!1),y!==2){if(dc&&!D){j.errorRecoveryDisabledLanes|=f,Is|=f,c=4;break e}f=Ht,Ht=c,f!==null&&(Ht===null?Ht=f:Ht.push.apply(Ht,f))}c=y}if(f=!1,c!==2)continue}}if(c===1){Ma(e,0),ws(e,t,0,!0);break}e:{switch(n=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ws(n,t,ir,!ys);break e;case 2:Ht=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=hc+300-ze(),10<c)){if(ws(n,t,ir,!ys),mr(n,0,!0)!==0)break e;n.timeoutHandle=Km(ym.bind(null,n,r,Ht,Xl,mc,t,ir,Is,Aa,ys,f,2,-0,0),c);break e}ym(n,r,Ht,Xl,mc,t,ir,Is,Aa,ys,f,0,-0,0)}}break}while(!0);Tr(e)}function ym(e,t,r,n,c,f,y,j,D,K,ae,ie,X,J){if(e.timeoutHandle=-1,ie=t.subtreeFlags,(ie&8192||(ie&16785408)===16785408)&&(zn={stylesheets:null,count:0,unsuspend:dx},dm(t),ie=mx(),ie!==null)){e.cancelPendingCommit=ie(Cm.bind(null,e,t,f,r,n,c,y,j,D,ae,1,X,J)),ws(e,f,y,!K);return}Cm(e,t,f,r,n,c,y,j,D)}function R0(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var n=0;n<r.length;n++){var c=r[n],f=c.getSnapshot;c=c.value;try{if(!qt(f(),c))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 ws(e,t,r,n){t&=~fc,t&=~Is,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var f=31-mt(c),y=1<<f;n[f]=-1,c&=~y}r!==0&&wr(e,r,t)}function Ql(){return(Fe&6)===0?(Rn(0),!1):!0}function yc(){if(Pe!==null){if($e===0)var e=Pe.return;else e=Pe,Br=qs=null,Li(e),Na=null,bn=0,e=Pe;for(;e!==null;)Jf(e.alternate,e),e=e.return;Pe=null}}function Ma(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,Y0(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),yc(),Ze=e,Pe=r=Pr(e.current,null),Be=t,$e=0,$t=null,ys=!1,ka=jr(e,t),dc=!1,Aa=ir=fc=Is=vs=ot=0,Ht=An=null,mc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var c=31-mt(n),f=1<<c;t|=e[c],n&=~f}return Yr=t,yl(),r}function vm(e,t){De=null,b.H=Pl,t===dn||t===kl?(t=Ld(),$e=3):t===Od?(t=Ld(),$e=4):$e=t===Pf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,$t=t,Pe===null&&(ot=1,Vl(e,sr(t,e.current)))}function bm(){var e=b.H;return b.H=Pl,e===null?Pl:e}function jm(){var e=b.A;return b.A=A0,e}function vc(){ot=4,ys||(Be&4194048)!==Be&&or.current!==null||(ka=!0),(vs&134217727)===0&&(Is&134217727)===0||Ze===null||ws(Ze,Be,ir,!1)}function bc(e,t,r){var n=Fe;Fe|=2;var c=bm(),f=jm();(Ze!==e||Be!==t)&&(Xl=null,Ma(e,t)),t=!1;var y=ot;e:do try{if($e!==0&&Pe!==null){var j=Pe,D=$t;switch($e){case 8:yc(),y=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(t=!0);var K=$e;if($e=0,$t=null,Oa(e,j,D,K),r&&ka){y=0;break e}break;default:K=$e,$e=0,$t=null,Oa(e,j,D,K)}}M0(),y=ot;break}catch(ae){vm(e,ae)}while(!0);return t&&e.shellSuspendCounter++,Br=qs=null,Fe=n,b.H=c,b.A=f,Pe===null&&(Ze=null,Be=0,yl()),y}function M0(){for(;Pe!==null;)wm(Pe)}function O0(e,t){var r=Fe;Fe|=2;var n=bm(),c=jm();Ze!==e||Be!==t?(Xl=null,Yl=ze()+500,Ma(e,t)):ka=jr(e,t);e:do try{if($e!==0&&Pe!==null){t=Pe;var f=$t;t:switch($e){case 1:$e=0,$t=null,Oa(e,t,f,1);break;case 2:case 9:if(Dd(f)){$e=0,$t=null,Nm(t);break}t=function(){$e!==2&&$e!==9||Ze!==e||($e=7),Tr(e)},f.then(t,t);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:Dd(f)?($e=0,$t=null,Nm(t)):($e=0,$t=null,Oa(e,t,f,7));break;case 5:var y=null;switch(Pe.tag){case 26:y=Pe.memoizedState;case 5:case 27:var j=Pe;if(!y||ah(y)){$e=0,$t=null;var D=j.sibling;if(D!==null)Pe=D;else{var K=j.return;K!==null?(Pe=K,Jl(K)):Pe=null}break t}}$e=0,$t=null,Oa(e,t,f,5);break;case 6:$e=0,$t=null,Oa(e,t,f,6);break;case 8:yc(),ot=6;break e;default:throw Error(i(462))}}D0();break}catch(ae){vm(e,ae)}while(!0);return Br=qs=null,b.H=n,b.A=c,Fe=r,Pe!==null?0:(Ze=null,Be=0,yl(),ot)}function D0(){for(;Pe!==null&&!nt();)wm(Pe)}function wm(e){var t=Xf(e.alternate,e,Yr);e.memoizedProps=e.pendingProps,t===null?Jl(e):Pe=t}function Nm(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Gf(r,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=Gf(r,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:Li(t);default:Jf(r,t),t=Pe=Nd(t,Yr),t=Xf(r,t,Yr)}e.memoizedProps=e.pendingProps,t===null?Jl(e):Pe=t}function Oa(e,t,r,n){Br=qs=null,Li(t),Na=null,bn=0;var c=t.return;try{if(w0(e,c,t,r,Be)){ot=1,Vl(e,sr(r,e.current)),Pe=null;return}}catch(f){if(c!==null)throw Pe=c,f;ot=1,Vl(e,sr(r,e.current)),Pe=null;return}t.flags&32768?(Ve||n===1?e=!0:ka||(Be&536870912)!==0?e=!1:(ys=e=!0,(n===2||n===9||n===3||n===6)&&(n=or.current,n!==null&&n.tag===13&&(n.flags|=16384))),Sm(t,e)):Jl(t)}function Jl(e){var t=e;do{if((t.flags&32768)!==0){Sm(t,ys);return}e=t.return;var r=S0(t.alternate,t,Yr);if(r!==null){Pe=r;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);ot===0&&(ot=5)}function Sm(e,t){do{var r=C0(e.alternate,e);if(r!==null){r.flags&=32767,Pe=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=r}while(e!==null);ot=6,Pe=null}function Cm(e,t,r,n,c,f,y,j,D){e.cancelPendingCommit=null;do Zl();while(wt!==0);if((Fe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=ui,hr(e,r,f,y,j,D),e===Ze&&(Pe=Ze=null,Be=0),Ta=t,js=e,Ra=r,pc=f,gc=c,pm=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,P0(Xt,function(){return Rm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=b.T,b.T=null,c=C.p,C.p=2,y=Fe,Fe|=4;try{E0(e,t,r)}finally{Fe=y,C.p=c,b.T=n}}wt=1,Em(),km(),Am()}}function Em(){if(wt===1){wt=0;var e=js,t=Ta,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=b.T,b.T=null;var n=C.p;C.p=2;var c=Fe;Fe|=4;try{im(t,e);var f=Oc,y=md(e.containerInfo),j=f.focusedElem,D=f.selectionRange;if(y!==j&&j&&j.ownerDocument&&fd(j.ownerDocument.documentElement,j)){if(D!==null&&ni(j)){var K=D.start,ae=D.end;if(ae===void 0&&(ae=K),"selectionStart"in j)j.selectionStart=K,j.selectionEnd=Math.min(ae,j.value.length);else{var ie=j.ownerDocument||document,X=ie&&ie.defaultView||window;if(X.getSelection){var J=X.getSelection(),Ee=j.textContent.length,Ne=Math.min(D.start,Ee),Ye=D.end===void 0?Ne:Math.min(D.end,Ee);!J.extend&&Ne>Ye&&(y=Ye,Ye=Ne,Ne=y);var q=dd(j,Ne),P=dd(j,Ye);if(q&&P&&(J.rangeCount!==1||J.anchorNode!==q.node||J.anchorOffset!==q.offset||J.focusNode!==P.node||J.focusOffset!==P.offset)){var F=ie.createRange();F.setStart(q.node,q.offset),J.removeAllRanges(),Ne>Ye?(J.addRange(F),J.extend(P.node,P.offset)):(F.setEnd(P.node,P.offset),J.addRange(F))}}}}for(ie=[],J=j;J=J.parentNode;)J.nodeType===1&&ie.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<ie.length;j++){var ne=ie[j];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}uo=!!Mc,Oc=Mc=null}finally{Fe=c,C.p=n,b.T=r}}e.current=t,wt=2}}function km(){if(wt===2){wt=0;var e=js,t=Ta,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=b.T,b.T=null;var n=C.p;C.p=2;var c=Fe;Fe|=4;try{am(e,t.alternate,t)}finally{Fe=c,C.p=n,b.T=r}}wt=3}}function Am(){if(wt===4||wt===3){wt=0,Ct();var e=js,t=Ta,r=Ra,n=pm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?wt=5:(wt=0,Ta=js=null,Tm(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(bs=null),bt(r),t=t.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Jt,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=b.T,c=C.p,C.p=2,b.T=null;try{for(var f=e.onRecoverableError,y=0;y<n.length;y++){var j=n[y];f(j.value,{componentStack:j.stack})}}finally{b.T=t,C.p=c}}(Ra&3)!==0&&Zl(),Tr(e),c=e.pendingLanes,(r&4194090)!==0&&(c&42)!==0?e===xc?Tn++:(Tn=0,xc=e):Tn=0,Rn(0)}}function Tm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,cn(t)))}function Zl(e){return Em(),km(),Am(),Rm()}function Rm(){if(wt!==5)return!1;var e=js,t=pc;pc=0;var r=bt(Ra),n=b.T,c=C.p;try{C.p=32>r?32:r,b.T=null,r=gc,gc=null;var f=js,y=Ra;if(wt=0,Ta=js=null,Ra=0,(Fe&6)!==0)throw Error(i(331));var j=Fe;if(Fe|=4,mm(f.current),um(f,f.current,y,r),Fe=j,Rn(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Jt,f)}catch{}return!0}finally{C.p=c,b.T=n,Tm(e,t)}}function Mm(e,t,r){t=sr(r,t),t=Xi(e.stateNode,t,2),e=ds(e,t,2),e!==null&&(kt(e,2),Tr(e))}function Qe(e,t,r){if(e.tag===3)Mm(e,e,r);else for(;t!==null;){if(t.tag===3){Mm(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(bs===null||!bs.has(n))){e=sr(r,e),r=Lf(2),n=ds(t,r,2),n!==null&&(zf(r,n,t,e),kt(n,2),Tr(n));break}}t=t.return}}function jc(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new T0;var c=new Set;n.set(t,c)}else c=n.get(t),c===void 0&&(c=new Set,n.set(t,c));c.has(r)||(dc=!0,c.add(r),e=U0.bind(null,e,t,r),t.then(e,e))}function U0(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Ze===e&&(Be&r)===r&&(ot===4||ot===3&&(Be&62914560)===Be&&300>ze()-hc?(Fe&2)===0&&Ma(e,0):fc|=r,Aa===Be&&(Aa=0)),Tr(e)}function Om(e,t){t===0&&(t=fe()),e=ma(e,t),e!==null&&(kt(e,t),Tr(e))}function L0(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Om(e,r)}function z0(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,c=e.memoizedState;c!==null&&(r=c.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(i(314))}n!==null&&n.delete(t),Om(e,r)}function P0(e,t){return ce(e,t)}var Wl=null,Da=null,wc=!1,eo=!1,Nc=!1,Ys=0;function Tr(e){e!==Da&&e.next===null&&(Da===null?Wl=Da=e:Da=Da.next=e),eo=!0,wc||(wc=!0,H0())}function Rn(e,t){if(!Nc&&eo){Nc=!0;do for(var r=!1,n=Wl;n!==null;){if(e!==0){var c=n.pendingLanes;if(c===0)var f=0;else{var y=n.suspendedLanes,j=n.pingedLanes;f=(1<<31-mt(42|e)+1)-1,f&=c&~(y&~j),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(r=!0,zm(n,f))}else f=Be,f=mr(n,n===Ze?f:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(f&3)===0||jr(n,f)||(r=!0,zm(n,f));n=n.next}while(r);Nc=!1}}function _0(){Dm()}function Dm(){eo=wc=!1;var e=0;Ys!==0&&(I0()&&(e=Ys),Ys=0);for(var t=ze(),r=null,n=Wl;n!==null;){var c=n.next,f=Um(n,t);f===0?(n.next=null,r===null?Wl=c:r.next=c,c===null&&(Da=r)):(r=n,(e!==0||(f&3)!==0)&&(eo=!0)),n=c}Rn(e)}function Um(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var y=31-mt(f),j=1<<y,D=c[y];D===-1?((j&r)===0||(j&n)!==0)&&(c[y]=ta(j,t)):D<=t&&(e.expiredLanes|=j),f&=~j}if(t=Ze,r=Be,r=mr(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,r===0||e===t&&($e===2||$e===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ae(n),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||jr(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(n!==null&&Ae(n),bt(r)){case 2:case 8:r=Yt;break;case 32:r=Xt;break;case 268435456:r=rs;break;default:r=Xt}return n=Lm.bind(null,e),r=ce(r,n),e.callbackPriority=t,e.callbackNode=r,t}return n!==null&&n!==null&&Ae(n),e.callbackPriority=2,e.callbackNode=null,2}function Lm(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Zl()&&e.callbackNode!==r)return null;var n=Be;return n=mr(e,e===Ze?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(xm(e,n,t),Um(e,ze()),e.callbackNode!=null&&e.callbackNode===r?Lm.bind(null,e):null)}function zm(e,t){if(Zl())return null;xm(e,t,!0)}function H0(){X0(function(){(Fe&6)!==0?ce(br,_0):Dm()})}function Sc(){return Ys===0&&(Ys=me()),Ys}function Pm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:dl(""+e)}function _m(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function B0(e,t,r,n,c){if(t==="submit"&&r&&r.stateNode===c){var f=Pm((c[rt]||null).action),y=n.submitter;y&&(t=(t=y[rt]||null)?Pm(t.formAction):y.getAttribute("formAction"),t!==null&&(f=t,y=null));var j=new pl("action","action",null,n,c);e.push({event:j,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Ys!==0){var D=y?_m(c,y):new FormData(c);Fi(r,{pending:!0,data:D,method:c.method,action:f},null,D)}}else typeof f=="function"&&(j.preventDefault(),D=y?_m(c,y):new FormData(c),Fi(r,{pending:!0,data:D,method:c.method,action:f},f,D))},currentTarget:c}]})}}for(var Cc=0;Cc<ci.length;Cc++){var Ec=ci[Cc],q0=Ec.toLowerCase(),V0=Ec[0].toUpperCase()+Ec.slice(1);gr(q0,"on"+V0)}gr(gd,"onAnimationEnd"),gr(xd,"onAnimationIteration"),gr(yd,"onAnimationStart"),gr("dblclick","onDoubleClick"),gr("focusin","onFocus"),gr("focusout","onBlur"),gr(n0,"onTransitionRun"),gr(l0,"onTransitionStart"),gr(o0,"onTransitionCancel"),gr(vd,"onTransitionEnd"),sa("onMouseEnter",["mouseout","mouseover"]),sa("onMouseLeave",["mouseout","mouseover"]),sa("onPointerEnter",["pointerout","pointerover"]),sa("onPointerLeave",["pointerout","pointerover"]),Os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Os("onBeforeInput",["compositionend","keypress","textInput","paste"]),Os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mn="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(Mn));function Hm(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],c=n.event;n=n.listeners;e:{var f=void 0;if(t)for(var y=n.length-1;0<=y;y--){var j=n[y],D=j.instance,K=j.currentTarget;if(j=j.listener,D!==f&&c.isPropagationStopped())break e;f=j,c.currentTarget=K;try{f(c)}catch(ae){ql(ae)}c.currentTarget=null,f=D}else for(y=0;y<n.length;y++){if(j=n[y],D=j.instance,K=j.currentTarget,j=j.listener,D!==f&&c.isPropagationStopped())break e;f=j,c.currentTarget=K;try{f(c)}catch(ae){ql(ae)}c.currentTarget=null,f=D}}}}function _e(e,t){var r=t[Ur];r===void 0&&(r=t[Ur]=new Set);var n=e+"__bubble";r.has(n)||(Bm(t,e,2,!1),r.add(n))}function kc(e,t,r){var n=0;t&&(n|=4),Bm(r,e,n,t)}var to="_reactListening"+Math.random().toString(36).slice(2);function Ac(e){if(!e[to]){e[to]=!0,Xe.forEach(function(r){r!=="selectionchange"&&(G0.has(r)||kc(r,!1,e),kc(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[to]||(t[to]=!0,kc("selectionchange",!1,t))}}function Bm(e,t,r,n){switch(uh(t)){case 2:var c=gx;break;case 8:c=xx;break;default:c=Vc}r=c.bind(null,t,r,e),c=void 0,!Qo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),n?c!==void 0?e.addEventListener(t,r,{capture:!0,passive:c}):e.addEventListener(t,r,!0):c!==void 0?e.addEventListener(t,r,{passive:c}):e.addEventListener(t,r,!1)}function Tc(e,t,r,n,c){var f=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var y=n.tag;if(y===3||y===4){var j=n.stateNode.containerInfo;if(j===c)break;if(y===4)for(y=n.return;y!==null;){var D=y.tag;if((D===3||D===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;j!==null;){if(y=ls(j),y===null)return;if(D=y.tag,D===5||D===6||D===26||D===27){n=f=y;continue e}j=j.parentNode}}n=n.return}Ku(function(){var K=f,ae=Yo(r),ie=[];e:{var X=bd.get(e);if(X!==void 0){var J=pl,Ee=e;switch(e){case"keypress":if(ml(r)===0)break e;case"keydown":case"keyup":J=Pg;break;case"focusin":Ee="focus",J=ei;break;case"focusout":Ee="blur",J=ei;break;case"beforeblur":case"afterblur":J=ei;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=Xu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=Cg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=Bg;break;case gd:case xd:case yd:J=Ag;break;case vd:J=Vg;break;case"scroll":case"scrollend":J=Ng;break;case"wheel":J=Fg;break;case"copy":case"cut":case"paste":J=Rg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Ju;break;case"toggle":case"beforetoggle":J=Kg}var Ne=(t&4)!==0,Ye=!Ne&&(e==="scroll"||e==="scrollend"),q=Ne?X!==null?X+"Capture":null:X;Ne=[];for(var P=K,F;P!==null;){var ne=P;if(F=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||F===null||q===null||(ne=Xa(P,q),ne!=null&&Ne.push(On(P,ne,F))),Ye)break;P=P.return}0<Ne.length&&(X=new J(X,Ee,null,r,ae),ie.push({event:X,listeners:Ne}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",X&&r!==Io&&(Ee=r.relatedTarget||r.fromElement)&&(ls(Ee)||Ee[Wt]))break e;if((J||X)&&(X=ae.window===ae?ae:(X=ae.ownerDocument)?X.defaultView||X.parentWindow:window,J?(Ee=r.relatedTarget||r.toElement,J=K,Ee=Ee?ls(Ee):null,Ee!==null&&(Ye=d(Ee),Ne=Ee.tag,Ee!==Ye||Ne!==5&&Ne!==27&&Ne!==6)&&(Ee=null)):(J=null,Ee=K),J!==Ee)){if(Ne=Xu,ne="onMouseLeave",q="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=Ju,ne="onPointerLeave",q="onPointerEnter",P="pointer"),Ye=J==null?X:we(J),F=Ee==null?X:we(Ee),X=new Ne(ne,P+"leave",J,r,ae),X.target=Ye,X.relatedTarget=F,ne=null,ls(ae)===K&&(Ne=new Ne(q,P+"enter",Ee,r,ae),Ne.target=F,Ne.relatedTarget=Ye,ne=Ne),Ye=ne,J&&Ee)t:{for(Ne=J,q=Ee,P=0,F=Ne;F;F=Ua(F))P++;for(F=0,ne=q;ne;ne=Ua(ne))F++;for(;0<P-F;)Ne=Ua(Ne),P--;for(;0<F-P;)q=Ua(q),F--;for(;P--;){if(Ne===q||q!==null&&Ne===q.alternate)break t;Ne=Ua(Ne),q=Ua(q)}Ne=null}else Ne=null;J!==null&&qm(ie,X,J,Ne,!1),Ee!==null&&Ye!==null&&qm(ie,Ye,Ee,Ne,!0)}}e:{if(X=K?we(K):window,J=X.nodeName&&X.nodeName.toLowerCase(),J==="select"||J==="input"&&X.type==="file")var pe=nd;else if(sd(X))if(ld)pe=r0;else{pe=e0;var Le=Wg}else J=X.nodeName,!J||J.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?K&&Ko(K.elementType)&&(pe=nd):pe=t0;if(pe&&(pe=pe(e,K))){ad(ie,pe,r,ae);break e}Le&&Le(e,X,K),e==="focusout"&&K&&X.type==="number"&&K.memoizedProps.value!=null&&$o(X,"number",X.value)}switch(Le=K?we(K):window,e){case"focusin":(sd(Le)||Le.contentEditable==="true")&&(ua=Le,li=K,sn=null);break;case"focusout":sn=li=ua=null;break;case"mousedown":oi=!0;break;case"contextmenu":case"mouseup":case"dragend":oi=!1,hd(ie,r,ae);break;case"selectionchange":if(a0)break;case"keydown":case"keyup":hd(ie,r,ae)}var be;if(ri)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else ca?td(e,r)&&(Ce="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&(Zu&&r.locale!=="ko"&&(ca||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&ca&&(be=Iu()):(os=ae,Jo="value"in os?os.value:os.textContent,ca=!0)),Le=ro(K,Ce),0<Le.length&&(Ce=new Qu(Ce,e,null,r,ae),ie.push({event:Ce,listeners:Le}),be?Ce.data=be:(be=rd(r),be!==null&&(Ce.data=be)))),(be=Yg?Xg(e,r):Qg(e,r))&&(Ce=ro(K,"onBeforeInput"),0<Ce.length&&(Le=new Qu("onBeforeInput","beforeinput",null,r,ae),ie.push({event:Le,listeners:Ce}),Le.data=be)),B0(ie,e,K,r,ae)}Hm(ie,t)})}function On(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ro(e,t){for(var r=t+"Capture",n=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Xa(e,r),c!=null&&n.unshift(On(e,c,f)),c=Xa(e,t),c!=null&&n.push(On(e,c,f))),e.tag===3)return n;e=e.return}return[]}function Ua(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function qm(e,t,r,n,c){for(var f=t._reactName,y=[];r!==null&&r!==n;){var j=r,D=j.alternate,K=j.stateNode;if(j=j.tag,D!==null&&D===n)break;j!==5&&j!==26&&j!==27||K===null||(D=K,c?(K=Xa(r,f),K!=null&&y.unshift(On(r,K,D))):c||(K=Xa(r,f),K!=null&&y.push(On(r,K,D)))),r=r.return}y.length!==0&&e.push({event:t,listeners:y})}var F0=/\r\n?/g,$0=/\u0000|\uFFFD/g;function Vm(e){return(typeof e=="string"?e:""+e).replace(F0,`
|
|
49
|
+
`).replace($0,"")}function Gm(e,t){return t=Vm(t),Vm(e)===t}function so(){}function Ie(e,t,r,n,c,f){switch(r){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||la(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&la(e,""+n);break;case"className":il(e,"class",n);break;case"tabIndex":il(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":il(e,r,n);break;case"style":Fu(e,n,f);break;case"data":if(t!=="object"){il(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(r);break}n=dl(""+n),e.setAttribute(r,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(r,"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"&&(r==="formAction"?(t!=="input"&&Ie(e,t,"name",c.name,c,null),Ie(e,t,"formEncType",c.formEncType,c,null),Ie(e,t,"formMethod",c.formMethod,c,null),Ie(e,t,"formTarget",c.formTarget,c,null)):(Ie(e,t,"encType",c.encType,c,null),Ie(e,t,"method",c.method,c,null),Ie(e,t,"target",c.target,c,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(r);break}n=dl(""+n),e.setAttribute(r,n);break;case"onClick":n!=null&&(e.onclick=so);break;case"onScroll":n!=null&&_e("scroll",e);break;case"onScrollEnd":n!=null&&_e("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(i(61));if(r=n.__html,r!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}r=dl(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(r,""+n):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":n===!0?e.setAttribute(r,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(r,n):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(r,n):e.removeAttribute(r);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(r):e.setAttribute(r,n);break;case"popover":_e("beforetoggle",e),_e("toggle",e),ol(e,"popover",n);break;case"xlinkActuate":Lr(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Lr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Lr(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Lr(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Lr(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Lr(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":ol(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=jg.get(r)||r,ol(e,r,n))}}function Rc(e,t,r,n,c,f){switch(r){case"style":Fu(e,n,f);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(i(61));if(r=n.__html,r!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"children":typeof n=="string"?la(e,n):(typeof n=="number"||typeof n=="bigint")&&la(e,""+n);break;case"onScroll":n!=null&&_e("scroll",e);break;case"onScrollEnd":n!=null&&_e("scrollend",e);break;case"onClick":n!=null&&(e.onclick=so);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!At.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(c=r.endsWith("Capture"),t=r.slice(2,c?r.length-7:void 0),f=e[rt]||null,f=f!=null?f[r]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof n=="function")){typeof f!="function"&&f!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,n,c);break e}r in e?e[r]=n:n===!0?e.setAttribute(r,""):ol(e,r,n)}}}function Nt(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_e("error",e),_e("load",e);var n=!1,c=!1,f;for(f in r)if(r.hasOwnProperty(f)){var y=r[f];if(y!=null)switch(f){case"src":n=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ie(e,t,f,y,r,null)}}c&&Ie(e,t,"srcSet",r.srcSet,r,null),n&&Ie(e,t,"src",r.src,r,null);return;case"input":_e("invalid",e);var j=f=y=c=null,D=null,K=null;for(n in r)if(r.hasOwnProperty(n)){var ae=r[n];if(ae!=null)switch(n){case"name":c=ae;break;case"type":y=ae;break;case"checked":D=ae;break;case"defaultChecked":K=ae;break;case"value":f=ae;break;case"defaultValue":j=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,t));break;default:Ie(e,t,n,ae,r,null)}}Bu(e,f,j,D,K,y,c,!1),cl(e);return;case"select":_e("invalid",e),n=y=f=null;for(c in r)if(r.hasOwnProperty(c)&&(j=r[c],j!=null))switch(c){case"value":f=j;break;case"defaultValue":y=j;break;case"multiple":n=j;default:Ie(e,t,c,j,r,null)}t=f,r=y,e.multiple=!!n,t!=null?na(e,!!n,t,!1):r!=null&&na(e,!!n,r,!0);return;case"textarea":_e("invalid",e),f=c=n=null;for(y in r)if(r.hasOwnProperty(y)&&(j=r[y],j!=null))switch(y){case"value":n=j;break;case"defaultValue":c=j;break;case"children":f=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(i(91));break;default:Ie(e,t,y,j,r,null)}Vu(e,n,c,f),cl(e);return;case"option":for(D in r)if(r.hasOwnProperty(D)&&(n=r[D],n!=null))switch(D){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ie(e,t,D,n,r,null)}return;case"dialog":_e("beforetoggle",e),_e("toggle",e),_e("cancel",e),_e("close",e);break;case"iframe":case"object":_e("load",e);break;case"video":case"audio":for(n=0;n<Mn.length;n++)_e(Mn[n],e);break;case"image":_e("error",e),_e("load",e);break;case"details":_e("toggle",e);break;case"embed":case"source":case"link":_e("error",e),_e("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 r)if(r.hasOwnProperty(K)&&(n=r[K],n!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ie(e,t,K,n,r,null)}return;default:if(Ko(t)){for(ae in r)r.hasOwnProperty(ae)&&(n=r[ae],n!==void 0&&Rc(e,t,ae,n,r,void 0));return}}for(j in r)r.hasOwnProperty(j)&&(n=r[j],n!=null&&Ie(e,t,j,n,r,null))}function K0(e,t,r,n){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,y=null,j=null,D=null,K=null,ae=null;for(J in r){var ie=r[J];if(r.hasOwnProperty(J)&&ie!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":D=ie;default:n.hasOwnProperty(J)||Ie(e,t,J,null,n,ie)}}for(var X in n){var J=n[X];if(ie=r[X],n.hasOwnProperty(X)&&(J!=null||ie!=null))switch(X){case"type":f=J;break;case"name":c=J;break;case"checked":K=J;break;case"defaultChecked":ae=J;break;case"value":y=J;break;case"defaultValue":j=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,t));break;default:J!==ie&&Ie(e,t,X,J,n,ie)}}Fo(e,y,j,D,K,ae,f,c);return;case"select":J=y=j=X=null;for(f in r)if(D=r[f],r.hasOwnProperty(f)&&D!=null)switch(f){case"value":break;case"multiple":J=D;default:n.hasOwnProperty(f)||Ie(e,t,f,null,n,D)}for(c in n)if(f=n[c],D=r[c],n.hasOwnProperty(c)&&(f!=null||D!=null))switch(c){case"value":X=f;break;case"defaultValue":j=f;break;case"multiple":y=f;default:f!==D&&Ie(e,t,c,f,n,D)}t=j,r=y,n=J,X!=null?na(e,!!r,X,!1):!!n!=!!r&&(t!=null?na(e,!!r,t,!0):na(e,!!r,r?[]:"",!1));return;case"textarea":J=X=null;for(j in r)if(c=r[j],r.hasOwnProperty(j)&&c!=null&&!n.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Ie(e,t,j,null,n,c)}for(y in n)if(c=n[y],f=r[y],n.hasOwnProperty(y)&&(c!=null||f!=null))switch(y){case"value":X=c;break;case"defaultValue":J=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&Ie(e,t,y,c,n,f)}qu(e,X,J);return;case"option":for(var Ee in r)if(X=r[Ee],r.hasOwnProperty(Ee)&&X!=null&&!n.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:Ie(e,t,Ee,null,n,X)}for(D in n)if(X=n[D],J=r[D],n.hasOwnProperty(D)&&X!==J&&(X!=null||J!=null))switch(D){case"selected":e.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:Ie(e,t,D,X,n,J)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ne in r)X=r[Ne],r.hasOwnProperty(Ne)&&X!=null&&!n.hasOwnProperty(Ne)&&Ie(e,t,Ne,null,n,X);for(K in n)if(X=n[K],J=r[K],n.hasOwnProperty(K)&&X!==J&&(X!=null||J!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,t));break;default:Ie(e,t,K,X,n,J)}return;default:if(Ko(t)){for(var Ye in r)X=r[Ye],r.hasOwnProperty(Ye)&&X!==void 0&&!n.hasOwnProperty(Ye)&&Rc(e,t,Ye,void 0,n,X);for(ae in n)X=n[ae],J=r[ae],!n.hasOwnProperty(ae)||X===J||X===void 0&&J===void 0||Rc(e,t,ae,X,n,J);return}}for(var q in r)X=r[q],r.hasOwnProperty(q)&&X!=null&&!n.hasOwnProperty(q)&&Ie(e,t,q,null,n,X);for(ie in n)X=n[ie],J=r[ie],!n.hasOwnProperty(ie)||X===J||X==null&&J==null||Ie(e,t,ie,X,n,J)}var Mc=null,Oc=null;function ao(e){return e.nodeType===9?e:e.ownerDocument}function Fm(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 $m(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 Dc(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 Uc=null;function I0(){var e=window.event;return e&&e.type==="popstate"?e===Uc?!1:(Uc=e,!0):(Uc=null,!1)}var Km=typeof setTimeout=="function"?setTimeout:void 0,Y0=typeof clearTimeout=="function"?clearTimeout:void 0,Im=typeof Promise=="function"?Promise:void 0,X0=typeof queueMicrotask=="function"?queueMicrotask:typeof Im<"u"?function(e){return Im.resolve(null).then(e).catch(Q0)}:Km;function Q0(e){setTimeout(function(){throw e})}function Ns(e){return e==="head"}function Ym(e,t){var r=t,n=0,c=0;do{var f=r.nextSibling;if(e.removeChild(r),f&&f.nodeType===8)if(r=f.data,r==="/$"){if(0<n&&8>n){r=n;var y=e.ownerDocument;if(r&1&&Dn(y.documentElement),r&2&&Dn(y.body),r&4)for(r=y.head,Dn(r),y=r.firstChild;y;){var j=y.nextSibling,D=y.nodeName;y[Ms]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&y.rel.toLowerCase()==="stylesheet"||r.removeChild(y),y=j}}if(c===0){e.removeChild(f),qn(t);return}c--}else r==="$"||r==="$?"||r==="$!"?c++:n=r.charCodeAt(0)-48;else n=0;r=f}while(r);qn(t)}function Lc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Lc(r),er(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function J0(e,t,r,n){for(;e.nodeType===1;){var c=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Ms])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=yr(e.nextSibling),e===null)break}return null}function Z0(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=yr(e.nextSibling),e===null))return null;return e}function zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function W0(e,t){var r=e.ownerDocument;if(e.data!=="$?"||r.readyState==="complete")t();else{var n=function(){t(),r.removeEventListener("DOMContentLoaded",n)};r.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function yr(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 Pc=null;function Xm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}function Qm(e,t,r){switch(t=ao(r),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 Dn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);er(e)}var cr=new Map,Jm=new Set;function no(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Xr=C.d;C.d={f:ex,r:tx,D:rx,C:sx,L:ax,m:nx,X:ox,S:lx,M:ix};function ex(){var e=Xr.f(),t=Ql();return e||t}function tx(e){var t=Lt(e);t!==null&&t.tag===5&&t.type==="form"?xf(t):Xr.r(e)}var La=typeof document>"u"?null:document;function Zm(e,t,r){var n=La;if(n&&typeof t=="string"&&t){var c=rr(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),Jm.has(c)||(Jm.add(c),e={rel:e,crossOrigin:r,href:t},n.querySelector(c)===null&&(t=n.createElement("link"),Nt(t,"link",e),Te(t),n.head.appendChild(t)))}}function rx(e){Xr.D(e),Zm("dns-prefetch",e,null)}function sx(e,t){Xr.C(e,t),Zm("preconnect",e,t)}function ax(e,t,r){Xr.L(e,t,r);var n=La;if(n&&e&&t){var c='link[rel="preload"][as="'+rr(t)+'"]';t==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+rr(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+rr(r.imageSizes)+'"]')):c+='[href="'+rr(e)+'"]';var f=c;switch(t){case"style":f=za(e);break;case"script":f=Pa(e)}cr.has(f)||(e=x({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),cr.set(f,e),n.querySelector(c)!==null||t==="style"&&n.querySelector(Un(f))||t==="script"&&n.querySelector(Ln(f))||(t=n.createElement("link"),Nt(t,"link",e),Te(t),n.head.appendChild(t)))}}function nx(e,t){Xr.m(e,t);var r=La;if(r&&e){var n=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+rr(n)+'"][href="'+rr(e)+'"]',f=c;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Pa(e)}if(!cr.has(f)&&(e=x({rel:"modulepreload",href:e},t),cr.set(f,e),r.querySelector(c)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ln(f)))return}n=r.createElement("link"),Nt(n,"link",e),Te(n),r.head.appendChild(n)}}}function lx(e,t,r){Xr.S(e,t,r);var n=La;if(n&&e){var c=Oe(n).hoistableStyles,f=za(e);t=t||"default";var y=c.get(f);if(!y){var j={loading:0,preload:null};if(y=n.querySelector(Un(f)))j.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},r),(r=cr.get(f))&&_c(e,r);var D=y=n.createElement("link");Te(D),Nt(D,"link",e),D._p=new Promise(function(K,ae){D.onload=K,D.onerror=ae}),D.addEventListener("load",function(){j.loading|=1}),D.addEventListener("error",function(){j.loading|=2}),j.loading|=4,lo(y,t,n)}y={type:"stylesheet",instance:y,count:1,state:j},c.set(f,y)}}}function ox(e,t){Xr.X(e,t);var r=La;if(r&&e){var n=Oe(r).hoistableScripts,c=Pa(e),f=n.get(c);f||(f=r.querySelector(Ln(c)),f||(e=x({src:e,async:!0},t),(t=cr.get(c))&&Hc(e,t),f=r.createElement("script"),Te(f),Nt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},n.set(c,f))}}function ix(e,t){Xr.M(e,t);var r=La;if(r&&e){var n=Oe(r).hoistableScripts,c=Pa(e),f=n.get(c);f||(f=r.querySelector(Ln(c)),f||(e=x({src:e,async:!0,type:"module"},t),(t=cr.get(c))&&Hc(e,t),f=r.createElement("script"),Te(f),Nt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},n.set(c,f))}}function Wm(e,t,r,n){var c=(c=ee.current)?no(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=za(r.href),r=Oe(c).hoistableStyles,n=r.get(t),n||(n={type:"style",instance:null,count:0,state:null},r.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=za(r.href);var f=Oe(c).hoistableStyles,y=f.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=c.querySelector(Un(e)))&&!f._p&&(y.instance=f,y.state.loading=5),cr.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},cr.set(e,r),f||cx(c,e,r,y.state))),t&&n===null)throw Error(i(528,""));return y}if(t&&n!==null)throw Error(i(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Pa(r),r=Oe(c).hoistableScripts,n=r.get(t),n||(n={type:"script",instance:null,count:0,state:null},r.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function za(e){return'href="'+rr(e)+'"'}function Un(e){return'link[rel="stylesheet"]['+e+"]"}function eh(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function cx(e,t,r,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Nt(t,"link",r),Te(t),e.head.appendChild(t))}function Pa(e){return'[src="'+rr(e)+'"]'}function Ln(e){return"script[async]"+e}function th(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+rr(r.href)+'"]');if(n)return t.instance=n,Te(n),n;var c=x({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Te(n),Nt(n,"style",c),lo(n,r.precedence,e),t.instance=n;case"stylesheet":c=za(r.href);var f=e.querySelector(Un(c));if(f)return t.state.loading|=4,t.instance=f,Te(f),f;n=eh(r),(c=cr.get(c))&&_c(n,c),f=(e.ownerDocument||e).createElement("link"),Te(f);var y=f;return y._p=new Promise(function(j,D){y.onload=j,y.onerror=D}),Nt(f,"link",n),t.state.loading|=4,lo(f,r.precedence,e),t.instance=f;case"script":return f=Pa(r.src),(c=e.querySelector(Ln(f)))?(t.instance=c,Te(c),c):(n=r,(c=cr.get(f))&&(n=x({},r),Hc(n,c)),e=e.ownerDocument||e,c=e.createElement("script"),Te(c),Nt(c,"link",n),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&&(n=t.instance,t.state.loading|=4,lo(n,r.precedence,e));return t.instance}function lo(e,t,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=n.length?n[n.length-1]:null,f=c,y=0;y<n.length;y++){var j=n[y];if(j.dataset.precedence===t)f=j;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function _c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var oo=null;function rh(e,t,r){if(oo===null){var n=new Map,c=oo=new Map;c.set(r,n)}else c=oo,n=c.get(r),n||(n=new Map,c.set(r,n));if(n.has(e))return n;for(n.set(e,null),r=r.getElementsByTagName(e),c=0;c<r.length;c++){var f=r[c];if(!(f[Ms]||f[tt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(t)||"";y=e+y;var j=n.get(y);j?j.push(f):n.set(y,[f])}}return n}function sh(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function ux(e,t,r){if(r===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 zn=null;function dx(){}function fx(e,t,r){if(zn===null)throw Error(i(475));var n=zn;if(t.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var c=za(r.href),f=e.querySelector(Un(c));if(f){e=f._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=io.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=f,Te(f);return}f=e.ownerDocument||e,r=eh(r),(c=cr.get(c))&&_c(r,c),f=f.createElement("link"),Te(f);var y=f;y._p=new Promise(function(j,D){y.onload=j,y.onerror=D}),Nt(f,"link",r),t.instance=f}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(n.count++,t=io.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}function mx(){if(zn===null)throw Error(i(475));var e=zn;return e.stylesheets&&e.count===0&&Bc(e,e.stylesheets),0<e.count?function(t){var r=setTimeout(function(){if(e.stylesheets&&Bc(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(r)}}:null}function io(){if(this.count--,this.count===0){if(this.stylesheets)Bc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var co=null;function Bc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,co=new Map,t.forEach(hx,e),co=null,io.call(e))}function hx(e,t){if(!(t.state.loading&4)){var r=co.get(e);if(r)var n=r.get(null);else{r=new Map,co.set(e,r);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var y=c[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(r.set(y.dataset.precedence,y),n=y)}n&&r.set(null,n)}c=t.instance,y=c.getAttribute("data-precedence"),f=r.get(y)||n,f===n&&r.set(null,c),r.set(y,c),this.count++,n=io.bind(this),c.addEventListener("load",n),c.addEventListener("error",n),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Pn={$$typeof:M,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function px(e,t,r,n,c,f,y,j){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=he(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=he(0),this.hiddenUpdates=he(null),this.identifierPrefix=n,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function nh(e,t,r,n,c,f,y,j,D,K,ae,ie){return e=new px(e,t,r,y,j,D,K,ie),t=1,f===!0&&(t|=24),f=Vt(3,null,null,t),e.current=f,f.stateNode=e,t=ji(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:n,isDehydrated:r,cache:t},Ci(f),e}function lh(e){return e?(e=ha,e):ha}function oh(e,t,r,n,c,f){c=lh(c),n.context===null?n.context=c:n.pendingContext=c,n=us(t),n.payload={element:r},f=f===void 0?null:f,f!==null&&(n.callback=f),r=ds(e,n,t),r!==null&&(It(r,e,t),mn(r,e,t))}function ih(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function qc(e,t){ih(e,t),(e=e.alternate)&&ih(e,t)}function ch(e){if(e.tag===13){var t=ma(e,67108864);t!==null&&It(t,e,67108864),qc(e,67108864)}}var uo=!0;function gx(e,t,r,n){var c=b.T;b.T=null;var f=C.p;try{C.p=2,Vc(e,t,r,n)}finally{C.p=f,b.T=c}}function xx(e,t,r,n){var c=b.T;b.T=null;var f=C.p;try{C.p=8,Vc(e,t,r,n)}finally{C.p=f,b.T=c}}function Vc(e,t,r,n){if(uo){var c=Gc(n);if(c===null)Tc(e,t,n,fo,r),dh(e,n);else if(vx(c,e,t,r,n))n.stopPropagation();else if(dh(e,n),t&4&&-1<yx.indexOf(e)){for(;c!==null;){var f=Lt(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=Zt(f.pendingLanes);if(y!==0){var j=f;for(j.pendingLanes|=2,j.entangledLanes|=2;y;){var D=1<<31-mt(y);j.entanglements[1]|=D,y&=~D}Tr(f),(Fe&6)===0&&(Yl=ze()+500,Rn(0))}}break;case 13:j=ma(f,2),j!==null&&It(j,f,2),Ql(),qc(f,2)}if(f=Gc(n),f===null&&Tc(e,t,n,fo,r),f===c)break;c=f}c!==null&&n.stopPropagation()}else Tc(e,t,n,null,r)}}function Gc(e){return e=Yo(e),Fc(e)}var fo=null;function Fc(e){if(fo=null,e=ls(e),e!==null){var t=d(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=m(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fo=e,null}function uh(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(Et()){case br:return 2;case Yt:return 8;case Xt:case Qt:return 32;case rs:return 268435456;default:return 32}default:return 32}}var $c=!1,Ss=null,Cs=null,Es=null,_n=new Map,Hn=new Map,ks=[],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 dh(e,t){switch(e){case"focusin":case"focusout":Ss=null;break;case"dragenter":case"dragleave":Cs=null;break;case"mouseover":case"mouseout":Es=null;break;case"pointerover":case"pointerout":_n.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hn.delete(t.pointerId)}}function Bn(e,t,r,n,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Lt(t),t!==null&&ch(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function vx(e,t,r,n,c){switch(t){case"focusin":return Ss=Bn(Ss,e,t,r,n,c),!0;case"dragenter":return Cs=Bn(Cs,e,t,r,n,c),!0;case"mouseover":return Es=Bn(Es,e,t,r,n,c),!0;case"pointerover":var f=c.pointerId;return _n.set(f,Bn(_n.get(f)||null,e,t,r,n,c)),!0;case"gotpointercapture":return f=c.pointerId,Hn.set(f,Bn(Hn.get(f)||null,e,t,r,n,c)),!0}return!1}function fh(e){var t=ls(e.target);if(t!==null){var r=d(t);if(r!==null){if(t=r.tag,t===13){if(t=m(r),t!==null){e.blockedOn=t,Je(e.priority,function(){if(r.tag===13){var n=Kt();n=ns(n);var c=ma(r,n);c!==null&&It(c,r,n),qc(r,n)}});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Gc(e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Io=n,r.target.dispatchEvent(n),Io=null}else return t=Lt(r),t!==null&&ch(t),e.blockedOn=r,!1;t.shift()}return!0}function mh(e,t,r){mo(e)&&r.delete(t)}function bx(){$c=!1,Ss!==null&&mo(Ss)&&(Ss=null),Cs!==null&&mo(Cs)&&(Cs=null),Es!==null&&mo(Es)&&(Es=null),_n.forEach(mh),Hn.forEach(mh)}function ho(e,t){e.blockedOn===t&&(e.blockedOn=null,$c||($c=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,bx)))}var po=null;function hh(e){po!==e&&(po=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){po===e&&(po=null);for(var t=0;t<e.length;t+=3){var r=e[t],n=e[t+1],c=e[t+2];if(typeof n!="function"){if(Fc(n||r)===null)continue;break}var f=Lt(r);f!==null&&(e.splice(t,3),t-=3,Fi(f,{pending:!0,data:c,method:r.method,action:n},n,c))}}))}function qn(e){function t(D){return ho(D,e)}Ss!==null&&ho(Ss,e),Cs!==null&&ho(Cs,e),Es!==null&&ho(Es,e),_n.forEach(t),Hn.forEach(t);for(var r=0;r<ks.length;r++){var n=ks[r];n.blockedOn===e&&(n.blockedOn=null)}for(;0<ks.length&&(r=ks[0],r.blockedOn===null);)fh(r),r.blockedOn===null&&ks.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(n=0;n<r.length;n+=3){var c=r[n],f=r[n+1],y=c[rt]||null;if(typeof f=="function")y||hh(r);else if(y){var j=null;if(f&&f.hasAttribute("formAction")){if(c=f,y=f[rt]||null)j=y.formAction;else if(Fc(c)!==null)continue}else j=y.action;typeof j=="function"?r[n+1]=j:(r.splice(n,3),n-=3),hh(r)}}}function Kc(e){this._internalRoot=e}go.prototype.render=Kc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var r=t.current,n=Kt();oh(r,n,e,t,null,null)},go.prototype.unmount=Kc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oh(e.current,2,null,e,null,null),Ql(),t[Wt]=null}};function go(e){this._internalRoot=e}go.prototype.unstable_scheduleHydration=function(e){if(e){var t=pr();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ks.length&&t!==0&&t<ks[r].priority;r++);ks.splice(r,0,e),r===0&&fh(e)}};var ph=l.version;if(ph!=="19.1.1")throw Error(i(527,ph,"19.1.1"));C.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=p(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var jx={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:b,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xo.isDisabled&&xo.supportsFiber)try{Jt=xo.inject(jx),ft=xo}catch{}}return Gn.createRoot=function(e,t){if(!u(e))throw Error(i(299));var r=!1,n="",c=Mf,f=Of,y=Df,j=null;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(j=t.unstable_transitionCallbacks)),t=nh(e,1,!1,null,null,r,n,c,f,y,j,null),e[Wt]=t.current,Ac(e),new Kc(t)},Gn.hydrateRoot=function(e,t,r){if(!u(e))throw Error(i(299));var n=!1,c="",f=Mf,y=Of,j=Df,D=null,K=null;return r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(j=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(D=r.unstable_transitionCallbacks),r.formState!==void 0&&(K=r.formState)),t=nh(e,1,!0,t,r??null,n,c,f,y,j,D,K),t.context=lh(null),r=t.current,n=Kt(),n=ns(n),c=us(n),c.callback=null,ds(r,c,n),r=n,t.current.lanes=r,kt(t,r),Tr(t),e[Wt]=t.current,Ac(e),new go(t)},Gn.version="19.1.1",Gn}var Ch;function Mx(){if(Ch)return Xc.exports;Ch=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Xc.exports=Rx(),Xc.exports}var Ox=Mx();const Eh=ip(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 kh="popstate";function Dx(a={}){function l(i,u){let{pathname:d,search:m,hash:h}=i.location;return au("",{pathname:d,search:m,hash:h},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function o(i,u){return typeof u=="string"?u:Qn(u)}return Lx(l,o,null,a)}function et(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function ur(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Ux(){return Math.random().toString(36).substring(2,10)}function Ah(a,l){return{usr:a.state,key:a.key,idx:l}}function au(a,l,o=null,i){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?Ga(l):l,state:o,key:l&&l.key||i||Ux()}}function Qn({pathname:a="/",search:l="",hash:o=""}){return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Ga(a){let l={};if(a){let o=a.indexOf("#");o>=0&&(l.hash=a.substring(o),a=a.substring(0,o));let i=a.indexOf("?");i>=0&&(l.search=a.substring(i),a=a.substring(0,i)),a&&(l.pathname=a)}return l}function Lx(a,l,o,i={}){let{window:u=document.defaultView,v5Compat:d=!1}=i,m=u.history,h="POP",p=null,g=x();g==null&&(g=0,m.replaceState({...m.state,idx:g},""));function x(){return(m.state||{idx:null}).idx}function w(){h="POP";let O=x(),R=O==null?null:O-g;g=O,p&&p({action:h,location:A.location,delta:R})}function k(O,R){h="PUSH";let N=au(A.location,O,R);g=x()+1;let M=Ah(N,g),G=A.createHref(N);try{m.pushState(M,"",G)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;u.location.assign(G)}d&&p&&p({action:h,location:A.location,delta:1})}function T(O,R){h="REPLACE";let N=au(A.location,O,R);g=x();let M=Ah(N,g),G=A.createHref(N);m.replaceState(M,"",G),d&&p&&p({action:h,location:A.location,delta:0})}function E(O){return zx(O)}let A={get action(){return h},get location(){return a(u,m)},listen(O){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(kh,w),p=O,()=>{u.removeEventListener(kh,w),p=null}},createHref(O){return l(u,O)},createURL:E,encodeLocation(O){let R=E(O);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:k,replace:T,go(O){return m.go(O)}};return A}function zx(a,l=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),et(o,"No window.location.(origin|href) available to create URL");let i=typeof a=="string"?a:Qn(a);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=o+i),new URL(i,o)}function cp(a,l,o="/"){return Px(a,l,o,!1)}function Px(a,l,o,i){let u=typeof l=="string"?Ga(l):l,d=Wr(u.pathname||"/",o);if(d==null)return null;let m=up(a);_x(m);let h=null;for(let p=0;h==null&&p<m.length;++p){let g=Xx(d);h=Ix(m[p],g,i)}return h}function up(a,l=[],o=[],i="",u=!1){let d=(m,h,p=u,g)=>{let x={relativePath:g===void 0?m.path||"":g,caseSensitive:m.caseSensitive===!0,childrenIndex:h,route:m};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(i)&&p)return;et(x.relativePath.startsWith(i),`Absolute route path "${x.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(i.length)}let w=Jr([i,x.relativePath]),k=o.concat(x);m.children&&m.children.length>0&&(et(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${w}".`),up(m.children,l,k,w,p)),!(m.path==null&&!m.index)&&l.push({path:w,score:$x(w,m.index),routesMeta:k})};return a.forEach((m,h)=>{var p;if(m.path===""||!((p=m.path)!=null&&p.includes("?")))d(m,h);else for(let g of dp(m.path))d(m,h,!0,g)}),l}function dp(a){let l=a.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=dp(i.join("/")),h=[];return h.push(...m.map(p=>p===""?d:[d,p].join("/"))),u&&h.push(...m),h.map(p=>a.startsWith("/")&&p===""?"/":p)}function _x(a){a.sort((l,o)=>l.score!==o.score?o.score-l.score:Kx(l.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var Hx=/^:[\w-]+$/,Bx=3,qx=2,Vx=1,Gx=10,Fx=-2,Th=a=>a==="*";function $x(a,l){let o=a.split("/"),i=o.length;return o.some(Th)&&(i+=Fx),l&&(i+=qx),o.filter(u=>!Th(u)).reduce((u,d)=>u+(Hx.test(d)?Bx:d===""?Vx:Gx),i)}function Kx(a,l){return a.length===l.length&&a.slice(0,-1).every((i,u)=>i===l[u])?a[a.length-1]-l[l.length-1]:0}function Ix(a,l,o=!1){let{routesMeta:i}=a,u={},d="/",m=[];for(let h=0;h<i.length;++h){let p=i[h],g=h===i.length-1,x=d==="/"?l:l.slice(d.length)||"/",w=ko({path:p.relativePath,caseSensitive:p.caseSensitive,end:g},x),k=p.route;if(!w&&g&&o&&!i[i.length-1].route.index&&(w=ko({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!w)return null;Object.assign(u,w.params),m.push({params:u,pathname:Jr([d,w.pathname]),pathnameBase:Wx(Jr([d,w.pathnameBase])),route:k}),w.pathnameBase!=="/"&&(d=Jr([d,w.pathnameBase]))}return m}function ko(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=Yx(a.path,a.caseSensitive,a.end),u=l.match(o);if(!u)return null;let d=u[0],m=d.replace(/(.)\/+$/,"$1"),h=u.slice(1);return{params:i.reduce((g,{paramName:x,isOptional:w},k)=>{if(x==="*"){let E=h[k]||"";m=d.slice(0,d.length-E.length).replace(/(.)\/+$/,"$1")}const T=h[k];return w&&!T?g[x]=void 0:g[x]=(T||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:m,pattern:a}}function Yx(a,l=!1,o=!0){ur(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let i=[],u="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,h,p)=>(i.push({paramName:h,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),u+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?u+="\\/*$":a!==""&&a!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),i]}function Xx(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return ur(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),a}}function Wr(a,l){if(l==="/")return a;if(!a.toLowerCase().startsWith(l.toLowerCase()))return null;let o=l.endsWith("/")?l.length-1:l.length,i=a.charAt(o);return i&&i!=="/"?null:a.slice(o)||"/"}function Qx(a,l="/"){let{pathname:o,search:i="",hash:u=""}=typeof a=="string"?Ga(a):a;return{pathname:o?o.startsWith("/")?o:Jx(o,l):l,search:ey(i),hash:ty(u)}}function Jx(a,l){let o=l.replace(/\/+$/,"").split("/");return a.split("/").forEach(u=>{u===".."?o.length>1&&o.pop():u!=="."&&o.push(u)}),o.length>1?o.join("/"):"/"}function Wc(a,l,o,i){return`Cannot include a '${a}' 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(a){return a.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function xu(a){let l=Zx(a);return l.map((o,i)=>i===l.length-1?o.pathname:o.pathnameBase)}function yu(a,l,o,i=!1){let u;typeof a=="string"?u=Ga(a):(u={...a},et(!u.pathname||!u.pathname.includes("?"),Wc("?","pathname","search",u)),et(!u.pathname||!u.pathname.includes("#"),Wc("#","pathname","hash",u)),et(!u.search||!u.search.includes("#"),Wc("#","search","hash",u)));let d=a===""||u.pathname==="",m=d?"/":u.pathname,h;if(m==null)h=o;else{let w=l.length-1;if(!i&&m.startsWith("..")){let k=m.split("/");for(;k[0]==="..";)k.shift(),w-=1;u.pathname=k.join("/")}h=w>=0?l[w]:"/"}let p=Qx(u,h),g=m&&m!=="/"&&m.endsWith("/"),x=(d||m===".")&&o.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var Jr=a=>a.join("/").replace(/\/\/+/g,"/"),Wx=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),ey=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,ty=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;function ry(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}var fp=["POST","PUT","PATCH","DELETE"];new Set(fp);var sy=["GET",...fp];new Set(sy);var Fa=v.createContext(null);Fa.displayName="DataRouter";var Uo=v.createContext(null);Uo.displayName="DataRouterState";v.createContext(!1);var mp=v.createContext({isTransitioning:!1});mp.displayName="ViewTransition";var ay=v.createContext(new Map);ay.displayName="Fetchers";var ny=v.createContext(null);ny.displayName="Await";var vr=v.createContext(null);vr.displayName="Navigation";var tl=v.createContext(null);tl.displayName="Location";var dr=v.createContext({outlet:null,matches:[],isDataRoute:!1});dr.displayName="Route";var vu=v.createContext(null);vu.displayName="RouteError";function ly(a,{relative:l}={}){et($a(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=v.useContext(vr),{hash:u,pathname:d,search:m}=rl(a,{relative:l}),h=d;return o!=="/"&&(h=d==="/"?o:Jr([o,d])),i.createHref({pathname:h,search:m,hash:u})}function $a(){return v.useContext(tl)!=null}function es(){return et($a(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(tl).location}var hp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pp(a){v.useContext(vr).static||v.useLayoutEffect(a)}function ts(){let{isDataRoute:a}=v.useContext(dr);return a?jy():oy()}function oy(){et($a(),"useNavigate() may be used only in the context of a <Router> component.");let a=v.useContext(Fa),{basename:l,navigator:o}=v.useContext(vr),{matches:i}=v.useContext(dr),{pathname:u}=es(),d=JSON.stringify(xu(i)),m=v.useRef(!1);return pp(()=>{m.current=!0}),v.useCallback((p,g={})=>{if(ur(m.current,hp),!m.current)return;if(typeof p=="number"){o.go(p);return}let x=yu(p,JSON.parse(d),u,g.relative==="path");a==null&&l!=="/"&&(x.pathname=x.pathname==="/"?l:Jr([l,x.pathname])),(g.replace?o.replace:o.push)(x,g.state,g)},[l,o,d,u,a])}var iy=v.createContext(null);function cy(a){let l=v.useContext(dr).outlet;return l&&v.createElement(iy.Provider,{value:a},l)}function gp(){let{matches:a}=v.useContext(dr),l=a[a.length-1];return l?l.params:{}}function rl(a,{relative:l}={}){let{matches:o}=v.useContext(dr),{pathname:i}=es(),u=JSON.stringify(xu(o));return v.useMemo(()=>yu(a,JSON.parse(u),i,l==="path"),[a,u,i,l])}function uy(a,l){return xp(a,l)}function xp(a,l,o,i,u){var N;et($a(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=v.useContext(vr),{matches:m}=v.useContext(dr),h=m[m.length-1],p=h?h.params:{},g=h?h.pathname:"/",x=h?h.pathnameBase:"/",w=h&&h.route;{let M=w&&w.path||"";yp(g,!w||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${M}">) 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="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let k=es(),T;if(l){let M=typeof l=="string"?Ga(l):l;et(x==="/"||((N=M.pathname)==null?void 0:N.startsWith(x)),`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 "${x}" but pathname "${M.pathname}" was given in the \`location\` prop.`),T=M}else T=k;let E=T.pathname||"/",A=E;if(x!=="/"){let M=x.replace(/^\//,"").split("/");A="/"+E.replace(/^\//,"").split("/").slice(M.length).join("/")}let O=cp(a,{pathname:A});ur(w||O!=null,`No routes matched location "${T.pathname}${T.search}${T.hash}" `),ur(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${T.pathname}${T.search}${T.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=py(O&&O.map(M=>Object.assign({},M,{params:Object.assign({},p,M.params),pathname:Jr([x,d.encodeLocation?d.encodeLocation(M.pathname).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?x:Jr([x,d.encodeLocation?d.encodeLocation(M.pathnameBase).pathname:M.pathnameBase])})),m,o,i,u);return l&&R?v.createElement(tl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...T},navigationType:"POP"}},R):R}function dy(){let a=by(),l=ry(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),o=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},d={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",a),m=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:d},"ErrorBoundary")," or"," ",v.createElement("code",{style:d},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},l),o?v.createElement("pre",{style:u},o):null,m)}var fy=v.createElement(dy,null),my=class extends v.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){this.props.unstable_onError?this.props.unstable_onError(a,l):console.error("React Router caught the following error during render",a)}render(){return this.state.error!==void 0?v.createElement(dr.Provider,{value:this.props.routeContext},v.createElement(vu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function hy({routeContext:a,match:l,children:o}){let i=v.useContext(Fa);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),v.createElement(dr.Provider,{value:a},o)}function py(a,l=[],o=null,i=null,u=null){if(a==null){if(!o)return null;if(o.errors)a=o.matches;else if(l.length===0&&!o.initialized&&o.matches.length>0)a=o.matches;else return null}let d=a,m=o==null?void 0:o.errors;if(m!=null){let g=d.findIndex(x=>x.route.id&&(m==null?void 0:m[x.route.id])!==void 0);et(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),d=d.slice(0,Math.min(d.length,g+1))}let h=!1,p=-1;if(o)for(let g=0;g<d.length;g++){let x=d[g];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(p=g),x.route.id){let{loaderData:w,errors:k}=o,T=x.route.loader&&!w.hasOwnProperty(x.route.id)&&(!k||k[x.route.id]===void 0);if(x.route.lazy||T){h=!0,p>=0?d=d.slice(0,p+1):d=[d[0]];break}}}return d.reduceRight((g,x,w)=>{let k,T=!1,E=null,A=null;o&&(k=m&&x.route.id?m[x.route.id]:void 0,E=x.route.errorElement||fy,h&&(p<0&&w===0?(yp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,A=null):p===w&&(T=!0,A=x.route.hydrateFallbackElement||null)));let O=l.concat(d.slice(0,w+1)),R=()=>{let N;return k?N=E:T?N=A:x.route.Component?N=v.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=g,v.createElement(hy,{match:x,routeContext:{outlet:g,matches:O,isDataRoute:o!=null},children:N})};return o&&(x.route.ErrorBoundary||x.route.errorElement||w===0)?v.createElement(my,{location:o.location,revalidation:o.revalidation,component:E,error:k,children:R(),routeContext:{outlet:null,matches:O,isDataRoute:!0},unstable_onError:i}):R()},null)}function bu(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gy(a){let l=v.useContext(Fa);return et(l,bu(a)),l}function xy(a){let l=v.useContext(Uo);return et(l,bu(a)),l}function yy(a){let l=v.useContext(dr);return et(l,bu(a)),l}function ju(a){let l=yy(a),o=l.matches[l.matches.length-1];return et(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function vy(){return ju("useRouteId")}function by(){var i;let a=v.useContext(vu),l=xy("useRouteError"),o=ju("useRouteError");return a!==void 0?a:(i=l.errors)==null?void 0:i[o]}function jy(){let{router:a}=gy("useNavigate"),l=ju("useNavigate"),o=v.useRef(!1);return pp(()=>{o.current=!0}),v.useCallback(async(u,d={})=>{ur(o.current,hp),o.current&&(typeof u=="number"?a.navigate(u):await a.navigate(u,{fromRouteId:l,...d}))},[a,l])}var Rh={};function yp(a,l,o){!l&&!Rh[a]&&(Rh[a]=!0,ur(!1,o))}v.memo(wy);function wy({routes:a,future:l,state:o,unstable_onError:i}){return xp(a,void 0,o,i,l)}function Ao({to:a,replace:l,state:o,relative:i}){et($a(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=v.useContext(vr);ur(!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}=v.useContext(dr),{pathname:m}=es(),h=ts(),p=yu(a,xu(d),m,i==="path"),g=JSON.stringify(p);return v.useEffect(()=>{h(JSON.parse(g),{replace:l,state:o,relative:i})},[h,g,i,l,o]),null}function vp(a){return cy(a.context)}function Ut(a){et(!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:a="/",children:l=null,location:o,navigationType:i="POP",navigator:u,static:d=!1}){et(!$a(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),h=v.useMemo(()=>({basename:m,navigator:u,static:d,future:{}}),[m,u,d]);typeof o=="string"&&(o=Ga(o));let{pathname:p="/",search:g="",hash:x="",state:w=null,key:k="default"}=o,T=v.useMemo(()=>{let E=Wr(p,m);return E==null?null:{location:{pathname:E,search:g,hash:x,state:w,key:k},navigationType:i}},[m,p,g,x,w,k,i]);return ur(T!=null,`<Router basename="${m}"> is not able to match the URL "${p}${g}${x}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:v.createElement(vr.Provider,{value:h},v.createElement(tl.Provider,{children:l,value:T}))}function Sy({children:a,location:l}){return uy(nu(a),l)}function nu(a,l=[]){let o=[];return v.Children.forEach(a,(i,u)=>{if(!v.isValidElement(i))return;let d=[...l,u];if(i.type===v.Fragment){o.push.apply(o,nu(i.props.children,d));return}et(i.type===Ut,`[${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>`),et(!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=nu(i.props.children,d)),o.push(m)}),o}var So="get",Co="application/x-www-form-urlencoded";function Lo(a){return a!=null&&typeof a.tagName=="string"}function Cy(a){return Lo(a)&&a.tagName.toLowerCase()==="button"}function Ey(a){return Lo(a)&&a.tagName.toLowerCase()==="form"}function ky(a){return Lo(a)&&a.tagName.toLowerCase()==="input"}function Ay(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function Ty(a,l){return a.button===0&&(!l||l==="_self")&&!Ay(a)}function lu(a=""){return new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((l,o)=>{let i=a[o];return l.concat(Array.isArray(i)?i.map(u=>[o,u]):[[o,i]])},[]))}function Ry(a,l){let o=lu(a);return l&&l.forEach((i,u)=>{o.has(u)||l.getAll(u).forEach(d=>{o.append(u,d)})}),o}var yo=null;function My(){if(yo===null)try{new FormData(document.createElement("form"),0),yo=!1}catch{yo=!0}return yo}var Oy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function eu(a){return a!=null&&!Oy.has(a)?(ur(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Co}"`),null):a}function Dy(a,l){let o,i,u,d,m;if(Ey(a)){let h=a.getAttribute("action");i=h?Wr(h,l):null,o=a.getAttribute("method")||So,u=eu(a.getAttribute("enctype"))||Co,d=new FormData(a)}else if(Cy(a)||ky(a)&&(a.type==="submit"||a.type==="image")){let h=a.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=a.getAttribute("formaction")||h.getAttribute("action");if(i=p?Wr(p,l):null,o=a.getAttribute("formmethod")||h.getAttribute("method")||So,u=eu(a.getAttribute("formenctype"))||eu(h.getAttribute("enctype"))||Co,d=new FormData(h,a),!My()){let{name:g,type:x,value:w}=a;if(x==="image"){let k=g?`${g}.`:"";d.append(`${k}x`,"0"),d.append(`${k}y`,"0")}else g&&d.append(g,w)}}else{if(Lo(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=So,i=null,u=Co,m=a}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 wu(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function Uy(a,l,o){let i=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return i.pathname==="/"?i.pathname=`_root.${o}`:l&&Wr(i.pathname,l)==="/"?i.pathname=`${l.replace(/\/$/,"")}/_root.${o}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${o}`,i}async function Ly(a,l){if(a.id in l)return l[a.id];try{let o=await import(a.module);return l[a.id]=o,o}catch(o){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function zy(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function Py(a,l,o){let i=await Promise.all(a.map(async u=>{let d=l.routes[u.route.id];if(d){let m=await Ly(d,o);return m.links?m.links():[]}return[]}));return qy(i.flat(1).filter(zy).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Mh(a,l,o,i,u,d){let m=(p,g)=>o[g]?p.route.id!==o[g].route.id:!0,h=(p,g)=>{var x;return o[g].pathname!==p.pathname||((x=o[g].route.path)==null?void 0:x.endsWith("*"))&&o[g].params["*"]!==p.params["*"]};return d==="assets"?l.filter((p,g)=>m(p,g)||h(p,g)):d==="data"?l.filter((p,g)=>{var w;let x=i.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(m(p,g)||h(p,g))return!0;if(p.route.shouldRevalidate){let k=p.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((w=o[0])==null?void 0:w.params)||{},nextUrl:new URL(a,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof k=="boolean")return k}return!0}):[]}function _y(a,l,{includeHydrateFallback:o}={}){return Hy(a.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(a){return[...new Set(a)]}function By(a){let l={},o=Object.keys(a).sort();for(let i of o)l[i]=a[i];return l}function qy(a,l){let o=new Set;return new Set(l),a.reduce((i,u)=>{let d=JSON.stringify(By(u));return o.has(d)||(o.add(d),i.push({key:d,link:u})),i},[])}function bp(){let a=v.useContext(Fa);return wu(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function Vy(){let a=v.useContext(Uo);return wu(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Nu=v.createContext(void 0);Nu.displayName="FrameworkContext";function jp(){let a=v.useContext(Nu);return wu(a,"You must render this element inside a <HydratedRouter> element"),a}function Gy(a,l){let o=v.useContext(Nu),[i,u]=v.useState(!1),[d,m]=v.useState(!1),{onFocus:h,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:w}=l,k=v.useRef(null);v.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let A=R=>{R.forEach(N=>{m(N.isIntersecting)})},O=new IntersectionObserver(A,{threshold:.5});return k.current&&O.observe(k.current),()=>{O.disconnect()}}},[a]),v.useEffect(()=>{if(i){let A=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(A)}}},[i]);let T=()=>{u(!0)},E=()=>{u(!1),m(!1)};return o?a!=="intent"?[d,k,{}]:[d,k,{onFocus:Fn(h,T),onBlur:Fn(p,E),onMouseEnter:Fn(g,T),onMouseLeave:Fn(x,E),onTouchStart:Fn(w,T)}]:[!1,k,{}]}function Fn(a,l){return o=>{a&&a(o),o.defaultPrevented||l(o)}}function Fy({page:a,...l}){let{router:o}=bp(),i=v.useMemo(()=>cp(o.routes,a,o.basename),[o.routes,a,o.basename]);return i?v.createElement(Ky,{page:a,matches:i,...l}):null}function $y(a){let{manifest:l,routeModules:o}=jp(),[i,u]=v.useState([]);return v.useEffect(()=>{let d=!1;return Py(a,l,o).then(m=>{d||u(m)}),()=>{d=!0}},[a,l,o]),i}function Ky({page:a,matches:l,...o}){let i=es(),{manifest:u,routeModules:d}=jp(),{basename:m}=bp(),{loaderData:h,matches:p}=Vy(),g=v.useMemo(()=>Mh(a,l,p,u,i,"data"),[a,l,p,u,i]),x=v.useMemo(()=>Mh(a,l,p,u,i,"assets"),[a,l,p,u,i]),w=v.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,A=!1;if(l.forEach(R=>{var M;let N=u.routes[R.route.id];!N||!N.hasLoader||(!g.some(G=>G.route.id===R.route.id)&&R.route.id in h&&((M=d[R.route.id])!=null&&M.shouldRevalidate)||N.hasClientLoader?A=!0:E.add(R.route.id))}),E.size===0)return[];let O=Uy(a,m,"data");return A&&E.size>0&&O.searchParams.set("_routes",l.filter(R=>E.has(R.route.id)).map(R=>R.route.id).join(",")),[O.pathname+O.search]},[m,h,i,u,g,l,a,d]),k=v.useMemo(()=>_y(x,u),[x,u]),T=$y(x);return v.createElement(v.Fragment,null,w.map(E=>v.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),k.map(E=>v.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),T.map(({key:E,link:A})=>v.createElement("link",{key:E,nonce:o.nonce,...A})))}function Iy(...a){return l=>{a.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var wp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wp&&(window.__reactRouterVersion="7.8.2")}catch{}function Yy({basename:a,children:l,window:o}){let i=v.useRef();i.current==null&&(i.current=Dx({window:o,v5Compat:!0}));let u=i.current,[d,m]=v.useState({action:u.action,location:u.location}),h=v.useCallback(p=>{v.startTransition(()=>m(p))},[m]);return v.useLayoutEffect(()=>u.listen(h),[u,h]),v.createElement(Ny,{basename:a,children:l,location:d.location,navigationType:d.action,navigator:u})}var Np=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sp=v.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:u,reloadDocument:d,replace:m,state:h,target:p,to:g,preventScrollReset:x,viewTransition:w,...k},T){let{basename:E}=v.useContext(vr),A=typeof g=="string"&&Np.test(g),O,R=!1;if(typeof g=="string"&&A&&(O=g,wp))try{let se=new URL(window.location.href),le=g.startsWith("//")?new URL(se.protocol+g):new URL(g),U=Wr(le.pathname,E);le.origin===se.origin&&U!=null?g=U+le.search+le.hash:R=!0}catch{ur(!1,`<Link to="${g}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let N=ly(g,{relative:u}),[M,G,W]=Gy(i,k),re=Jy(g,{replace:m,state:h,target:p,preventScrollReset:x,relative:u,viewTransition:w});function te(se){l&&l(se),se.defaultPrevented||re(se)}let $=v.createElement("a",{...k,...W,href:O||N,onClick:R||d?l:te,ref:Iy(T,G),target:p,"data-discover":!A&&o==="render"?"true":void 0});return M&&!A?v.createElement(v.Fragment,null,$,v.createElement(Fy,{page:N})):$});Sp.displayName="Link";var Cp=v.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:u=!1,style:d,to:m,viewTransition:h,children:p,...g},x){let w=rl(m,{relative:g.relative}),k=es(),T=v.useContext(Uo),{navigator:E,basename:A}=v.useContext(vr),O=T!=null&&sv(w)&&h===!0,R=E.encodeLocation?E.encodeLocation(w).pathname:w.pathname,N=k.pathname,M=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;o||(N=N.toLowerCase(),M=M?M.toLowerCase():null,R=R.toLowerCase()),M&&A&&(M=Wr(M,A)||M);const G=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let W=N===R||!u&&N.startsWith(R)&&N.charAt(G)==="/",re=M!=null&&(M===R||!u&&M.startsWith(R)&&M.charAt(R.length)==="/"),te={isActive:W,isPending:re,isTransitioning:O},$=W?l:void 0,se;typeof i=="function"?se=i(te):se=[i,W?"active":null,re?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let le=typeof d=="function"?d(te):d;return v.createElement(Sp,{...g,"aria-current":$,className:se,ref:x,style:le,to:m,viewTransition:h},typeof p=="function"?p(te):p)});Cp.displayName="NavLink";var Xy=v.forwardRef(({discover:a="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:u,state:d,method:m=So,action:h,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:w,...k},T)=>{let E=tv(),A=rv(h,{relative:g}),O=m.toLowerCase()==="get"?"get":"post",R=typeof h=="string"&&Np.test(h),N=M=>{if(p&&p(M),M.defaultPrevented)return;M.preventDefault();let G=M.nativeEvent.submitter,W=(G==null?void 0:G.getAttribute("formmethod"))||m;E(G||M.currentTarget,{fetcherKey:l,method:W,navigate:o,replace:u,state:d,relative:g,preventScrollReset:x,viewTransition:w})};return v.createElement("form",{ref:T,method:O,action:A,onSubmit:i?p:N,...k,"data-discover":!R&&a==="render"?"true":void 0})});Xy.displayName="Form";function Qy(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ep(a){let l=v.useContext(Fa);return et(l,Qy(a)),l}function Jy(a,{target:l,replace:o,state:i,preventScrollReset:u,relative:d,viewTransition:m}={}){let h=ts(),p=es(),g=rl(a,{relative:d});return v.useCallback(x=>{if(Ty(x,l)){x.preventDefault();let w=o!==void 0?o:Qn(p)===Qn(g);h(a,{replace:w,state:i,preventScrollReset:u,relative:d,viewTransition:m})}},[p,h,g,o,i,l,a,u,d,m])}function Zy(a){ur(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=v.useRef(lu(a)),o=v.useRef(!1),i=es(),u=v.useMemo(()=>Ry(i.search,o.current?null:l.current),[i.search]),d=ts(),m=v.useCallback((h,p)=>{const g=lu(typeof h=="function"?h(new URLSearchParams(u)):h);o.current=!0,d("?"+g,p)},[d,u]);return[u,m]}var Wy=0,ev=()=>`__${String(++Wy)}__`;function tv(){let{router:a}=Ep("useSubmit"),{basename:l}=v.useContext(vr),o=vy();return v.useCallback(async(i,u={})=>{let{action:d,method:m,encType:h,formData:p,body:g}=Dy(i,l);if(u.navigate===!1){let x=u.fetcherKey||ev();await a.fetch(x,o,u.action||d,{preventScrollReset:u.preventScrollReset,formData:p,body:g,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await a.navigate(u.action||d,{preventScrollReset:u.preventScrollReset,formData:p,body:g,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:o,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,l,o])}function rv(a,{relative:l}={}){let{basename:o}=v.useContext(vr),i=v.useContext(dr);et(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),d={...rl(a||".",{relative:l})},m=es();if(a==null){d.search=m.search;let h=new URLSearchParams(d.search),p=h.getAll("index");if(p.some(x=>x==="")){h.delete("index"),p.filter(w=>w).forEach(w=>h.append("index",w));let x=h.toString();d.search=x?`?${x}`:""}}return(!a||a===".")&&u.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:Jr([o,d.pathname])),Qn(d)}function sv(a,{relative:l}={}){let o=v.useContext(mp);et(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Ep("useViewTransitionState"),u=rl(a,{relative:l});if(!o.isTransitioning)return!1;let d=Wr(o.currentLocation.pathname,i)||o.currentLocation.pathname,m=Wr(o.nextLocation.pathname,i)||o.nextLocation.pathname;return ko(u.pathname,m)!=null||ko(u.pathname,d)!=null}const av=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},Su=()=>{const l=av().basePath||"";return l&&!l.startsWith("/")?"/"+l:l},nv=()=>Su()+"/api",Cu=a=>{const l=nv(),o=a.startsWith("/")?a:"/"+a;return l+o},lv=async()=>{try{const a=window.location.pathname,l=[a.replace(/\/[^/]*$/,"")+"/config","/config",...a.includes("/")?[a.split("/")[1]?`/${a.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(a){return console.error("Error loading runtime config:",a),{basePath:"",version:"dev",name:"mcphub"}}},Eo=[],ov=a=>{Eo.push(a)},Eu=async(a,l={})=>{let o=a.toString(),i={...l};try{for(const d of Eo)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 Eo)d.response&&(u=await d.response(u));return u}catch(u){let d=u;for(const m of Eo)m.error&&(d=await m.error(d));throw d}},zo=async(a,l={})=>{try{const o=Cu(a),i=await Eu(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"}}},Ge=(a,l={})=>zo(a,{...l,method:"GET"}),St=(a,l,o={})=>zo(a,{...o,method:"POST",headers:{"Content-Type":"application/json",...o.headers},body:l?JSON.stringify(l):void 0}),Bt=(a,l,o={})=>zo(a,{...o,method:"PUT",headers:{"Content-Type":"application/json",...o.headers},body:l?JSON.stringify(l):void 0}),Jn=(a,l={})=>zo(a,{...l,method:"DELETE"}),ku="mcphub_token",sl=()=>localStorage.getItem(ku),kp=a=>{localStorage.setItem(ku,a)},To=()=>{localStorage.removeItem(ku)},iv={request:async(a,l)=>{const o=new Headers(l.headers),i=localStorage.getItem("i18nextLng")||"en";o.set("Accept-Language",i);const u=sl();return u&&o.set("x-auth-token",u),{url:a,config:{...l,headers:o}}},response:async a=>(a.status===401&&To(),a),error:async a=>(console.error("Auth interceptor error:",a),a)},cv=()=>{ov(iv)},uv=async a=>{try{const l=await St("/auth/login",a);return l.success&&l.token?(kp(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"}}},dv=async a=>{try{const l=await St("/auth/register",a);return l.success&&l.token?(kp(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"}}},fv=async()=>{if(!sl())return{success:!1,message:"No authentication token"};try{return await Ge("/auth/user")}catch(l){return console.error("Get current user error:",l),{success:!1,message:"An error occurred while fetching user data"}}},mv=async a=>{if(!sl())return{success:!1,message:"No authentication token"};try{return await St("/auth/change-password",a)}catch(o){return console.error("Change password error:",o),{success:!1,message:"An error occurred while changing password"}}},hv=()=>{To()},pv=async()=>{var a,l;try{const o=Su(),i=await Eu(`${o}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});if(i.ok){const u=await i.json();return{skipAuth:((a=u.data)==null?void 0:a.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}}},Rr={isAuthenticated:!1,loading:!0,user:null,error:null},Ap=v.createContext({auth:Rr,login:async()=>!1,register:async()=>!1,logout:()=>{}}),gv=({children:a})=>{const[l,o]=v.useState(Rr);v.useEffect(()=>{(async()=>{const{skipAuth:h,permissions:p}=await pv();if(h){o({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:p},error:null});return}if(!sl()){o({...Rr,loading:!1});return}try{const x=await fv();x.success&&x.user?o({isAuthenticated:!0,loading:!1,user:x.user,error:null}):(To(),o({...Rr,loading:!1}))}catch{To(),o({...Rr,loading:!1})}})()},[]);const i=async(m,h)=>{try{const p=await uv({username:m,password:h});return p.success&&p.token&&p.user?(o({isAuthenticated:!0,loading:!1,user:p.user,error:null}),!0):(o({...Rr,loading:!1,error:p.message||"Authentication failed"}),!1)}catch{return o({...Rr,loading:!1,error:"Authentication failed"}),!1}},u=async(m,h,p=!1)=>{try{const g=await dv({username:m,password:h,isAdmin:p});return g.success&&g.token&&g.user?(o({isAuthenticated:!0,loading:!1,user:g.user,error:null}),!0):(o({...Rr,loading:!1,error:g.message||"Registration failed"}),!1)}catch{return o({...Rr,loading:!1,error:"Registration failed"}),!1}},d=()=>{hv(),o({...Rr,loading:!1})};return s.jsx(Ap.Provider,{value:{auth:l,login:i,register:u,logout:d},children:a})},Zs=()=>v.useContext(Ap),xv=(a,l,o,i)=>{var d,m,h,p;const u=[o,{code:l,...i||{}}];if((m=(d=a==null?void 0:a.services)==null?void 0:d.logger)!=null&&m.forward)return a.services.logger.forward(u,"warn","react-i18next::",!0);Js(u[0])&&(u[0]=`react-i18next:: ${u[0]}`),(p=(h=a==null?void 0:a.services)==null?void 0:h.logger)!=null&&p.warn?a.services.logger.warn(...u):console!=null&&console.warn&&console.warn(...u)},Oh={},ou=(a,l,o,i)=>{Js(o)&&Oh[o]||(Js(o)&&(Oh[o]=new Date),xv(a,l,o,i))},Tp=(a,l)=>()=>{if(a.isInitialized)l();else{const o=()=>{setTimeout(()=>{a.off("initialized",o)},0),l()};a.on("initialized",o)}},iu=(a,l,o)=>{a.loadNamespaces(l,Tp(a,o))},Dh=(a,l,o,i)=>{if(Js(o)&&(o=[o]),a.options.preload&&a.options.preload.indexOf(l)>-1)return iu(a,o,i);o.forEach(u=>{a.options.ns.indexOf(u)<0&&a.options.ns.push(u)}),a.loadLanguages(l,Tp(a,i))},yv=(a,l,o={})=>!l.languages||!l.languages.length?(ou(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(a,{lng:o.lng,precheck:(i,u)=>{if(o.bindI18n&&o.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!u(i.isLanguageChangingTo,a))return!1}}),Js=a=>typeof a=="string",vv=a=>typeof a=="object"&&a!==null,bv=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,jv={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},wv=a=>jv[a],Nv=a=>a.replace(bv,wv);let cu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Nv};const Sv=(a={})=>{cu={...cu,...a}},Cv=()=>cu;let Rp;const Ev=a=>{Rp=a},kv=()=>Rp,Av={type:"3rdParty",init(a){Sv(a.options.react),Ev(a)}},Tv=v.createContext();class Rv{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(o=>{this.usedNamespaces[o]||(this.usedNamespaces[o]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Mv=(a,l)=>{const o=v.useRef();return v.useEffect(()=>{o.current=a},[a,l]),o.current},Mp=(a,l,o,i)=>a.getFixedT(l,o,i),Ov=(a,l,o,i)=>v.useCallback(Mp(a,l,o,i),[a,l,o,i]),ve=(a,l={})=>{var G,W,re,te;const{i18n:o}=l,{i18n:i,defaultNS:u}=v.useContext(Tv)||{},d=o||i||kv();if(d&&!d.reportNamespaces&&(d.reportNamespaces=new Rv),!d){ou(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const $=(le,U)=>Js(U)?U:vv(U)&&Js(U.defaultValue)?U.defaultValue:Array.isArray(le)?le[le.length-1]:le,se=[$,{},!1];return se.t=$,se.i18n={},se.ready=!1,se}(G=d.options.react)!=null&&G.wait&&ou(d,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...Cv(),...d.options.react,...l},{useSuspense:h,keyPrefix:p}=m;let g=u||((W=d.options)==null?void 0:W.defaultNS);g=Js(g)?[g]:g||["translation"],(te=(re=d.reportNamespaces).addUsedNamespaces)==null||te.call(re,g);const x=(d.isInitialized||d.initializedStoreOnce)&&g.every($=>yv($,d,m)),w=Ov(d,l.lng||null,m.nsMode==="fallback"?g:g[0],p),k=()=>w,T=()=>Mp(d,l.lng||null,m.nsMode==="fallback"?g:g[0],p),[E,A]=v.useState(k);let O=g.join();l.lng&&(O=`${l.lng}${O}`);const R=Mv(O),N=v.useRef(!0);v.useEffect(()=>{const{bindI18n:$,bindI18nStore:se}=m;N.current=!0,!x&&!h&&(l.lng?Dh(d,l.lng,g,()=>{N.current&&A(T)}):iu(d,g,()=>{N.current&&A(T)})),x&&R&&R!==O&&N.current&&A(T);const le=()=>{N.current&&A(T)};return $&&(d==null||d.on($,le)),se&&(d==null||d.store.on(se,le)),()=>{N.current=!1,d&&$&&($==null||$.split(" ").forEach(U=>d.off(U,le))),se&&d&&se.split(" ").forEach(U=>d.store.off(U,le))}},[d,O]),v.useEffect(()=>{N.current&&x&&A(k)},[d,p,x]);const M=[E,d,x];if(M.t=E,M.i18n=d,M.ready=x,x||!x&&!h)return M;throw new Promise($=>{l.lng?Dh(d,l.lng,g,()=>$()):iu(d,g,()=>$())})};/**
|
|
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 Dv=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Uv=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,o,i)=>i?i.toUpperCase():o.toLowerCase()),Uh=a=>{const l=Uv(a);return l.charAt(0).toUpperCase()+l.slice(1)},Op=(...a)=>a.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 Lv={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 zv=v.forwardRef(({color:a="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:d,iconNode:m,...h},p)=>v.createElement("svg",{ref:p,...Lv,width:l,height:l,stroke:a,strokeWidth:i?Number(o)*24/Number(l):o,className:Op("lucide",u),...h},[...m.map(([g,x])=>v.createElement(g,x)),...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 at=(a,l)=>{const o=v.forwardRef(({className:i,...u},d)=>v.createElement(zv,{ref:d,iconNode:l,className:Op(`lucide-${Dv(Uh(a))}`,`lucide-${a}`,i),...u}));return o.displayName=Uh(a),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 Pv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ka=at("check",Pv);/**
|
|
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 _v=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Po=at("chevron-down",_v);/**
|
|
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 Hv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Au=at("chevron-right",Hv);/**
|
|
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 Bv=[["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"}]],Tu=at("circle-alert",Bv);/**
|
|
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 qv=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Dp=at("circle-check-big",qv);/**
|
|
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 Vv=[["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"}]],Up=at("circle-x",Vv);/**
|
|
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 Gv=[["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"}]],Ro=at("copy",Gv);/**
|
|
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 Fv=[["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"}]],$v=at("download",Fv);/**
|
|
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 Kv=[["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"}]],Iv=at("file-code",Kv);/**
|
|
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 Yv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Xv=at("info",Yv);/**
|
|
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 Qv=[["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"}]],Jv=at("link",Qv);/**
|
|
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 Zv=[["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"}]],Lp=at("loader",Zv);/**
|
|
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 Wv=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],eb=at("log-out",Wv);/**
|
|
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 tb=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],rb=at("moon",tb);/**
|
|
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 sb=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],zp=at("play",sb);/**
|
|
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 ab=[["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"}]],nb=at("refresh-cw",ab);/**
|
|
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 lb=[["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"}]],ob=at("settings",lb);/**
|
|
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 ib=[["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"}]],_o=at("square-pen",ib);/**
|
|
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 cb=[["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"}]],ub=at("sun",cb);/**
|
|
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 db=[["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"}]],Pp=at("trash",db);/**
|
|
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 fb=[["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"}]],mb=at("user",fb);/**
|
|
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 hb=[["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"}]],pb=at("wrench",hb);/**
|
|
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 gb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zn=at("x",gb);function _p(a){var l,o,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var u=a.length;for(l=0;l<u;l++)a[l]&&(o=_p(a[l]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function xb(){for(var a,l,o=0,i="",u=arguments.length;o<u;o++)(a=arguments[o])&&(l=_p(a))&&(i&&(i+=" "),i+=l);return i}const Ru="-",yb=a=>{const l=bb(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:m=>{const h=m.split(Ru);return h[0]===""&&h.length!==1&&h.shift(),Hp(h,l)||vb(m)},getConflictingClassGroupIds:(m,h)=>{const p=o[m]||[];return h&&i[m]?[...p,...i[m]]:p}}},Hp=(a,l)=>{var m;if(a.length===0)return l.classGroupId;const o=a[0],i=l.nextPart.get(o),u=i?Hp(a.slice(1),i):void 0;if(u)return u;if(l.validators.length===0)return;const d=a.join(Ru);return(m=l.validators.find(({validator:h})=>h(d)))==null?void 0:m.classGroupId},Lh=/^\[(.+)\]$/,vb=a=>{if(Lh.test(a)){const l=Lh.exec(a)[1],o=l==null?void 0:l.substring(0,l.indexOf(":"));if(o)return"arbitrary.."+o}},bb=a=>{const{theme:l,classGroups:o}=a,i={nextPart:new Map,validators:[]};for(const u in o)uu(o[u],i,u,l);return i},uu=(a,l,o,i)=>{a.forEach(u=>{if(typeof u=="string"){const d=u===""?l:zh(l,u);d.classGroupId=o;return}if(typeof u=="function"){if(jb(u)){uu(u(i),l,o,i);return}l.validators.push({validator:u,classGroupId:o});return}Object.entries(u).forEach(([d,m])=>{uu(m,zh(l,d),o,i)})})},zh=(a,l)=>{let o=a;return l.split(Ru).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},jb=a=>a.isThemeGetter,wb=a=>{if(a<1)return{get:()=>{},set:()=>{}};let l=0,o=new Map,i=new Map;const u=(d,m)=>{o.set(d,m),l++,l>a&&(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)}}},du="!",fu=":",Nb=fu.length,Sb=a=>{const{prefix:l,experimentalParseClassName:o}=a;let i=u=>{const d=[];let m=0,h=0,p=0,g;for(let E=0;E<u.length;E++){let A=u[E];if(m===0&&h===0){if(A===fu){d.push(u.slice(p,E)),p=E+Nb;continue}if(A==="/"){g=E;continue}}A==="["?m++:A==="]"?m--:A==="("?h++:A===")"&&h--}const x=d.length===0?u:u.substring(p),w=Cb(x),k=w!==x,T=g&&g>p?g-p:void 0;return{modifiers:d,hasImportantModifier:k,baseClassName:w,maybePostfixModifierPosition:T}};if(l){const u=l+fu,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},Cb=a=>a.endsWith(du)?a.substring(0,a.length-1):a.startsWith(du)?a.substring(1):a,Eb=a=>{const l=Object.fromEntries(a.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}},kb=a=>({cache:wb(a.cacheSize),parseClassName:Sb(a),sortModifiers:Eb(a),...yb(a)}),Ab=/\s+/,Tb=(a,l)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:u,sortModifiers:d}=l,m=[],h=a.trim().split(Ab);let p="";for(let g=h.length-1;g>=0;g-=1){const x=h[g],{isExternal:w,modifiers:k,hasImportantModifier:T,baseClassName:E,maybePostfixModifierPosition:A}=o(x);if(w){p=x+(p.length>0?" "+p:p);continue}let O=!!A,R=i(O?E.substring(0,A):E);if(!R){if(!O){p=x+(p.length>0?" "+p:p);continue}if(R=i(E),!R){p=x+(p.length>0?" "+p:p);continue}O=!1}const N=d(k).join(":"),M=T?N+du:N,G=M+R;if(m.includes(G))continue;m.push(G);const W=u(R,O);for(let re=0;re<W.length;++re){const te=W[re];m.push(M+te)}p=x+(p.length>0?" "+p:p)}return p};function Rb(){let a=0,l,o,i="";for(;a<arguments.length;)(l=arguments[a++])&&(o=Bp(l))&&(i&&(i+=" "),i+=o);return i}const Bp=a=>{if(typeof a=="string")return a;let l,o="";for(let i=0;i<a.length;i++)a[i]&&(l=Bp(a[i]))&&(o&&(o+=" "),o+=l);return o};function Mb(a,...l){let o,i,u,d=m;function m(p){const g=l.reduce((x,w)=>w(x),a());return o=kb(g),i=o.cache.get,u=o.cache.set,d=h,h(p)}function h(p){const g=i(p);if(g)return g;const x=Tb(p,o);return u(p,x),x}return function(){return d(Rb.apply(null,arguments))}}const gt=a=>{const l=o=>o[a]||[];return l.isThemeGetter=!0,l},qp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ob=/^\d+\/\d+$/,Db=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ub=/\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$/,Lb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_a=a=>Ob.test(a),Ue=a=>!!a&&!Number.isNaN(Number(a)),Ts=a=>!!a&&Number.isInteger(Number(a)),tu=a=>a.endsWith("%")&&Ue(a.slice(0,-1)),Qr=a=>Db.test(a),_b=()=>!0,Hb=a=>Ub.test(a)&&!Lb.test(a),Gp=()=>!1,Bb=a=>zb.test(a),qb=a=>Pb.test(a),Vb=a=>!ge(a)&&!xe(a),Gb=a=>Ia(a,Kp,Gp),ge=a=>qp.test(a),Xs=a=>Ia(a,Ip,Hb),ru=a=>Ia(a,Yb,Ue),Ph=a=>Ia(a,Fp,Gp),Fb=a=>Ia(a,$p,qb),vo=a=>Ia(a,Yp,Bb),xe=a=>Vp.test(a),$n=a=>Ya(a,Ip),$b=a=>Ya(a,Xb),_h=a=>Ya(a,Fp),Kb=a=>Ya(a,Kp),Ib=a=>Ya(a,$p),bo=a=>Ya(a,Yp,!0),Ia=(a,l,o)=>{const i=qp.exec(a);return i?i[1]?l(i[1]):o(i[2]):!1},Ya=(a,l,o=!1)=>{const i=Vp.exec(a);return i?i[1]?l(i[1]):o:!1},Fp=a=>a==="position"||a==="percentage",$p=a=>a==="image"||a==="url",Kp=a=>a==="length"||a==="size"||a==="bg-size",Ip=a=>a==="length",Yb=a=>a==="number",Xb=a=>a==="family-name",Yp=a=>a==="shadow",Qb=()=>{const a=gt("color"),l=gt("font"),o=gt("text"),i=gt("font-weight"),u=gt("tracking"),d=gt("leading"),m=gt("breakpoint"),h=gt("container"),p=gt("spacing"),g=gt("radius"),x=gt("shadow"),w=gt("inset-shadow"),k=gt("text-shadow"),T=gt("drop-shadow"),E=gt("blur"),A=gt("perspective"),O=gt("aspect"),R=gt("ease"),N=gt("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...G(),xe,ge],re=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],$=()=>[xe,ge,p],se=()=>[_a,"full","auto",...$()],le=()=>[Ts,"none","subgrid",xe,ge],U=()=>["auto",{span:["full",Ts,xe,ge]},Ts,xe,ge],z=()=>[Ts,"auto",xe,ge],Q=()=>["auto","min","max","fr",xe,ge],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],b=()=>["auto",...$()],C=()=>[_a,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],L=()=>[a,xe,ge],oe=()=>[...G(),_h,Ph,{position:[xe,ge]}],S=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",Kb,Gb,{size:[xe,ge]}],Z=()=>[tu,$n,Xs],H=()=>["","none","full",g,xe,ge],I=()=>["",Ue,$n,Xs],de=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[Ue,tu,_h,Ph],ue=()=>["","none",E,xe,ge],je=()=>["none",Ue,xe,ge],Se=()=>["none",Ue,xe,ge],ye=()=>[Ue,xe,ge],Me=()=>[_a,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Qr],breakpoint:[Qr],color:[_b],container:[Qr],"drop-shadow":[Qr],ease:["in","out","in-out"],font:[Vb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Qr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Qr],shadow:[Qr],spacing:["px",Ue],text:[Qr],"text-shadow":[Qr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_a,ge,xe,O]}],container:["container"],columns:[{columns:[Ue,ge,xe,h]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:W()}],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:se()}],"inset-x":[{"inset-x":se()}],"inset-y":[{"inset-y":se()}],start:[{start:se()}],end:[{end:se()}],top:[{top:se()}],right:[{right:se()}],bottom:[{bottom:se()}],left:[{left:se()}],visibility:["visible","invisible","collapse"],z:[{z:[Ts,"auto",xe,ge]}],basis:[{basis:[_a,"full","auto",h,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ue,_a,"auto","initial","none",ge]}],grow:[{grow:["",Ue,xe,ge]}],shrink:[{shrink:["",Ue,xe,ge]}],order:[{order:[Ts,"first","last","none",xe,ge]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":le()}],"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":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:b()}],mx:[{mx:b()}],my:[{my:b()}],ms:[{ms:b()}],me:[{me:b()}],mt:[{mt:b()}],mr:[{mr:b()}],mb:[{mb:b()}],ml:[{ml:b()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],w:[{w:[h,"screen",...C()]}],"min-w":[{"min-w":[h,"screen","none",...C()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[m]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",o,$n,Xs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,xe,ru]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tu,ge]}],"font-family":[{font:[$b,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":[Ue,"none",xe,ru]}],leading:[{leading:[d,...$()]}],"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:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ue,"from-font","auto",xe,Xs]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Ue,"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:$()}],"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:oe()}],"bg-repeat":[{bg:S()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ts,xe,ge],radial:["",xe,ge],conic:[Ts,xe,ge]},Ib,Fb]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ue,xe,ge]}],"outline-w":[{outline:["",Ue,$n,Xs]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",x,bo,vo]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",w,bo,vo]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Ue,Xs]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",k,bo,vo]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Ue,xe,ge]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":[Ue]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[xe,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":G()}],"mask-image-conic-pos":[{"mask-conic":[Ue]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:S()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,ge]}],filter:[{filter:["","none",xe,ge]}],blur:[{blur:ue()}],brightness:[{brightness:[Ue,xe,ge]}],contrast:[{contrast:[Ue,xe,ge]}],"drop-shadow":[{"drop-shadow":["","none",T,bo,vo]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Ue,xe,ge]}],"hue-rotate":[{"hue-rotate":[Ue,xe,ge]}],invert:[{invert:["",Ue,xe,ge]}],saturate:[{saturate:[Ue,xe,ge]}],sepia:[{sepia:["",Ue,xe,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,ge]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Ue,xe,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Ue,xe,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ue,xe,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ue,xe,ge]}],"backdrop-invert":[{"backdrop-invert":["",Ue,xe,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Ue,xe,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Ue,xe,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Ue,xe,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"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:[Ue,"initial",xe,ge]}],ease:[{ease:["linear","initial",R,xe,ge]}],delay:[{delay:[Ue,xe,ge]}],animate:[{animate:["none",N,xe,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,xe,ge]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"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:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Me()}],"translate-x":[{"translate-x":Me()}],"translate-y":[{"translate-y":Me()}],"translate-z":[{"translate-z":Me()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",...L()]}],"stroke-w":[{stroke:[Ue,$n,Xs,ru]}],stroke:[{stroke:["none",...L()]}],"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"]}},Jb=Mb(Qb);function Zr(...a){return Jb(xb(a))}const Zb=({message:a,type:l="info",duration:o=3e3,onClose:i,visible:u})=>{const{t:d}=ve();v.useEffect(()=>{if(u){const g=setTimeout(()=>{i()},o);return()=>clearTimeout(g)}},[u,o,i]);const m={success:s.jsx(Ka,{className:"w-5 h-5 text-green-500"}),error:s.jsx(Zn,{className:"w-5 h-5 text-red-500"}),info:s.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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:s.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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"})})},h={success:"bg-green-50 border-green-200",error:"bg-red-50 border-red-200",info:"bg-blue-50 border-blue-200",warning:"bg-yellow-50 border-yellow-200"},p={success:"text-green-800",error:"text-red-800",info:"text-blue-800",warning:"text-yellow-800"};return s.jsx("div",{className:Zr("fixed top-4 right-4 z-50 max-w-sm p-4 rounded-md shadow-lg border",h[l],"transform transition-all duration-300 ease-in-out",u?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"flex-shrink-0",children:m[l]}),s.jsx("div",{className:"ml-3",children:s.jsx("p",{className:Zr("text-sm font-medium",p[l]),children:a})}),s.jsx("div",{className:"ml-auto pl-3",children:s.jsx("div",{className:"-mx-1.5 -my-1.5",children:s.jsxs("button",{onClick:i,className:Zr("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:[s.jsx("span",{className:"sr-only",children:d("common.dismiss")}),s.jsx(Zn,{className:"h-5 w-5"})]})})})]})})},Xp=v.createContext(void 0),al=()=>{const a=v.useContext(Xp);if(!a)throw new Error("useToast must be used within a ToastProvider");return a},Wb=({children:a})=>{const[l,o]=v.useState({message:"",type:"info",visible:!1,duration:3e3}),i=v.useCallback((d,m="info",h=3e3)=>{o({message:d,type:m,visible:!0,duration:h})},[]),u=v.useCallback(()=>{o(d=>({...d,visible:!1}))},[]);return s.jsxs(Xp.Provider,{value:{showToast:i},children:[a,s.jsx(Zb,{message:l.message,type:l.type,duration:l.duration,onClose:u,visible:l.visible})]})},Qp=v.createContext(void 0),e1=()=>{const a=v.useContext(Qp);if(!a)throw new Error("useTheme must be used within a ThemeProvider");return a},t1=({children:a})=>{const[l,o]=v.useState(()=>localStorage.getItem("theme")||"system"),[i,u]=v.useState("light"),d=m=>{o(m),localStorage.setItem("theme",m)};return v.useEffect(()=>{const m=()=>{const p=window.document.documentElement,g=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",x=l==="system"?g:l;u(x),x==="dark"?(console.log("Applying dark mode to HTML root element"),p.classList.add("dark"),document.body.style.backgroundColor="#111827"):(console.log("Removing dark mode from HTML root element"),p.classList.remove("dark"),document.body.style.backgroundColor="")},h=window.matchMedia("(prefers-color-scheme: dark)");return h.addEventListener("change",m),m(),()=>{h.removeEventListener("change",m)}},[l]),s.jsx(Qp.Provider,{value:{theme:l,setTheme:d,resolvedTheme:i},children:a})},jo={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},Jp=v.createContext(void 0),r1=({children:a})=>{const{t:l}=ve(),{auth:o}=Zs(),[i,u]=v.useState([]),[d,m]=v.useState(null),[h,p]=v.useState(0),[g,x]=v.useState(!0),[w,k]=v.useState(0),T=v.useRef(null),E=v.useRef(0),A=v.useRef(0),O=3e3,R=()=>{T.current&&(clearInterval(T.current),T.current=null)},N=v.useCallback(le=>{const U=(le==null?void 0:le.immediate)??!0;R();const z=async()=>{try{console.log("[ServerContext] Fetching servers from API...");const Q=await Ge("/servers");A.current=Date.now(),Q&&Q.success&&Array.isArray(Q.data)?u(Q.data):Q&&Array.isArray(Q)?u(Q):(console.error("Invalid server data format:",Q),u([])),m(null)}catch(Q){console.error("Error fetching servers during normal polling:",Q),navigator.onLine?Q instanceof TypeError&&(Q.message.includes("NetworkError")||Q.message.includes("Failed to fetch"))?m(l("errors.serverConnection")):m(l("errors.serverFetch")):m(l("errors.network"))}};U&&z(),T.current=setInterval(z,jo.normal.pollingInterval)},[l]);v.useEffect(()=>{o.isAuthenticated?(console.log("[ServerContext] User authenticated, triggering refresh"),p(le=>le+1)):(console.log("[ServerContext] User not authenticated, clearing data and stopping polling"),R(),u([]),x(!1),m(null))},[o.isAuthenticated]),v.useEffect(()=>{if(!o.isAuthenticated){console.log("[ServerContext] User not authenticated, skipping polling setup");return}h>0&&(E.current=0,k(0));const le=async()=>{try{console.log("[ServerContext] Initial fetch - attempt",E.current+1);const U=await Ge("/servers");return A.current=Date.now(),U&&U.success&&Array.isArray(U.data)?(u(U.data),x(!1),N({immediate:!1}),!0):U&&Array.isArray(U)?(u(U),x(!1),N({immediate:!1}),!0):(console.error("Invalid server data format:",U),u([]),x(!1),N({immediate:!1}),!0)}catch(U){return E.current+=1,console.error(`Initial loading attempt ${E.current} failed:`,U),k(E.current),navigator.onLine?m(l("errors.initialStartup")):m(l("errors.network")),E.current>=jo.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),x(!1),R(),N()),!1}};return g?(R(),le(),T.current=setInterval(le,jo.startup.pollingInterval),console.log(`Started initial polling with interval: ${jo.startup.pollingInterval}ms`)):N(),()=>{R()}},[h,l,g,N]);const M=v.useCallback(()=>{R(),g&&(x(!0),E.current=0,k(0)),p(le=>le+1)},[g]),G=v.useCallback(()=>{const U=Date.now()-A.current;console.log("[ServerContext] refreshIfNeeded called, time since last fetch:",U,"ms"),U>=O?(console.log("[ServerContext] Triggering refresh (exceeded MIN_REFRESH_INTERVAL:",O,"ms)"),M()):console.log("[ServerContext] Skipping refresh (MIN_REFRESH_INTERVAL:",O,"ms, time since last:",U,"ms)")},[M]),W=v.useCallback(()=>{p(le=>le+1)},[]),re=v.useCallback(async le=>{try{const U=await Ge("/settings");if(U&&U.success&&U.data&&U.data.mcpServers&&U.data.mcpServers[le.name]){const z=U.data.mcpServers[le.name];return{name:le.name,status:le.status,tools:le.tools||[],config:z}}else return console.error("Failed to get server config from settings:",U),m(l("server.invalidConfig",{serverName:le.name})),null}catch(U){return console.error("Error fetching server settings:",U),m(U instanceof Error?U.message:String(U)),null}},[l]),te=v.useCallback(async le=>{try{const U=encodeURIComponent(le),z=await Jn(`/servers/${U}`);return!z||!z.success?(m((z==null?void 0:z.message)||l("server.deleteError",{serverName:le})),!1):(p(Q=>Q+1),!0)}catch(U){return m(l("errors.general")+": "+(U instanceof Error?U.message:String(U))),!1}},[l]),$=v.useCallback(async(le,U)=>{try{const z=encodeURIComponent(le.name),Q=await St(`/servers/${z}/toggle`,{enabled:U});return!Q||!Q.success?(console.error("Failed to toggle server:",Q),m((Q==null?void 0:Q.message)||l("server.toggleError",{serverName:le.name})),!1):(p(B=>B+1),!0)}catch(z){return console.error("Error toggling server:",z),m(z instanceof Error?z.message:String(z)),!1}},[l]),se={servers:i,error:d,setError:m,isLoading:g,fetchAttempts:w,triggerRefresh:M,refreshIfNeeded:G,handleServerAdd:W,handleServerEdit:re,handleServerRemove:te,handleServerToggle:$};return s.jsx(Jp.Provider,{value:se,children:a})},s1=()=>{const a=v.useContext(Jp);if(a===void 0)throw new Error("useServerContext must be used within a ServerProvider");return a},Zp=()=>{const{t:a}=ve(),{theme:l,setTheme:o}=e1(),i=()=>{o(l==="light"?"dark":"light")};return s.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:a(l==="light"?"theme.dark":"theme.light"),"aria-label":a(l==="light"?"theme.dark":"theme.light"),children:l==="light"?s.jsx(rb,{className:"h-5 w-5"}):s.jsx(ub,{className:"h-5 w-5"})})},a1=a=>{const{t:l}=ve();return s.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,...a,children:[s.jsx("title",{children:l("common.language")}),s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2 12h20"}),s.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"})]})},Wp=()=>{const{i18n:a}=ve(),[l,o]=v.useState(!1),[i,u]=v.useState(a.language),d=[{code:"en",label:"English"},{code:"zh",label:"中文"},{code:"fr",label:"Français"}];v.useEffect(()=>{u(a.language)},[a.language]),v.useEffect(()=>{const p=g=>{g.target.closest(".language-dropdown")||o(!1)};return l&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[l]);const m=p=>{localStorage.setItem("i18nextLng",p),o(!1),window.location.reload()},h=()=>{o(!l)};return s.jsxs("div",{className:"relative language-dropdown",children:[s.jsx("button",{onClick:h,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:s.jsx(a1,{className:"h-5 w-5"})}),l&&s.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:s.jsx("div",{children:d.map(p=>s.jsx("button",{onClick:()=>m(p.code),className:`flex items-center w-full px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${i.startsWith(p.code)?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,children:p.label},p.code))})})]})},n1=a=>{const{t:l}=ve();return s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...a,children:[s.jsx("title",{children:l("common.github")}),s.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:a})=>{const{t:l}=ve();return s.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-10",children:s.jsxs("div",{className:"flex justify-between items-center px-3 py-3",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("button",{onClick:a,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:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),s.jsx("h1",{className:"ml-4 text-xl font-bold text-gray-900 dark:text-white",children:l("app.title")})]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 mr-2",children:"v0.9.15"}),s.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:s.jsx(n1,{className:"h-5 w-5"})}),s.jsx(Zp,{}),s.jsx(Wp,{})]})]})})},Kn=({permissions:a,fallback:l=null,children:o})=>eg(a)?s.jsx(s.Fragment,{children:o}):s.jsx(s.Fragment,{children:l}),eg=a=>{const{auth:l}=Zs();if(!l.isAuthenticated||!l.user)return!1;const o=l.user.permissions||[];return a==="x"&&!o.includes("x")?!1:o.includes("*")||l.user.isAdmin?!0:(Array.isArray(a)?a:[a]).some(u=>o.includes(u))},o1="https://registry.npmjs.org",i1="@samanhappy/mcphub",tg=async()=>{try{const a=await fetch(`${o1}/${i1}/latest`);if(!a.ok)throw new Error(`Failed to fetch latest version: ${a.status}`);return(await a.json()).version||null}catch(a){return console.error("Error checking for latest version:",a),null}},rg=(a,l)=>{if(a==="dev")return-1;const o=a.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:a,onClose:l,version:o})=>{const{t:i}=ve(),[u,d]=v.useState(!1),[m,h]=v.useState(""),[p,g]=v.useState(!1),x=async()=>{g(!0);try{const w=await tg();w&&(h(w),d(rg(o,w)>0))}catch(w){console.error("Failed to check for updates:",w)}finally{g(!1)}};return v.useEffect(()=>{a&&x()},[a,o]),a?s.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:s.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:s.jsxs("div",{className:"p-6 relative",children:[s.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:s.jsx(Zn,{className:"h-5 w-5"})}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:i("about.title")}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[i("about.currentVersion"),":"]}),s.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:o})]}),u&&m&&s.jsx("div",{className:"bg-blue-50 dark:bg-blue-900 p-3 rounded",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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"})})}),s.jsxs("div",{className:"ml-3 flex-1 text-sm text-blue-700 dark:text-blue-300",children:[s.jsx("p",{children:i("about.newVersionAvailable",{version:m})}),s.jsx("p",{className:"mt-1",children:s.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")})})]})]})}),s.jsxs("button",{onClick:x,disabled:p,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
|
+
${p?"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:[s.jsx(nb,{className:`h-4 w-4 mr-2 ${p?"animate-spin":""}`}),i(p?"about.checking":"about.checkForUpdates")]})]})]})})}):null},u1=({open:a,onOpenChange:l})=>{const{i18n:o,t:i}=ve();return a?s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:s.jsxs("div",{className:"p-6 relative",children:[s.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:s.jsx(Zn,{className:"h-5 w-5"})}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:i("sponsor.title")}),s.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:o.language==="zh"?s.jsx("img",{src:"./assets/reward.png",alt:i("sponsor.rewardAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}):s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:i("sponsor.supportMessage")}),s.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:a,onOpenChange:l})=>{const{t:o}=ve();return a?s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:s.jsxs("div",{className:"p-6 relative",children:[s.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:s.jsx(Zn,{className:"h-5 w-5"})}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:o("wechat.title")}),s.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[s.jsx("img",{src:"./assets/wexin.png",alt:o("wechat.qrCodeAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}),s.jsx("p",{className:"mt-4 text-center text-gray-700 dark:text-gray-300",children:o("wechat.scanMessage")})]})]})})}):null},f1=a=>{const{t:l}=ve();return s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...a,children:[s.jsx("title",{children:l("common.wechat")}),s.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=a=>{const{t:l}=ve();return s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...a,children:[s.jsx("title",{children:l("common.discord")}),s.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=a=>{const{t:l}=ve();return s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...a,children:[s.jsx("title",{children:l("sponsor.label")}),s.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:a,version:l})=>{var te;const{t:o,i18n:i}=ve(),u=ts(),{auth:d,logout:m}=Zs(),[h,p]=v.useState(!1),[g,x]=v.useState(!1),[w,k]=v.useState(!1),[T,E]=v.useState(!1),[A,O]=v.useState(!1),R=v.useRef(null);v.useEffect(()=>{(async()=>{try{const se=await tg();se&&x(rg(l,se)>0)}catch(se){console.error("Error checking for new version:",se)}})()},[l]),v.useEffect(()=>{const $=se=>{R.current&&!R.current.contains(se.target)&&p(!1)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[]);const N=()=>{u("/settings"),p(!1)},M=()=>{m(),u("/login")},G=()=>{k(!0),p(!1)},W=()=>{E(!0),p(!1)},re=()=>{O(!0),p(!1)};return s.jsxs("div",{ref:R,className:"relative",children:[s.jsxs("button",{onClick:()=>p(!h),className:`flex ${a?"justify-center":"items-center"} w-full p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors rounded-md ${h?"bg-gray-100 dark:bg-gray-700":""}`,children:[s.jsxs("div",{className:"flex-shrink-0 relative",children:[s.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:s.jsx(mb,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),g&&s.jsx("span",{className:"absolute -top-1 -right-1 block w-2 h-2 bg-red-500 rounded-full"})]}),!a&&s.jsx("div",{className:"ml-3 flex flex-col items-start",children:s.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")})})]}),h&&s.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:[s.jsxs("button",{onClick:W,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:[s.jsx(h1,{className:"h-4 w-4 mr-2"}),o("sponsor.label")]}),i.language==="zh"?s.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:[s.jsx(f1,{className:"h-4 w-4 mr-2"}),o("wechat.label")]}):s.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:[s.jsx(m1,{className:"h-4 w-4 mr-2"}),o("discord.label")]}),s.jsxs("button",{onClick:N,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:[s.jsx(ob,{className:"h-4 w-4 mr-2"}),o("nav.settings")]}),s.jsxs("button",{onClick:G,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:[s.jsx(Xv,{className:"h-4 w-4 mr-2"}),o("about.title"),g&&s.jsx("span",{className:"absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"})]}),s.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),s.jsxs("button",{onClick:M,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:[s.jsx(eb,{className:"h-4 w-4 mr-2"}),o("app.logout")]})]}),s.jsx(c1,{isOpen:w,onClose:()=>k(!1),version:l}),s.jsx(u1,{open:T,onOpenChange:E}),s.jsx(d1,{open:A,onOpenChange:O})]})},g1=({collapsed:a})=>{var d;const{t:l}=ve(),{auth:o}=Zs(),i="0.9.15",u=[{path:"/",label:l("nav.dashboard"),icon:s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[s.jsx("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),s.jsx("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})]})},{path:"/servers",label:l("nav.servers"),icon:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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&&eg("x")?[{path:"/users",label:l("nav.users"),icon:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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 s.jsxs("aside",{className:`bg-white dark:bg-gray-800 shadow-sm transition-all duration-300 ease-in-out flex flex-col h-full relative ${a?"w-16":"w-64"}`,children:[s.jsx("div",{className:"overflow-y-auto flex-grow",children:s.jsx("nav",{className:"p-3 space-y-1",children:u.map(m=>s.jsxs(Cp,{to:m.path,className:({isActive:h})=>`flex items-center px-2.5 py-2 rounded-lg transition-colors duration-200
|
|
197
|
+
${h?"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:[s.jsx("span",{className:"flex-shrink-0",children:m.icon}),!a&&s.jsx("span",{className:"ml-3",children:m.label})]},m.path))})}),s.jsx("div",{className:"p-3 bg-white dark:bg-gray-800",children:s.jsx(p1,{collapsed:a,version:i})})]})},x1=({children:a})=>s.jsx("main",{className:"flex-1 overflow-auto p-6 bg-gray-100 dark:bg-gray-900",children:s.jsx("div",{className:"container mx-auto",children:a})}),y1=()=>{const[a,l]=Va.useState(!1),o=()=>{l(!a)};return s.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[s.jsx(l1,{onToggleSidebar:o}),s.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[s.jsx(g1,{collapsed:a}),s.jsx(x1,{children:s.jsx(vp,{})})]})]})},v1=({redirectPath:a="/login"})=>{const{t:l}=ve(),{auth:o}=Zs();return o.loading?s.jsx("div",{className:"flex items-center justify-center h-screen",children:l("app.loading")}):o.isAuthenticated?s.jsx(vp,{}):s.jsx(Ao,{to:a,replace:!0})},b1=()=>{const{t:a}=ve(),[l,o]=v.useState(""),[i,u]=v.useState(""),[d,m]=v.useState(null),[h,p]=v.useState(!1),{login:g}=Zs(),x=ts(),w=async k=>{k.preventDefault(),m(null),p(!0);try{if(!l||!i){m(a("auth.emptyFields")),p(!1);return}await g(l,i)?x("/"):m(a("auth.loginFailed"))}catch{m(a("auth.loginError"))}finally{p(!1)}};return s.jsxs("div",{className:"relative min-h-screen w-full overflow-hidden bg-gray-50 dark:bg-gray-950",children:[s.jsxs("div",{className:"absolute top-4 right-4 z-20 flex items-center gap-2",children:[s.jsx(Zp,{}),s.jsx(Wp,{})]}),s.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)"}}),s.jsx("div",{className:"pointer-events-none absolute inset-0 -z-10",children:s.jsxs("svg",{className:"h-full w-full opacity-[0.08] dark:opacity-[0.12]",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("defs",{children:s.jsx("pattern",{id:"grid",width:"32",height:"32",patternUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 32 0 L 0 0 0 32",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})})}),s.jsx("rect",{width:"100%",height:"100%",fill:"url(#grid)",className:"text-gray-400 dark:text-gray-300"})]})}),s.jsx("div",{className:"relative mx-auto flex min-h-screen w-full max-w-md items-center justify-center px-6 py-16",children:s.jsxs("div",{className:"w-full space-y-16",children:[s.jsx("div",{className:"flex justify-center w-full",children:s.jsx("h1",{className:"text-5xl sm:text-5xl font-extrabold leading-tight tracking-tight text-gray-900 dark:text-white whitespace-nowrap",children:s.jsx("span",{className:"bg-gradient-to-r from-indigo-400 via-cyan-400 to-emerald-400 bg-clip-text text-transparent",children:a("auth.slogan")})})}),s.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:[s.jsx("div",{className:"absolute -top-24 right-12 h-40 w-40 -translate-y-6 rounded-full bg-indigo-500/30 blur-3xl"}),s.jsx("div",{className:"absolute -bottom-24 -left-12 h-40 w-40 translate-y-6 rounded-full bg-cyan-500/20 blur-3xl"}),s.jsxs("form",{className:"mt-4 space-y-4",onSubmit:w,children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"username",className:"sr-only",children:a("auth.username")}),s.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:a("auth.username"),value:l,onChange:k=>o(k.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"password",className:"sr-only",children:a("auth.password")}),s.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:a("auth.password"),value:i,onChange:k=>u(k.target.value)})]})]}),d&&s.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}),s.jsx("div",{children:s.jsx("button",{type:"submit",disabled:h,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:a(h?"auth.loggingIn":"auth.login")})})]})]})]})})]})},nl=a=>{const l=s1(),{refreshIfNeeded:o}=l;return v.useEffect(()=>{a!=null&&a.refreshOnMount&&o()},[a==null?void 0:a.refreshOnMount,o]),l},j1=()=>{const{t:a}=ve(),{servers:l,error:o,setError:i,isLoading:u}=nl({refreshOnMount:!0}),d={total:l.length,online:l.filter(h=>h.status==="connected").length,offline:l.filter(h=>h.status==="disconnected").length,connecting:l.filter(h=>h.status==="connecting").length},m={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:a("pages.dashboard.title")}),o&&s.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-status-red text-lg font-medium",children:a("app.error")}),s.jsx("p",{className:"text-gray-600 mt-1",children:o})]}),s.jsx("button",{onClick:()=>i(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":a("app.closeButton"),children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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&&s.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:s.jsxs("div",{className:"flex flex-col items-center",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),s.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}),!u&&s.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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"})})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:a("pages.dashboard.totalServers")}),s.jsx("p",{className:"text-3xl font-bold text-gray-900",children:d.total})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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"})})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:a("pages.dashboard.onlineServers")}),s.jsx("p",{className:"text-3xl font-bold text-gray-900",children:d.online})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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"})})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:a("pages.dashboard.offlineServers")}),s.jsx("p",{className:"text-3xl font-bold text-gray-900",children:d.offline})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:a("pages.dashboard.connectingServers")}),s.jsx("p",{className:"text-3xl font-bold text-gray-900",children:d.connecting})]})]})})]}),l.length>0&&!u&&s.jsxs("div",{className:"mt-8",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:a("pages.dashboard.recentServers")}),s.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:s.jsxs("table",{className:"min-w-full",children:[s.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.name")}),s.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.status")}),s.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.tools")}),s.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.prompts")}),s.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.enabled")})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:l.slice(0,5).map((h,p)=>{var g,x;return s.jsxs("tr",{children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:h.name}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:s.jsx("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${h.status==="connected"?"status-badge-online":h.status==="disconnected"?"status-badge-offline":"status-badge-connecting"}`,children:a(m[h.status]||h.status)})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((g=h.tools)==null?void 0:g.length)||0}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((x=h.prompts)==null?void 0:x.length)||0}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:h.enabled!==!1?s.jsx("span",{className:"text-green-600",children:"✓"}):s.jsx("span",{className:"text-status-red",children:"✗"})})]},p)})})]})})]})]})},w1="modulepreload",N1=function(a,l){return new URL(a,l).href},Hh={},Bh=function(l,o,i){let u=Promise.resolve();if(o&&o.length>0){let m=function(x){return Promise.all(x.map(w=>Promise.resolve(w).then(k=>({status:"fulfilled",value:k}),k=>({status:"rejected",reason:k}))))};const h=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));u=m(o.map(x=>{if(x=N1(x,i),x in Hh)return;Hh[x]=!0;const w=x.endsWith(".css"),k=w?'[rel="stylesheet"]':"";if(!!i)for(let A=h.length-1;A>=0;A--){const O=h[A];if(O.href===x&&(!w||O.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${k}`))return;const E=document.createElement("link");if(E.rel=w?"stylesheet":w1,w||(E.as="script"),E.crossOrigin="",E.href=x,g&&E.setAttribute("nonce",g),document.head.appendChild(E),w)return new Promise((A,O)=>{E.addEventListener("load",A),E.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${x}`)))})}))}function d(m){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=m,window.dispatchEvent(h),!h.defaultPrevented)throw m}return u.then(m=>{for(const h of m||[])h.status==="rejected"&&d(h.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 wo({children:a,variant:l="default",className:o,onClick:i}){return s.jsx("span",{className:Zr("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:a})}const C1=({status:a})=>{const{t:l}=ve(),o={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline"},i={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return s.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${o[a]}`,children:l(i[a]||a)})},sg=async(a,l)=>{try{const o=l?`/tools/${l}/${a.toolName}`:"/tools/call",i=await St(o,a.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(a,l,o)=>{try{const i=await St(`/servers/${a}/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(a,l,o)=>{try{const i=await Bt(`/servers/${a}/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:sg,toggleTool:E1,updateToolDescription:ag},Symbol.toStringTag,{value:"Module"})),Ws=()=>{const{t:a}=ve(),{showToast:l}=al(),[o,i]=v.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!1,bearerAuthKey:"",skipAuth:!1}),[u,d]=v.useState({bearerAuthKey:""}),[m,h]=v.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[p,g]=v.useState({enabled:!1,dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[x,w]=v.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[k,T]=v.useState("-"),[E,A]=v.useState(!1),[O,R]=v.useState(null),[N,M]=v.useState(0),G=v.useCallback(()=>{M(V=>V+1)},[]),W=v.useCallback(async()=>{var V,b,C,L,oe,S,_,Z,H,I;A(!0),R(null);try{const de=await Ge("/settings");de.success&&((b=(V=de.data)==null?void 0:V.systemConfig)!=null&&b.routing)&&i({enableGlobalRoute:de.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:de.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:de.data.systemConfig.routing.enableBearerAuth??!1,bearerAuthKey:de.data.systemConfig.routing.bearerAuthKey||"",skipAuth:de.data.systemConfig.routing.skipAuth??!1}),de.success&&((L=(C=de.data)==null?void 0:C.systemConfig)!=null&&L.install)&&h({pythonIndexUrl:de.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:de.data.systemConfig.install.npmRegistry||"",baseUrl:de.data.systemConfig.install.baseUrl||"http://localhost:3000"}),de.success&&((S=(oe=de.data)==null?void 0:oe.systemConfig)!=null&&S.smartRouting)&&g({enabled:de.data.systemConfig.smartRouting.enabled??!1,dbUrl:de.data.systemConfig.smartRouting.dbUrl||"",openaiApiBaseUrl:de.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:de.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:de.data.systemConfig.smartRouting.openaiApiEmbeddingModel||""}),de.success&&((Z=(_=de.data)==null?void 0:_.systemConfig)!=null&&Z.mcpRouter)&&w({apiKey:de.data.systemConfig.mcpRouter.apiKey||"",referer:de.data.systemConfig.mcpRouter.referer||"https://www.mcphubx.com",title:de.data.systemConfig.mcpRouter.title||"MCPHub",baseUrl:de.data.systemConfig.mcpRouter.baseUrl||"https://api.mcprouter.to/v1"}),de.success&&((I=(H=de.data)==null?void 0:H.systemConfig)==null?void 0:I.nameSeparator)!==void 0&&T(de.data.systemConfig.nameSeparator)}catch(de){console.error("Failed to fetch settings:",de),R(de instanceof Error?de.message:"Failed to fetch settings"),l(a("errors.failedToFetchSettings"))}finally{A(!1)}},[a]),re=async(V,b)=>{A(!0),R(null);try{const C=await Bt("/system-config",{routing:{[V]:b}});return C.success?(i({...o,[V]:b}),l(a("settings.systemConfigUpdated")),!0):(l(C.message||a("errors.failedToUpdateRouteConfig")),!1)}catch(C){return console.error("Failed to update routing config:",C),R(C instanceof Error?C.message:"Failed to update routing config"),l(a("errors.failedToUpdateRouteConfig")),!1}finally{A(!1)}},te=async(V,b)=>{A(!0),R(null);try{const C=await Bt("/system-config",{install:{[V]:b}});return C.success?(h({...m,[V]:b}),l(a("settings.systemConfigUpdated")),!0):(l(C.message||a("errors.failedToUpdateSystemConfig")),!1)}catch(C){return console.error("Failed to update system config:",C),R(C instanceof Error?C.message:"Failed to update system config"),l(a("errors.failedToUpdateSystemConfig")),!1}finally{A(!1)}},$=async(V,b)=>{A(!0),R(null);try{const C=await Bt("/system-config",{smartRouting:{[V]:b}});return C.success?(g({...p,[V]:b}),l(a("settings.systemConfigUpdated")),!0):(l(C.message||a("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(C){console.error("Failed to update smart routing config:",C);const L=C instanceof Error?C.message:"Failed to update smart routing config";return R(L),l(L),!1}finally{A(!1)}},se=async V=>{A(!0),R(null);try{const b=await Bt("/system-config",{smartRouting:V});return b.success?(g({...p,...V}),l(a("settings.systemConfigUpdated")),!0):(l(b.message||a("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(b){console.error("Failed to update smart routing config:",b);const C=b instanceof Error?b.message:"Failed to update smart routing config";return R(C),l(C),!1}finally{A(!1)}},le=async V=>{A(!0),R(null);try{const b=await Bt("/system-config",{routing:V});return b.success?(i({...o,...V}),l(a("settings.systemConfigUpdated")),!0):(l(b.message||a("errors.failedToUpdateRouteConfig")),!1)}catch(b){return console.error("Failed to update routing config:",b),R(b instanceof Error?b.message:"Failed to update routing config"),l(a("errors.failedToUpdateRouteConfig")),!1}finally{A(!1)}},U=async(V,b)=>{A(!0),R(null);try{const C=await Bt("/system-config",{mcpRouter:{[V]:b}});return C.success?(w({...x,[V]:b}),l(a("settings.systemConfigUpdated")),!0):(l(C.message||a("errors.failedToUpdateSystemConfig")),!1)}catch(C){console.error("Failed to update MCPRouter config:",C);const L=C instanceof Error?C.message:"Failed to update MCPRouter config";return R(L),l(L),!1}finally{A(!1)}},z=async V=>{A(!0),R(null);try{const b=await Bt("/system-config",{mcpRouter:V});return b.success?(w({...x,...V}),l(a("settings.systemConfigUpdated")),!0):(l(b.message||a("errors.failedToUpdateSystemConfig")),!1)}catch(b){console.error("Failed to update MCPRouter config:",b);const C=b instanceof Error?b.message:"Failed to update MCPRouter config";return R(C),l(C),!1}finally{A(!1)}},Q=async V=>{A(!0),R(null);try{const b=await Bt("/system-config",{nameSeparator:V});return b.success?(T(V),l(a("settings.restartRequired"),"info"),!0):(l(b.message||a("errors.failedToUpdateSystemConfig")),!1)}catch(b){console.error("Failed to update name separator:",b);const C=b instanceof Error?b.message:"Failed to update name separator";return R(C),l(C),!1}finally{A(!1)}},B=async V=>{A(!0),R(null);try{return await Ge(`/mcp-settings/export?serverName=${V||""}`)}catch(b){console.error("Failed to export MCP settings:",b);const C=b instanceof Error?b.message:"Failed to export MCP settings";R(C),l(C)}finally{A(!1)}};return v.useEffect(()=>{W()},[W,N]),v.useEffect(()=>{o&&d({bearerAuthKey:o.bearerAuthKey})},[o]),{routingConfig:o,tempRoutingConfig:u,setTempRoutingConfig:d,installConfig:m,smartRoutingConfig:p,mcpRouterConfig:x,nameSeparator:k,loading:E,error:O,setError:R,triggerRefresh:G,fetchSettings:W,updateRoutingConfig:re,updateInstallConfig:te,updateSmartRoutingConfig:$,updateSmartRoutingConfigBatch:se,updateRoutingConfigBatch:le,updateMCPRouterConfig:U,updateMCPRouterConfigBatch:z,updateNameSeparator:Q,exportMCPSettings:B}},Qs=({checked:a,onCheckedChange:l,disabled:o=!1})=>s.jsx("button",{type:"button",role:"switch","aria-checked":a,disabled:o,className:Zr("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",a?"bg-blue-200":"bg-gray-100",o?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!o&&l(!a),children:s.jsx("span",{className:Zr("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",a?"translate-x-6":"translate-x-1")})}),ng=({schema:a,onSubmit:l,onCancel:o,loading:i=!1,storageKey:u,title:d})=>{const{t:m}=ve(),[h,p]=v.useState({}),[g,x]=v.useState({}),[w,k]=v.useState(!1),[T,E]=v.useState(""),[A,O]=v.useState(""),R=v.useMemo(()=>(z=>{const Q=B=>{if(typeof B=="object"&&B!==null){const V=B;return{type:V.type||"string",description:V.description,enum:V.enum,default:V.default,properties:V.properties?Object.fromEntries(Object.entries(V.properties).map(([b,C])=>[b,Q(C)])):void 0,required:V.required,items:V.items?Q(V.items):void 0}}return{type:"string"}};return{type:z.type,properties:z.properties?Object.fromEntries(Object.entries(z.properties).map(([B,V])=>[B,Q(V)])):void 0,required:z.required}})(a),[a]);v.useEffect(()=>{const U=(Q,B="")=>{const V={};return Q.type==="object"&&Q.properties&&Object.entries(Q.properties).forEach(([b,C])=>{const L=B?`${B}.${b}`:b;C.default!==void 0?V[b]=C.default:C.type==="string"?V[b]="":C.type==="number"||C.type==="integer"?V[b]=0:C.type==="boolean"?V[b]=!1:C.type==="array"?V[b]=[]:C.type==="object"&&(C.properties?V[b]=U(C,L):V[b]={})}),V};let z=U(R);if(u)try{const Q=localStorage.getItem(u);if(Q){const B=JSON.parse(Q);z={...z,...B}}}catch(Q){console.warn("Failed to load saved form data:",Q)}p(z)},[R,u]),v.useEffect(()=>{w&&Object.keys(h).length>0&&(E(JSON.stringify(h,null,2)),O(""))},[w,h]);const N=U=>{E(U),O("");try{const z=JSON.parse(U);if(p(z),u)try{localStorage.setItem(u,JSON.stringify(z))}catch(Q){console.warn("Failed to save form data to localStorage:",Q)}}catch{O(m("tool.invalidJsonFormat"))}},M=()=>{E(JSON.stringify(h,null,2)),O(""),k(!0)},G=()=>{if(T.trim())try{const U=JSON.parse(T);p(U),O(""),k(!1)}catch{O(m("tool.fixJsonBeforeSwitching"));return}else k(!1)},W=(U,z)=>{p(Q=>{const B={...Q},V=U.split(".");let b=B;for(let C=0;C<V.length-1;C++)b[V[C]]||(b[V[C]]={}),b=b[V[C]];if(b[V[V.length-1]]=z,u)try{localStorage.setItem(u,JSON.stringify(B))}catch(C){console.warn("Failed to save form data to localStorage:",C)}return B}),g[U]&&x(Q=>{const B={...Q};return delete B[U],B})},re=()=>{const U={},z=(Q,B,V="")=>{Q.type==="object"&&Q.properties&&Object.entries(Q.properties).forEach(([b,C])=>{var S;const L=V?`${V}.${b}`:b,oe=$(B,L);if((S=Q.required)!=null&&S.includes(b)&&(oe==null||oe==="")){U[L]=`${b} is required`;return}oe!=null&&oe!==""&&(C.type==="string"&&typeof oe!="string"?U[L]=`${b} must be a string`:C.type==="number"&&typeof oe!="number"?U[L]=`${b} must be a number`:C.type==="integer"&&(!Number.isInteger(oe)||typeof oe!="number")?U[L]=`${b} must be an integer`:C.type==="boolean"&&typeof oe!="boolean"?U[L]=`${b} must be a boolean`:C.type==="array"&&Array.isArray(oe)?C.items&&oe.forEach((_,Z)=>{var H;((H=C.items)==null?void 0:H.type)==="object"&&C.items.properties&&z(C.items,_,`${L}.${Z}`)}):C.type==="object"&&typeof oe=="object"&&z(C,oe,L))})};return z(R,h),x(U),Object.keys(U).length===0},te=U=>{U.preventDefault(),re()&&l(h)},$=(U,z)=>z.split(".").reduce((Q,B)=>Q==null?void 0:Q[B],U),se=(U,z,Q,B)=>{const V=Q==null?void 0:Q[U];return z.type==="string"?z.enum?s.jsxs("select",{value:V||"",onChange:b=>B(b.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:[s.jsx("option",{value:"",children:m("tool.selectOption")}),z.enum.map((b,C)=>s.jsx("option",{value:b,children:b},C))]}):s.jsx("input",{type:"text",value:V||"",onChange:b=>B(b.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"?s.jsx("input",{type:"number",step:z.type==="integer"?"1":"any",value:V??"",onChange:b=>{const C=b.target.value===""?"":z.type==="integer"?parseInt(b.target.value):parseFloat(b.target.value);B(C)},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"?s.jsx("input",{type:"checkbox",checked:V||!1,onChange:b=>B(b.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):s.jsx("input",{type:"text",value:V||"",onChange:b=>B(b.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})})},le=(U,z,Q="")=>{var C,L,oe,S,_,Z,H,I,de,ee,Y,ue,je,Se;const B=Q?`${Q}.${U}`:U,V=$(h,B),b=g[B];if(z.type==="array"){const ye=$(h,B)||[];return s.jsxs("div",{className:"mb-6",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Q?(L=(C=$(R,Q))==null?void 0:C.required)==null?void 0:L.includes(U):(oe=R.required)==null?void 0:oe.includes(U))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),s.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[ye.map((Me,ce)=>{var Ae,nt,Ct;return s.jsxs("div",{className:"mb-3 p-3 bg-white border rounded-md",children:[s.jsxs("div",{className:"flex justify-between items-center mb-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:m("tool.item",{index:ce+1})}),s.jsx("button",{type:"button",onClick:()=>{const ze=[...ye];ze.splice(ce,1),W(B,ze)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((Ae=z.items)==null?void 0:Ae.type)==="string"&&z.items.enum?s.jsxs("select",{value:Me||"",onChange:ze=>{const Et=[...ye];Et[ce]=ze.target.value,W(B,Et)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[s.jsx("option",{value:"",children:m("tool.selectOption")}),z.items.enum.map((ze,Et)=>s.jsx("option",{value:ze,children:ze},Et))]}):((nt=z.items)==null?void 0:nt.type)==="object"&&z.items.properties?s.jsx("div",{className:"space-y-3",children:Object.entries(z.items.properties).map(([ze,Et])=>{var br,Yt;return s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ze,((Yt=(br=z.items)==null?void 0:br.required)==null?void 0:Yt.includes(ze))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),se(ze,Et,Me,Xt=>{const Qt=[...ye];Qt[ce]={...Qt[ce],[ze]:Xt},W(B,Qt)})]},ze)})}):s.jsx("input",{type:"text",value:Me||"",onChange:ze=>{const Et=[...ye];Et[ce]=ze.target.value,W(B,Et)},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:((Ct=z.items)==null?void 0:Ct.type)||"value"})})]},ce)}),s.jsx("button",{type:"button",onClick:()=>{var ce;const Me=((ce=z.items)==null?void 0:ce.type)==="object"?{}:"";W(B,[...ye,Me])},className:"w-full mt-2 px-3 py-2 text-sm text-blue-600 border border-blue-300 rounded-md hover:bg-blue-50",children:m("tool.addItem",{key:U})})]}),b&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:b})]},B)}return z.type==="object"?z.properties?s.jsxs("div",{className:"mb-6",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Q?(_=(S=$(R,Q))==null?void 0:S.required)==null?void 0:_.includes(U):(Z=R.required)==null?void 0:Z.includes(U))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),s.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(z.properties).map(([ye,Me])=>le(ye,Me,B))}),b&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:b})]},B):s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Q?(I=(H=$(R,Q))==null?void 0:H.required)==null?void 0:I.includes(U):(de=R.required)==null?void 0:de.includes(U))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"}),s.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),z.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),s.jsx("textarea",{value:typeof V=="object"?JSON.stringify(V,null,2):V||"{}",onChange:ye=>{try{const Me=JSON.parse(ye.target.value);W(B,Me)}catch{W(B,ye.target.value)}},placeholder:`{
|
|
198
|
+
"key": "value"
|
|
199
|
+
}`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${b?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),b&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:b})]},B):z.type==="string"?z.enum?s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Q?!1:(ee=R.required)==null?void 0:ee.includes(U))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),s.jsxs("select",{value:V||"",onChange:ye=>W(B,ye.target.value),className:`w-full border rounded-md px-3 py-2 ${b?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[s.jsx("option",{value:"",children:m("tool.selectOption")}),z.enum.map((ye,Me)=>s.jsx("option",{value:ye,children:ye},Me))]}),b&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:b})]},B):s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Q?!1:(Y=R.required)==null?void 0:Y.includes(U))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),s.jsx("input",{type:"text",value:V||"",onChange:ye=>W(B,ye.target.value),className:`w-full border rounded-md px-3 py-2 ${b?"border-red":"border-gray-200"} focus:outline-none form-input`}),b&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:b})]},B):z.type==="number"||z.type==="integer"?s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Q?!1:(ue=R.required)==null?void 0:ue.includes(U))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),z.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),s.jsx("input",{type:"number",step:z.type==="integer"?"1":"any",value:V??"",onChange:ye=>{const Me=ye.target.value===""?"":z.type==="integer"?parseInt(ye.target.value):parseFloat(ye.target.value);W(B,Me)},className:`w-full border rounded-md px-3 py-2 form-input ${b?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),b&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:b})]},B):z.type==="boolean"?s.jsxs("div",{className:"mb-4",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",checked:V||!1,onChange:ye=>W(B,ye.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),s.jsxs("label",{className:"ml-2 block text-sm text-gray-700",children:[U,(Q?!1:(je=R.required)==null?void 0:je.includes(U))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),z.description&&s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:z.description}),b&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:b})]},B):s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[U,(Q?!1:(Se=R.required)==null?void 0:Se.includes(U))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"}),s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",z.type,")"]})]}),z.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:z.description}),s.jsx("input",{type:"text",value:V||"",onChange:ye=>W(B,ye.target.value),placeholder:m("tool.enterValue",{type:z.type}),className:`w-full border rounded-md px-3 py-2 ${b?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),b&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:b})]},B)};return R.properties?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex justify-between items-center pb-3",children:[s.jsx("h6",{className:"text-md font-medium text-gray-900",children:d}),s.jsxs("div",{className:"flex space-x-2",children:[s.jsx("button",{type:"button",onClick:G,className:`px-3 py-1 text-sm rounded-md transition-colors ${w?"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")}),s.jsx("button",{type:"button",onClick:M,className:`px-3 py-1 text-sm rounded-md transition-colors ${w?"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")})]})]}),w?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("tool.jsonConfiguration")}),s.jsx("textarea",{value:T,onChange:U=>N(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 ${A?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),A&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]}),s.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[s.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")}),s.jsx("button",{onClick:()=>{try{const U=JSON.parse(T);l(U)}catch{O(m("tool.invalidJsonFormat"))}},disabled:i||!!A,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")})]})]}):s.jsxs("form",{onSubmit:te,className:"space-y-4",children:[Object.entries(R.properties||{}).map(([U,z])=>le(U,z)),s.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[s.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")}),s.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")})]})]})]}):s.jsxs("div",{className:"p-4 bg-gray-50 rounded-md",children:[s.jsx("p",{className:"text-sm text-gray-600",children:m("tool.noParameters")}),s.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[s.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")}),s.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")})]})]})},A1=({result:a,onClose:l})=>{const{t:o}=ve(),i=a.content,u=m=>Array.isArray(m)?m.map((h,p)=>s.jsx("div",{className:"mb-3 last:mb-0",children:d(h)},p)):d(m),d=m=>{if(typeof m=="string")return s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.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 s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m.text})});if(m.type==="image"&&m.data)return s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.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 h=typeof m=="string"?JSON.parse(m):m;return s.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[s.jsx("div",{className:"text-xs text-gray-500 mb-2",children:o("tool.jsonResponse")}),s.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(h,null,2)})]})}catch{return s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})}}return s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})};return s.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[s.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[a.success?s.jsx(Dp,{size:20,className:"text-status-green"}):s.jsx(Up,{size:20,className:"text-status-red"}),s.jsx("div",{children:s.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[o("tool.execution")," ",a.success?o("tool.successful"):o("tool.failed")]})})]}),s.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),s.jsx("div",{className:"p-4",children:a.success?s.jsx("div",{children:a.content&&a.content.length>0?s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-gray-600 mb-3",children:o("tool.result")}),u(a.content)]}):s.jsx("div",{className:"text-sm text-gray-500 italic",children:o("tool.noContent")})}):s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[s.jsx(Tu,{size:16,className:"text-red-500"}),s.jsx("span",{className:"text-sm font-medium text-red-700",children:o("tool.error")})]}),i&&i.length>0?s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-gray-600 mb-3",children:o("tool.errorDetails")}),u(i)]}):s.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:s.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:a.error||a.message||o("tool.unknownError")})})]})})]})};function T1(a){return a==null?!0:typeof a=="string"?a.trim()==="":Array.isArray(a)?a.length===0:typeof a=="object"?Object.keys(a).length===0:!1}const R1=({tool:a,server:l,onToggle:o,onDescriptionUpdate:i})=>{const{t:u}=ve(),{nameSeparator:d}=Ws(),[m,h]=v.useState(!1),[p,g]=v.useState(!1),[x,w]=v.useState(!1),[k,T]=v.useState(null),[E,A]=v.useState(!1),[O,R]=v.useState(a.description||""),N=v.useRef(null),M=v.useRef(null),[G,W]=v.useState(0);v.useEffect(()=>{E&&N.current&&(N.current.focus(),G>0&&(N.current.style.width=`${G+20}px`))},[E,G]),v.useEffect(()=>{!E&&M.current&&W(M.current.offsetWidth)},[E,O]);const re=v.useCallback(()=>`mcphub_tool_form_${l?`${l}_`:""}${a.name}`,[a.name,l]),te=v.useCallback(()=>{localStorage.removeItem(re())},[re]),$=b=>{o&&o(a.name,b)},se=()=>{A(!0)},le=async()=>{try{const b=await ag(l,a.name,O);b.success?(A(!1),i&&i(a.name,O)):(R(a.description||""),console.error("Failed to update tool description:",b.error))}catch(b){console.error("Error updating tool description:",b),R(a.description||""),A(!1)}},U=b=>{R(b.target.value)},z=b=>{b.key==="Enter"?le():b.key==="Escape"&&(R(a.description||""),A(!1))},Q=async b=>{w(!0);try{b=Object.fromEntries(Object.entries(b).filter(([L,oe])=>!T1(oe)));const C=await sg({toolName:a.name,arguments:b},l);T(C)}catch(C){T({success:!1,error:C instanceof Error?C.message:"Unknown error occurred"})}finally{w(!1)}},B=()=>{g(!1),te(),T(null)},V=()=>{T(null)};return s.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg p-4 mb-4",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>h(!m),children:[s.jsx("div",{className:"flex-1",children:s.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[a.name.replace(l+d,""),s.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:E?s.jsxs(s.Fragment,{children:[s.jsx("input",{ref:N,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:O,onChange:U,onKeyDown:z,onClick:b=>b.stopPropagation(),style:{minWidth:"100px",width:G>0?`${G+20}px`:"auto"}}),s.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:b=>{b.stopPropagation(),le()},children:s.jsx(Ka,{size:16})})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M,children:O||u("tool.noDescription")}),s.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:b=>{b.stopPropagation(),se()},children:s.jsx(_o,{size:14})})]})})]})}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"flex items-center space-x-2",onClick:b=>b.stopPropagation(),children:s.jsx(Qs,{checked:a.enabled??!0,onCheckedChange:$,disabled:x})}),s.jsxs("button",{onClick:b=>{b.stopPropagation(),h(!0),g(!0)},className:"flex items-center space-x-1 px-3 py-1 text-sm text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors btn-primary",disabled:x||!a.enabled,children:[x?s.jsx(Lp,{size:14,className:"animate-spin"}):s.jsx(zp,{size:14}),s.jsx("span",{children:u(x?"tool.running":"tool.run")})]}),s.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:m?s.jsx(Po,{size:18}):s.jsx(Au,{size:18})})]})]}),m&&s.jsxs("div",{className:"mt-4 space-y-4",children:[!p&&s.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:u("tool.inputSchema")}),s.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(a.inputSchema,null,2)})]}),p&&s.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[s.jsx(ng,{schema:a.inputSchema||{type:"object"},onSubmit:Q,onCancel:B,loading:x,storageKey:re(),title:u("tool.runToolWithName",{name:a.name.replace(l+d,"")})}),k&&s.jsx("div",{className:"mt-4",children:s.jsx(A1,{result:k,onClose:V})})]})]})]})},lg=async(a,l)=>{try{const o=await St(`/mcp/${l}/prompts/${encodeURIComponent(a.promptName)}`,{name:a.promptName,arguments:a.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(a,l,o)=>{try{const i=await St(`/servers/${a}/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:lg,togglePrompt:M1},Symbol.toStringTag,{value:"Module"})),qh=({result:a,onClose:l})=>{const{t:o}=ve(),i=u=>{if(typeof u=="string")return s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.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 s.jsxs("div",{className:"space-y-4",children:[u.description&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:o("prompt.description")}),s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.jsx("p",{className:"text-sm text-gray-800",children:u.description})})]}),u.messages&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:o("prompt.messages")}),s.jsx("div",{className:"space-y-3",children:u.messages.map((d,m)=>s.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[s.jsx("div",{className:"flex items-center mb-2",children:s.jsxs("span",{className:"inline-block w-16 text-xs font-medium text-gray-500",children:[d.role,":"]})}),typeof d.content=="string"?s.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d.content}):typeof d.content=="object"&&d.content.type==="text"?s.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d.content.text}):s.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 s.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[s.jsx("div",{className:"text-xs text-gray-500 mb-2",children:o("prompt.jsonResponse")}),s.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(d,null,2)})]})}catch{return s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(u)})})}}return s.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:s.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(u)})})};return s.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[s.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[a.success?s.jsx(Dp,{size:20,className:"text-status-green"}):s.jsx(Up,{size:20,className:"text-status-red"}),s.jsx("div",{children:s.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[o("prompt.execution")," ",a.success?o("prompt.successful"):o("prompt.failed")]})})]}),s.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),s.jsx("div",{className:"p-4",children:a.success?s.jsx("div",{children:a.data?s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-gray-600 mb-3",children:o("prompt.result")}),i(a.data)]}):s.jsx("div",{className:"text-sm text-gray-500 italic",children:o("prompt.noContent")})}):s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[s.jsx(Tu,{size:16,className:"text-red-500"}),s.jsx("span",{className:"text-sm font-medium text-red-700",children:o("prompt.error")})]}),s.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:s.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:a.error||a.message||o("prompt.unknownError")})})]})})]})},D1=({prompt:a,server:l,onToggle:o,onDescriptionUpdate:i})=>{const{t:u}=ve(),{nameSeparator:d}=Ws(),[m,h]=v.useState(!1),[p,g]=v.useState(!1),[x,w]=v.useState(!1),[k,T]=v.useState(null),[E,A]=v.useState(!1),[O,R]=v.useState(a.description||""),N=v.useRef(null),M=v.useRef(null),[G,W]=v.useState(0);v.useEffect(()=>{E&&N.current&&(N.current.focus(),G>0&&(N.current.style.width=`${G+20}px`))},[E,G]),v.useEffect(()=>{!E&&M.current&&W(M.current.offsetWidth)},[E,O]);const re=v.useCallback(()=>`mcphub_prompt_form_${l?`${l}_`:""}${a.name}`,[a.name,l]),te=v.useCallback(()=>{localStorage.removeItem(re())},[re]),$=C=>{o&&o(a.name,C)},se=()=>{A(!0)},le=async()=>{A(!1),i&&i(a.name,O)},U=C=>{R(C.target.value)},z=C=>{C.key==="Enter"?le():C.key==="Escape"&&(R(a.description||""),A(!1))},Q=async C=>{w(!0);try{const L=await lg({promptName:a.name,arguments:C},l);console.log("GetPrompt result:",L),T({success:L.success,data:L.data,error:L.error})}catch(L){T({success:!1,error:L instanceof Error?L.message:"Unknown error occurred"})}finally{w(!1)}},B=()=>{g(!1),te(),T(null)},V=()=>{T(null)},b=()=>{if(!a.arguments||a.arguments.length===0)return{type:"object",properties:{},required:[]};const C={},L=[];return a.arguments.forEach(oe=>{C[oe.name]={type:"string",description:oe.description||""},oe.required&&L.push(oe.name)}),{type:"object",properties:C,required:L}};return s.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg p-4 mb-4",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>h(!m),children:[s.jsx("div",{className:"flex-1",children:s.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[a.name.replace(l+d,""),a.title&&s.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600",children:a.title}),s.jsx("span",{className:"ml-2 text-sm font-normal text-gray-500 inline-flex items-center",children:E?s.jsxs(s.Fragment,{children:[s.jsx("input",{ref:N,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:O,onChange:U,onKeyDown:z,onClick:C=>C.stopPropagation(),style:{minWidth:"100px",width:G>0?`${G+20}px`:"auto"}}),s.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:C=>{C.stopPropagation(),le()},children:s.jsx(Ka,{size:16})})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M,children:O||u("tool.noDescription")}),s.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:C=>{C.stopPropagation(),se()},children:s.jsx(_o,{size:14})})]})})]})}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"flex items-center space-x-2",onClick:C=>C.stopPropagation(),children:a.enabled!==void 0&&s.jsx(Qs,{checked:a.enabled,onCheckedChange:$,disabled:x})}),s.jsxs("button",{onClick:C=>{C.stopPropagation(),h(!0),g(!0)},className:"flex items-center space-x-1 px-3 py-1 text-sm text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors btn-primary",disabled:x||!a.enabled,children:[x?s.jsx(Lp,{size:14,className:"animate-spin"}):s.jsx(zp,{size:14}),s.jsx("span",{children:u(x?"tool.running":"tool.run")})]}),s.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:m?s.jsx(Po,{size:18}):s.jsx(Au,{size:18})})]})]}),m&&s.jsxs("div",{className:"mt-4 space-y-4",children:[p&&s.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[s.jsx(ng,{schema:b(),onSubmit:Q,onCancel:B,loading:x,storageKey:re(),title:u("prompt.runPromptWithName",{name:a.name.replace(l+d,"")})}),k&&s.jsx("div",{className:"mt-4",children:s.jsx(qh,{result:k,onClose:V})})]}),!p&&a.arguments&&a.arguments.length>0&&s.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:u("tool.parameters")}),s.jsx("div",{className:"space-y-2",children:a.arguments.map((C,L)=>s.jsxs("div",{className:"flex items-start",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("span",{className:"font-medium text-gray-700",children:C.name}),C.required&&s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),C.description&&s.jsx("p",{className:"text-sm text-gray-600 mt-1",children:C.description})]}),s.jsx("div",{className:"text-xs text-gray-500 ml-2",children:C.title||""})]},L))})]}),!p&&k&&s.jsx("div",{className:"mt-4",children:s.jsx(qh,{result:k,onClose:V})})]})]})},Mu=({isOpen:a,onClose:l,onConfirm:o,serverName:i,isGroup:u=!1,isUser:d=!1})=>{const{t:m}=ve();return a?s.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:s.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:s.jsxs("div",{className:"p-6",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:m(d?"users.confirmDelete":u?"groups.confirmDelete":"server.confirmDelete")}),s.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})}),s.jsxs("div",{className:"flex justify-end space-x-3",children:[s.jsx("button",{onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),s.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:a,onRemove:l,onEdit:o,onToggle:i,onRefresh:u})=>{var z,Q;const{t:d}=ve(),{showToast:m}=al(),[h,p]=v.useState(!1),[g,x]=v.useState(!1),[w,k]=v.useState(!1),[T,E]=v.useState(!1),[A,O]=v.useState(!1),R=v.useRef(null);v.useEffect(()=>{const B=V=>{R.current&&!R.current.contains(V.target)&&E(!1)};return document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[]);const{exportMCPSettings:N}=Ws(),M=B=>{B.stopPropagation(),x(!0)},G=B=>{B.stopPropagation(),o(a)},W=async B=>{if(B.stopPropagation(),!(w||!i)){k(!0);try{await i(a,a.enabled===!1)}finally{k(!1)}}},re=B=>{B.stopPropagation(),E(!T)},te=B=>{if(B.stopPropagation(),!!a.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(a.error).then(()=>{O(!0),m(d("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>O(!1),2e3)});else{const V=document.createElement("textarea");V.value=a.error,V.style.position="fixed",V.style.left="-9999px",document.body.appendChild(V),V.focus(),V.select();try{document.execCommand("copy"),O(!0),m(d("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>O(!1),2e3)}catch(b){m(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",b)}document.body.removeChild(V)}},$=async B=>{B.stopPropagation();try{const V=await N(a.name),b=JSON.stringify(V.data,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(b),m(d("common.copySuccess")||"Copied to clipboard","success");else{const C=document.createElement("textarea");C.value=b,C.style.position="fixed",C.style.left="-9999px",document.body.appendChild(C),C.focus(),C.select();try{document.execCommand("copy"),m(d("common.copySuccess")||"Copied to clipboard","success")}catch(L){m(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",L)}document.body.removeChild(C)}}catch(V){console.error("Error copying server configuration:",V),m(d("common.copyFailed")||"Copy failed","error")}},se=()=>{l(a.name),x(!1)},le=async(B,V)=>{try{const{toggleTool:b}=await Bh(async()=>{const{toggleTool:L}=await Promise.resolve().then(()=>k1);return{toggleTool:L}},[],import.meta.url),C=await b(a.name,B,V);C.success?(m(d(V?"tool.enableSuccess":"tool.disableSuccess",{name:B}),"success"),u&&u()):m(C.error||d("tool.toggleFailed"),"error")}catch(b){console.error("Error toggling tool:",b),m(d("tool.toggleFailed"),"error")}},U=async(B,V)=>{try{const{togglePrompt:b}=await Bh(async()=>{const{togglePrompt:L}=await Promise.resolve().then(()=>O1);return{togglePrompt:L}},void 0,import.meta.url),C=await b(a.name,B,V);C.success?(m(d(V?"tool.enableSuccess":"tool.disableSuccess",{name:B}),"success"),u&&u()):m(C.error||d("tool.toggleFailed"),"error")}catch(b){console.error("Error toggling prompt:",b),m(d("tool.toggleFailed"),"error")}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bg-white shadow rounded-lg p-6 mb-6 page-card transition-all duration-200 ${a.enabled===!1?"opacity-60":""}`,children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>p(!h),children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("h2",{className:`text-xl font-semibold ${a.enabled===!1?"text-gray-600":"text-gray-900"}`,children:a.name}),s.jsx(C1,{status:a.status}),s.jsxs("div",{className:"flex items-center px-2 py-1 bg-blue-50 text-blue-700 rounded-full text-sm btn-primary",children:[s.jsx("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:s.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"})}),s.jsxs("span",{children:[((z=a.tools)==null?void 0:z.length)||0," ",d("server.tools")]})]}),s.jsxs("div",{className:"flex items-center px-2 py-1 bg-purple-50 text-purple-700 rounded-full text-sm btn-primary",children:[s.jsxs("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:[s.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"}),s.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"})]}),s.jsxs("span",{children:[((Q=a.prompts)==null?void 0:Q.length)||0," ",d("server.prompts")]})]}),a.error&&s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"cursor-pointer",onClick:re,"aria-label":d("server.viewErrorDetails"),children:s.jsx(Tu,{className:"text-red-500 hover:text-red-600",size:18})}),T&&s.jsxs("div",{ref:R,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:B=>B.stopPropagation(),children:[s.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:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("h4",{className:"text-sm font-medium text-red-600",children:d("server.errorDetails")}),s.jsx("button",{onClick:te,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:d("common.copy"),children:A?s.jsx(Ka,{size:14,className:"text-green-500"}):s.jsx(Ro,{size:14})})]}),s.jsx("button",{onClick:B=>{B.stopPropagation(),E(!1)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),s.jsx("div",{className:"p-4 pt-2",children:s.jsx("pre",{className:"text-sm text-gray-700 break-words whitespace-pre-wrap",children:a.error})})]})]})]}),s.jsxs("div",{className:"flex space-x-2",children:[s.jsx("button",{onClick:$,className:"px-3 py-1 btn-secondary",children:d("server.copy")}),s.jsx("button",{onClick:G,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:d("server.edit")}),s.jsx("div",{className:"flex items-center",children:s.jsx("button",{onClick:W,className:`px-3 py-1 text-sm rounded transition-colors ${w?"bg-gray-200 text-gray-500":a.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:w,children:w?d("common.processing"):a.enabled!==!1?d("server.disable"):d("server.enable")})}),s.jsx("button",{onClick:M,className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 text-sm btn-danger",children:d("server.delete")}),s.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:h?s.jsx(Po,{size:18}):s.jsx(Au,{size:18})})]})]}),h&&s.jsxs(s.Fragment,{children:[a.tools&&s.jsxs("div",{className:"mt-6",children:[s.jsx("h6",{className:`font-medium ${a.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:d("server.tools")}),s.jsx("div",{className:"space-y-4",children:a.tools.map((B,V)=>s.jsx(R1,{server:a.name,tool:B,onToggle:le},V))})]}),a.prompts&&s.jsxs("div",{className:"mt-6",children:[s.jsx("h6",{className:`font-medium ${a.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:d("server.prompts")}),s.jsx("div",{className:"space-y-4",children:a.prompts.map((B,V)=>s.jsx(D1,{server:a.name,prompt:B,onToggle:U},V))})]})]})]}),s.jsx(Mu,{isOpen:g,onClose:()=>x(!1),onConfirm:se,serverName:a.name})]})},ll=({onSubmit:a,onCancel:l,initialData:o=null,modalTitle:i,formError:u=null})=>{var b,C,L,oe,S,_,Z,H,I,de,ee,Y,ue,je,Se,ye,Me,ce,Ae,nt,Ct,ze,Et,br,Yt,Xt,Qt,rs,ss,Rs,Jt,ft,Ot,mt,as,fr,ea,Or,Dr,Zt,mr,jr,ta;const{t:d}=ve(),m=()=>!o||!o.config?"stdio":o.config.type?o.config.type:o.config.url?"sse":"stdio",h=me=>!me||!me.config||!me.config.env?[]:Object.entries(me.config.env).map(([fe,he])=>({key:fe,value:he,description:""})),[p,g]=v.useState(m()),[x,w]=v.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:h(o),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:((L=(C=o.config.openapi.security)==null?void 0:C.apiKey)==null?void 0:L.name)||"",apiKeyIn:((S=(oe=o.config.openapi.security)==null?void 0:oe.apiKey)==null?void 0:S.in)||"header",apiKeyValue:((Z=(_=o.config.openapi.security)==null?void 0:_.apiKey)==null?void 0:Z.value)||"",httpScheme:((I=(H=o.config.openapi.security)==null?void 0:H.http)==null?void 0:I.scheme)||"bearer",httpCredentials:((ee=(de=o.config.openapi.security)==null?void 0:de.http)==null?void 0:ee.credentials)||"",oauth2Token:((ue=(Y=o.config.openapi.security)==null?void 0:Y.oauth2)==null?void 0:ue.token)||"",openIdConnectUrl:((Se=(je=o.config.openapi.security)==null?void 0:je.openIdConnect)==null?void 0:Se.url)||"",openIdConnectToken:((Me=(ye=o.config.openapi.security)==null?void 0:ye.openIdConnect)==null?void 0:Me.token)||"",passthroughHeaders:o.config.openapi.passthroughHeaders?o.config.openapi.passthroughHeaders.join(", "):""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none",passthroughHeaders:""}}),[k,T]=v.useState(o&&o.config&&o.config.env?Object.entries(o.config.env).map(([me,fe])=>({key:me,value:fe})):[]),[E,A]=v.useState(o&&o.config&&o.config.headers?Object.entries(o.config.headers).map(([me,fe])=>({key:me,value:fe})):[]),[O,R]=v.useState(!1),[N,M]=v.useState(null),G=!!o,W=me=>{const{name:fe,value:he}=me.target;w({...x,[fe]:he})},re=me=>{const fe=me.split(" ").filter(he=>he.trim()!=="");w({...x,arguments:me,args:fe})},te=me=>{g(me),w(fe=>({...fe,type:me}))},$=(me,fe,he)=>{const kt=[...k];kt[me][fe]=he,T(kt)},se=()=>{T([...k,{key:"",value:""}])},le=me=>{const fe=[...k];fe.splice(me,1),T(fe)},U=(me,fe,he)=>{const kt=[...E];kt[me][fe]=he,A(kt)},z=()=>{A([...E,{key:"",value:""}])},Q=me=>{const fe=[...E];fe.splice(me,1),A(fe)},B=(me,fe)=>{w(he=>({...he,options:{...he.options,[me]:fe}}))},V=async me=>{var fe,he,kt;me.preventDefault(),M(null);try{const hr={};k.forEach(({key:bt,value:pr})=>{bt.trim()&&(hr[bt.trim()]=pr)});const wr={};E.forEach(({key:bt,value:pr})=>{bt.trim()&&(wr[bt.trim()]=pr)});const Nr={};(fe=x.options)!=null&&fe.timeout&&x.options.timeout!==6e4&&(Nr.timeout=x.options.timeout),(he=x.options)!=null&&he.resetTimeoutOnProgress&&(Nr.resetTimeoutOnProgress=x.options.resetTimeoutOnProgress),(kt=x.options)!=null&&kt.maxTotalTimeout&&(Nr.maxTotalTimeout=x.options.maxTotalTimeout);const ns={name:x.name,config:{type:p,...p==="openapi"?{openapi:(()=>{var pr,Je,He,tt,rt,Wt,Ur;const bt={version:((pr=x.openapi)==null?void 0:pr.version)||"3.1.0"};if(((Je=x.openapi)==null?void 0:Je.inputMode)==="url")bt.url=((He=x.openapi)==null?void 0:He.url)||"";else if(((tt=x.openapi)==null?void 0:tt.inputMode)==="schema"&&((rt=x.openapi)!=null&&rt.schema))try{bt.schema=JSON.parse(x.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(Wt=x.openapi)!=null&&Wt.securityType&&x.openapi.securityType!=="none"&&(bt.security={type:x.openapi.securityType,...x.openapi.securityType==="apiKey"&&{apiKey:{name:x.openapi.apiKeyName||"",in:x.openapi.apiKeyIn||"header",value:x.openapi.apiKeyValue||""}},...x.openapi.securityType==="http"&&{http:{scheme:x.openapi.httpScheme||"bearer",credentials:x.openapi.httpCredentials||""}},...x.openapi.securityType==="oauth2"&&{oauth2:{token:x.openapi.oauth2Token||""}},...x.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:x.openapi.openIdConnectUrl||"",token:x.openapi.openIdConnectToken||""}}}),(Ur=x.openapi)!=null&&Ur.passthroughHeaders&&x.openapi.passthroughHeaders.trim()&&(bt.passthroughHeaders=x.openapi.passthroughHeaders.split(",").map(Sr=>Sr.trim()).filter(Sr=>Sr.length>0)),bt})(),...Object.keys(wr).length>0?{headers:wr}:{}}:p==="sse"||p==="streamable-http"?{url:x.url,...Object.keys(wr).length>0?{headers:wr}:{}}:{command:x.command,args:x.args,env:Object.keys(hr).length>0?hr:void 0},...Object.keys(Nr).length>0?{options:Nr}:{}}};a(ns)}catch(hr){M(`Error: ${hr instanceof Error?hr.message:String(hr)}`)}};return s.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-xl max-h-screen overflow-y-auto",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:i}),s.jsx("button",{onClick:l,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(N||u)&&s.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:u||N}),s.jsxs("form",{onSubmit:V,children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:d("server.name")}),s.jsx("input",{type:"text",name:"name",id:"name",value:x.name,onChange:W,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:G})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.type")}),s.jsxs("div",{className:"flex space-x-4",children:[s.jsxs("div",{children:[s.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:p==="stdio",onChange:()=>te("stdio"),className:"mr-1"}),s.jsx("label",{htmlFor:"command",children:d("server.typeStdio")})]}),s.jsxs("div",{children:[s.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>te("sse"),className:"mr-1"}),s.jsx("label",{htmlFor:"url",children:d("server.typeSse")})]}),s.jsxs("div",{children:[s.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>te("streamable-http"),className:"mr-1"}),s.jsx("label",{htmlFor:"streamable-http",children:d("server.typeStreamableHttp")})]}),s.jsxs("div",{children:[s.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>te("openapi"),className:"mr-1"}),s.jsx("label",{htmlFor:"openapi",children:d("server.typeOpenapi")})]})]})]}),p==="openapi"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.inputMode")}),s.jsxs("div",{className:"flex space-x-4",children:[s.jsxs("div",{children:[s.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((ce=x.openapi)==null?void 0:ce.inputMode)==="url",onChange:()=>w(me=>({...me,openapi:{...me.openapi,inputMode:"url"}})),className:"mr-1"}),s.jsx("label",{htmlFor:"input-mode-url",children:d("server.openapi.inputModeUrl")})]}),s.jsxs("div",{children:[s.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((Ae=x.openapi)==null?void 0:Ae.inputMode)==="schema",onChange:()=>w(me=>({...me,openapi:{...me.openapi,inputMode:"schema"}})),className:"mr-1"}),s.jsx("label",{htmlFor:"input-mode-schema",children:d("server.openapi.inputModeSchema")})]})]})]}),((nt=x.openapi)==null?void 0:nt.inputMode)==="url"&&s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-url",children:d("server.openapi.specUrl")}),s.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((Ct=x.openapi)==null?void 0:Ct.url)||"",onChange:me=>w(fe=>({...fe,openapi:{...fe.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"&&((ze=x.openapi)==null?void 0:ze.inputMode)==="url"})]}),((Et=x.openapi)==null?void 0:Et.inputMode)==="schema"&&s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-schema",children:d("server.openapi.schema")}),s.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((br=x.openapi)==null?void 0:br.schema)||"",onChange:me=>w(fe=>({...fe,openapi:{...fe.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"&&((Yt=x.openapi)==null?void 0:Yt.inputMode)==="schema"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.openapi.schemaHelp")})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.security")}),s.jsxs("select",{value:((Xt=x.openapi)==null?void 0:Xt.securityType)||"none",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,securityType:me.target.value,url:((he=fe.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:[s.jsx("option",{value:"none",children:d("server.openapi.securityNone")}),s.jsx("option",{value:"apiKey",children:d("server.openapi.securityApiKey")}),s.jsx("option",{value:"http",children:d("server.openapi.securityHttp")}),s.jsx("option",{value:"oauth2",children:d("server.openapi.securityOAuth2")}),s.jsx("option",{value:"openIdConnect",children:d("server.openapi.securityOpenIdConnect")})]})]}),((Qt=x.openapi)==null?void 0:Qt.securityType)==="apiKey"&&s.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.apiKeyConfig")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyName")}),s.jsx("input",{type:"text",value:((rs=x.openapi)==null?void 0:rs.apiKeyName)||"",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,apiKeyName:me.target.value,url:((he=fe.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyIn")}),s.jsxs("select",{value:((ss=x.openapi)==null?void 0:ss.apiKeyIn)||"header",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,apiKeyIn:me.target.value,url:((he=fe.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[s.jsx("option",{value:"header",children:d("server.openapi.apiKeyInHeader")}),s.jsx("option",{value:"query",children:d("server.openapi.apiKeyInQuery")}),s.jsx("option",{value:"cookie",children:d("server.openapi.apiKeyInCookie")})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyValue")}),s.jsx("input",{type:"password",value:((Rs=x.openapi)==null?void 0:Rs.apiKeyValue)||"",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,apiKeyValue:me.target.value,url:((he=fe.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"})]})]})]}),((Jt=x.openapi)==null?void 0:Jt.securityType)==="http"&&s.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.httpAuthConfig")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.httpScheme")}),s.jsxs("select",{value:((ft=x.openapi)==null?void 0:ft.httpScheme)||"bearer",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,httpScheme:me.target.value,url:((he=fe.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[s.jsx("option",{value:"basic",children:d("server.openapi.httpSchemeBasic")}),s.jsx("option",{value:"bearer",children:d("server.openapi.httpSchemeBearer")}),s.jsx("option",{value:"digest",children:d("server.openapi.httpSchemeDigest")})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.httpCredentials")}),s.jsx("input",{type:"password",value:((Ot=x.openapi)==null?void 0:Ot.httpCredentials)||"",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,httpCredentials:me.target.value,url:((he=fe.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((mt=x.openapi)==null?void 0:mt.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((as=x.openapi)==null?void 0:as.securityType)==="oauth2"&&s.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.oauth2Config")}),s.jsx("div",{className:"grid grid-cols-1 gap-3",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.oauth2Token")}),s.jsx("input",{type:"password",value:((fr=x.openapi)==null?void 0:fr.oauth2Token)||"",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,oauth2Token:me.target.value,url:((he=fe.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"})]})})]}),((ea=x.openapi)==null?void 0:ea.securityType)==="openIdConnect"&&s.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.openIdConnectConfig")}),s.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.openIdConnectUrl")}),s.jsx("input",{type:"url",value:((Or=x.openapi)==null?void 0:Or.openIdConnectUrl)||"",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,openIdConnectUrl:me.target.value,url:((he=fe.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"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.openIdConnectToken")}),s.jsx("input",{type:"password",value:((Dr=x.openapi)==null?void 0:Dr.openIdConnectToken)||"",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,openIdConnectToken:me.target.value,url:((he=fe.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"})]})]})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.passthroughHeaders")}),s.jsx("input",{type:"text",value:((Zt=x.openapi)==null?void 0:Zt.passthroughHeaders)||"",onChange:me=>w(fe=>{var he;return{...fe,openapi:{...fe.openapi,passthroughHeaders:me.target.value,url:((he=fe.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"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.openapi.passthroughHeadersHelp")})]}),s.jsxs("div",{className:"mb-4",children:[s.jsxs("div",{className:"flex justify-between items-center mb-2",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.headers")}),s.jsx("button",{type:"button",onClick:z,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:"+"})]}),E.map((me,fe)=>s.jsxs("div",{className:"flex items-center mb-2",children:[s.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[s.jsx("input",{type:"text",value:me.key,onChange:he=>U(fe,"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"}),s.jsx("span",{className:"flex items-center",children:":"}),s.jsx("input",{type:"text",value:me.value,onChange:he=>U(fe,"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..."})]}),s.jsx("button",{type:"button",onClick:()=>Q(fe),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:"-"})]},fe))]})]}):p==="sse"||p==="streamable-http"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"url",children:d("server.url")}),s.jsx("input",{type:"url",name:"url",id:"url",value:x.url,onChange:W,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"})]}),s.jsxs("div",{className:"mb-4",children:[s.jsxs("div",{className:"flex justify-between items-center mb-2",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.headers")}),s.jsx("button",{type:"button",onClick:z,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:"+"})]}),E.map((me,fe)=>s.jsxs("div",{className:"flex items-center mb-2",children:[s.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[s.jsx("input",{type:"text",value:me.key,onChange:he=>U(fe,"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"}),s.jsx("span",{className:"flex items-center",children:":"}),s.jsx("input",{type:"text",value:me.value,onChange:he=>U(fe,"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..."})]}),s.jsx("button",{type:"button",onClick:()=>Q(fe),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:"-"})]},fe))]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"command",children:d("server.command")}),s.jsx("input",{type:"text",name:"command",id:"command",value:x.command,onChange:W,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"})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"arguments",children:d("server.arguments")}),s.jsx("input",{type:"text",name:"arguments",id:"arguments",value:x.arguments,onChange:me=>re(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"})]}),s.jsxs("div",{className:"mb-4",children:[s.jsxs("div",{className:"flex justify-between items-center mb-2",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.envVars")}),s.jsx("button",{type:"button",onClick:se,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,fe)=>s.jsxs("div",{className:"flex items-center mb-2",children:[s.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[s.jsx("input",{type:"text",value:me.key,onChange:he=>$(fe,"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")}),s.jsx("span",{className:"flex items-center",children:":"}),s.jsx("input",{type:"text",value:me.value,onChange:he=>$(fe,"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")})]}),s.jsx("button",{type:"button",onClick:()=>le(fe),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:"-"})]},fe))]})]}),p!=="openapi"&&s.jsxs("div",{className:"mb-4",children:[s.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(!O),children:[s.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.requestOptions")}),s.jsx("span",{className:"text-gray-500 text-sm",children:O?"▼":"▶"})]}),O&&s.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:d("server.timeout")}),s.jsx("input",{type:"number",id:"timeout",value:((mr=x.options)==null?void 0:mr.timeout)||6e4,onChange:me=>B("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"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.timeoutDescription")})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:d("server.maxTotalTimeout")}),s.jsx("input",{type:"number",id:"maxTotalTimeout",value:((jr=x.options)==null?void 0:jr.maxTotalTimeout)||"",onChange:me=>B("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"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.maxTotalTimeoutDescription")})]})]}),s.jsxs("div",{className:"mt-3",children:[s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",checked:((ta=x.options)==null?void 0:ta.resetTimeoutOnProgress)||!1,onChange:me=>B("resetTimeoutOnProgress",me.target.checked),className:"mr-2"}),s.jsx("span",{className:"text-gray-600 text-sm",children:d("server.resetTimeoutOnProgress")})]}),s.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:d("server.resetTimeoutOnProgressDescription")})]})]})]}),s.jsxs("div",{className:"flex justify-end mt-6",children:[s.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")}),s.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(G?"server.save":"server.add")})]})]})]})},og=a=>{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((h,p)=>u(h,`${m}[${p}]`)):d&&typeof d=="object"&&Object.entries(d).forEach(([h,p])=>{u(p,m?`${m}.${h}`:h)})};return u(a),Array.from(l)},L1=({onAdd:a})=>{const{t:l}=ve(),[o,i]=v.useState(!1),[u,d]=v.useState(null),[m,h]=v.useState(!1),[p,g]=v.useState(null),[x,w]=v.useState([]),k=()=>{i(!o),d(null),h(!1),g(null)},T=async()=>{p&&(await E(p),h(!1),g(null))},E=async O=>{try{d(null);const R=await St("/servers",O);if(!R.success){R&&R.message?d(R.message):d(l("server.addError"));return}i(!1),a()}catch(R){console.error("Error adding server:",R),navigator.onLine?R instanceof TypeError&&(R.message.includes("NetworkError")||R.message.includes("Failed to fetch"))?d(l("errors.serverConnection")):d(l("errors.serverAdd")):d(l("errors.network"))}},A=async O=>{try{const R=og(O);R.length>0?(w(R),g(O),h(!0)):await E(O)}catch(R){console.error("Error processing server submission:",R),d(l("errors.serverAdd"))}};return s.jsxs("div",{children:[s.jsxs("button",{onClick:k,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:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:s.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&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx(ll,{onSubmit:A,onCancel:k,modalTitle:l("server.addServer"),formError:u})}),m&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:l("server.confirmVariables")}),s.jsx("p",{className:"text-gray-600 mb-4",children:l("server.variablesDetected")}),s.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})})}),s.jsxs("div",{className:"ml-3",children:[s.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[l("server.detectedVariables"),":"]}),s.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:x.map((O,R)=>s.jsxs("li",{className:"font-mono",children:["$",`{${O}}`]},R))})]})]})}),s.jsx("p",{className:"text-gray-600 text-sm mb-6",children:l("server.confirmVariablesMessage")}),s.jsxs("div",{className:"flex justify-end space-x-3",children:[s.jsx("button",{onClick:()=>{h(!1),g(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:l("common.cancel")}),s.jsx("button",{onClick:T,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:l("server.confirmAndAdd")})]})]})})]})},z1=({server:a,onEdit:l,onCancel:o})=>{const{t:i}=ve(),[u,d]=v.useState(null),m=async h=>{try{d(null);const p=encodeURIComponent(a.name),g=await Bt(`/servers/${p}`,h);if(!g.success){g&&g.message?d(g.message):d(i("server.updateError",{serverName:a.name}));return}l()}catch(p){console.error("Error updating server:",p),navigator.onLine?p instanceof TypeError&&(p.message.includes("NetworkError")||p.message.includes("Failed to fetch"))?d(i("errors.serverConnection")):d(i("errors.serverUpdate",{serverName:a.name})):d(i("errors.network"))}};return s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx(ll,{onSubmit:m,onCancel:o,initialData:a,modalTitle:i("server.editTitle",{serverName:a.name}),formError:u})})},P1=({isOpen:a,onClose:l,onConfirm:o,title:i,message:u,confirmText:d,cancelText:m,variant:h="warning"})=>{const{t:p}=ve();if(!a)return null;const g=()=>{switch(h){case"danger":return{icon:s.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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:s.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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:s.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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:x,confirmClass:w}=g(),k=E=>{E.target===E.currentTarget&&l()},T=E=>{E.key==="Escape"?l():E.key==="Enter"&&o()};return s.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:k,onKeyDown:T,tabIndex:-1,children:s.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:s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"flex items-start space-x-3",children:[x&&s.jsx("div",{className:"flex-shrink-0",children:x}),s.jsxs("div",{className:"flex-1",children:[i&&s.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:i}),s.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:u})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.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||p("common.cancel")}),s.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 ${w} ${h==="danger"?"btn-danger":h==="warning"?"btn-warning":"btn-primary"}`,children:d||p("common.confirm")})]})]})})})},_1=({onSuccess:a,onCancel:l})=>{const{t:o}=ve(),[i,u]=v.useState(!1),[d,m]=v.useState(!1),[h,p]=v.useState(null),[g,x]=v.useState(null),[w,k]=v.useState(!1),[T,E]=v.useState(null),[A,O]=v.useState(""),[R,N]=v.useState(!1),[M,G]=v.useState(""),W=B=>{B.preventDefault(),u(!0)},re=B=>{B.preventDefault(),u(!1)},te=B=>{B.preventDefault(),u(!1);const V=B.dataTransfer.files;if(V.length>0){const b=V[0];b.name.endsWith(".dxt")?(x(b),p(null)):p(o("dxt.invalidFileType"))}},$=B=>{const V=B.target.files;if(V&&V.length>0){const b=V[0];b.name.endsWith(".dxt")?(x(b),p(null)):p(o("dxt.invalidFileType"))}},se=async()=>{if(!g){p(o("dxt.noFileSelected"));return}m(!0),p(null);try{const B=new FormData;B.append("dxtFile",g);const V=await Eu(Cu("/dxt/upload"),{method:"POST",body:B}),b=await V.json();if(!V.ok)throw new Error(b.message||`HTTP error! Status: ${V.status}`);if(b.success&&b.data)E(b.data.manifest),O(b.data.extractDir),k(!0);else throw new Error(b.message||o("dxt.uploadFailed"))}catch(B){console.error("DXT upload error:",B),p(B instanceof Error?B.message:o("dxt.uploadFailed"))}finally{m(!1)}},le=async(B,V=!1)=>{var b;m(!0),p(null);try{const C=Q(T,A,B);if(!V){const oe=await Ge("/servers");if(oe.success&&((b=oe.data)==null?void 0:b.find(_=>_.name===B))){G(B),N(!0),m(!1);return}}let L;if(V?L=await Bt(`/servers/${encodeURIComponent(B)}`,{name:B,config:C}):L=await St("/servers",{name:B,config:C}),L.success)a(C);else throw new Error(L.message||o("dxt.installFailed"))}catch(C){console.error("DXT install error:",C),p(C instanceof Error?C.message:o("dxt.installFailed")),m(!1)}},U=()=>{N(!1),M&&le(M,!0)},z=()=>{N(!1),G(""),m(!1)},Q=(B,V,b)=>{var oe;const C=((oe=B.server)==null?void 0:oe.mcp_config)||{},L={type:"stdio",command:C.command||"node",args:(C.args||[]).map(S=>S.replace("${__dirname}",V))};return C.env&&Object.keys(C.env).length>0&&(L.env={...C.env},Object.keys(L.env).forEach(S=>{typeof L.env[S]=="string"&&(L.env[S]=L.env[S].replace("${__dirname}",V))})),L};return w&&T?s.jsxs(s.Fragment,{children:[s.jsx(P1,{isOpen:R,onClose:z,onConfirm:U,title:o("dxt.serverExistsTitle"),message:o("dxt.serverExistsConfirm",{serverName:M}),confirmText:o("dxt.override"),cancelText:o("common.cancel"),variant:"warning"}),s.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${R?"opacity-50 pointer-events-none":""}`,children:s.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[s.jsxs("div",{className:"flex justify-between items-center mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o("dxt.installServer")}),s.jsx("button",{onClick:l,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),h&&s.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:s.jsx("p",{className:"text-red-700",children:h})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:o("dxt.extensionInfo")}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsxs("strong",{children:[o("dxt.name"),":"]})," ",T.display_name||T.name]}),s.jsxs("div",{children:[s.jsxs("strong",{children:[o("dxt.version"),":"]})," ",T.version]}),s.jsxs("div",{children:[s.jsxs("strong",{children:[o("dxt.description"),":"]})," ",T.description]}),T.author&&s.jsxs("div",{children:[s.jsxs("strong",{children:[o("dxt.author"),":"]})," ",T.author.name]}),T.tools&&T.tools.length>0&&s.jsxs("div",{children:[s.jsxs("strong",{children:[o("dxt.tools"),":"]}),s.jsx("ul",{className:"list-disc list-inside ml-4",children:T.tools.map((B,V)=>s.jsxs("li",{children:[B.name," - ",B.description]},V))})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:o("dxt.serverName")}),s.jsx("input",{type:"text",id:"serverName",defaultValue:T.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")})]}),s.jsxs("div",{className:"flex justify-end space-x-4",children:[s.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")}),s.jsx("button",{onClick:()=>{const B=document.getElementById("serverName"),V=(B==null?void 0:B.value.trim())||T.name;le(V)},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?s.jsxs(s.Fragment,{children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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")})]})]})]})})]}):s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-lg",children:[s.jsxs("div",{className:"flex justify-between items-center mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o("dxt.uploadTitle")}),s.jsx("button",{onClick:l,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),h&&s.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:s.jsx("p",{className:"text-red-700",children:h})}),s.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center transition-colors ${i?"border-blue-500 bg-blue-50":g?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:W,onDragLeave:re,onDrop:te,children:[g?s.jsxs("div",{className:"space-y-2",children:[s.jsx("svg",{className:"mx-auto h-12 w-12 text-green-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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"})}),s.jsx("p",{className:"text-sm text-gray-900 font-medium",children:g.name}),s.jsxs("p",{className:"text-xs text-gray-500",children:[(g.size/1024/1024).toFixed(2)," MB"]})]}):s.jsxs("div",{className:"space-y-2",children:[s.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.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"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-900",children:o("dxt.dropFileHere")}),s.jsx("p",{className:"text-xs text-gray-500",children:o("dxt.orClickToSelect")})]})]}),s.jsx("input",{type:"file",accept:".dxt",onChange:$,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),s.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[s.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")}),s.jsx("button",{onClick:se,disabled:!g||d,className:"px-4 py-2 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:d?s.jsxs(s.Fragment,{children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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:a}=ve(),l=ts(),{servers:o,error:i,setError:u,isLoading:d,handleServerAdd:m,handleServerEdit:h,handleServerRemove:p,handleServerToggle:g,triggerRefresh:x}=nl({refreshOnMount:!0}),[w,k]=v.useState(null),[T,E]=v.useState(!1),[A,O]=v.useState(!1),R=async W=>{const re=await h(W);re&&k(re)},N=()=>{k(null),x()},M=async()=>{E(!0);try{x(),await new Promise(W=>setTimeout(W,500))}finally{E(!1)}},G=W=>{O(!1),x()};return s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:a("pages.servers.title")}),s.jsxs("div",{className:"flex space-x-4",children:[s.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:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})}),a("nav.market")]}),s.jsx(L1,{onAdd:m}),s.jsxs("button",{onClick:()=>O(!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:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})}),a("dxt.upload")]}),s.jsxs("button",{onClick:M,disabled: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 ${T?"opacity-70 cursor-not-allowed":""}`,children:[T?s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}):s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})}),a("common.refresh")]})]})]}),i&&s.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:s.jsx("p",{className:"text-gray-600 mt-1",children:i})}),s.jsx("button",{onClick:()=>u(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":a("app.closeButton"),children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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?s.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:s.jsxs("div",{className:"flex flex-col items-center",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),s.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}):o.length===0?s.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:s.jsx("p",{className:"text-gray-600",children:a("app.noServers")})}):s.jsx("div",{className:"space-y-6",children:o.map((W,re)=>s.jsx(U1,{server:W,onRemove:p,onEdit:R,onToggle:g,onRefresh:x},re))}),w&&s.jsx(z1,{server:w,onEdit:N,onCancel:()=>k(null)}),A&&s.jsx(_1,{onSuccess:G,onCancel:()=>O(!1)})]})},Ou=()=>{const{t:a}=ve(),[l,o]=v.useState([]),[i,u]=v.useState(!0),[d,m]=v.useState(null),[h,p]=v.useState(0),g=v.useCallback(async()=>{try{u(!0);const R=await Ge("/groups");R&&R.success&&Array.isArray(R.data)?o(R.data):(console.error("Invalid group data format:",R),o([])),m(null)}catch(R){console.error("Error fetching groups:",R),m(R instanceof Error?R.message:"Failed to fetch groups"),o([])}finally{u(!1)}},[]),x=v.useCallback(()=>{p(R=>R+1)},[]),w=async(R,N,M=[])=>{try{const G=await St("/groups",{name:R,description:N,servers:M});return console.log("Group created successfully:",G),!G||!G.success?(m((G==null?void 0:G.message)||a("groups.createError")),G):(x(),G||null)}catch(G){return m(G instanceof Error?G.message:"Failed to create group"),null}},k=async(R,N)=>{try{const M=await Bt(`/groups/${R}`,N);return!M||!M.success?(m((M==null?void 0:M.message)||a("groups.updateError")),M):(x(),M||null)}catch(M){return m(M instanceof Error?M.message:"Failed to update group"),null}},T=async(R,N)=>{try{const M=await Bt(`/groups/${R}/servers/batch`,{servers:N});return!M||!M.success?(m((M==null?void 0:M.message)||a("groups.updateError")),null):(x(),M.data||null)}catch(M){return m(M instanceof Error?M.message:"Failed to update group servers"),null}},E=async R=>{try{const N=await Jn(`/groups/${R}`);return!N||!N.success?(m((N==null?void 0:N.message)||a("groups.deleteError")),N):(x(),N)}catch(N){return m(N instanceof Error?N.message:"Failed to delete group"),null}},A=async(R,N)=>{try{const M=await St(`/groups/${R}/servers`,{serverName:N});return!M||!M.success?(m((M==null?void 0:M.message)||a("groups.serverAddError")),null):(x(),M.data||null)}catch(M){return m(M instanceof Error?M.message:"Failed to add server to group"),null}},O=async(R,N)=>{try{const M=await Jn(`/groups/${R}/servers/${N}`);return!M||!M.success?(m((M==null?void 0:M.message)||a("groups.serverRemoveError")),null):(x(),M.data||null)}catch(M){return m(M instanceof Error?M.message:"Failed to remove server from group"),null}};return v.useEffect(()=>{g()},[g,h]),{groups:l,loading:i,error:d,setError:m,triggerRefresh:x,createGroup:w,updateGroup:k,updateGroupServers:T,deleteGroup:E,addServerToGroup:A,removeServerFromGroup:O}},ig=({servers:a,value:l,onChange:o,className:i})=>{const{t:u}=ve(),{nameSeparator:d}=Ws(),[m,h]=v.useState(new Set),p=Va.useMemo(()=>l.map(N=>typeof N=="string"?{name:N,tools:"all"}:{...N,tools:N.tools||"all"}),[l]),g=Va.useMemo(()=>a.filter(N=>N.enabled!==!1),[a]);Va.useEffect(()=>{const N=new Set(p.map(G=>G.name)),M=new Set(g.map(G=>G.name));h(G=>{const W=new Set;return G.forEach(re=>{(N.has(re)||M.has(re))&&W.add(re)}),W})},[p,g]);const x=N=>{if(p.findIndex(G=>G.name===N)>=0){const G=p.filter(W=>W.name!==N);o(G)}else{const G=[...p,{name:N,tools:"all"}];o(G)}},w=N=>{h(M=>{const G=new Set(M);return G.has(N)?G.delete(N):G.add(N),G})},k=(N,M,G=!1)=>{if(Array.isArray(M)&&M.length===0){const W=p.filter(re=>re.name!==N);o(W),G||h(re=>{const te=new Set(re);return te.delete(N),te})}else if(p.findIndex(re=>re.name===N)>=0){const re=p.map(te=>te.name===N?{...te,tools:M}:te);o(re)}else{const re=[...p,{name:N,tools:M}];o(re)}},T=(N,M)=>{var te;const G=g.find($=>$.name===N);if(!G)return;const W=((te=G.tools)==null?void 0:te.map($=>$.name.replace(`${N}${d}`,"")))||[],re=p.find($=>$.name===N);if(!re){const $=[...p,{name:N,tools:[M]}];o($);return}if(re.tools==="all"){const $=W.filter(se=>se!==M);k(N,$)}else if(Array.isArray(re.tools)){const $=re.tools;if($.includes(M)){const se=$.filter(le=>le!==M);k(N,se)}else{const se=[...$,M];se.length===W.length?k(N,"all"):k(N,se)}}},E=N=>{const M=p.find(G=>G.name===N);return M?M.tools==="all":!1},A=N=>{const M=p.find(G=>G.name===N);return M?Array.isArray(M.tools)&&M.tools.length>0:!1},O=(N,M)=>{const G=p.find(W=>W.name===N);return G?G.tools==="all"?!0:Array.isArray(G.tools)?G.tools.includes(M):!1:!1},R=N=>{const M=g.find(G=>G.name===N);return(M==null?void 0:M.tools)||[]};return s.jsxs("div",{className:Zr("space-y-4",i),children:[s.jsx("div",{className:"space-y-3",children:g.map(N=>{const M=E(N.name),G=A(N.name),W=m.has(N.name),re=R(N.name),te=p.find($=>$.name===N.name);return s.jsxs("div",{className:"border border-gray-200 rounded-lg hover:border-gray-300 hover:bg-gray-50 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors",onClick:()=>w(N.name),children:[s.jsxs("div",{className:"flex items-center space-x-3",onClick:$=>{$.stopPropagation(),x(N.name)},children:[s.jsx("input",{type:"checkbox",checked:M||G,onChange:()=>x(N.name),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),s.jsx("span",{className:"font-medium text-gray-900 cursor-pointer select-none",children:N.name})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[te&&te.tools!=="all"&&Array.isArray(te.tools)&&s.jsxs("span",{className:"text-sm text-green-600",children:["(",u("groups.toolsSelected")," ",te.tools.length,"/",re.length,")"]}),te&&te.tools==="all"&&s.jsxs("span",{className:"text-sm text-green-600",children:["(",u("groups.allTools")," ",re.length,"/",re.length,")"]}),re.length>0&&s.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:s.jsx("svg",{className:Zr("w-5 h-5 transition-transform",W&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),W&&re.length>0&&s.jsxs("div",{className:"border-t border-gray-200 bg-gray-50 p-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:u("groups.toolSelection")}),s.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?k(N.name,[],!0):k(N.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")})]}),s.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:re.map($=>{const se=$.name.replace(`${N.name}${d}`,""),le=O(N.name,se);return s.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:le,onChange:()=>T(N.name,se),className:"w-3 h-3 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),s.jsx("span",{className:"text-gray-700",children:se}),$.description&&s.jsx("span",{className:"text-gray-400 text-xs truncate",children:$.description})]},$.name)})})]})]},N.name)})}),g.length===0&&s.jsx("p",{className:"text-gray-500 text-sm",children:u("groups.noServerOptions")})]})},B1=({onAdd:a,onCancel:l})=>{const{t:o}=ve(),{createGroup:i}=Ou(),{servers:u}=nl(),[d,m]=v.useState([]),[h,p]=v.useState(null),[g,x]=v.useState(!1),[w,k]=v.useState({name:"",description:"",servers:[]});v.useEffect(()=>{m(u.filter(A=>A.enabled!==!1))},[u]);const T=A=>{const{name:O,value:R}=A.target;k(N=>({...N,[O]:R}))},E=async A=>{A.preventDefault(),x(!0),p(null);try{if(!w.name.trim()){p(o("groups.nameRequired")),x(!1);return}const O=await i(w.name,w.description,w.servers);if(!O||!O.success){p((O==null?void 0:O.message)||o("groups.createError")),x(!1);return}a()}catch(O){p(O instanceof Error?O.message:String(O)),x(!1)}};return s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[s.jsxs("div",{className:"p-6 flex-shrink-0",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:o("groups.addNew")}),h&&s.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:h})]}),s.jsxs("form",{onSubmit:E,className:"flex flex-col flex-1 min-h-0",children:[s.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[o("groups.name")," *"]}),s.jsx("input",{type:"text",id:"name",name:"name",value:w.name,onChange:T,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})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:o("groups.configureTools")}),s.jsx(ig,{servers:d,value:w.servers,onChange:A=>k(O=>({...O,servers:A})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),s.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[s.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:g,children:o("common.cancel")}),s.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:g,children:o(g?"common.submitting":"common.create")})]})]})]})})},q1=({group:a,onEdit:l,onCancel:o})=>{const{t:i}=ve(),{updateGroup:u}=Ou(),{servers:d}=nl(),[m,h]=v.useState([]),[p,g]=v.useState(null),[x,w]=v.useState(!1),[k,T]=v.useState({name:a.name,description:a.description||"",servers:a.servers||[]});v.useEffect(()=>{h(d.filter(O=>O.enabled!==!1))},[d]);const E=O=>{const{name:R,value:N}=O.target;T(M=>({...M,[R]:N}))},A=async O=>{O.preventDefault(),w(!0),g(null);try{if(!k.name.trim()){g(i("groups.nameRequired")),w(!1);return}const R=await u(a.id,{name:k.name,description:k.description,servers:k.servers});if(!R||!R.success){g((R==null?void 0:R.message)||i("groups.updateError")),w(!1);return}l()}catch(R){g(R instanceof Error?R.message:String(R)),w(!1)}};return s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[s.jsxs("div",{className:"p-6 flex-shrink-0",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:i("groups.edit")}),p&&s.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:p})]}),s.jsxs("form",{onSubmit:A,className:"flex flex-col flex-1 min-h-0",children:[s.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[i("groups.name")," *"]}),s.jsx("input",{type:"text",id:"name",name:"name",value:k.name,onChange:E,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})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:i("groups.configureTools")}),s.jsx(ig,{servers:m,value:k.servers,onChange:O=>T(R=>({...R,servers:O})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),s.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[s.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:x,children:i("common.cancel")}),s.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:x,children:i(x?"common.submitting":"common.save")})]})]})]})})},V1=({group:a,servers:l,onEdit:o,onDelete:i})=>{const{t:u}=ve(),{showToast:d}=al(),{installConfig:m}=Ws(),[h,p]=v.useState(!1),[g,x]=v.useState(!1),[w,k]=v.useState(!1),[T,E]=v.useState(null),A=v.useRef(null);v.useEffect(()=>{const U=z=>{A.current&&!A.current.contains(z.target)&&k(!1)};return document.addEventListener("mousedown",U),()=>{document.removeEventListener("mousedown",U)}},[]);const O=()=>{o(a)},R=()=>{p(!0)},N=()=>{i(a.id),p(!1)},M=U=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(U).then(()=>{x(!0),k(!1),d(u("common.copySuccess"),"success"),setTimeout(()=>x(!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"),x(!0),k(!1),d(u("common.copySuccess"),"success"),setTimeout(()=>x(!1),2e3)}catch(Q){d(u("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",Q)}document.body.removeChild(z)}},G=()=>{M(a.id)},W=()=>{M(`${m.baseUrl}/mcp/${a.id}`)},re=()=>{const U={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${a.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};M(JSON.stringify(U,null,2))},te=U=>U.map(z=>typeof z=="string"?z:z.name),$=U=>{const z=a.servers.find(Q=>typeof Q=="string"?Q===U:Q.name===U);return typeof z=="string"?{name:z,tools:"all"}:z},se=te(a.servers),le=l.filter(U=>se.includes(U.name));return s.jsxs("div",{className:"bg-white shadow rounded-lg p-6 ",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:a.name}),s.jsxs("div",{className:"flex items-center ml-3",children:[s.jsx("span",{className:"text-xs text-gray-500 mr-1",children:a.id}),s.jsxs("div",{className:"relative",ref:A,children:[s.jsxs("button",{onClick:()=>k(!w),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:u("common.copy"),children:[g?s.jsx(Ka,{size:14,className:"text-green-500"}):s.jsx(Ro,{size:14}),s.jsx(Po,{size:12,className:"ml-1"})]}),w&&s.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:[s.jsxs("button",{onClick:G,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[s.jsx(Ro,{size:12,className:"mr-2"}),u("common.copyId")]}),s.jsxs("button",{onClick:W,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[s.jsx(Jv,{size:12,className:"mr-2"}),u("common.copyUrl")]}),s.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:[s.jsx(Iv,{size:12,className:"mr-2"}),u("common.copyJson")]})]})]})]})]}),a.description&&s.jsx("p",{className:"text-gray-600 text-sm mt-1",children:a.description})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"bg-blue-50 text-blue-700 px-3 py-1 rounded-full text-sm btn-secondary",children:u("groups.serverCount",{count:a.servers.length})}),s.jsx("button",{onClick:O,className:"text-gray-500 hover:text-gray-700",title:u("groups.edit"),children:s.jsx(_o,{size:18})}),s.jsx("button",{onClick:R,className:"text-gray-500 hover:text-red-600",title:u("groups.delete"),children:s.jsx(Pp,{size:18})})]})]}),s.jsx("div",{className:"mt-4",children:le.length===0?s.jsx("p",{className:"text-gray-500 italic",children:u("groups.noServers")}):s.jsx("div",{className:"flex flex-wrap gap-2",children:le.map(U=>{var L;const z=$(U.name),Q=z&&z.tools!=="all"&&Array.isArray(z.tools),B=Q&&Array.isArray(z==null?void 0:z.tools)?z.tools.length:((L=U.tools)==null?void 0:L.length)||0,V=T===U.name,b=()=>Q&&Array.isArray(z==null?void 0:z.tools)?z.tools:U.tools&&U.tools.length>0?U.tools.map(oe=>oe.name):[],C=()=>{E(V?null:U.name)};return s.jsxs("div",{className:"relative",children:[s.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:C,children:[s.jsx("span",{className:"font-medium text-gray-700 text-sm",children:U.name}),s.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"}`}),B>0&&s.jsxs("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded flex items-center gap-1",children:[s.jsx(pb,{size:12}),B]})]}),V&&s.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:[s.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[u(Q?"groups.selectedTools":"groups.allTools"),":"]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:b().map((oe,S)=>s.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:oe},S))})]})]},U.name)})})}),s.jsx(Mu,{isOpen:h,onClose:()=>p(!1),onConfirm:N,serverName:a.name,isGroup:!0})]})},G1=()=>{const{t:a}=ve(),{groups:l,loading:o,error:i,setError:u,deleteGroup:d,triggerRefresh:m}=Ou(),{servers:h}=nl({refreshOnMount:!0}),[p,g]=v.useState(null),[x,w]=v.useState(!1),k=R=>{g(R)},T=()=>{g(null),m()},E=async R=>{const N=await d(R);(!N||!N.success)&&u((N==null?void 0:N.message)||a("groups.deleteError"))},A=()=>{w(!0)},O=()=>{w(!1),m()};return s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:a("pages.groups.title")}),s.jsx("div",{className:"flex space-x-4",children:s.jsxs("button",{onClick:A,className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})}),a("groups.add")]})})]}),i&&s.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:s.jsx("p",{children:i})}),o?s.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:s.jsxs("div",{className:"flex flex-col items-center justify-center",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),s.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}):l.length===0?s.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:s.jsx("p",{className:"text-gray-600",children:a("groups.noGroups")})}):s.jsx("div",{className:"space-y-6",children:l.map(R=>s.jsx(V1,{group:R,servers:h,onEdit:k,onDelete:E},R.id))}),x&&s.jsx(B1,{onAdd:O,onCancel:O}),p&&s.jsx(q1,{group:p,onEdit:T,onCancel:()=>g(null)})]})},Du=()=>{const{t:a}=ve(),[l,o]=v.useState([]),[i,u]=v.useState(!0),[d,m]=v.useState(null),[h,p]=v.useState(0),g=v.useCallback(async()=>{try{u(!0);const E=await Ge("/users");if(!E.success){m(E.message||a("users.fetchError"));return}E&&E.success&&Array.isArray(E.data)?o(E.data):(console.error("Invalid user data format:",E),o([])),m(null)}catch(E){console.error("Error fetching users:",E),m(E instanceof Error?E.message:"Failed to fetch users"),o([])}finally{u(!1)}},[]),x=v.useCallback(()=>{p(E=>E+1)},[]),w=async E=>{try{const A=await St("/users",E);return x(),A}catch(A){return m(A instanceof Error?A.message:"Failed to create user"),null}},k=async(E,A)=>{try{const O=await Bt(`/users/${E}`,A);return x(),O||null}catch(O){return m(O instanceof Error?O.message:"Failed to update user"),null}},T=async E=>{try{const A=await Jn(`/users/${E}`);return A!=null&&A.success?(x(),A):(m((A==null?void 0:A.message)||a("users.deleteError")),A)}catch(A){return m(A instanceof Error?A.message:"Failed to delete user"),!1}};return v.useEffect(()=>{g()},[g,h]),{users:l,loading:i,error:d,setError:m,triggerRefresh:x,createUser:w,updateUser:k,deleteUser:T}},F1=({onAdd:a,onCancel:l})=>{const{t:o}=ve(),{createUser:i}=Du(),[u,d]=v.useState(null),[m,h]=v.useState(!1),[p,g]=v.useState({username:"",password:"",isAdmin:!1}),x=async k=>{if(k.preventDefault(),d(null),!p.username.trim()){d(o("users.usernameRequired"));return}if(!p.password.trim()){d(o("users.passwordRequired"));return}if(p.password.length<6){d(o("users.passwordTooShort"));return}h(!0);try{const T=await i(p);T!=null&&T.success?a():d((T==null?void 0:T.message)||o("users.createError"))}catch(T){d(T instanceof Error?T.message:o("users.createError"))}finally{h(!1)}},w=k=>{const{name:T,value:E,type:A,checked:O}=k.target;g(R=>({...R,[T]:A==="checkbox"?O:E}))};return s.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:s.jsx("div",{className:"bg-white p-8 rounded-lg shadow-xl max-w-md w-full mx-4",children:s.jsxs("form",{onSubmit:x,children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:o("users.addNew")}),u&&s.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-3 mb-4",children:s.jsx("p",{className:"text-sm",children:u})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-1",children:[o("users.username")," *"]}),s.jsx("input",{type:"text",id:"username",name:"username",value:p.username,onChange:w,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})]}),s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:[o("users.password")," *"]}),s.jsx("input",{type:"password",id:"password",name:"password",value:p.password,onChange:w,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})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",id:"isAdmin",name:"isAdmin",checked:p.isAdmin,onChange:w,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded",disabled:m}),s.jsx("label",{htmlFor:"isAdmin",className:"ml-2 block text-sm text-gray-700",children:o("users.adminRole")})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.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")}),s.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")})]})]})})})},$1=({user:a,onEdit:l,onCancel:o})=>{const{t:i}=ve(),{updateUser:u}=Du(),[d,m]=v.useState(null),[h,p]=v.useState(!1),[g,x]=v.useState({isAdmin:a.isAdmin,newPassword:"",confirmPassword:""}),w=async T=>{if(T.preventDefault(),m(null),g.newPassword&&g.newPassword!==g.confirmPassword){m(i("users.passwordMismatch"));return}if(g.newPassword&&g.newPassword.length<6){m(i("users.passwordTooShort"));return}p(!0);try{const E={isAdmin:g.isAdmin};g.newPassword&&(E.newPassword=g.newPassword);const A=await u(a.username,E);A!=null&&A.success?l():m((A==null?void 0:A.message)||i("users.updateError"))}catch(E){m(E instanceof Error?E.message:i("users.updateError"))}finally{p(!1)}},k=T=>{const{name:E,value:A,type:O,checked:R}=T.target;x(N=>({...N,[E]:O==="checkbox"?R:A}))};return s.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:s.jsx("div",{className:"bg-white p-8 rounded-lg shadow-xl max-w-md w-full mx-4",children:s.jsxs("form",{onSubmit:w,children:[s.jsxs("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:[i("users.edit")," - ",a.username]}),d&&s.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-3 mb-4",children:s.jsx("p",{className:"text-sm",children:d})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",id:"isAdmin",name:"isAdmin",checked:g.isAdmin,onChange:k,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded",disabled:h}),s.jsx("label",{htmlFor:"isAdmin",className:"ml-2 block text-sm text-gray-700",children:i("users.adminRole")})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"newPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:i("users.newPassword")}),s.jsx("input",{type:"password",id:"newPassword",name:"newPassword",value:g.newPassword,onChange:k,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:h,minLength:6})]}),g.newPassword&&s.jsxs("div",{children:[s.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:i("users.confirmPassword")}),s.jsx("input",{type:"password",id:"confirmPassword",name:"confirmPassword",value:g.confirmPassword,onChange:k,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:h,minLength:6})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.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:h,children:i("common.cancel")}),s.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:h,children:i(h?"common.updating":"users.update")})]})]})})})},K1=({user:a,currentUser:l,onEdit:o,onDelete:i})=>{const{t:u}=ve(),[d,m]=v.useState(!1),h=()=>{m(!0)},p=()=>{i(a.username),m(!1)},g=(l==null?void 0:l.username)===a.username,x=!g;return s.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("div",{className:"flex-1",children:s.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[s.jsx("div",{className:"w-10 h-10 bg-blue-500 rounded-full flex items-center justify-center",children:s.jsx("span",{className:"text-white font-medium text-sm",children:a.username.charAt(0).toUpperCase()})}),s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:[a.username,g&&s.jsx("span",{className:"ml-2 px-2 py-1 text-xs bg-blue-100 text-blue-800 rounded",children:u("users.currentUser")})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${a.isAdmin?"bg-red-100 text-red-800":"bg-gray-100 text-gray-800"}`,children:a.isAdmin?u("users.admin"):u("users.user")})})]})]})}),s.jsxs("div",{className:"flex space-x-2",children:[s.jsx("button",{onClick:()=>o(a),className:"text-gray-500 hover:text-gray-700",title:u("users.edit"),children:s.jsx(_o,{size:18})}),x&&s.jsx("button",{onClick:h,className:"text-gray-500 hover:text-red-600",title:u("users.delete"),children:s.jsx(Pp,{size:18})})]})]}),s.jsx(Mu,{isOpen:d,onClose:()=>m(!1),onConfirm:p,serverName:a.username,isGroup:!1,isUser:!0})]})},I1=()=>{const{t:a}=ve(),{auth:l}=Zs(),o=l.user,{users:i,loading:u,error:d,setError:m,deleteUser:h,triggerRefresh:p}=Du(),[g,x]=v.useState(null),[w,k]=v.useState(!1);if(!(o!=null&&o.isAdmin))return s.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:s.jsx("p",{className:"text-red-600",children:a("users.adminRequired")})});const T=N=>{x(N)},E=()=>{x(null),p()},A=async N=>{const M=await h(N);M!=null&&M.success||m((M==null?void 0:M.message)||a("users.deleteError"))},O=()=>{k(!0)},R=()=>{k(!1),p()};return s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:a("pages.users.title")}),s.jsx("div",{className:"flex space-x-4",children:s.jsxs("button",{onClick:O,className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})}),a("users.add")]})})]}),d&&s.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:s.jsx("p",{children:d})}),u?s.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:s.jsxs("div",{className:"flex flex-col items-center justify-center",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),s.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}):i.length===0?s.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:s.jsx("p",{className:"text-gray-600",children:a("users.noUsers")})}):s.jsx("div",{className:"space-y-6",children:i.map(N=>s.jsx(K1,{user:N,currentUser:o,onEdit:T,onDelete:A},N.username))}),w&&s.jsx(F1,{onAdd:R,onCancel:R}),g&&s.jsx($1,{user:g,onEdit:E,onCancel:()=>x(null)})]})},Y1=({onSuccess:a,onCancel:l})=>{const{t:o}=ve(),[i,u]=v.useState({currentPassword:"",newPassword:""}),[d,m]=v.useState(""),[h,p]=v.useState(!1),[g,x]=v.useState(null),[w,k]=v.useState(!1),T=A=>{const{name:O,value:R}=A.target;O==="confirmPassword"?m(R):u(N=>({...N,[O]:R}))},E=async A=>{if(A.preventDefault(),x(null),i.newPassword!==d){x(o("auth.passwordsNotMatch"));return}p(!0);try{const O=await mv(i);O.success?(k(!0),a&&a()):x(O.message||o("auth.changePasswordError"))}catch{x(o("auth.changePasswordError"))}finally{p(!1)}};return s.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-md",children:[s.jsx("h2",{className:"text-xl font-bold mb-4",children:o("auth.changePassword")}),w?s.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:o("auth.changePasswordSuccess")}):s.jsxs("form",{onSubmit:E,children:[g&&s.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:g}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"currentPassword",children:o("auth.currentPassword")}),s.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:T,required:!0})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"newPassword",children:o("auth.newPassword")}),s.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:T,required:!0,minLength:6})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"confirmPassword",children:o("auth.confirmPassword")}),s.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:T,required:!0,minLength:6})]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[l&&s.jsx("button",{type:"button",onClick:l,disabled:h,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")}),s.jsx("button",{type:"submit",disabled:h,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:h?s.jsxs("span",{className:"flex items-center",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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(a=32){const l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=new Uint8Array(a);return crypto.getRandomValues(o),Array.from(o).map(i=>l.charAt(i%l.length)).join("")}const In={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:a}=ve(),l=ts(),{showToast:o}=al(),[i,u]=v.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[d,m]=v.useState({dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[h,p]=v.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[g,x]=v.useState("-"),{routingConfig:w,tempRoutingConfig:k,setTempRoutingConfig:T,installConfig:E,smartRoutingConfig:A,mcpRouterConfig:O,nameSeparator:R,loading:N,updateRoutingConfig:M,updateRoutingConfigBatch:G,updateInstallConfig:W,updateSmartRoutingConfig:re,updateSmartRoutingConfigBatch:te,updateMCPRouterConfig:$,updateNameSeparator:se,exportMCPSettings:le}=Ws();v.useEffect(()=>{E&&u(E)},[E]),v.useEffect(()=>{A&&m({dbUrl:A.dbUrl||"",openaiApiBaseUrl:A.openaiApiBaseUrl||"",openaiApiKey:A.openaiApiKey||"",openaiApiEmbeddingModel:A.openaiApiEmbeddingModel||""})},[A]),v.useEffect(()=>{O&&p({apiKey:O.apiKey||"",referer:O.referer||"https://www.mcphubx.com",title:O.title||"MCPHub",baseUrl:O.baseUrl||"https://api.mcprouter.to/v1"})},[O]),v.useEffect(()=>{x(R)},[R]);const[U,z]=v.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,mcpRouterConfig:!1,nameSeparator:!1,password:!1,exportConfig:!1}),Q=ce=>{z(Ae=>({...Ae,[ce]:!Ae[ce]}))},B=async(ce,Ae)=>{if(ce==="enableBearerAuth"&&Ae===!0&&!k.bearerAuthKey&&!w.bearerAuthKey){const nt=X1();V(nt),await G({enableBearerAuth:!0,bearerAuthKey:nt})&&T(ze=>({...ze,bearerAuthKey:nt}));return}await M(ce,Ae)},V=ce=>{T(Ae=>({...Ae,bearerAuthKey:ce}))},b=async()=>{await M("bearerAuthKey",k.bearerAuthKey)},C=(ce,Ae)=>{u({...i,[ce]:Ae})},L=async ce=>{await W(ce,i[ce])},oe=(ce,Ae)=>{m({...d,[ce]:Ae})},S=async ce=>{await re(ce,d[ce])},_=(ce,Ae)=>{p({...h,[ce]:Ae})},Z=async ce=>{await $(ce,h[ce])},H=async()=>{await se(g)},I=async ce=>{if(ce){const Ae=d.dbUrl||A.dbUrl,nt=d.openaiApiKey||A.openaiApiKey;if(!Ae||!nt){const ze=[];Ae||ze.push(a("settings.dbUrl")),nt||ze.push(a("settings.openaiApiKey")),o(a("settings.smartRoutingValidationError",{fields:ze.join(", ")}));return}const Ct={enabled:ce};d.dbUrl!==A.dbUrl&&(Ct.dbUrl=d.dbUrl),d.openaiApiBaseUrl!==A.openaiApiBaseUrl&&(Ct.openaiApiBaseUrl=d.openaiApiBaseUrl),d.openaiApiKey!==A.openaiApiKey&&(Ct.openaiApiKey=d.openaiApiKey),d.openaiApiEmbeddingModel!==A.openaiApiEmbeddingModel&&(Ct.openaiApiEmbeddingModel=d.openaiApiEmbeddingModel),await te(Ct)}else await re("enabled",ce)},de=()=>{setTimeout(()=>{l("/")},2e3)},[ee,Y]=v.useState(!1),[ue,je]=v.useState(""),Se=async()=>{try{const ce=await le();console.log("Fetched MCP settings:",ce);const Ae=JSON.stringify(ce.data,null,2);je(Ae)}catch(ce){console.error("Error fetching MCP settings:",ce),o(a("settings.exportError")||"Failed to fetch settings","error")}};v.useEffect(()=>{U.exportConfig&&!ue&&Se()},[U.exportConfig]);const ye=async()=>{if(ue)try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(ue),Y(!0),o(a("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>Y(!1),2e3);else{const ce=document.createElement("textarea");ce.value=ue,ce.style.position="fixed",ce.style.left="-9999px",document.body.appendChild(ce),ce.focus(),ce.select();try{document.execCommand("copy"),Y(!0),o(a("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>Y(!1),2e3)}catch(Ae){o(a("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",Ae)}document.body.removeChild(ce)}}catch(ce){console.error("Error copying configuration:",ce),o(a("common.copyFailed")||"Copy failed","error")}},Me=()=>{if(!ue)return;const ce=new Blob([ue],{type:"application/json"}),Ae=URL.createObjectURL(ce),nt=document.createElement("a");nt.href=Ae,nt.download="mcp_settings.json",document.body.appendChild(nt),nt.click(),document.body.removeChild(nt),URL.revokeObjectURL(Ae),o(a("settings.exportSuccess")||"Settings exported successfully","success")};return s.jsxs("div",{className:"container mx-auto",children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:a("pages.settings.title")}),s.jsx(Kn,{permissions:In.SETTINGS_SMART_ROUTING,children:s.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card dashboard-card",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>Q("smartRoutingConfig"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("pages.settings.smartRouting")}),s.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:U.smartRoutingConfig?"▼":"►"})]}),U.smartRoutingConfig&&s.jsxs("div",{className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableSmartRouting")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableSmartRoutingDescription")})]}),s.jsx(Qs,{disabled:N,checked:A.enabled,onCheckedChange:ce=>I(ce)})]}),s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsx("div",{className:"mb-2",children:s.jsxs("h3",{className:"font-medium text-gray-700",children:[s.jsx("span",{className:"text-red-500 px-1",children:"*"}),a("settings.dbUrl")]})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:d.dbUrl,onChange:ce=>oe("dbUrl",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>S("dbUrl"),disabled:N,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:a("common.save")})]})]}),s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsx("div",{className:"mb-2",children:s.jsxs("h3",{className:"font-medium text-gray-700",children:[s.jsx("span",{className:"text-red-500 px-1",children:"*"}),a("settings.openaiApiKey")]})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"password",value:d.openaiApiKey,onChange:ce=>oe("openaiApiKey",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>S("openaiApiKey"),disabled:N,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:a("common.save")})]})]}),s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsx("div",{className:"mb-2",children:s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.openaiApiBaseUrl")})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:d.openaiApiBaseUrl,onChange:ce=>oe("openaiApiBaseUrl",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>S("openaiApiBaseUrl"),disabled:N,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:a("common.save")})]})]}),s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsx("div",{className:"mb-2",children:s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.openaiApiEmbeddingModel")})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:d.openaiApiEmbeddingModel,onChange:ce=>oe("openaiApiEmbeddingModel",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>S("openaiApiEmbeddingModel"),disabled:N,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:a("common.save")})]})]})]})]})}),s.jsx(Kn,{permissions:In.SETTINGS_INSTALL_CONFIG,children:s.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card dashboard-card",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>Q("mcpRouterConfig"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.mcpRouterConfig")}),s.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:U.mcpRouterConfig?"▼":"►"})]}),U.mcpRouterConfig&&s.jsxs("div",{className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.mcpRouterApiKey")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.mcpRouterApiKeyDescription")})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"password",value:h.apiKey,onChange:ce=>_("apiKey",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>Z("apiKey"),disabled:N,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:a("common.save")})]})]}),s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.mcpRouterBaseUrl")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.mcpRouterBaseUrlDescription")})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:h.baseUrl,onChange:ce=>_("baseUrl",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>Z("baseUrl"),disabled:N,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:a("common.save")})]})]})]})]})}),s.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>Q("nameSeparator"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.systemSettings")}),s.jsx("span",{className:"text-gray-500",children:U.nameSeparator?"▼":"►"})]}),U.nameSeparator&&s.jsx("div",{className:"space-y-4 mt-4",children:s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.nameSeparatorLabel")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.nameSeparatorDescription")})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:g,onChange:ce=>x(ce.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:N,maxLength:5}),s.jsx("button",{onClick:H,disabled:N,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:a("common.save")})]})]})})]}),s.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>Q("routingConfig"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("pages.settings.routeConfig")}),s.jsx("span",{className:"text-gray-500",children:U.routingConfig?"▼":"►"})]}),U.routingConfig&&s.jsxs("div",{className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableBearerAuth")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableBearerAuthDescription")})]}),s.jsx(Qs,{disabled:N,checked:w.enableBearerAuth,onCheckedChange:ce=>B("enableBearerAuth",ce)})]}),w.enableBearerAuth&&s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.bearerAuthKey")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.bearerAuthKeyDescription")})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:k.bearerAuthKey,onChange:ce=>V(ce.target.value),placeholder:a("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:N||!w.enableBearerAuth}),s.jsx("button",{onClick:b,disabled:N||!w.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:a("common.save")})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableGlobalRoute")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableGlobalRouteDescription")})]}),s.jsx(Qs,{disabled:N,checked:w.enableGlobalRoute,onCheckedChange:ce=>B("enableGlobalRoute",ce)})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableGroupNameRoute")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableGroupNameRouteDescription")})]}),s.jsx(Qs,{disabled:N,checked:w.enableGroupNameRoute,onCheckedChange:ce=>B("enableGroupNameRoute",ce)})]}),s.jsx(Kn,{permissions:In.SETTINGS_SKIP_AUTH,children:s.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.skipAuth")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.skipAuthDescription")})]}),s.jsx(Qs,{disabled:N,checked:w.skipAuth,onCheckedChange:ce=>B("skipAuth",ce)})]})})]})]}),s.jsx(Kn,{permissions:In.SETTINGS_INSTALL_CONFIG,children:s.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>Q("installConfig"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.installConfig")}),s.jsx("span",{className:"text-gray-500",children:U.installConfig?"▼":"►"})]}),U.installConfig&&s.jsxs("div",{className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.baseUrl")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.baseUrlDescription")})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:i.baseUrl,onChange:ce=>C("baseUrl",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>L("baseUrl"),disabled:N,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:a("common.save")})]})]}),s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.pythonIndexUrl")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.pythonIndexUrlDescription")})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:i.pythonIndexUrl,onChange:ce=>C("pythonIndexUrl",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>L("pythonIndexUrl"),disabled:N,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:a("common.save")})]})]}),s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.npmRegistry")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.npmRegistryDescription")})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"text",value:i.npmRegistry,onChange:ce=>C("npmRegistry",ce.target.value),placeholder:a("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:N}),s.jsx("button",{onClick:()=>L("npmRegistry"),disabled:N,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:a("common.save")})]})]})]})]})}),s.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>Q("password"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("auth.changePassword")}),s.jsx("span",{className:"text-gray-500",children:U.password?"▼":"►"})]}),U.password&&s.jsx("div",{className:"max-w-lg mt-4",children:s.jsx(Y1,{onSuccess:de})})]}),s.jsx(Kn,{permissions:In.SETTINGS_EXPORT_CONFIG,children:s.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>Q("exportConfig"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.exportMcpSettings")}),s.jsx("span",{className:"text-gray-500",children:U.exportConfig?"▼":"►"})]}),U.exportConfig&&s.jsx("div",{className:"space-y-4 mt-4",children:s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.mcpSettingsJson")}),s.jsx("p",{className:"text-sm text-gray-500",children:a("settings.mcpSettingsJsonDescription")})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("button",{onClick:ye,disabled:!ue,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:[ee?s.jsx(Ka,{size:16}):s.jsx(Ro,{size:16}),a(ee?"common.copied":"settings.copyToClipboard")]}),s.jsxs("button",{onClick:Me,disabled:!ue,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:[s.jsx($v,{size:16}),a("settings.downloadJson")]})]}),ue&&s.jsx("div",{className:"mt-3",children:s.jsx("pre",{className:"bg-gray-900 text-gray-100 p-4 rounded-md overflow-x-auto text-xs max-h-96",children:ue})})]})]})})]})})]})},J1=()=>{const{t:a}=ve(),[l,o]=v.useState([]),[i,u]=v.useState([]),[d,m]=v.useState([]),[h,p]=v.useState([]),[g,x]=v.useState(""),[w,k]=v.useState(""),[T,E]=v.useState(""),[A,O]=v.useState(!0),[R,N]=v.useState(null),[M,G]=v.useState(null),[W,re]=v.useState([]),[te,$]=v.useState(1),[se,le]=v.useState(9),[U,z]=v.useState(1),Q=v.useCallback(async()=>{try{O(!0);const ee=await Ge("/market/servers");ee&&ee.success&&Array.isArray(ee.data)?(u(ee.data),B(ee.data,te)):(console.error("Invalid market servers data format:",ee),N(a("market.fetchError")))}catch(ee){console.error("Error fetching market servers:",ee),N(ee instanceof Error?ee.message:String(ee))}finally{O(!1)}},[a]),B=v.useCallback((ee,Y,ue=se)=>{const je=ee.length,Se=Math.ceil(je/ue);z(Se);const ye=Math.max(1,Math.min(Y,Se));ye!==Y&&$(ye);const Me=(ye-1)*ue,ce=ee.slice(Me,Me+ue);o(ce)},[se]),V=v.useCallback(ee=>{$(ee),B(i,ee,se)},[i,B,se]),b=v.useCallback(async()=>{try{const ee=await Ge("/market/categories");ee&&ee.success&&Array.isArray(ee.data)?m(ee.data):console.error("Invalid categories data format:",ee)}catch(ee){console.error("Error fetching categories:",ee)}},[]),C=v.useCallback(async()=>{try{const ee=await Ge("/market/tags");ee&&ee.success&&Array.isArray(ee.data)?p(ee.data):console.error("Invalid tags data format:",ee)}catch(ee){console.error("Error fetching tags:",ee)}},[]),L=v.useCallback(async ee=>{try{O(!0);const Y=await Ge(`/market/servers/${ee}`);return Y&&Y.success&&Y.data?(G(Y.data),Y.data):(console.error("Invalid server data format:",Y),N(a("market.serverNotFound")),null)}catch(Y){return console.error(`Error fetching server ${ee}:`,Y),N(Y instanceof Error?Y.message:String(Y)),null}finally{O(!1)}},[a]),oe=v.useCallback(async ee=>{try{if(O(!0),E(ee),!ee.trim()){Q();return}const Y=await Ge(`/market/servers/search?query=${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(u(Y.data),$(1),B(Y.data,1)):(console.error("Invalid search results format:",Y),N(a("market.searchError")))}catch(Y){console.error("Error searching servers:",Y),N(Y instanceof Error?Y.message:String(Y))}finally{O(!1)}},[a,i,B,Q]),S=v.useCallback(async ee=>{try{if(O(!0),x(ee),k(""),!ee){Q();return}const Y=await Ge(`/market/categories/${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(u(Y.data),$(1),B(Y.data,1)):(console.error("Invalid category filter results format:",Y),N(a("market.filterError")))}catch(Y){console.error("Error filtering servers by category:",Y),N(Y instanceof Error?Y.message:String(Y))}finally{O(!1)}},[a,Q,B]),_=v.useCallback(async ee=>{try{if(O(!0),k(ee),x(""),!ee){Q();return}const Y=await Ge(`/market/tags/${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(u(Y.data),$(1),B(Y.data,1)):(console.error("Invalid tag filter results format:",Y),N(a("market.tagFilterError")))}catch(Y){console.error("Error filtering servers by tag:",Y),N(Y instanceof Error?Y.message:String(Y))}finally{O(!1)}},[a,Q,B]),Z=v.useCallback(async()=>{try{const ee=await Ge("/servers");if(ee&&ee.success&&Array.isArray(ee.data)){const Y=ee.data.map(ue=>ue.name);re(Y)}}catch(ee){console.error("Error fetching installed servers:",ee)}},[]),H=v.useCallback(ee=>W.includes(ee),[W]),I=v.useCallback(async(ee,Y)=>{var ue,je;try{const Se=(ue=ee.installations)!=null&&ue.npm?"npm":Object.keys(ee.installations||{}).length>0?Object.keys(ee.installations)[0]:null;if(!Se||!((je=ee.installations)!=null&&je[Se]))return N(a("market.noInstallationMethod")),!1;const ye=ee.installations[Se],Me={name:ee.name,config:Y.type==="stdio"?{command:Y.command||ye.command||"",args:Y.args||ye.args||[],env:{...ye.env,...Y.env}}:Y},ce=await St("/servers",Me);if(!ce.success)throw new Error(ce.message||"Failed to install server");return await Z(),!0}catch(Se){return console.error("Error installing server:",Se),N(Se instanceof Error?Se.message:String(Se)),!1}},[a,Z]),de=v.useCallback(ee=>{le(ee),$(1),B(i,1,ee)},[i,B]);return v.useEffect(()=>{Q(),b(),C(),Z()},[Q,b,C,Z]),{servers:l,allServers:i,categories:d,tags:h,selectedCategory:g,selectedTag:w,searchQuery:T,loading:A,error:R,setError:N,currentServer:M,fetchMarketServers:Q,fetchServerByName:L,searchServers:oe,filterByCategory:S,filterByTag:_,installServer:I,currentPage:te,totalPages:U,serversPerPage:se,changePage:V,changeServersPerPage:de,isServerInstalled:H}},Z1=()=>{const{t:a}=ve(),[l,o]=v.useState([]),[i,u]=v.useState([]),[d,m]=v.useState([]),[h,p]=v.useState([]),[g,x]=v.useState(""),[w,k]=v.useState(""),[T,E]=v.useState(""),[A,O]=v.useState(!0),[R,N]=v.useState(null),[M,G]=v.useState(null),[W,re]=v.useState(1),[te,$]=v.useState(9),[se,le]=v.useState(1),U=v.useCallback(async()=>{try{O(!0);const H=await Ge("/cloud/servers");H&&H.success&&Array.isArray(H.data)?(u(H.data),z(H.data,W)):(console.error("Invalid cloud market servers data format:",H),N(a("cloud.fetchError")))}catch(H){console.error("Error fetching cloud market servers:",H);const I=H instanceof Error?H.message:String(H);I==="MCPROUTER_API_KEY_NOT_CONFIGURED"||I.toLowerCase().includes("mcprouter api key not configured"),N(I)}finally{O(!1)}},[a]),z=v.useCallback((H,I,de=te)=>{const ee=H.length,Y=Math.ceil(ee/de);le(Y);const ue=Math.max(1,Math.min(I,Y));ue!==I&&re(ue);const je=(ue-1)*de,Se=H.slice(je,je+de);o(Se)},[te]),Q=v.useCallback(H=>{re(H),z(i,H,te)},[i,z,te]),B=v.useCallback(async()=>{try{const H=await Ge("/cloud/categories");H&&H.success&&Array.isArray(H.data)?m(H.data):console.error("Invalid cloud market categories data format:",H)}catch(H){console.error("Error fetching cloud market categories:",H)}},[]),V=v.useCallback(async()=>{try{const H=await Ge("/cloud/tags");H&&H.success&&Array.isArray(H.data)?p(H.data):console.error("Invalid cloud market tags data format:",H)}catch(H){console.error("Error fetching cloud market tags:",H)}},[]),b=v.useCallback(async H=>{try{O(!0);const I=await Ge(`/cloud/servers/${H}`);return I&&I.success&&I.data?(G(I.data),I.data):(console.error("Invalid cloud server data format:",I),N(a("cloud.serverNotFound")),null)}catch(I){console.error(`Error fetching cloud server ${H}:`,I);const de=I instanceof Error?I.message:String(I);return de==="MCPROUTER_API_KEY_NOT_CONFIGURED"||de.toLowerCase().includes("mcprouter api key not configured"),N(de),null}finally{O(!1)}},[a]),C=v.useCallback(async H=>{try{if(O(!0),E(H),!H.trim()){U();return}const I=await Ge(`/cloud/servers/search?query=${encodeURIComponent(H)}`);I&&I.success&&Array.isArray(I.data)?(u(I.data),re(1),z(I.data,1)):(console.error("Invalid cloud search results format:",I),N(a("cloud.searchError")))}catch(I){console.error("Error searching cloud servers:",I),N(I instanceof Error?I.message:String(I))}finally{O(!1)}},[a,i,z,U]),L=v.useCallback(async H=>{try{if(O(!0),x(H),k(""),!H){U();return}const I=await Ge(`/cloud/categories/${encodeURIComponent(H)}`);I&&I.success&&Array.isArray(I.data)?(u(I.data),re(1),z(I.data,1)):(console.error("Invalid cloud category filter results format:",I),N(a("cloud.filterError")))}catch(I){console.error("Error filtering cloud servers by category:",I),N(I instanceof Error?I.message:String(I))}finally{O(!1)}},[a,U,z]),oe=v.useCallback(async H=>{try{if(O(!0),k(H),x(""),!H){U();return}const I=await Ge(`/cloud/tags/${encodeURIComponent(H)}`);I&&I.success&&Array.isArray(I.data)?(u(I.data),re(1),z(I.data,1)):(console.error("Invalid cloud tag filter results format:",I),N(a("cloud.tagFilterError")))}catch(I){console.error("Error filtering cloud servers by tag:",I),N(I instanceof Error?I.message:String(I))}finally{O(!1)}},[a,U,z]),S=v.useCallback(async H=>{try{const I=await Ge(`/cloud/servers/${H}/tools`);if(!I.success)throw console.error("Failed to fetch cloud server tools:",I),new Error(I.message||"Failed to fetch cloud server tools");return I&&I.success&&Array.isArray(I.data)?I.data:(console.error("Invalid cloud server tools data format:",I),[])}catch(I){console.error(`Error fetching tools for cloud server ${H}:`,I);const de=I instanceof Error?I.message:String(I);if(de==="MCPROUTER_API_KEY_NOT_CONFIGURED"||de.toLowerCase().includes("mcprouter api key not configured"))throw I;return[]}},[]),_=v.useCallback(async(H,I,de)=>{try{const ee=await St(`/cloud/servers/${H}/tools/${I}/call`,{arguments:de});if(ee&&ee.success)return ee.data;throw new Error(ee.message||"Failed to call tool")}catch(ee){throw console.error(`Error calling tool ${I} on cloud server ${H}:`,ee),ee}},[]),Z=v.useCallback(H=>{$(H),re(1),z(i,1,H)},[i,z]);return v.useEffect(()=>{U(),B(),V()},[U,B,V]),{servers:l,allServers:i,categories:d,tags:h,selectedCategory:g,selectedTag:w,searchQuery:T,loading:A,error:R,setError:N,currentServer:M,fetchCloudServers:U,fetchServerByName:b,searchServers:C,filterByCategory:L,filterByTag:oe,fetchServerTools:S,callServerTool:_,currentPage:W,totalPages:se,serversPerPage:te,changePage:Q,changeServersPerPage:Z}},W1=()=>{const{t:a}=ve(),[l,o]=v.useState([]),[i,u]=v.useState([]),[d,m]=v.useState(!0),[h,p]=v.useState(null),[g,x]=v.useState(""),[w,k]=v.useState(1),[T,E]=v.useState(9),[A,O]=v.useState(null),[R,N]=v.useState(!1),[M,G]=v.useState([]),[W]=v.useState(1),re=v.useCallback(async(b,C)=>{try{m(!0),p(null);const L=new URLSearchParams;L.append("limit",T.toString()),b&&L.append("cursor",b);const oe=C!==void 0?C:g;oe.trim()&&L.append("search",oe.trim());const S=await Ge(`/registry/servers?${L.toString()}`);if(S&&S.success&&S.data){const _=S.data;if(_.servers&&Array.isArray(_.servers)){o(_.servers);const Z=_.metadata.count===T&&!!_.metadata.nextCursor;N(Z),O(_.metadata.nextCursor||null),u(b?H=>[...H,..._.servers]:_.servers)}else console.error("Invalid registry servers data format:",_),p(a("registry.fetchError"))}else p(a("registry.fetchError"))}catch(L){console.error("Error fetching registry servers:",L);const oe=L instanceof Error?L.message:String(L);p(oe)}finally{m(!1)}},[a,T]),te=v.useCallback(async()=>{if(!R||!A)return;const b=M[M.length-1]||"";G(C=>[...C,b]),k(C=>C+1),await re(A,g)},[R,A,M,g,re]),$=v.useCallback(async()=>{if(w<=1)return;const b=[...M];b.pop();const C=b[b.length-1];G(b),k(L=>L-1),await re(C||void 0,g)},[w,M,g,re]),se=v.useCallback(async b=>{b!==w&&(b>w&&R?await te():b<w&&w>1&&await $())},[w,R,te,$]),le=v.useCallback(async b=>{E(b),k(1),G([]),u([]),await re(void 0,g)},[g,re]),U=v.useCallback(async b=>{try{m(!0),p(null);const C=encodeURIComponent(b),L=await Ge(`/registry/servers/${C}/versions`);if(L&&L.success&&L.data){const oe=L.data;return oe.servers&&Array.isArray(oe.servers)&&oe.servers.length>0?oe.servers[0]:(console.error("Invalid registry server data format:",oe),p(a("registry.serverNotFound")),null)}else return p(a("registry.serverNotFound")),null}catch(C){console.error(`Error fetching registry server ${b}:`,C);const L=C instanceof Error?C.message:String(C);return p(L),null}finally{m(!1)}},[a]),z=v.useCallback(async b=>{try{p(null);const C=encodeURIComponent(b),L=await Ge(`/registry/servers/${C}/versions`);if(L&&L.success&&L.data){const oe=L.data;return oe.servers&&Array.isArray(oe.servers)?oe.servers:(console.error("Invalid registry server versions data format:",oe),[])}else return[]}catch(C){console.error(`Error fetching versions for server ${b}:`,C);const L=C instanceof Error?C.message:String(C);return p(L),[]}},[]),Q=v.useCallback(async(b,C)=>{try{p(null);const L=encodeURIComponent(b),oe=encodeURIComponent(C),S=await Ge(`/registry/servers/${L}/versions/${oe}`);if(S&&S.success&&S.data){const _=S.data;return _&&_.server?_:(console.error("Invalid registry server version data format:",_),null)}else return null}catch(L){console.error(`Error fetching version ${C} for server ${b}:`,L);const oe=L instanceof Error?L.message:String(L);return p(oe),null}},[]),B=v.useCallback(async b=>{console.log("Searching registry servers with query:",b),x(b),k(1),G([]),u([]),await re(void 0,b)},[re]),V=v.useCallback(async()=>{x(""),k(1),G([]),u([]),await re(void 0,"")},[re]);return v.useEffect(()=>{re(void 0,g)},[]),{servers:l,allServers:i,loading:d,error:h,setError:p,searchQuery:g,searchServers:B,clearSearch:V,fetchServerByName:U,fetchServerVersions:z,fetchServerVersion:Q,currentPage:w,totalPages:W,hasNextPage:R,hasPreviousPage:w>1,changePage:se,goToNextPage:te,goToPreviousPage:$,serversPerPage:T,changeServersPerPage:le}},e2=({server:a,onClick:l})=>{var p,g,x,w;const{t:o}=ve(),i=k=>k.split(" ").map(T=>T.charAt(0)).join("").toUpperCase().slice(0,2),u=()=>{if(!a.tags||a.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const k=28,T=M=>M.length+3;let E=0,A=0;const O=[...a.tags].sort((M,G)=>M.length-G.length);for(A=0;A<O.length;A++){const M=T(O[A]);if(E+M>k)break;if(E+=M,A===O.length-1)return{tagsToShow:O,hasMore:!1,moreCount:0}}A===0&&O.length>0&&(A=1);const R=O.length-A,N=3+String(R).length+o("market.moreTags").length;return E+N<=k||A<1?{tagsToShow:O.slice(0,A),hasMore:!0,moreCount:R}:{tagsToShow:O.slice(0,Math.max(1,A-1)),hasMore:!0,moreCount:R+1}},{tagsToShow:d,hasMore:m,moreCount:h}=u();return s.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(a),children:[s.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"}),s.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[s.jsxs("div",{className:"flex items-start justify-between mb-2",children:[s.jsxs("div",{className:"flex-1",children:[s.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:a.display_name}),s.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[s.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(((p=a.author)==null?void 0:p.name)||o("market.unknown"))}),s.jsx("div",{children:s.jsx("p",{className:"text-xs font-medium text-gray-700",children:((g=a.author)==null?void 0:g.name)||o("market.unknown")})})]})]}),s.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.is_official&&s.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")})})]}),s.jsx("div",{className:"mb-2 flex-1",children:s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2 min-h-[36px]",children:a.description})}),s.jsx("div",{className:"mb-2",children:s.jsx("div",{className:"flex flex-wrap gap-1 min-h-[24px]",children:((x=a.categories)==null?void 0:x.length)>0?a.categories.map((k,T)=>s.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded whitespace-nowrap",children:k},T)):s.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})}),s.jsx("div",{className:"mb-2",children:s.jsx("div",{className:"relative min-h-[24px] overflow-x-auto",children:((w=a.tags)==null?void 0:w.length)>0?s.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[d.map((k,T)=>s.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0",children:["#",k]},T)),m&&s.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",h," ",o("market.moreTags")]})]}):s.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})})]})]})},t2=({server:a,onBack:l,onInstall:o,installing:i=!1,isInstalled:u=!1})=>{var se,le;const{t:d}=ve(),[m,h]=v.useState(!1),[p,g]=v.useState(null),[x,w]=v.useState(!1),[k,T]=v.useState(null),[E,A]=v.useState([]),O=()=>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")},R=()=>{h(!m),g(null),w(!1),T(null)},N=async()=>{k&&(await M(k),w(!1),T(null))},M=async U=>{try{g(null),o(a,U.config),h(!1)}catch(z){console.error("Error installing server:",z),g(d("errors.serverInstall"))}},G=()=>{u||R()},W=()=>{if(!a.installations)return;if(a.installations.npm)return a.installations.npm;if(a.installations.uvx)return a.installations.uvx;if(a.installations.default)return a.installations.default;const U=Object.keys(a.installations);if(U.length>0)return a.installations[U[0]]},re=async U=>{try{const z=og(U);z.length>0?(A(z),T(U),w(!0)):await M(U)}catch(z){console.error("Error processing server installation:",z),g(d("errors.serverInstall"))}},te=O(),$=W();return s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[s.jsx("div",{className:"mb-4",children:s.jsxs("button",{onClick:l,className:"text-gray-600 hover:text-gray-900 flex items-center",children:[s.jsx("svg",{className:"h-5 w-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:s.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")]})}),s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsx("div",{children:s.jsxs("h2",{className:"text-2xl font-bold text-gray-900 flex items-center flex-wrap",children:[a.display_name,s.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",a.name,")"]}),s.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[d("market.author"),": ",a.author.name," • ",d("market.license"),": ",a.license," •",s.jsx("a",{href:a.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:d("market.repository")})]})]})}),s.jsxs("div",{className:"flex items-center",children:[a.is_official&&s.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")}),s.jsx("button",{onClick:G,disabled:te.disabled,className:te.className,children:te.text})]})]}),s.jsx("p",{className:"text-gray-700 mb-6",children:a.description}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[d("market.categories")," & ",d("market.tags")]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[(se=a.categories)==null?void 0:se.map((U,z)=>s.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:U},`cat-${z}`)),a.tags&&a.tags.map((U,z)=>s.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",U]},`tag-${z}`))]})]}),a.arguments&&Object.keys(a.arguments).length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.arguments")}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:s.jsxs("tr",{children:[s.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")}),s.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")}),s.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")}),s.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")})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(a.arguments).map(([U,z],Q)=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:U}),s.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:z.description}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:z.required?s.jsx("span",{className:"text-green-600",children:"✓"}):s.jsx("span",{className:"text-gray-600",children:"✗"})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:s.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:z.example})})]},Q))})]})})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.tools")}),s.jsx("div",{className:"space-y-4",children:(le=a.tools)==null?void 0:le.map((U,z)=>s.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[s.jsxs("h4",{className:"font-medium mb-2",children:[U.name,s.jsx("button",{type:"button",onClick:()=>{const Q=document.getElementById(`schema-${z}`);Q&&Q.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:d("market.viewSchema")})]}),s.jsx("p",{className:"text-gray-600 mb-2",children:U.description}),s.jsx("div",{className:"mt-2",children:s.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))})]}),a.examples&&a.examples.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.examples")}),s.jsx("div",{className:"space-y-4",children:a.examples.map((U,z)=>s.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[s.jsx("h4",{className:"font-medium mb-2",children:U.title}),s.jsx("p",{className:"text-gray-600 mb-2",children:U.description}),s.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:U.prompt})]},z))})]}),s.jsx("div",{className:"mt-6 flex justify-end",children:s.jsx("button",{onClick:G,disabled:te.disabled,className:te.className,children:te.text})}),m&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx(ll,{onSubmit:re,onCancel:R,modalTitle:d("market.installServer",{name:a.display_name}),formError:p,initialData:{name:a.name,status:"disconnected",config:$?{command:$.command||"",args:$.args||[],env:$.env||{}}:void 0}})}),x&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:d("server.confirmVariables")}),s.jsx("p",{className:"text-gray-600 mb-4",children:d("server.variablesDetected")}),s.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})})}),s.jsxs("div",{className:"ml-3",children:[s.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[d("server.detectedVariables"),":"]}),s.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:E.map((U,z)=>s.jsxs("li",{className:"font-mono",children:["$",`{${U}}`]},z))})]})]})}),s.jsx("p",{className:"text-gray-600 text-sm mb-6",children:d("market.confirmVariablesMessage")}),s.jsxs("div",{className:"flex justify-end space-x-3",children:[s.jsx("button",{onClick:()=>{w(!1),T(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:d("common.cancel")}),s.jsx("button",{onClick:N,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:d("market.confirmAndInstall")})]})]})})]})},r2=({server:a,onClick:l})=>{const{t:o}=ve(),i=()=>{l(a)},u=()=>{if(a.description&&a.description.length<=150)return a.description;if(a.content){const h=a.content.split(`
|
|
216
|
+
`).filter(p=>p.trim());for(const p of h)if(p.length>50&&p.length<=150)return p}return a.description?a.description.slice(0,150)+"...":o("cloud.noDescription")},d=h=>{try{const p=new Date(h),g=p.getFullYear(),x=(p.getMonth()+1).toString().padStart(2,"0"),w=p.getDate().toString().padStart(2,"0");return`${g}/${x}/${w}`}catch{return""}},m=h=>h.split(" ").map(p=>p.charAt(0)).join("").toUpperCase().slice(0,2);return s.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:[s.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"}),s.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex-1",children:[s.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:a.title||a.name}),s.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[s.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(a.author_name)}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-700",children:a.author_name}),a.updated_at&&s.jsxs("p",{className:"text-xs text-gray-500",children:[o("cloud.updated")," ",d(a.updated_at)]})]})]})]}),s.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.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"})})]}),s.jsx("div",{className:"mb-3 flex-1",children:s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2",children:u()})}),a.tools&&a.tools.length>0&&s.jsx("div",{className:"mb-3",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[s.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"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s.jsxs("span",{className:"text-sm text-gray-600 font-medium",children:[a.tools.length," ",a.tools.length===1?o("cloud.tool"):o("cloud.tools")]})]})}),s.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[s.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:[s.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:s.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"})}),s.jsx("span",{children:d(a.created_at)})]}),s.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[s.jsx("span",{children:o("cloud.viewDetails")}),s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},mu=()=>{const{t:a}=ve(),l=ts(),o=()=>{l("/settings")},i=()=>{window.open("https://mcprouter.co","_blank","noopener,noreferrer")};return s.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-6 mb-6",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("svg",{className:"h-5 w-5 text-amber-400",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})})}),s.jsxs("div",{className:"ml-3 flex-1",children:[s.jsx("h3",{className:"text-sm font-medium text-amber-800",children:a("cloud.apiKeyNotConfigured")}),s.jsx("div",{className:"mt-2 text-sm text-amber-700",children:s.jsx("p",{children:a("cloud.apiKeyNotConfiguredDescription")})}),s.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[s.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:[s.jsx("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.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"})}),a("cloud.getApiKey")]}),s.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:[s.jsxs("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[s.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"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),a("cloud.configureInSettings")]})]})]})]})})},s2=({serverName:a,onBack:l,onCallTool:o,fetchServerTools:i,onInstall:u,installing:d=!1,isInstalled:m=!1})=>{const{t:h}=ve(),{mcpRouterConfig:p}=Ws(),[g,x]=v.useState(null),[w,k]=v.useState(!0),[T,E]=v.useState(null),[A,O]=v.useState([]),[R,N]=v.useState(!1),[M,G]=v.useState(!1),[W,re]=v.useState(null),[te,$]=v.useState({}),[se,le]=v.useState({}),[U,z]=v.useState({}),[Q,B]=v.useState(!1),[V,b]=v.useState(null),C=Y=>(console.error("Checking for MCPRouter API key error:",Y),Y==="MCPROUTER_API_KEY_NOT_CONFIGURED"||Y.toLowerCase().includes("mcprouter api key not configured")),L=()=>m?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:h("market.installed")}:d?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:h("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:h("market.install")},oe=()=>{!m&&u&&(B(!0),b(null))},S=()=>{B(!1),b(null)},_=async Y=>{try{if(!g||!u)return;b(null),u(g,Y.config),B(!1)}catch(ue){console.error("Error installing server:",ue),b(h("errors.serverInstall"))}};v.useEffect(()=>{(async()=>{try{k(!0),E(null);const ue=await Ge(`/cloud/servers/${a}`);ue&&ue.success&&ue.data?(x(ue.data),O(ue.data.tools||[])):E(h("cloud.serverNotFound"))}catch(ue){console.error("Failed to load server details:",ue),E(ue instanceof Error?ue.message:String(ue))}finally{k(!1)}})()},[a,h]),v.useEffect(()=>{(async()=>{if(g&&(!g.tools||g.tools.length===0)&&i){N(!0),G(!1);try{const ue=await i(g.name);O(ue)}catch(ue){console.error("Failed to load tools:",ue);const je=ue instanceof Error?ue.message:String(ue);C(je)&&G(!0)}finally{N(!1)}}})()},[g==null?void 0:g.name,g==null?void 0:g.tools,i]);const Z=Y=>{try{const ue=new Date(Y),je=ue.getFullYear(),Se=String(ue.getMonth()+1).padStart(2,"0"),ye=String(ue.getDate()).padStart(2,"0"),Me=String(ue.getHours()).padStart(2,"0"),ce=String(ue.getMinutes()).padStart(2,"0"),Ae=String(ue.getSeconds()).padStart(2,"0");return`${je}-${Se}-${ye} ${Me}:${ce}:${Ae}`}catch{return Y}},H=(Y,ue,je)=>{le(Se=>({...Se,[Y]:{...Se[Y],[ue]:je}}))},I=async Y=>{if(!(!o||!g)){re(Y);try{const ue=se[Y]||{},je=await o(g.server_key,Y,ue);$(Se=>({...Se,[Y]:je}))}catch(ue){console.error("Tool call failed:",ue);const je=ue instanceof Error?ue.message:String(ue);$(Se=>({...Se,[Y]:{error:je}}))}finally{re(null)}}},de=Y=>{z(ue=>({...ue,[Y]:!ue[Y]}))},ee=(Y,ue,je)=>{var Me;const Se=((Me=se[Y.name])==null?void 0:Me[ue])||"",ye=ce=>{let Ae=ce.target.value;je.type==="number"||je.type==="integer"?Ae=Ae===""?void 0:Number(Ae):je.type==="boolean"&&(Ae=ce.target.value==="true"),H(Y.name,ue,Ae)};return je.type==="boolean"?s.jsxs("select",{value:Se===!0?"true":Se===!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:[s.jsx("option",{value:""}),s.jsx("option",{value:"true",children:h("common.true")}),s.jsx("option",{value:"false",children:h("common.false")})]}):je.type==="number"||je.type==="integer"?s.jsx("input",{type:"number",step:je.type==="integer"?"1":"any",value:Se||"",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"}):s.jsx("input",{type:"text",value:Se||"",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 s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[s.jsx("div",{className:"mb-6",children:s.jsxs("button",{onClick:l,className:"inline-flex items-center text-gray-600 hover:text-gray-900 transition-colors group",children:[s.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:s.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"})}),h("cloud.backToList")]})}),w?s.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:s.jsxs("div",{className:"flex flex-col items-center",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),s.jsx("p",{className:"text-gray-600 text-lg",children:h("app.loading")})]})}):T&&!C(T)?s.jsx("div",{className:"bg-white rounded-xl shadow-sm p-6",children:s.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("svg",{className:"h-5 w-5 text-red-400 mr-3",fill:"currentColor",viewBox:"0 0 20 20",children:s.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"})}),s.jsx("p",{className:"text-red-700",children:T})]})})}):g?s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden",children:s.jsx("div",{className:"bg-gradient-to-r from-gray-100 to-gray-200 px-6 py-4",children:s.jsxs("div",{className:"flex justify-between items-end",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-800 mb-2",children:g.title||g.name}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[s.jsx("span",{className:"text-sm bg-white/60 text-gray-700 px-3 py-1 rounded-full",children:g.name}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("svg",{className:"h-4 w-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})}),h("cloud.by")," ",g.author_name]})]})]}),s.jsxs("div",{className:"text-right flex flex-col items-end gap-3",children:[s.jsxs("div",{className:"text-xs text-gray-500",children:[h("cloud.updated"),": ",Z(g.updated_at)]}),u&&!C(T||"")&&!M&&s.jsx("button",{onClick:oe,disabled:L().disabled,className:L().className,children:L().text})]})]})})}),s.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[s.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.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"})}),h("cloud.description")]}),s.jsx("p",{className:"text-gray-700 leading-relaxed",children:g.description})]}),g.content&&s.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[s.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.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"})}),h("cloud.details")]}),s.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:s.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:g.content})})]}),s.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[s.jsxs("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[s.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"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),h("cloud.tools"),A.length>0&&s.jsx("span",{className:"ml-2 bg-blue-100 text-blue-800 text-sm font-medium px-2.5 py-0.5 rounded-full",children:A.length})]}),M&&s.jsx(mu,{}),R?s.jsxs("div",{className:"flex items-center justify-center py-12",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),s.jsx("span",{className:"text-gray-600",children:h("cloud.loadingTools")})]}):A.length===0&&!M?s.jsxs("div",{className:"text-center py-12",children:[s.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.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"})}),s.jsx("p",{className:"text-gray-600",children:h("cloud.noTools")})]}):A.length>0?s.jsx("div",{className:"space-y-4",children:A.map((Y,ue)=>s.jsxs("div",{className:"border border-gray-200 rounded-lg p-6 hover:border-gray-300 transition-colors",children:[s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-2 flex items-center",children:[s.jsx("span",{className:"bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded mr-3",children:"TOOL"}),Y.name]}),s.jsx("p",{className:"text-gray-600 leading-relaxed whitespace-pre-wrap",children:Y.description})]}),o&&s.jsx("button",{onClick:()=>I(Y.name),disabled:W===Y.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:W===Y.name?s.jsxs(s.Fragment,{children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),h("cloud.calling")]}):s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h6m2 8l4-4H7l4 4z"})}),h("cloud.callTool")]})})]}),Y.inputSchema&&Y.inputSchema.properties&&Object.keys(Y.inputSchema.properties).length>0&&s.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700",children:h("cloud.parameters")}),s.jsxs("button",{onClick:()=>de(Y.name),className:"text-sm text-blue-600 hover:text-blue-800 focus:outline-none flex items-center gap-1 transition-colors",children:[h("cloud.viewSchema"),s.jsx("svg",{className:`h-3 w-3 transition-transform duration-200 ${U[Y.name]?"rotate-90":"rotate-0"}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:s.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[Y.name]&&s.jsx("div",{className:"mb-4",children:s.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-3 overflow-auto",children:s.jsx("pre",{className:"text-sm text-gray-800",children:JSON.stringify(Y.inputSchema,null,2)})})}),s.jsx("div",{className:"space-y-4",children:Object.entries(Y.inputSchema.properties).map(([je,Se])=>{var ye;return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[je,((ye=Y.inputSchema.required)==null?void 0:ye.includes(je))&&s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),Se.description&&s.jsx("p",{className:"text-xs text-gray-500",children:Se.description}),ee(Y,je,Se)]},je)})})]}),te[Y.name]&&s.jsx("div",{className:"border-t border-gray-100 pt-4 mt-4",children:te[Y.name].error?s.jsx(s.Fragment,{children:C(te[Y.name].error)?s.jsx(mu,{}):s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"text-sm font-medium text-red-600 mb-3 flex items-center",children:[s.jsx("svg",{className:"h-4 w-4 text-red-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:s.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"})}),h("cloud.error")]}),s.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:s.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap overflow-auto",children:te[Y.name].error})})]})}):s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-3 flex items-center",children:[s.jsx("svg",{className:"h-4 w-4 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:s.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"})}),h("cloud.result")]}),s.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:s.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap overflow-auto",children:JSON.stringify(te[Y.name],null,2)})})]})})]},ue))}):null]})]}):s.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.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"})}),s.jsx("p",{className:"text-gray-600 text-lg",children:h("cloud.serverNotFound")})]})}),Q&&g&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx(ll,{onSubmit:_,onCancel:S,modalTitle:h("cloud.installServer",{name:g.title||g.name}),formError:V,initialData:{name:g.name,status:"disconnected",config:{type:"streamable-http",url:g.server_url,headers:{Authorization:`Bearer ${p.apiKey||"<MCPROUTER_API_KEY>"}`,"HTTP-Referer":p.referer||"<YOUR_APP_URL>","X-Title":p.title||"<YOUR_APP_NAME>"}}}})})]})},a2=({serverEntry:a,onClick:l})=>{var R,N;const{t:o}=ve(),{server:i,_meta:u}=a,d=()=>{l(a)},m=()=>i.description&&i.description.length<=150?i.description:i.description?i.description.slice(0,150)+"...":o("registry.noDescription"),h=M=>{if(!M)return"";try{const G=new Date(M),W=G.getFullYear(),re=(G.getMonth()+1).toString().padStart(2,"0"),te=G.getDate().toString().padStart(2,"0");return`${W}/${re}/${te}`}catch{return""}},g=i.icons&&i.icons.length>0?i.icons.find(G=>!G.theme||G.theme==="light")||i.icons[0]:null,x=u==null?void 0:u["io.modelcontextprotocol.registry/official"],w=x==null?void 0:x.isLatest,k=x==null?void 0:x.publishedAt,T=x==null?void 0:x.updatedAt,E=((R=i.packages)==null?void 0:R.length)||0,A=((N=i.remotes)==null?void 0:N.length)||0,O=E+A;return s.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:d,children:[s.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"}),s.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[s.jsx("div",{className:"flex items-start justify-between mb-3",children:s.jsxs("div",{className:"flex items-start space-x-3 flex-1",children:[g?s.jsx("img",{src:g.src,alt:i.title,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0",onError:M=>{M.currentTarget.style.display="none"}}):s.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-lg flex items-center justify-center text-white text-xl font-semibold flex-shrink-0",children:"M"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-lg font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200 mb-1 line-clamp-2",children:i.name}),s.jsxs("div",{className:"flex flex-wrap gap-1 mb-1",children:[w&&s.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800",children:o("registry.latest")}),s.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:["v",i.version]})]})]})]})}),s.jsx("div",{className:"mb-3 flex-1",children:s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-3",children:m()})}),O>0&&s.jsx("div",{className:"mb-3",children:s.jsxs("div",{className:"flex items-center space-x-4",children:[E>0&&s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.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"})}),s.jsxs("span",{className:"text-sm text-gray-600",children:[E," ",o(E===1?"registry.package":"registry.packages")]})]}),A>0&&s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})}),s.jsxs("span",{className:"text-sm text-gray-600",children:[A," ",o(A===1?"registry.remote":"registry.remotes")]})]})]})}),s.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[s.jsx("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:(k||T)&&s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:s.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"})}),s.jsx("span",{children:h(T||k)})]})}),s.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[s.jsx("span",{children:o("registry.viewDetails")}),s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},n2=({serverEntry:a,onBack:l,onInstall:o,installing:i=!1,isInstalled:u=!1,fetchVersions:d})=>{const{t:m}=ve(),{server:h,_meta:p}=a,[g,x]=v.useState(h.version),[w,k]=v.useState([]),[T,E]=v.useState(!1),[A,O]=v.useState(!1),[R,N]=v.useState(null),[M,G]=v.useState(null),[W,re]=v.useState(null),[te,$]=v.useState({packages:!0,remotes:!0,repository:!0}),se=p==null?void 0:p["io.modelcontextprotocol.registry/official"];v.useEffect(()=>{(async()=>{if(d){E(!0);try{const _=await d(h.name);k(_)}catch(_){console.error("Failed to load versions:",_)}finally{E(!1)}}})()},[h.name,d]);const U=h.icons&&h.icons.length>0?h.icons.find(_=>!_.theme||_.theme==="light")||h.icons[0]:null,z=S=>{if(!S)return"";try{return new Date(S).toLocaleDateString()}catch{return""}},Q=S=>{$(_=>({..._,[S]:!_[S]}))},B=(S,_)=>{N(S),G(_),re(null),O(!0)},V=()=>{O(!1),re(null)},b=async S=>{try{if(!o||!M||!R)return;re(null);const _=S.config;o(h,_),O(!1)}catch(_){console.error("Error installing server:",_),re(m("errors.serverInstall"))}},C=()=>{if(!M||!R)return null;if(console.log("Building initial form data for:",M),R==="package"&&"identifier"in M){const S=M,_={};S.environmentVariables&&S.environmentVariables.forEach(H=>{_[H.name]=H.default||""});const Z=l2(S.registryType);return{name:h.name,status:"disconnected",config:{type:"stdio",command:Z,args:o2(Z,S),env:Object.keys(_).length>0?_:void 0}}}else if(R==="remote"&&"url"in M){const S=M,_={};S.headers&&S.headers.forEach(H=>{_[H.name]=H.default||H.value||""});const Z=S.type==="sse"?"sse":"streamable-http";return{name:h.name,status:"disconnected",config:{type:Z,url:S.url,headers:Object.keys(_).length>0?_:void 0}}}return null},L=(S,_)=>s.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 mb-3 hover:border-blue-400 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"font-medium text-gray-900",children:S.identifier}),S.version&&s.jsxs("p",{className:"text-sm text-gray-500",children:["Version: ",S.version]}),S.runtimeHint&&s.jsx("p",{className:"text-sm text-gray-600 mt-1",children:S.runtimeHint})]}),s.jsx("button",{onClick:()=>B("package",S),disabled:u||i,className:`px-4 py-2 rounded text-sm font-medium transition-colors ${u?"bg-green-600 text-white cursor-default":i?"bg-gray-400 text-white cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:m(u?"registry.installed":i?"registry.installing":"registry.install")})]}),S.registryType&&s.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[s.jsx("span",{className:"font-medium",children:"Registry:"})," ",S.registryType]}),S.transport&&s.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[s.jsx("span",{className:"font-medium",children:"Transport:"})," ",S.transport.type,S.transport.url&&s.jsxs("span",{className:"ml-2 text-gray-500",children:["(",S.transport.url,")"]})]}),S.environmentVariables&&S.environmentVariables.length>0&&s.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[s.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.environmentVariables"),":"]}),s.jsx("div",{className:"space-y-2",children:S.environmentVariables.map((Z,H)=>s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"flex items-start",children:[s.jsx("span",{className:"font-mono text-gray-900 font-medium",children:Z.name}),Z.isRequired&&s.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800",children:m("common.required")}),Z.isSecret&&s.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:m("common.secret")})]}),Z.description&&s.jsx("p",{className:"text-gray-600 mt-1",children:Z.description}),Z.default&&s.jsxs("p",{className:"text-gray-500 mt-1",children:[s.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",s.jsx("span",{className:"font-mono",children:Z.default})]})]},H))})]}),S.packageArguments&&S.packageArguments.length>0&&s.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[s.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.packageArguments"),":"]}),s.jsx("div",{className:"space-y-2",children:S.packageArguments.map((Z,H)=>s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"flex items-start",children:[s.jsx("span",{className:"font-mono text-gray-900 font-medium",children:Z.name}),Z.isRequired&&s.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800",children:m("common.required")}),Z.isSecret&&s.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:m("common.secret")}),Z.isRepeated&&s.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-purple-100 text-purple-800",children:m("common.repeated")})]}),Z.description&&s.jsx("p",{className:"text-gray-600 mt-1",children:Z.description}),Z.type&&s.jsxs("p",{className:"text-gray-500 mt-1",children:[s.jsxs("span",{className:"font-medium",children:[m("common.type"),":"]})," ",s.jsx("span",{className:"font-mono",children:Z.type})]}),Z.default&&s.jsxs("p",{className:"text-gray-500 mt-1",children:[s.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",s.jsx("span",{className:"font-mono",children:Z.default})]}),Z.value&&s.jsxs("p",{className:"text-gray-500 mt-1",children:[s.jsxs("span",{className:"font-medium",children:[m("common.value"),":"]})," ",s.jsx("span",{className:"font-mono",children:Z.value})]}),Z.valueHint&&s.jsxs("p",{className:"text-gray-500 mt-1",children:[s.jsxs("span",{className:"font-medium",children:[m("common.valueHint"),":"]})," ",s.jsx("span",{className:"font-mono",children:Z.valueHint})]}),Z.choices&&Z.choices.length>0&&s.jsxs("p",{className:"text-gray-500 mt-1",children:[s.jsxs("span",{className:"font-medium",children:[m("common.choices"),":"]})," ",s.jsx("span",{className:"font-mono",children:Z.choices.join(", ")})]})]},H))})]})]},_),oe=(S,_)=>s.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 mb-3 hover:border-blue-400 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"font-medium text-gray-900",children:S.type}),s.jsx("p",{className:"text-sm text-gray-600 mt-1 break-all",children:S.url})]}),s.jsx("button",{onClick:()=>B("remote",S),disabled:u||i,className:`px-4 py-2 rounded text-sm font-medium transition-colors ${u?"bg-green-600 text-white cursor-default":i?"bg-gray-400 text-white cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:m(u?"registry.installed":i?"registry.installing":"registry.install")})]}),S.headers&&S.headers.length>0&&s.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[s.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.headers"),":"]}),s.jsx("div",{className:"space-y-2",children:S.headers.map((Z,H)=>s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"flex items-start",children:[s.jsx("span",{className:"font-mono text-gray-900 font-medium",children:Z.name}),Z.isRequired&&s.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800",children:m("common.required")}),Z.isSecret&&s.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:m("common.secret")})]}),Z.description&&s.jsx("p",{className:"text-gray-600 mt-1",children:Z.description}),Z.value&&s.jsxs("p",{className:"text-gray-500 mt-1",children:[s.jsxs("span",{className:"font-medium",children:[m("common.value"),":"]})," ",s.jsx("span",{className:"font-mono",children:Z.value})]}),Z.default&&s.jsxs("p",{className:"text-gray-500 mt-1",children:[s.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",s.jsx("span",{className:"font-mono",children:Z.default})]})]},H))})]})]},_);return s.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:l,className:"flex items-center text-blue-600 hover:text-blue-800 mb-4 transition-colors",children:[s.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),m("registry.backToList")]}),s.jsxs("div",{className:"flex items-start space-x-4",children:[U?s.jsx("img",{src:U.src,alt:h.title,className:"w-20 h-20 rounded-lg object-cover flex-shrink-0",onError:S=>{S.currentTarget.style.display="none"}}):s.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-blue-500 to-purple-600 rounded-lg flex items-center justify-center text-white text-3xl font-semibold flex-shrink-0",children:"M"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:h.name}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(se==null?void 0:se.isLatest)&&s.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800",children:m("registry.latest")}),s.jsxs("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800",children:["v",h.version]}),(se==null?void 0:se.status)&&s.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-gray-100 text-gray-800",children:se.status}),s.jsxs("span",{className:"flex flex-wrap items-center gap-4 text-sm text-gray-600",children:[(se==null?void 0:se.publishedAt)&&s.jsxs("div",{children:[s.jsxs("span",{className:"font-medium",children:[m("registry.published"),":"]})," ",z(se.publishedAt)]}),(se==null?void 0:se.updatedAt)&&s.jsxs("div",{children:[s.jsxs("span",{className:"font-medium",children:[m("registry.updated"),":"]})," ",z(se.updatedAt)]})]})]})]})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-3",children:m("registry.description")}),s.jsx("p",{className:"text-gray-700 leading-relaxed whitespace-pre-wrap",children:h.description})]}),h.websiteUrl&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-3",children:m("registry.website")}),s.jsx("a",{href:h.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 hover:underline",children:h.websiteUrl})]}),h.packages&&h.packages.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>Q("packages"),className:"flex items-center justify-between w-full text-xl font-semibold text-gray-900 mb-3 hover:text-blue-600 transition-colors",children:[s.jsxs("span",{children:[m("registry.packages")," (",h.packages.length,")"]}),s.jsx("svg",{className:`w-5 h-5 transform transition-transform ${te.packages?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),te.packages&&s.jsx("div",{className:"space-y-3",children:h.packages.map(L)})]}),h.remotes&&h.remotes.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>Q("remotes"),className:"flex items-center justify-between w-full text-xl font-semibold text-gray-900 mb-3 hover:text-blue-600 transition-colors",children:[s.jsxs("span",{children:[m("registry.remotes")," (",h.remotes.length,")"]}),s.jsx("svg",{className:`w-5 h-5 transform transition-transform ${te.remotes?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),te.remotes&&s.jsx("div",{className:"space-y-3",children:h.remotes.map(oe)})]}),h.repository&&s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>Q("repository"),className:"flex items-center justify-between w-full text-xl font-semibold text-gray-900 mb-3 hover:text-blue-600 transition-colors",children:[s.jsx("span",{children:m("registry.repository")}),s.jsx("svg",{className:`w-5 h-5 transform transition-transform ${te.repository?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),te.repository&&s.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[h.repository.url&&s.jsxs("div",{className:"mb-2",children:[s.jsx("span",{className:"font-medium text-gray-700",children:"URL:"})," ",s.jsx("a",{href:h.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 hover:underline break-all",children:h.repository.url})]}),h.repository.source&&s.jsxs("div",{className:"mb-2",children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Source:"})," ",h.repository.source]}),h.repository.subfolder&&s.jsxs("div",{className:"mb-2",children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Subfolder:"})," ",h.repository.subfolder]}),h.repository.id&&s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-gray-700",children:"ID:"})," ",h.repository.id]})]})]}),A&&M&&R&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx(ll,{onSubmit:b,onCancel:V,modalTitle:m("registry.installServer",{name:h.title||h.name}),formError:W,initialData:C()})})]})};function l2(a){switch(a.toLowerCase()){case"pypi":case"python":return"uvx";case"npm":case"node":return"npx";case"oci":case"docker":return"docker";default:return""}}function o2(a,l){const o=[l.identifier+(l.version?`@${l.version}`:"")],i=[];switch(l.packageArguments&&l.packageArguments.length>0&&l.packageArguments.forEach(u=>{if(u.isRequired||u.default||u.value){const d=`--${u.name}`,m=u.value||u.default||`\${${u.name.toUpperCase()}}`;i.push(d,m)}}),a.toLowerCase()){case"uvx":return[...o,...i];case"npx":return[...o,...i];case"docker":{const u=[];return l.environmentVariables&&l.environmentVariables.forEach(d=>{u.push("-e",`${d.name}`)}),["run","-i","--rm",...u,...o,...i]}default:return[...o,...i]}}const i2=({currentPage:a,totalPages:l,onPageChange:o})=>{const i=()=>{const u=[];u.push(s.jsx("button",{onClick:()=>o(1),className:`px-3 py-1 mx-1 rounded ${a===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,a-Math.floor(5/2));m>2&&u.push(s.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let h=m;h<=Math.min(l-1,m+5-3);h++)u.push(s.jsx("button",{onClick:()=>o(h),className:`px-3 py-1 mx-1 rounded ${a===h?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:h},h));return m+5-3<l-1&&u.push(s.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),l>1&&u.push(s.jsx("button",{onClick:()=>o(l),className:`px-3 py-1 mx-1 rounded ${a===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:s.jsxs("div",{className:"flex justify-center items-center my-6",children:[s.jsx("button",{onClick:()=>o(Math.max(1,a-1)),disabled:a===1,className:`px-3 py-1 rounded mr-2 ${a===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"« Prev"}),s.jsx("div",{className:"flex",children:i()}),s.jsx("button",{onClick:()=>o(Math.min(l,a+1)),disabled:a===l,className:`px-3 py-1 rounded ml-2 ${a===l?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"Next »"})]})},c2=({currentPage:a,hasNextPage:l,hasPreviousPage:o,onNextPage:i,onPreviousPage:u})=>s.jsxs("div",{className:"flex items-center justify-center space-x-2 my-6",children:[s.jsxs("button",{onClick:u,disabled:!o,className:`px-4 py-2 rounded transition-all duration-200 ${o?"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary":"bg-gray-100 text-gray-400 cursor-not-allowed"}`,children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 inline-block mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:s.jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Prev"]}),s.jsxs("span",{className:"px-4 py-2 bg-blue-500 text-white rounded btn-primary",children:["Page ",a]}),s.jsxs("button",{onClick:i,disabled:!l,className:`px-4 py-2 rounded transition-all duration-200 ${l?"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary":"bg-gray-100 text-gray-400 cursor-not-allowed"}`,children:["Next",s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 inline-block ml-1",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})})]})]}),Vh=()=>{const{t:a}=ve(),l=ts(),{serverName:o}=gp(),{showToast:i}=al(),[u,d]=Zy(),m=u.get("tab")||"cloud",{servers:h,allServers:p,categories:g,loading:x,error:w,setError:k,searchServers:T,filterByCategory:E,filterByTag:A,selectedCategory:O,selectedTag:R,installServer:N,fetchServerByName:M,isServerInstalled:G,currentPage:W,totalPages:re,changePage:te,serversPerPage:$,changeServersPerPage:se}=J1(),{servers:le,allServers:U,loading:z,error:Q,setError:B,fetchServerTools:V,callServerTool:b,currentPage:C,totalPages:L,changePage:oe,serversPerPage:S,changeServersPerPage:_}=Z1(),{servers:Z,allServers:H,loading:I,error:de,setError:ee,searchServers:Y,clearSearch:ue,fetchServerByName:je,fetchServerVersions:Se,currentPage:ye,totalPages:Me,hasNextPage:ce,hasPreviousPage:Ae,changePage:nt,goToNextPage:Ct,goToPreviousPage:ze,serversPerPage:Et,changeServersPerPage:br}=W1(),[Yt,Xt]=v.useState(null),[Qt,rs]=v.useState(null),[ss,Rs]=v.useState(null),[Jt,ft]=v.useState(""),[Ot,mt]=v.useState(""),[as,fr]=v.useState(!1),[ea,Or]=v.useState(new Set),[Dr,Zt]=v.useState(new Set);v.useEffect(()=>{(async()=>{if(o)if(m==="cloud"){const Oe=le.find(Te=>Te.name===o);Oe?rs(Oe):l("/market?tab=cloud")}else if(m==="registry"){console.log("Loading registry server details for:",o);const Oe=await je(o);Oe?Rs(Oe):l("/market?tab=registry")}else{const Oe=await M(o);Oe?Xt(Oe):l("/market?tab=local")}else Xt(null),rs(null),Rs(null)})()},[o,m,le,M,je,l]);const mr=we=>{const Oe=new URLSearchParams(u);Oe.set("tab",we),d(Oe),o&&l("/market?"+Oe.toString())},jr=we=>{we.preventDefault(),m==="local"?T(Jt):m==="registry"&&Y(Ot)},ta=we=>{m==="local"&&E(we)},me=()=>{m==="local"?(ft(""),E(""),A("")):m==="registry"&&(mt(""),ue())},fe=we=>{var Oe;if(m==="cloud")l(`/market/${we.name}?tab=cloud`);else if(m==="registry"){const Te=we;console.log("Registry server clicked:",Te);const Xe=(Oe=Te.server)==null?void 0:Oe.name;if(console.log("Server name extracted:",Xe),Xe){const At=`/market/${encodeURIComponent(Xe)}?tab=registry`;console.log("Navigating to:",At),l(At)}else console.error("Server name is undefined in registry server:",Te)}else l(`/market/${we.name}?tab=local`)},he=()=>{l(`/market?tab=${m}`)},kt=async(we,Oe)=>{try{fr(!0),await N(we,Oe)&&i(a("market.installSuccess",{serverName:we.display_name}),"success")}finally{fr(!1)}},hr=async(we,Oe)=>{try{fr(!0);const Te={name:we.name,config:Oe},Xe=await St("/servers",Te);if(!Xe.success){const At=(Xe==null?void 0:Xe.message)||a("server.addError");i(At,"error");return}Or(At=>new Set(At).add(we.name)),i(a("cloud.installSuccess",{name:we.title||we.name}),"success")}catch(Te){console.error("Error installing cloud server:",Te);const Xe=Te instanceof Error?Te.message:String(Te);i(a("cloud.installError",{error:Xe}),"error")}finally{fr(!1)}},wr=async(we,Oe)=>{try{fr(!0);const Te={name:we.name,config:Oe},Xe=await St("/servers",Te);if(!Xe.success){const At=(Xe==null?void 0:Xe.message)||a("server.addError");i(At,"error");return}Zt(At=>new Set(At).add(we.name)),i(a("registry.installSuccess",{name:we.title||we.name}),"success")}catch(Te){console.error("Error installing registry server:",Te);const Xe=Te instanceof Error?Te.message:String(Te);i(a("registry.installError",{error:Xe}),"error")}finally{fr(!1)}},Nr=async(we,Oe,Te)=>{try{const Xe=await b(we,Oe,Te);return i(a("cloud.toolCallSuccess",{toolName:Oe}),"success"),Xe}catch(Xe){const At=Xe instanceof Error?Xe.message:String(Xe);throw ns(At)||i(a("cloud.toolCallError",{toolName:Oe,error:At}),"error"),Xe}},ns=we=>we==="MCPROUTER_API_KEY_NOT_CONFIGURED"||we.toLowerCase().includes("mcprouter api key not configured"),bt=we=>{m==="local"?te(we):m==="registry"?nt(we):oe(we),window.scrollTo({top:0,behavior:"smooth"})},pr=we=>{const Oe=parseInt(we.target.value,10);m==="local"?se(Oe):m==="registry"?br(Oe):_(Oe)};if(Yt)return s.jsx(t2,{server:Yt,onBack:he,onInstall:kt,installing:as,isInstalled:G(Yt.name)});if(Qt)return s.jsx(s2,{serverName:Qt.name,onBack:he,onCallTool:Nr,fetchServerTools:V,onInstall:hr,installing:as,isInstalled:ea.has(Qt.name)});if(ss)return s.jsx(n2,{serverEntry:ss,onBack:he,onInstall:wr,installing:as,isInstalled:Dr.has(ss.server.name),fetchVersions:Se});const Je=m==="local",He=m==="registry",tt=Je?h:He?Z:le,rt=Je?p:He?H:U,Wt=Je?g:[],Ur=Je?x:He?I:z,Sr=Je?w:He?de:Q,Bo=Je?k:He?ee:B,ra=Je?O:"",Ms=Je?R:"",er=Je?W:He?ye:C,ls=Je?re:He?Me:L,Lt=Je?$:He?Et:S;return s.jsxs("div",{children:[s.jsx("div",{className:"mb-6",children:s.jsx("div",{className:"border-b border-gray-200",children:s.jsxs("nav",{className:"-mb-px flex space-x-3",children:[s.jsxs("button",{onClick:()=>mr("cloud"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${!Je&&!He?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[a("cloud.title"),s.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",s.jsx("a",{href:"https://mcprouter.co",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPRouter"}),")"]})]}),s.jsxs("button",{onClick:()=>mr("local"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Je?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[a("market.title"),s.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",s.jsx("a",{href:"https://mcpm.sh",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPM"}),")"]})]}),s.jsxs("button",{onClick:()=>mr("registry"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${He?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[a("registry.title"),s.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",s.jsx("a",{href:"https://registry.modelcontextprotocol.io",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:a("registry.official")}),")"]})]})]})})}),Sr&&s.jsx(s.Fragment,{children:!Je&&ns(Sr)?s.jsx(mu,{}):s.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{children:Sr}),s.jsx("button",{onClick:()=>Bo(null),className:"text-red-700 hover:text-red-900 transition-colors duration-200",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})})})]})})}),(Je||He)&&s.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:s.jsxs("form",{onSubmit:jr,className:"flex space-x-4 mb-0",children:[s.jsx("div",{className:"flex-grow",children:s.jsx("input",{type:"text",value:He?Ot:Jt,onChange:we=>{He?mt(we.target.value):ft(we.target.value)},placeholder:a(He?"registry.searchPlaceholder":"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"})}),s.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:a(He?"registry.search":"market.search")}),(Je&&(Jt||ra||Ms)||He&&Ot)&&s.jsx("button",{type:"button",onClick:me,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:a(He?"registry.clearFilters":"market.clearFilters")})]})}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[Je&&s.jsx("div",{className:"md:w-48 flex-shrink-0",children:s.jsx("div",{className:"bg-white shadow rounded-lg p-4 mb-6 sticky top-4 page-card",children:Wt.length>0?s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:"flex justify-between items-center mb-3",children:[s.jsx("h3",{className:"font-medium text-gray-900",children:a("market.categories")}),ra&&s.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>E(""),children:a("market.clearCategoryFilter")})]}),s.jsx("div",{className:"flex flex-col gap-2",children:Wt.map(we=>s.jsx("button",{onClick:()=>ta(we),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${ra===we?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:we},we))})]}):Ur?s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"mb-3",children:s.jsx("h3",{className:"font-medium text-gray-900",children:a("market.categories")})}),s.jsxs("div",{className:"flex flex-col gap-2 items-center py-4 loading-container",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),s.jsx("p",{className:"text-sm text-gray-600",children:a("app.loading")})]})]}):s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"mb-3",children:s.jsx("h3",{className:"font-medium text-gray-900",children:a("market.categories")})}),s.jsx("p",{className:"text-sm text-gray-600 py-2",children:a("market.noCategories")})]})})}),s.jsx("div",{className:"flex-grow",children:Ur?s.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.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"})]}),s.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}):tt.length===0?s.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:s.jsx("p",{className:"text-gray-600",children:a(Je?"market.noServers":He?"registry.noServers":"cloud.noServers")})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:tt.map((we,Oe)=>Je?s.jsx(e2,{server:we,onClick:fe},Oe):He?s.jsx(a2,{serverEntry:we,onClick:fe},Oe):s.jsx(r2,{server:we,onClick:fe},Oe))}),s.jsxs("div",{className:"flex items-center mb-4",children:[s.jsx("div",{className:"flex-[2] text-sm text-gray-500",children:Je?a("market.showing",{from:(er-1)*Lt+1,to:Math.min(er*Lt,rt.length),total:rt.length}):He?a("registry.showing",{from:(er-1)*Lt+1,to:(er-1)*Lt+tt.length,total:rt.length+(ce?"+":"")}):a("cloud.showing",{from:(er-1)*Lt+1,to:Math.min(er*Lt,rt.length),total:rt.length})}),s.jsx("div",{className:"flex-[4] flex justify-center",children:He?s.jsx(c2,{currentPage:er,hasNextPage:ce,hasPreviousPage:Ae,onNextPage:Ct,onPreviousPage:ze}):s.jsx(i2,{currentPage:er,totalPages:ls,onPageChange:bt})}),s.jsxs("div",{className:"flex-[2] flex items-center justify-end space-x-2",children:[s.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[a(Je?"market.perPage":He?"registry.perPage":"cloud.perPage"),":"]}),s.jsxs("select",{id:"perPage",value:Lt,onChange:pr,className:"border rounded p-1 text-sm btn-secondary outline-none",children:[s.jsx("option",{value:"6",children:"6"}),s.jsx("option",{value:"9",children:"9"}),s.jsx("option",{value:"12",children:"12"}),s.jsx("option",{value:"24",children:"24"})]})]})]})]})})]})]})},u2={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"},d2={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 f2({variant:a="default",size:l="default",className:o,disabled:i,children:u,...d}){return s.jsx("button",{className:Zr("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",u2[a],d2[l],o),disabled:i,...d,children:u})}const m2=({logs:a,isLoading:l=!1,error:o=null,onClear:i})=>{const{t:u}=ve(),d=v.useRef(null),[m,h]=v.useState(!0),[p,g]=v.useState(""),[x,w]=v.useState(["info","error","warn","debug"]),[k,T]=v.useState(["main","child"]);v.useEffect(()=>{m&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[a,m]);const E=a.filter(N=>{const M=p?N.message.toLowerCase().includes(p.toLowerCase()):!0,G=x.includes(N.type),W=k.includes(N.source);return M&&G&&W}),A=N=>new Date(N).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),O=N=>{switch(N){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"}},R=N=>{switch(N){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 s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"bg-card p-3 rounded-t-md flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("span",{className:"font-semibold text-sm",children:[u("logs.filters"),":"]}),s.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:p,onChange:N=>g(N.target.value)}),s.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(N=>s.jsx(wo,{variant:x.includes(N)?"default":"outline",className:`cursor-pointer ${x.includes(N)?O(N):""}`,onClick:()=>{x.includes(N)?w(M=>M.filter(G=>G!==N)):w(M=>[...M,N])},children:N},N))}),s.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(N=>s.jsx(wo,{variant:k.includes(N)?"default":"outline",className:`cursor-pointer ${k.includes(N)?R(N):""}`,onClick:()=>{k.includes(N)?T(M=>M.filter(G=>G!==N)):T(M=>[...M,N])},children:u(N==="main"?"logs.mainProcess":"logs.childProcess")},N))})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("label",{className:"flex items-center gap-1 text-sm",children:[s.jsx("input",{type:"checkbox",checked:m,onChange:()=>h(!m),className:"form-checkbox h-4 w-4"}),u("logs.autoScroll")]}),s.jsx(f2,{variant:"outline",size:"sm",onClick:i,className:"btn-secondary",disabled:l||a.length===0,children:u("logs.clearLogs")})]})]}),s.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?s.jsx("div",{className:"flex justify-center items-center h-full",children:s.jsx("span",{children:u("logs.loading")})}):o?s.jsx("div",{className:"text-red-500 p-2",children:o.message}):E.length===0?s.jsx("div",{className:"text-center text-muted-foreground p-8",children:p||x.length<4||k.length<2?u("logs.noMatch"):u("logs.noLogs")}):E.map((N,M)=>s.jsxs("div",{className:`py-1 ${N.type==="error"?"text-red-500":N.type==="warn"?"text-yellow-500":""}`,children:[s.jsxs("span",{className:"text-gray-400",children:["[",A(N.timestamp),"]"]}),s.jsx(wo,{className:`ml-2 mr-1 ${O(N.type)}`,children:N.type}),s.jsxs(wo,{variant:"default",className:`mr-2 ${R(N.source)}`,children:[N.source==="main"?u("logs.main"):u("logs.child"),N.processId?` (${N.processId})`:""]}),s.jsx("span",{className:"whitespace-pre-wrap",children:N.message})]},`${N.timestamp}-${M}`))})]})},h2=async()=>{try{const a=await Jn("/logs");if(!a.success)throw new Error(a.error||"Failed to clear logs")}catch(a){throw console.error("Error clearing logs:",a),a}},p2=()=>{const[a,l]=v.useState([]),[o,i]=v.useState(!0),[u,d]=v.useState(null);return v.useEffect(()=>{let h=null,p=!0;const g=()=>{try{h&&h.close();const x=sl();h=new EventSource(Cu(`/logs/stream?token=${x}`)),h.onmessage=w=>{if(p)try{const k=JSON.parse(w.data);k.type==="initial"?(l(k.logs),i(!1)):k.type==="log"&&l(T=>[...T,k.log])}catch(k){console.error("Error parsing SSE message:",k)}},h.onerror=()=>{p&&(h&&(h.close(),setTimeout(g,5e3)),d(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(x){if(!p)return;d(x instanceof Error?x:new Error("Failed to connect to log stream")),i(!1)}};return g(),()=>{p=!1,h&&h.close()}},[]),{logs:a,loading:o,error:u,clearLogs:async()=>{try{await h2(),l([])}catch(h){d(h instanceof Error?h:new Error("Failed to clear logs"))}}}},g2=()=>{const{t:a}=ve(),{logs:l,loading:o,error:i,clearLogs:u}=p2();return s.jsxs("div",{className:"container mx-auto p-4",children:[s.jsx("div",{className:"flex justify-between items-center mb-4",children:s.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:a("pages.logs.title")})}),s.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:s.jsx(m2,{logs:l,isLoading:o,error:i,onClear:u})})]})},x2=()=>{const{serverName:a}=gp();return s.jsx(Ao,{to:`/market/${a}?tab=cloud`,replace:!0})};function Gh(){const a=Su();return s.jsx(t1,{children:s.jsx(gv,{children:s.jsx(r1,{children:s.jsx(Wb,{children:s.jsx(Yy,{basename:a,children:s.jsxs(Sy,{children:[s.jsx(Ut,{path:"/login",element:s.jsx(b1,{})}),s.jsx(Ut,{element:s.jsx(v1,{}),children:s.jsxs(Ut,{element:s.jsx(y1,{}),children:[s.jsx(Ut,{path:"/",element:s.jsx(j1,{})}),s.jsx(Ut,{path:"/servers",element:s.jsx(H1,{})}),s.jsx(Ut,{path:"/groups",element:s.jsx(G1,{})}),s.jsx(Ut,{path:"/users",element:s.jsx(I1,{})}),s.jsx(Ut,{path:"/market",element:s.jsx(Vh,{})}),s.jsx(Ut,{path:"/market/:serverName",element:s.jsx(Vh,{})}),s.jsx(Ut,{path:"/cloud",element:s.jsx(Ao,{to:"/market?tab=cloud",replace:!0})}),s.jsx(Ut,{path:"/cloud/:serverName",element:s.jsx(x2,{})}),s.jsx(Ut,{path:"/logs",element:s.jsx(g2,{})}),s.jsx(Ut,{path:"/settings",element:s.jsx(Q1,{})})]})}),s.jsx(Ut,{path:"*",element:s.jsx(Ao,{to:"/"})})]})})})})})})}const ke=a=>typeof a=="string",Yn=()=>{let a,l;const o=new Promise((i,u)=>{a=i,l=u});return o.resolve=a,o.reject=l,o},Fh=a=>a==null?"":""+a,y2=(a,l,o)=>{a.forEach(i=>{l[i]&&(o[i]=l[i])})},v2=/###/g,$h=a=>a&&a.indexOf("###")>-1?a.replace(v2,"."):a,Kh=a=>!a||ke(a),Xn=(a,l,o)=>{const i=ke(l)?l.split("."):l;let u=0;for(;u<i.length-1;){if(Kh(a))return{};const d=$h(i[u]);!a[d]&&o&&(a[d]=new o),Object.prototype.hasOwnProperty.call(a,d)?a=a[d]:a={},++u}return Kh(a)?{}:{obj:a,k:$h(i[u])}},Ih=(a,l,o)=>{const{obj:i,k:u}=Xn(a,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),h=Xn(a,m,Object);for(;h.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),h=Xn(a,m,Object),h!=null&&h.obj&&typeof h.obj[`${h.k}.${d}`]<"u"&&(h.obj=void 0);h.obj[`${h.k}.${d}`]=o},b2=(a,l,o,i)=>{const{obj:u,k:d}=Xn(a,l,Object);u[d]=u[d]||[],u[d].push(o)},Mo=(a,l)=>{const{obj:o,k:i}=Xn(a,l);if(o&&Object.prototype.hasOwnProperty.call(o,i))return o[i]},j2=(a,l,o)=>{const i=Mo(a,o);return i!==void 0?i:Mo(l,o)},cg=(a,l,o)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in a?ke(a[i])||a[i]instanceof String||ke(l[i])||l[i]instanceof String?o&&(a[i]=l[i]):cg(a[i],l[i],o):a[i]=l[i]);return a},Ha=a=>a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var w2={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const N2=a=>ke(a)?a.replace(/[&<>"'\/]/g,l=>w2[l]):a;class S2{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 C2=[" ",",","?","!",";"],E2=new S2(20),k2=(a,l,o)=>{l=l||"",o=o||"";const i=C2.filter(m=>l.indexOf(m)<0&&o.indexOf(m)<0);if(i.length===0)return!0;const u=E2.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let d=!u.test(a);if(!d){const m=a.indexOf(o);m>0&&!u.test(a.substring(0,m))&&(d=!0)}return d},hu=(a,l,o=".")=>{if(!a)return;if(a[l])return Object.prototype.hasOwnProperty.call(a,l)?a[l]:void 0;const i=l.split(o);let u=a;for(let d=0;d<i.length;){if(!u||typeof u!="object")return;let m,h="";for(let p=d;p<i.length;++p)if(p!==d&&(h+=o),h+=i[p],m=u[h],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&p<i.length-1)continue;d+=p-d+1;break}u=m}return u},Wn=a=>a==null?void 0:a.replace("_","-"),A2={type:"logger",log(a){this.output("log",a)},warn(a){this.output("warn",a)},error(a){this.output("error",a)},output(a,l){var o,i;(i=(o=console==null?void 0:console[a])==null?void 0:o.apply)==null||i.call(o,console,l)}};class Oo{constructor(l,o={}){this.init(l,o)}init(l,o={}){this.prefix=o.prefix||"i18next:",this.logger=l||A2,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:(ke(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[o](l))}create(l){return new Oo(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new Oo(this.logger,l)}}var Mr=new Oo;class Ho{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 Yh extends Ho{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 g,x;const d=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator,m=u.ignoreJSONStructure!==void 0?u.ignoreJSONStructure:this.options.ignoreJSONStructure;let h;l.indexOf(".")>-1?h=l.split("."):(h=[l,o],i&&(Array.isArray(i)?h.push(...i):ke(i)&&d?h.push(...i.split(d)):h.push(i)));const p=Mo(this.data,h);return!p&&!o&&!i&&l.indexOf(".")>-1&&(l=h[0],o=h[1],i=h.slice(2).join(".")),p||!m||!ke(i)?p:hu((x=(g=this.data)==null?void 0:g[l])==null?void 0:x[o],i,d)}addResource(l,o,i,u,d={silent:!1}){const m=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let h=[l,o];i&&(h=h.concat(m?i.split(m):i)),l.indexOf(".")>-1&&(h=l.split("."),u=o,o=h[1]),this.addNamespaces(o),Ih(this.data,h,u),d.silent||this.emit("added",l,o,i,u)}addResources(l,o,i,u={silent:!1}){for(const d in i)(ke(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 h=[l,o];l.indexOf(".")>-1&&(h=l.split("."),u=i,i=o,o=h[1]),this.addNamespaces(o);let p=Mo(this.data,h)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),u?cg(p,i,d):p={...p,...i},Ih(this.data,h,p),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 ug={processors:{},addPostProcessor(a){this.processors[a.name]=a},handle(a,l,o,i,u){return a.forEach(d=>{var m;l=((m=this.processors[d])==null?void 0:m.process(l,o,i,u))??l}),l}};const dg=Symbol("i18next/PATH_KEY");function T2(){const a=[],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===dg?a:(a.push(u),o=Proxy.revocable(i,l),o.proxy)},Proxy.revocable(Object.create(null),l).proxy}function pu(a,l){const{[dg]:o}=a(T2());return o.join((l==null?void 0:l.keySeparator)??".")}const Xh={},Qh=a=>!ke(a)&&typeof a!="boolean"&&typeof a!="number";class Do extends Ho{constructor(l,o={}){super(),y2(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Mr.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,h=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!k2(l,i,u);if(m&&!h){const p=l.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:l,namespaces:ke(d)?[d]:d};const g=l.split(i);(i!==u||i===u&&this.options.ns.indexOf(g[0])>-1)&&(d=g.shift()),l=g.join(u)}return{key:l,namespaces:ke(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=pu(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:h,namespaces:p}=this.extractFromKey(l[l.length-1],u),g=p[p.length-1];let x=u.nsSeparator!==void 0?u.nsSeparator:this.options.nsSeparator;x===void 0&&(x=":");const w=u.lng||this.language,k=u.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((w==null?void 0:w.toLowerCase())==="cimode")return k?d?{res:`${g}${x}${h}`,usedKey:h,exactUsedKey:h,usedLng:w,usedNS:g,usedParams:this.getUsedParamsDetails(u)}:`${g}${x}${h}`:d?{res:h,usedKey:h,exactUsedKey:h,usedLng:w,usedNS:g,usedParams:this.getUsedParamsDetails(u)}:h;const T=this.resolve(l,u);let E=T==null?void 0:T.res;const A=(T==null?void 0:T.usedKey)||h,O=(T==null?void 0:T.exactUsedKey)||h,R=["[object Number]","[object Function]","[object RegExp]"],N=u.joinArrays!==void 0?u.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,G=u.count!==void 0&&!ke(u.count),W=Do.hasDefaultValue(u),re=G?this.pluralResolver.getSuffix(w,u.count,u):"",te=u.ordinal&&G?this.pluralResolver.getSuffix(w,u.count,{ordinal:!1}):"",$=G&&!u.ordinal&&u.count===0,se=$&&u[`defaultValue${this.options.pluralSeparator}zero`]||u[`defaultValue${re}`]||u[`defaultValue${te}`]||u.defaultValue;let le=E;M&&!E&&W&&(le=se);const U=Qh(le),z=Object.prototype.toString.apply(le);if(M&&le&&U&&R.indexOf(z)<0&&!(ke(N)&&Array.isArray(le))){if(!u.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(A,le,{...u,ns:p}):`key '${h} (${this.language})' returned an object instead of string.`;return d?(T.res=Q,T.usedParams=this.getUsedParamsDetails(u),T):Q}if(m){const Q=Array.isArray(le),B=Q?[]:{},V=Q?O:A;for(const b in le)if(Object.prototype.hasOwnProperty.call(le,b)){const C=`${V}${m}${b}`;W&&!E?B[b]=this.translate(C,{...u,defaultValue:Qh(se)?se[b]:void 0,joinArrays:!1,ns:p}):B[b]=this.translate(C,{...u,joinArrays:!1,ns:p}),B[b]===C&&(B[b]=le[b])}E=B}}else if(M&&ke(N)&&Array.isArray(E))E=E.join(N),E&&(E=this.extendTranslation(E,l,u,i));else{let Q=!1,B=!1;!this.isValidLookup(E)&&W&&(Q=!0,E=se),this.isValidLookup(E)||(B=!0,E=h);const b=(u.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:E,C=W&&se!==E&&this.options.updateMissing;if(B||Q||C){if(this.logger.log(C?"updateKey":"missingKey",w,g,h,C?se:E),m){const _=this.resolve(h,{...u,keySeparator:!1});_&&_.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 L=[];const oe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,u.lng||this.language);if(this.options.saveMissingTo==="fallback"&&oe&&oe[0])for(let _=0;_<oe.length;_++)L.push(oe[_]);else this.options.saveMissingTo==="all"?L=this.languageUtils.toResolveHierarchy(u.lng||this.language):L.push(u.lng||this.language);const S=(_,Z,H)=>{var de;const I=W&&H!==E?H:b;this.options.missingKeyHandler?this.options.missingKeyHandler(_,g,Z,I,C,u):(de=this.backendConnector)!=null&&de.saveMissing&&this.backendConnector.saveMissing(_,g,Z,I,C,u),this.emit("missingKey",_,g,Z,E)};this.options.saveMissing&&(this.options.saveMissingPlurals&&G?L.forEach(_=>{const Z=this.pluralResolver.getSuffixes(_,u);$&&u[`defaultValue${this.options.pluralSeparator}zero`]&&Z.indexOf(`${this.options.pluralSeparator}zero`)<0&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(H=>{S([_],h+H,u[`defaultValue${H}`]||se)})}):S(L,h,se))}E=this.extendTranslation(E,l,u,T,i),B&&E===h&&this.options.appendNamespaceToMissingKey&&(E=`${g}${x}${h}`),(B||Q)&&this.options.parseMissingKeyHandler&&(E=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${x}${h}`:h,Q?E:void 0,u))}return d?(T.res=E,T.usedParams=this.getUsedParamsDetails(u),T):E}extendTranslation(l,o,i,u,d){var p,g;if((p=this.i18nFormat)!=null&&p.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 x=ke(l)&&(((g=i==null?void 0:i.interpolation)==null?void 0:g.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let w;if(x){const T=l.match(this.interpolator.nestingRegexp);w=T&&T.length}let k=i.replace&&!ke(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(k={...this.options.interpolation.defaultVariables,...k}),l=this.interpolator.interpolate(l,k,i.lng||this.language||u.usedLng,i),x){const T=l.match(this.interpolator.nestingRegexp),E=T&&T.length;w<E&&(i.nest=!1)}!i.lng&&u&&u.res&&(i.lng=this.language||u.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...T)=>(d==null?void 0:d[0])===T[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${T[0]} in key: ${o[0]}`),null):this.translate(...T,o),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,h=ke(m)?[m]:m;return l!=null&&(h!=null&&h.length)&&i.applyPostProcessor!==!1&&(l=ug.handle(h,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,h;return ke(l)&&(l=[l]),l.forEach(p=>{if(this.isValidLookup(i))return;const g=this.extractFromKey(p,o),x=g.key;u=x;let w=g.namespaces;this.options.fallbackNS&&(w=w.concat(this.options.fallbackNS));const k=o.count!==void 0&&!ke(o.count),T=k&&!o.ordinal&&o.count===0,E=o.context!==void 0&&(ke(o.context)||typeof o.context=="number")&&o.context!=="",A=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);w.forEach(O=>{var R,N;this.isValidLookup(i)||(h=O,!Xh[`${A[0]}-${O}`]&&((R=this.utils)!=null&&R.hasLoadedNamespace)&&!((N=this.utils)!=null&&N.hasLoadedNamespace(h))&&(Xh[`${A[0]}-${O}`]=!0,this.logger.warn(`key "${u}" for languages "${A.join(", ")}" won't get resolved as namespace "${h}" 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!!!")),A.forEach(M=>{var re;if(this.isValidLookup(i))return;m=M;const G=[x];if((re=this.i18nFormat)!=null&&re.addLookupKeys)this.i18nFormat.addLookupKeys(G,x,M,O,o);else{let te;k&&(te=this.pluralResolver.getSuffix(M,o.count,o));const $=`${this.options.pluralSeparator}zero`,se=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(k&&(o.ordinal&&te.indexOf(se)===0&&G.push(x+te.replace(se,this.options.pluralSeparator)),G.push(x+te),T&&G.push(x+$)),E){const le=`${x}${this.options.contextSeparator||"_"}${o.context}`;G.push(le),k&&(o.ordinal&&te.indexOf(se)===0&&G.push(le+te.replace(se,this.options.pluralSeparator)),G.push(le+te),T&&G.push(le+$))}}let W;for(;W=G.pop();)this.isValidLookup(i)||(d=W,i=this.getResource(M,O,W,o))}))})}),{res:i,usedKey:u,exactUsedKey:d,usedLng:m,usedNS:h}}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&&!ke(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 Jh{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Mr.create("languageUtils")}getScriptPartFromCode(l){if(l=Wn(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=Wn(l),!l||l.indexOf("-")<0)return l;const o=l.split("-");return this.formatLanguageCode(o[0])}formatLanguageCode(l){if(ke(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)),ke(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 ke(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))):ke(l)&&d(this.formatLanguageCode(l)),i.forEach(m=>{u.indexOf(m)<0&&d(this.formatLanguageCode(m))}),u}}const Zh={zero:0,one:1,two:2,few:3,many:4,other:5},Wh={select:a=>a===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class R2{constructor(l,o={}){this.languageUtils=l,this.options=o,this.logger=Mr.create("pluralResolver"),this.pluralRulesCache={}}addRule(l,o){this.rules[l]=o}clearCache(){this.pluralRulesCache={}}getRule(l,o={}){const i=Wn(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!"),Wh;if(!l.match(/-|_/))return Wh;const p=this.languageUtils.getLanguagePartFromCode(l);m=this.getRule(p,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)=>Zh[u]-Zh[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 ep=(a,l,o,i=".",u=!0)=>{let d=j2(a,l,o);return!d&&u&&ke(o)&&(d=hu(a,o,i),d===void 0&&(d=hu(l,o,i))),d},su=a=>a.replace(/\$/g,"$$$$");class M2{constructor(l={}){var o;this.logger=Mr.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:h,suffixEscaped:p,formatSeparator:g,unescapeSuffix:x,unescapePrefix:w,nestingPrefix:k,nestingPrefixEscaped:T,nestingSuffix:E,nestingSuffixEscaped:A,nestingOptionsSeparator:O,maxReplaces:R,alwaysFormat:N}=l.interpolation;this.escape=o!==void 0?o:N2,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=u!==void 0?u:!1,this.prefix=d?Ha(d):m||"{{",this.suffix=h?Ha(h):p||"}}",this.formatSeparator=g||",",this.unescapePrefix=x?"":w||"-",this.unescapeSuffix=this.unescapePrefix?"":x||"",this.nestingPrefix=k?Ha(k):T||Ha("$t("),this.nestingSuffix=E?Ha(E):A||Ha(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=R||1e3,this.alwaysFormat=N!==void 0?N:!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 T;let d,m,h;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=E=>{if(E.indexOf(this.formatSeparator)<0){const N=ep(o,p,E,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,i,{...u,...o,interpolationkey:E}):N}const A=E.split(this.formatSeparator),O=A.shift().trim(),R=A.join(this.formatSeparator).trim();return this.format(ep(o,p,O,this.options.keySeparator,this.options.ignoreJSONStructure),R,i,{...u,...o,interpolationkey:O})};this.resetRegExp();const x=(u==null?void 0:u.missingInterpolationHandler)||this.options.missingInterpolationHandler,w=((T=u==null?void 0:u.interpolation)==null?void 0:T.skipOnVariables)!==void 0?u.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:E=>su(E)},{regex:this.regexp,safeValue:E=>this.escapeValue?su(this.escape(E)):su(E)}].forEach(E=>{for(h=0;d=E.regex.exec(l);){const A=d[1].trim();if(m=g(A),m===void 0)if(typeof x=="function"){const R=x(l,d,u);m=ke(R)?R:""}else if(u&&Object.prototype.hasOwnProperty.call(u,A))m="";else if(w){m=d[0];continue}else this.logger.warn(`missed to pass in variable ${A} for interpolating ${l}`),m="";else!ke(m)&&!this.useRawValueToEscape&&(m=Fh(m));const O=E.safeValue(m);if(l=l.replace(d[0],O),w?(E.regex.lastIndex+=m.length,E.regex.lastIndex-=d[0].length):E.regex.lastIndex=0,h++,h>=this.maxReplaces)break}}),l}nest(l,o,i={}){let u,d,m;const h=(p,g)=>{const x=this.nestingOptionsSeparator;if(p.indexOf(x)<0)return p;const w=p.split(new RegExp(`${x}[ ]*{`));let k=`{${w[1]}`;p=w[0],k=this.interpolate(k,m);const T=k.match(/'/g),E=k.match(/"/g);(((T==null?void 0:T.length)??0)%2===0&&!E||E.length%2!==0)&&(k=k.replace(/'/g,'"'));try{m=JSON.parse(k),g&&(m={...g,...m})}catch(A){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,A),`${p}${x}${k}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,p};for(;u=this.nestingRegexp.exec(l);){let p=[];m={...i},m=m.replace&&!ke(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;const g=/{.*}/.test(u[1])?u[1].lastIndexOf("}")+1:u[1].indexOf(this.formatSeparator);if(g!==-1&&(p=u[1].slice(g).split(this.formatSeparator).map(x=>x.trim()).filter(Boolean),u[1]=u[1].slice(0,g)),d=o(h.call(this,u[1].trim(),m),m),d&&u[0]===l&&!ke(d))return d;ke(d)||(d=Fh(d)),d||(this.logger.warn(`missed to resolve ${u[1]} for nesting ${l}`),d=""),p.length&&(d=p.reduce((x,w)=>this.format(x,w,i.lng,{...i,interpolationkey:u[1].trim()}),d.trim())),l=l.replace(u[0],d),this.regexp.lastIndex=0}return l}}const O2=a=>{let l=a.toLowerCase().trim();const o={};if(a.indexOf("(")>-1){const i=a.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[h,...p]=m.split(":"),g=p.join(":").trim().replace(/^'+|'+$/g,""),x=h.trim();o[x]||(o[x]=g),g==="false"&&(o[x]=!1),g==="true"&&(o[x]=!0),isNaN(g)||(o[x]=parseInt(g,10))}})}return{formatName:l,formatOptions:o}},tp=a=>{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 h=l[m];return h||(h=a(Wn(i),u),l[m]=h),h(o)}},D2=a=>(l,o,i)=>a(Wn(o),i)(l);class U2{constructor(l={}){this.logger=Mr.create("formatter"),this.options=l,this.init(l)}init(l,o={interpolation:{}}){this.formatSeparator=o.interpolation.formatSeparator||",";const i=o.cacheInBuiltFormats?tp:D2;this.formats={number:i((u,d)=>{const m=new Intl.NumberFormat(u,{...d});return h=>m.format(h)}),currency:i((u,d)=>{const m=new Intl.NumberFormat(u,{...d,style:"currency"});return h=>m.format(h)}),datetime:i((u,d)=>{const m=new Intl.DateTimeFormat(u,{...d});return h=>m.format(h)}),relativetime:i((u,d)=>{const m=new Intl.RelativeTimeFormat(u,{...d});return h=>m.format(h,d.range||"day")}),list:i((u,d)=>{const m=new Intl.ListFormat(u,{...d});return h=>m.format(h)})}}add(l,o){this.formats[l.toLowerCase().trim()]=o}addCached(l,o){this.formats[l.toLowerCase().trim()]=tp(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(h=>h.indexOf(")")>-1)){const h=d.findIndex(p=>p.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,h)].join(this.formatSeparator)}return d.reduce((h,p)=>{var w;const{formatName:g,formatOptions:x}=O2(p);if(this.formats[g]){let k=h;try{const T=((w=u==null?void 0:u.formatParams)==null?void 0:w[u.interpolationkey])||{},E=T.locale||T.lng||u.locale||u.lng||i;k=this.formats[g](h,E,{...x,...u,...T})}catch(T){this.logger.warn(T)}return k}else this.logger.warn(`there was no format function for ${g}`);return h},l)}}const L2=(a,l)=>{a.pending[l]!==void 0&&(delete a.pending[l],a.pendingCount--)};class z2 extends Ho{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=Mr.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={},h={},p={};return l.forEach(g=>{let x=!0;o.forEach(w=>{const k=`${g}|${w}`;!i.reload&&this.store.hasResourceBundle(g,w)?this.state[k]=2:this.state[k]<0||(this.state[k]===1?m[k]===void 0&&(m[k]=!0):(this.state[k]=1,x=!1,m[k]===void 0&&(m[k]=!0),d[k]===void 0&&(d[k]=!0),p[w]===void 0&&(p[w]=!0)))}),x||(h[g]=!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(h),toLoadNamespaces:Object.keys(p)}}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 h={};this.queue.forEach(p=>{b2(p.loaded,[d],m),L2(p,l),o&&p.errors.push(o),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(g=>{h[g]||(h[g]={});const x=p.loaded[g];x.length&&x.forEach(w=>{h[g][w]===void 0&&(h[g][w]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(p=>!p.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 h=(g,x)=>{if(this.readingCalls--,this.waitingReads.length>0){const w=this.waitingReads.shift();this.read(w.lng,w.ns,w.fcName,w.tried,w.wait,w.callback)}if(g&&x&&u<this.maxRetries){setTimeout(()=>{this.read.call(this,l,o,i,u+1,d*2,m)},d);return}m(g,x)},p=this.backend[i].bind(this.backend);if(p.length===2){try{const g=p(l,o);g&&typeof g.then=="function"?g.then(x=>h(null,x)).catch(h):h(null,g)}catch(g){h(g)}return}return p(l,o,h)}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();ke(l)&&(l=this.languageUtils.toResolveHierarchy(l)),ke(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,h)=>{m&&this.logger.warn(`${o}loading namespace ${d} for language ${u} failed`,m),!m&&h&&this.logger.log(`${o}loaded namespace ${d} for language ${u}`,h),this.loaded(l,m,h)})}saveMissing(l,o,i,u,d,m={},h=()=>{}){var p,g,x,w,k;if((g=(p=this.services)==null?void 0:p.utils)!=null&&g.hasLoadedNamespace&&!((w=(x=this.services)==null?void 0:x.utils)!=null&&w.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((k=this.backend)!=null&&k.create){const T={...m,isUpdate:d},E=this.backend.create.bind(this.backend);if(E.length<6)try{let A;E.length===5?A=E(l,o,i,u,T):A=E(l,o,i,u),A&&typeof A.then=="function"?A.then(O=>h(null,O)).catch(h):h(null,A)}catch(A){h(A)}else E(l,o,i,u,h,T)}!l||!l[0]||this.store.addResource(l[0],o,i,u)}}}const rp=()=>({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:a=>{let l={};if(typeof a[1]=="object"&&(l=a[1]),ke(a[1])&&(l.defaultValue=a[1]),ke(a[2])&&(l.tDescription=a[2]),typeof a[2]=="object"||typeof a[3]=="object"){const o=a[3]||a[2];Object.keys(o).forEach(i=>{l[i]=o[i]})}return l},interpolation:{escapeValue:!0,format:a=>a,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),sp=a=>{var l,o;return ke(a.ns)&&(a.ns=[a.ns]),ke(a.fallbackLng)&&(a.fallbackLng=[a.fallbackLng]),ke(a.fallbackNS)&&(a.fallbackNS=[a.fallbackNS]),((o=(l=a.supportedLngs)==null?void 0:l.indexOf)==null?void 0:o.call(l,"cimode"))<0&&(a.supportedLngs=a.supportedLngs.concat(["cimode"])),typeof a.initImmediate=="boolean"&&(a.initAsync=a.initImmediate),a},No=()=>{},P2=a=>{Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach(o=>{typeof a[o]=="function"&&(a[o]=a[o].bind(a))})};class el extends Ho{constructor(l={},o){if(super(),this.options=sp(l),this.services={},this.logger=Mr,this.modules={external:[]},P2(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&&(ke(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=rp();this.options={...i,...this.options,...sp(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=g=>g?typeof g=="function"?new g:g:null;if(!this.options.isClone){this.modules.logger?Mr.init(u(this.modules.logger),this.options):Mr.init(null,this.options);let g;this.modules.formatter?g=this.modules.formatter:g=U2;const x=new Jh(this.options);this.store=new Yh(this.options.resources,this.options);const w=this.services;w.logger=Mr,w.resourceStore=this.store,w.languageUtils=x,w.pluralResolver=new R2(x,{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"),g&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(w.formatter=u(g),w.formatter.init&&w.formatter.init(w,this.options),this.options.interpolation.format=w.formatter.format.bind(w.formatter)),w.interpolator=new M2(this.options),w.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},w.backendConnector=new z2(u(this.modules.backend),w.resourceStore,w,this.options),w.backendConnector.on("*",(T,...E)=>{this.emit(T,...E)}),this.modules.languageDetector&&(w.languageDetector=u(this.modules.languageDetector),w.languageDetector.init&&w.languageDetector.init(w,this.options.detection,this.options)),this.modules.i18nFormat&&(w.i18nFormat=u(this.modules.i18nFormat),w.i18nFormat.init&&w.i18nFormat.init(this)),this.translator=new Do(this.services,this.options),this.translator.on("*",(T,...E)=>{this.emit(T,...E)}),this.modules.external.forEach(T=>{T.init&&T.init(this)})}if(this.format=this.options.interpolation.format,o||(o=No),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[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(g=>{this[g]=(...x)=>this.store[g](...x)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(g=>{this[g]=(...x)=>(this.store[g](...x),this)});const h=Yn(),p=()=>{const g=(x,w)=>{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),h.resolve(w),o(x,w)};if(this.languages&&!this.isInitialized)return g(null,this.t.bind(this));this.changeLanguage(this.options.lng,g)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),h}loadResources(l,o=No){var d,m;let i=o;const u=ke(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 h=[],p=g=>{if(!g||g==="cimode")return;this.services.languageUtils.toResolveHierarchy(g).forEach(w=>{w!=="cimode"&&h.indexOf(w)<0&&h.push(w)})};u?p(u):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(x=>p(x)),(m=(d=this.options.preload)==null?void 0:d.forEach)==null||m.call(d,g=>p(g)),this.services.backendConnector.load(h,this.options.ns,g=>{!g&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(g)})}else i(null)}reloadResources(l,o,i){const u=Yn();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=No),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"&&ug.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=Yn();this.emit("languageChanging",l);const u=h=>{this.language=h,this.languages=this.services.languageUtils.toResolveHierarchy(h),this.resolvedLanguage=void 0,this.setResolvedLanguage(h)},d=(h,p)=>{p?this.isLanguageChangingTo===l&&(u(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,i.resolve((...g)=>this.t(...g)),o&&o(h,(...g)=>this.t(...g))},m=h=>{var x,w;!l&&!h&&this.services.languageDetector&&(h=[]);const p=ke(h)?h:h&&h[0],g=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(ke(h)?[h]:h);g&&(this.language||u(g),this.translator.language||this.translator.changeLanguage(g),(w=(x=this.services.languageDetector)==null?void 0:x.cacheUserLanguage)==null||w.call(x,g)),this.loadResources(g,k=>{d(k,g)})};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,...h)=>{let p;typeof m!="object"?p=this.options.overloadTranslationOptionHandler([d,m].concat(h)):p={...m},p.lng=p.lng||u.lng,p.lngs=p.lngs||u.lngs,p.ns=p.ns||u.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||i||u.keyPrefix);const g=this.options.keySeparator||".";let x;return p.keyPrefix&&Array.isArray(d)?x=d.map(w=>(typeof w=="function"&&(w=pu(w,{...this.options,...m})),`${p.keyPrefix}${g}${w}`)):(typeof d=="function"&&(d=pu(d,{...this.options,...m})),x=p.keyPrefix?`${p.keyPrefix}${g}${d}`:d),this.t(x,p)};return ke(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=(h,p)=>{const g=this.services.backendConnector.state[`${h}|${p}`];return g===-1||g===0||g===2};if(o.precheck){const h=o.precheck(this,m);if(h!==void 0)return h}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=Yn();return this.options.ns?(ke(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=Yn();ke(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 h=m.getTextInfo();if(h&&h.direction)return h.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 Jh(rp());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 el(l,o)}cloneInstance(l={},o=No){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const u={...this.options,...l,isClone:!0},d=new el(u);if((l.debug!==void 0||l.prefix!==void 0)&&(d.logger=d.logger.clone(l)),["store","services","language"].forEach(h=>{d[h]=this[h]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},i){const h=Object.keys(this.store.data).reduce((p,g)=>(p[g]={...this.store.data[g]},p[g]=Object.keys(p[g]).reduce((x,w)=>(x[w]={...p[g][w]},x),p[g]),p),{});d.store=new Yh(h,u),d.services.resourceStore=d.store}return d.translator=new Do(d.services,u),d.translator.on("*",(h,...p)=>{d.emit(h,...p)}),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 Mt=el.createInstance();Mt.createInstance=el.createInstance;Mt.createInstance;Mt.dir;Mt.init;Mt.loadResources;Mt.reloadResources;Mt.use;Mt.changeLanguage;Mt.getFixedT;Mt.t;Mt.exists;Mt.setDefaultNamespace;Mt.hasLoadedNamespace;Mt.loadNamespaces;Mt.loadLanguages;const{slice:_2,forEach:H2}=[];function B2(a){return H2.call(_2.call(arguments,1),l=>{if(l)for(const o in l)a[o]===void 0&&(a[o]=l[o])}),a}function q2(a){return typeof a!="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(a))}const ap=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,V2=function(a,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},u=encodeURIComponent(l);let d=`${a}=${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},np={create(a,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=V2(a,l,u)},read(a){const l=`${a}=`,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(a,l){this.create(a,"",-1,l)}};var G2={name:"cookie",lookup(a){let{lookupCookie:l}=a;if(l&&typeof document<"u")return np.read(l)||void 0},cacheUserLanguage(a,l){let{lookupCookie:o,cookieMinutes:i,cookieDomain:u,cookieOptions:d}=l;o&&typeof document<"u"&&np.create(o,a,i,u,d)}},F2={name:"querystring",lookup(a){var i;let{lookupQuerystring:l}=a,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 h=0;h<m.length;h++){const p=m[h].indexOf("=");p>0&&m[h].substring(0,p)===l&&(o=m[h].substring(p+1))}}return o}},$2={name:"hash",lookup(a){var u;let{lookupHash:l,lookupFromHashIndex:o}=a,i;if(typeof window<"u"){const{hash:d}=window.location;if(d&&d.length>2){const m=d.substring(1);if(l){const h=m.split("&");for(let p=0;p<h.length;p++){const g=h[p].indexOf("=");g>0&&h[p].substring(0,g)===l&&(i=h[p].substring(g+1))}}if(i)return i;if(!i&&o>-1){const h=d.match(/\/([a-zA-Z-]*)/g);return Array.isArray(h)?(u=h[typeof o=="number"?o:0])==null?void 0:u.replace("/",""):void 0}}}return i}};let Ba=null;const lp=()=>{if(Ba!==null)return Ba;try{if(Ba=typeof window<"u"&&window.localStorage!==null,!Ba)return!1;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Ba=!1}return Ba};var K2={name:"localStorage",lookup(a){let{lookupLocalStorage:l}=a;if(l&&lp())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(a,l){let{lookupLocalStorage:o}=l;o&&lp()&&window.localStorage.setItem(o,a)}};let qa=null;const op=()=>{if(qa!==null)return qa;try{if(qa=typeof window<"u"&&window.sessionStorage!==null,!qa)return!1;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{qa=!1}return qa};var I2={name:"sessionStorage",lookup(a){let{lookupSessionStorage:l}=a;if(l&&op())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(a,l){let{lookupSessionStorage:o}=l;o&&op()&&window.sessionStorage.setItem(o,a)}},Y2={name:"navigator",lookup(a){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}},X2={name:"htmlTag",lookup(a){let{htmlTag:l}=a,o;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(o=i.getAttribute("lang")),o}},Q2={name:"path",lookup(a){var u;let{lookupFromPathIndex:l}=a;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}},J2={name:"subdomain",lookup(a){var u,d;let{lookupFromSubdomainIndex:l}=a;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 fg=!1;try{document.cookie,fg=!0}catch{}const mg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];fg||mg.splice(1,1);const Z2=()=>({order:mg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a});class hg{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=B2(o,this.options||{},Z2()),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(G2),this.addDetector(F2),this.addDetector(K2),this.addDetector(I2),this.addDetector(Y2),this.addDetector(X2),this.addDetector(Q2),this.addDetector(J2),this.addDetector($2)}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&&!q2(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)}))}}hg.type="languageDetector";const W2={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"},ej={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..."},tj={viewProfile:"View profile",userCenter:"User Center"},rj={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"},sj={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},aj={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},nj={title:"Theme",light:"Light",dark:"Dark",system:"System"},lj={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"},oj={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)"}},ij={online:"Online",offline:"Offline",connecting:"Connecting"},cj={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"},uj={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",required:"Required",secret:"Secret",default:"Default",value:"Value",type:"Type",repeated:"Repeated",valueHint:"Value Hint",choices:"Choices"},dj={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",cloud:"Cloud Market",logs:"Logs"},fj={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"}},mj={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"},hj={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"},pj={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"},gj={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}}"},xj={title:"Registry",official:"Official",latest:"Latest",description:"Description",website:"Website",repository:"Repository",packages:"Packages",package:"package",remotes:"Remotes",remote:"remote",published:"Published",updated:"Updated",install:"Install",installing:"Installing...",installed:"Installed",installServer:"Install {{name}}",installSuccess:"Server {{name}} installed successfully",installError:"Failed to install server: {{error}}",noDescription:"No description available",viewDetails:"View Details",backToList:"Back to Registry",search:"Search",searchPlaceholder:"Search registry servers by name",clearFilters:"Clear",noServers:"No registry servers found",fetchError:"Error fetching registry servers",serverNotFound:"Registry server not found",showing:"Showing {{from}}-{{to}} of {{total}} registry servers",perPage:"Per page",environmentVariables:"Environment Variables",packageArguments:"Package Arguments",runtimeArguments:"Runtime Arguments",headers:"Headers"},yj={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}}"},vj={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}}"},bj={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"},jj={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"},wj={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."},Nj={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"}},Sj={app:W2,about:ej,profile:tj,sponsor:rj,wechat:sj,discord:aj,theme:nj,auth:lj,server:oj,status:ij,errors:cj,common:uj,nav:dj,pages:fj,logs:mj,groups:hj,market:pj,cloud:gj,registry:xj,tool:yj,prompt:vj,settings:bj,dxt:jj,users:wj,api:Nj},Cj={title:"MCPHub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCPHub"},Ej={title:"关于",versionInfo:"MCPHub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},kj={viewProfile:"查看个人中心",userCenter:"个人中心"},Aj={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCPHub 的开发!",supportButton:"在 Ko-fi 上支持"},Tj={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},Rj={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},Mj={title:"主题",light:"浅色",dark:"深色",system:"系统"},Oj={login:"登录",loginTitle:"登录 MCPHub",slogan:"统一的 MCP 服务器管理平台",subtitle:"模型上下文协议服务器的集中管理平台,通过灵活的路由策略组织、监控和扩展多个 MCP 服务器。",username:"用户名",password:"密码",loggingIn:"登录中...",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败"},Dj={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)"}},Uj={online:"在线",offline:"离线",connecting:"连接中"},Lj={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},zj={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",required:"必填",secret:"敏感",default:"默认值",value:"值",type:"类型",repeated:"可重复",valueHint:"值提示",choices:"可选值"},Pj={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",cloud:"云端市场",logs:"日志"},_j={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:"系统日志"}},Hj={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},Bj={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:"配置工具"},qj={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:"确认并安装"},Vj={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}}"},Gj={title:"注册中心",official:"官方",latest:"最新版本",description:"描述",website:"网站",repository:"代码仓库",packages:"安装包",package:"安装包",remotes:"远程服务",remote:"远程服务",published:"发布时间",updated:"更新时间",install:"安装",installing:"安装中...",installed:"已安装",installServer:"安装 {{name}}",installSuccess:"服务器 {{name}} 安装成功",installError:"安装服务器失败:{{error}}",noDescription:"无描述信息",viewDetails:"查看详情",backToList:"返回注册中心",search:"搜索",searchPlaceholder:"按名称搜索注册中心服务器",clearFilters:"清除",noServers:"未找到注册中心服务器",fetchError:"获取注册中心服务器失败",serverNotFound:"未找到注册中心服务器",showing:"显示 {{from}}-{{to}}/{{total}} 个注册中心服务器",perPage:"每页显示",environmentVariables:"环境变量",packageArguments:"安装包参数",runtimeArguments:"运行时参数",headers:"请求头"},Fj={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}}"},$j={run:"获取",running:"获取中...",result:"提示词结果",error:"提示词错误",execution:"提示词执行",successful:"成功",failed:"失败",errorDetails:"错误详情:",noContent:"提示词执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",description:"描述",messages:"消息",noDescription:"无描述信息",runPromptWithName:"获取提示词: {{name}}"},Kj={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:"获取配置失败"},Ij={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:"覆盖"},Yj={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}}' 吗?此操作无法撤消。"},Xj={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:"服务器工具更新成功"}},Qj={app:Cj,about:Ej,profile:kj,sponsor:Aj,wechat:Tj,discord:Rj,theme:Mj,auth:Oj,server:Dj,status:Uj,errors:Lj,common:zj,nav:Pj,pages:_j,logs:Hj,groups:Bj,market:qj,cloud:Vj,registry:Gj,tool:Fj,prompt:$j,settings:Kj,dxt:Ij,users:Yj,api:Xj},Jj={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"},Zj={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..."},Wj={viewProfile:"Voir le profil",userCenter:"Centre utilisateur"},ew={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"},tw={label:"WeChat",title:"Se connecter via WeChat",qrCodeAlt:"QR Code WeChat",scanMessage:"Scannez ce QR code pour nous contacter sur WeChat"},rw={label:"Discord",title:"Rejoignez notre serveur Discord",community:"Rejoignez notre communauté grandissante sur Discord pour du support, des discussions et des mises à jour !"},sw={title:"Thème",light:"Clair",dark:"Sombre",system:"Système"},aw={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"},nw={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)"}},lw={online:"En ligne",offline:"Hors ligne",connecting:"Connexion en cours"},ow={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"},iw={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",required:"Requis",secret:"Secret",default:"Défaut",value:"Valeur",type:"Type",repeated:"Répété",valueHint:"Indice de valeur",choices:"Choix"},cw={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"},uw={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"}},dw={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"},fw={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"},mw={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"},hw={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}}"},pw={title:"Registre",official:"Officiel",latest:"Dernière version",description:"Description",website:"Site web",repository:"Dépôt",packages:"Paquets",package:"paquet",remotes:"Services distants",remote:"service distant",published:"Publié",updated:"Mis à jour",install:"Installer",installing:"Installation...",installed:"Installé",installServer:"Installer {{name}}",installSuccess:"Serveur {{name}} installé avec succès",installError:"Échec de l'installation du serveur : {{error}}",noDescription:"Aucune description disponible",viewDetails:"Voir les détails",backToList:"Retour au registre",search:"Rechercher",searchPlaceholder:"Rechercher des serveurs par nom",clearFilters:"Effacer",noServers:"Aucun serveur trouvé dans le registre",fetchError:"Erreur lors de la récupération des serveurs du registre",serverNotFound:"Serveur du registre non trouvé",showing:"Affichage de {{from}}-{{to}} sur {{total}} serveurs du registre",perPage:"Par page",environmentVariables:"Variables d'environnement",packageArguments:"Arguments du paquet",runtimeArguments:"Arguments d'exécution",headers:"En-têtes"},gw={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}}"},xw={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}}"},yw={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"},vw={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"},bw={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."},jw={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"}},ww={app:Jj,about:Zj,profile:Wj,sponsor:ew,wechat:tw,discord:rw,theme:sw,auth:aw,server:nw,status:lw,errors:ow,common:iw,nav:cw,pages:uw,logs:dw,groups:fw,market:mw,cloud:hw,registry:pw,tool:gw,prompt:xw,settings:yw,dxt:vw,users:bw,api:jw};Mt.use(hg).use(Av).init({resources:{en:{translation:Sj},zh:{translation:Qj},fr:{translation:ww}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const Nw=()=>{cv()};Nw();async function Sw(){try{console.log("Loading runtime configuration...");const a=await lv();console.log("Runtime configuration loaded:",a),window.__MCPHUB_CONFIG__=a,Eh.createRoot(document.getElementById("root")).render(s.jsx(Va.StrictMode,{children:s.jsx(Gh,{})}))}catch(a){console.error("Failed to initialize app:",a),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},Eh.createRoot(document.getElementById("root")).render(s.jsx(Va.StrictMode,{children:s.jsx(Gh,{})}))}}Sw();
|
|
217
|
+
//# sourceMappingURL=index-BLUhSkL4.js.map
|