@samanhappy/mcphub 0.9.15 → 0.10.0
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/README.md +67 -0
- package/README.zh.md +65 -0
- package/dist/config/index.js +17 -4
- package/dist/config/index.js.map +1 -1
- package/dist/controllers/authController.js +16 -0
- package/dist/controllers/authController.js.map +1 -1
- package/dist/controllers/oauthCallbackController.js +276 -0
- package/dist/controllers/oauthCallbackController.js.map +1 -0
- package/dist/controllers/serverController.js +1 -1
- package/dist/controllers/serverController.js.map +1 -1
- package/dist/controllers/userController.js +23 -1
- package/dist/controllers/userController.js.map +1 -1
- package/dist/routes/index.js +3 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/server.js +10 -0
- package/dist/server.js.map +1 -1
- package/dist/services/mcpOAuthProvider.js +472 -0
- package/dist/services/mcpOAuthProvider.js.map +1 -0
- package/dist/services/mcpService.js +328 -199
- package/dist/services/mcpService.js.map +1 -1
- package/dist/services/oauthClientRegistration.js +444 -0
- package/dist/services/oauthClientRegistration.js.map +1 -0
- package/dist/services/oauthService.js +216 -0
- package/dist/services/oauthService.js.map +1 -0
- package/dist/services/oauthSettingsStore.js +106 -0
- package/dist/services/oauthSettingsStore.js.map +1 -0
- package/dist/utils/passwordValidation.js +38 -0
- package/dist/utils/passwordValidation.js.map +1 -0
- package/dist/utils/path.js.map +1 -1
- package/frontend/dist/assets/index-BP5IZhlg.js +251 -0
- package/frontend/dist/assets/index-BP5IZhlg.js.map +1 -0
- package/frontend/dist/assets/index-C_58ZhSt.css +1 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +3 -2
- package/frontend/dist/assets/index-BLUhSkL4.js +0 -217
- package/frontend/dist/assets/index-BLUhSkL4.js.map +0 -1
- package/frontend/dist/assets/index-D8hgHrZ3.css +0 -1
|
@@ -0,0 +1,251 @@
|
|
|
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 cp(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Kc={exports:{}},Fn={};/**
|
|
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 Sx(){if(gh)return Fn;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 Fn.Fragment=l,Fn.jsx=o,Fn.jsxs=o,Fn}var xh;function Cx(){return xh||(xh=1,Kc.exports=Sx()),Kc.exports}var s=Cx(),Yc={exports:{}},Me={};/**
|
|
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 Ex(){if(yh)return Me;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"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.iterator;function E(S){return S===null||typeof S!="object"?null:(S=b&&S[b]||S["@@iterator"],typeof S=="function"?S:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,C={};function M(S,_,Z){this.props=S,this.context=_,this.refs=C,this.updater=Z||O}M.prototype.isReactComponent={},M.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")},M.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function R(){}R.prototype=M.prototype;function N(S,_,Z){this.props=S,this.context=_,this.refs=C,this.updater=Z||O}var T=N.prototype=new R;T.constructor=N,A(T,M.prototype),T.isPureReactComponent=!0;var V=Array.isArray,W={H:null,A:null,T:null,S:null,V:null},se=Object.prototype.hasOwnProperty;function re(S,_,Z,H,$,fe){return Z=fe.ref,{$$typeof:a,type:S,key:_,ref:Z!==void 0?Z:null,props:fe}}function F(S,_){return re(S.type,_,void 0,void 0,void 0,S.props)}function te(S){return typeof S=="object"&&S!==null&&S.$$typeof===a}function ie(S){var _={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Z){return _[Z]})}var z=/\/+/g;function U(S,_){return typeof S=="object"&&S!==null&&S.key!=null?ie(""+S.key):_.toString(36)}function J(){}function K(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(J,J):(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 B(S,_,Z,H,$){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var ee=!1;if(S===null)ee=!0;else switch(fe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(S.$$typeof){case a:case l:ee=!0;break;case v:return ee=S._init,B(ee(S._payload),_,Z,H,$)}}if(ee)return $=$(S),ee=H===""?"."+U(S,0):H,V($)?(Z="",ee!=null&&(Z=ee.replace(z,"$&/")+"/"),B($,_,Z,"",function(we){return we})):$!=null&&(te($)&&($=F($,Z+($.key==null||S&&S.key===$.key?"":(""+$.key).replace(z,"$&/")+"/")+ee)),_.push($)),1;ee=0;var Y=H===""?".":H+":";if(V(S))for(var de=0;de<S.length;de++)H=S[de],fe=Y+U(H,de),ee+=B(H,_,Z,fe,$);else if(de=E(S),typeof de=="function")for(S=de.call(S),de=0;!(H=S.next()).done;)H=H.value,fe=Y+U(H,de++),ee+=B(H,_,Z,fe,$);else if(fe==="object"){if(typeof S.then=="function")return B(K(S),_,Z,H,$);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 j(S,_,Z){if(S==null)return S;var H=[],$=0;return B(S,H,"","",function(fe){return _.call(Z,fe,$++)}),H}function k(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 le(){}return Me.Children={map:j,forEach:function(S,_,Z){j(S,function(){_.apply(this,arguments)},Z)},count:function(S){var _=0;return j(S,function(){_++}),_},toArray:function(S){return j(S,function(_){return _})||[]},only:function(S){if(!te(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},Me.Component=M,Me.Fragment=o,Me.Profiler=u,Me.PureComponent=N,Me.StrictMode=i,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,Me.__COMPILER_RUNTIME={__proto__:null,c:function(S){return W.H.useMemoCache(S)}},Me.cache=function(S){return function(){return S.apply(null,arguments)}},Me.cloneElement=function(S,_,Z){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var H=A({},S.props),$=S.key,fe=void 0;if(_!=null)for(ee in _.ref!==void 0&&(fe=void 0),_.key!==void 0&&($=""+_.key),_)!se.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),de=0;de<ee;de++)Y[de]=arguments[de+2];H.children=Y}return re(S.type,$,void 0,void 0,fe,H)},Me.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},Me.createElement=function(S,_,Z){var H,$={},fe=null;if(_!=null)for(H in _.key!==void 0&&(fe=""+_.key),_)se.call(_,H)&&H!=="key"&&H!=="__self"&&H!=="__source"&&($[H]=_[H]);var ee=arguments.length-2;if(ee===1)$.children=Z;else if(1<ee){for(var Y=Array(ee),de=0;de<ee;de++)Y[de]=arguments[de+2];$.children=Y}if(S&&S.defaultProps)for(H in ee=S.defaultProps,ee)$[H]===void 0&&($[H]=ee[H]);return re(S,fe,void 0,void 0,null,$)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(S){return{$$typeof:h,render:S}},Me.isValidElement=te,Me.lazy=function(S){return{$$typeof:v,_payload:{_status:-1,_result:S},_init:k}},Me.memo=function(S,_){return{$$typeof:p,type:S,compare:_===void 0?null:_}},Me.startTransition=function(S){var _=W.T,Z={};W.T=Z;try{var H=S(),$=W.S;$!==null&&$(Z,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(le,L)}catch(fe){L(fe)}finally{W.T=_}},Me.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},Me.use=function(S){return W.H.use(S)},Me.useActionState=function(S,_,Z){return W.H.useActionState(S,_,Z)},Me.useCallback=function(S,_){return W.H.useCallback(S,_)},Me.useContext=function(S){return W.H.useContext(S)},Me.useDebugValue=function(){},Me.useDeferredValue=function(S,_){return W.H.useDeferredValue(S,_)},Me.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,_)},Me.useId=function(){return W.H.useId()},Me.useImperativeHandle=function(S,_,Z){return W.H.useImperativeHandle(S,_,Z)},Me.useInsertionEffect=function(S,_){return W.H.useInsertionEffect(S,_)},Me.useLayoutEffect=function(S,_){return W.H.useLayoutEffect(S,_)},Me.useMemo=function(S,_){return W.H.useMemo(S,_)},Me.useOptimistic=function(S,_){return W.H.useOptimistic(S,_)},Me.useReducer=function(S,_,Z){return W.H.useReducer(S,_,Z)},Me.useRef=function(S){return W.H.useRef(S)},Me.useState=function(S){return W.H.useState(S)},Me.useSyncExternalStore=function(S,_,Z){return W.H.useSyncExternalStore(S,_,Z)},Me.useTransition=function(){return W.H.useTransition()},Me.version="19.1.1",Me}var vh;function gu(){return vh||(vh=1,Yc.exports=Ex()),Yc.exports}var x=gu();const Fa=cp(x);var Xc={exports:{}},Gn={},Jc={exports:{}},Qc={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var bh;function kx(){return bh||(bh=1,(function(a){function l(j,k){var L=j.length;j.push(k);e:for(;0<L;){var le=L-1>>>1,S=j[le];if(0<u(S,k))j[le]=k,j[L]=S,L=le;else break e}}function o(j){return j.length===0?null:j[0]}function i(j){if(j.length===0)return null;var k=j[0],L=j.pop();if(L!==k){j[0]=L;e:for(var le=0,S=j.length,_=S>>>1;le<_;){var Z=2*(le+1)-1,H=j[Z],$=Z+1,fe=j[$];if(0>u(H,L))$<S&&0>u(fe,H)?(j[le]=fe,j[$]=L,le=$):(j[le]=H,j[Z]=L,le=Z);else if($<S&&0>u(fe,L))j[le]=fe,j[$]=L,le=$;else break e}}return k}function u(j,k){var L=j.sortIndex-k.sortIndex;return L!==0?L:j.id-k.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 g=[],p=[],v=1,b=null,E=3,O=!1,A=!1,C=!1,M=!1,R=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function V(j){for(var k=o(p);k!==null;){if(k.callback===null)i(p);else if(k.startTime<=j)i(p),k.sortIndex=k.expirationTime,l(g,k);else break;k=o(p)}}function W(j){if(C=!1,V(j),!A)if(o(g)!==null)A=!0,se||(se=!0,U());else{var k=o(p);k!==null&&B(W,k.startTime-j)}}var se=!1,re=-1,F=5,te=-1;function ie(){return M?!0:!(a.unstable_now()-te<F)}function z(){if(M=!1,se){var j=a.unstable_now();te=j;var k=!0;try{e:{A=!1,C&&(C=!1,N(re),re=-1),O=!0;var L=E;try{t:{for(V(j),b=o(g);b!==null&&!(b.expirationTime>j&&ie());){var le=b.callback;if(typeof le=="function"){b.callback=null,E=b.priorityLevel;var S=le(b.expirationTime<=j);if(j=a.unstable_now(),typeof S=="function"){b.callback=S,V(j),k=!0;break t}b===o(g)&&i(g),V(j)}else i(g);b=o(g)}if(b!==null)k=!0;else{var _=o(p);_!==null&&B(W,_.startTime-j),k=!1}}break e}finally{b=null,E=L,O=!1}k=void 0}}finally{k?U():se=!1}}}var U;if(typeof T=="function")U=function(){T(z)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,K=J.port2;J.port1.onmessage=z,U=function(){K.postMessage(null)}}else U=function(){R(z,0)};function B(j,k){re=R(function(){j(a.unstable_now())},k)}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(j){j.callback=null},a.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<j?Math.floor(1e3/j):5},a.unstable_getCurrentPriorityLevel=function(){return E},a.unstable_next=function(j){switch(E){case 1:case 2:case 3:var k=3;break;default:k=E}var L=E;E=k;try{return j()}finally{E=L}},a.unstable_requestPaint=function(){M=!0},a.unstable_runWithPriority=function(j,k){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var L=E;E=j;try{return k()}finally{E=L}},a.unstable_scheduleCallback=function(j,k,L){var le=a.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?le+L:le):L=le,j){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,j={id:v++,callback:k,priorityLevel:j,startTime:L,expirationTime:S,sortIndex:-1},L>le?(j.sortIndex=L,l(p,j),o(g)===null&&j===o(p)&&(C?(N(re),re=-1):C=!0,B(W,L-le))):(j.sortIndex=S,l(g,j),A||O||(A=!0,se||(se=!0,U()))),j},a.unstable_shouldYield=ie,a.unstable_wrapCallback=function(j){var k=E;return function(){var L=E;E=k;try{return j.apply(this,arguments)}finally{E=L}}}})(Qc)),Qc}var jh;function Ax(){return jh||(jh=1,Jc.exports=kx()),Jc.exports}var Zc={exports:{}},Ot={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var wh;function Tx(){if(wh)return Ot;wh=1;var a=gu();function l(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(g,p,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:g,containerInfo:p,implementation:v}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ot.createPortal=function(g,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(l(299));return d(g,p,null,v)},Ot.flushSync=function(g){var p=m.T,v=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=p,i.p=v,i.d.f()}},Ot.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(g,p))},Ot.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Ot.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var v=p.as,b=h(v,p.crossOrigin),E=typeof p.integrity=="string"?p.integrity:void 0,O=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?i.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:E,fetchPriority:O}):v==="script"&&i.d.X(g,{crossOrigin:b,integrity:E,fetchPriority:O,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ot.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=h(p.as,p.crossOrigin);i.d.M(g,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(g)},Ot.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,b=h(v,p.crossOrigin);i.d.L(g,v,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ot.preloadModule=function(g,p){if(typeof g=="string")if(p){var v=h(p.as,p.crossOrigin);i.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(g)},Ot.requestFormReset=function(g){i.d.r(g)},Ot.unstable_batchedUpdates=function(g,p){return g(p)},Ot.useFormState=function(g,p,v){return m.H.useFormState(g,p,v)},Ot.useFormStatus=function(){return m.H.useHostTransitionStatus()},Ot.version="19.1.1",Ot}var Nh;function Rx(){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=Tx(),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 Mx(){if(Sh)return Gn;Sh=1;var a=Ax(),l=gu(),o=Rx();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 g(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var 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,w=c.child;w;){if(w===r){y=!0,r=c,n=f;break}if(w===n){y=!0,n=c,r=f;break}w=w.sibling}if(!y){for(w=f.child;w;){if(w===r){y=!0,r=f,n=c;break}if(w===n){y=!0,n=f,r=c;break}w=w.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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),N=Symbol.for("react.consumer"),T=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case M:return"Profiler";case C:return"StrictMode";case W:return"Suspense";case se:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case T:return(e.displayName||"Context")+".Provider";case N:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var B=Array.isArray,j=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},le=[],S=-1;function _(e){return{current:e}}function Z(e){0>S||(e.current=le[S],le[S]=null,S--)}function H(e,t){S++,le[S]=e.current,e.current=t}var $=_(null),fe=_(null),ee=_(null),Y=_(null);function de(e,t){switch(H(ee,t),H(fe,e),H($,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gm(t),e=Im(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Z($),H($,e)}function we(){Z($),Z(fe),Z(ee)}function Se(e){e.memoizedState!==null&&H(Y,e);var t=$.current,r=Im(t,e.type);t!==r&&(H(fe,e),H($,r))}function be(e){fe.current===e&&(Z($),Z(fe)),Y.current===e&&(Z(Y),_n._currentValue=L)}var Oe=Object.prototype.hasOwnProperty,ue=a.unstable_scheduleCallback,Te=a.unstable_cancelCallback,nt=a.unstable_shouldYield,kt=a.unstable_requestPaint,Ue=a.unstable_now,At=a.unstable_getCurrentPriorityLevel,wr=a.unstable_ImmediatePriority,Wt=a.unstable_UserBlockingPriority,er=a.unstable_NormalPriority,tr=a.unstable_LowPriority,as=a.unstable_IdlePriority,ns=a.log,Rs=a.unstable_setDisableYieldValue,rr=null,ht=null;function zt(e){if(typeof ns=="function"&&Rs(e),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(rr,e)}catch{}}var pt=Math.clz32?Math.clz32:ta,ls=Math.log,pr=Math.LN2;function ta(e){return e>>>=0,e===0?32:31-(ls(e)/pr|0)|0}var Lr=256,Ur=4194304;function sr(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 gr(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 w=n&134217727;return w!==0?(n=w&~f,n!==0?c=sr(n):(y&=w,y!==0?c=sr(y):r||(r=w&~e,r!==0&&(c=sr(r))))):(w=n&~f,w!==0?c=sr(w):y!==0?c=sr(y):r||(r=n&~e,r!==0&&(c=sr(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 Nr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ra(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 Ms(){var e=Lr;return Lr<<=1,(Lr&4194048)===0&&(Lr=256),e}function Pr(){var e=Ur;return Ur<<=1,(Ur&62914560)===0&&(Ur=4194304),e}function Sr(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Cr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function sa(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 w=e.entanglements,D=e.expirationTimes,I=e.hiddenUpdates;for(r=y&~r;0<r;){var ne=31-pt(r),ce=1<<ne;w[ne]=0,D[ne]=-1;var X=I[ne];if(X!==null)for(I[ne]=null,ne=0;ne<X.length;ne++){var Q=X[ne];Q!==null&&(Q.lane&=-536870913)}r&=~ce}n!==0&&Os(e,n,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(y&~t))}function Os(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-pt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|r&4194090}function me(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-pt(r),c=1<<n;c&t|e[n]&t&&(e[n]|=t),r&=~c}}function ae(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 he(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Gt(){var e=k.p;return e!==0?e:(e=window.event,e===void 0?32:uh(e.type))}function Ve(e,t){var r=k.p;try{return k.p=e,t()}finally{k.p=r}}var Pe=Math.random().toString(36).slice(2),Ze="__reactFiber$"+Pe,rt="__reactProps$"+Pe,xr="__reactContainer$"+Pe,lt="__reactEvents$"+Pe,Tt="__reactListeners$"+Pe,Er="__reactHandles$"+Pe,It="__reactResources$"+Pe,_t="__reactMarker$"+Pe;function gt(e){delete e[Ze],delete e[rt],delete e[lt],delete e[Tt],delete e[Er]}function Lt(e){var t=e[Ze];if(t)return t;for(var r=e.parentNode;r;){if(t=r[xr]||r[Ze]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Xm(e);e!==null;){if(r=e[Ze])return r;e=Xm(e)}return t}e=r,r=e.parentNode}return null}function ct(e){if(e=e[Ze]||e[xr]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function pe(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Re(e){var t=e[It];return t||(t=e[It]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ke(e){e[_t]=!0}var Je=new Set,Rt={};function Ds(e,t){aa(e,t),aa(e+"Capture",t)}function aa(e,t){for(Rt[e]=t,e=0;e<t.length;e++)Je.add(t[e])}var gg=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]*$"),zu={},Lu={};function xg(e){return Oe.call(Lu,e)?!0:Oe.call(zu,e)?!1:gg.test(e)?Lu[e]=!0:(zu[e]=!0,!1)}function il(e,t,r){if(xg(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 cl(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 _r(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,Uu;function na(e){if(qo===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);qo=t&&t[1]||"",Uu=-1<r.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+qo+e+Uu}var Vo=!1;function Fo(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 ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(Q){var X=Q}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(Q){X=Q}e.call(ce.prototype)}}else{try{throw Error()}catch(Q){X=Q}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(Q){if(Q&&X&&typeof Q.stack=="string")return[Q.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],w=f[1];if(y&&w){var D=y.split(`
|
|
44
|
+
`),I=w.split(`
|
|
45
|
+
`);for(c=n=0;n<D.length&&!D[n].includes("DetermineComponentFrameRoot");)n++;for(;c<I.length&&!I[c].includes("DetermineComponentFrameRoot");)c++;if(n===D.length||c===I.length)for(n=D.length-1,c=I.length-1;1<=n&&0<=c&&D[n]!==I[c];)c--;for(;1<=n&&0<=c;n--,c--)if(D[n]!==I[c]){if(n!==1||c!==1)do if(n--,c--,0>c||D[n]!==I[c]){var ne=`
|
|
46
|
+
`+D[n].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=n&&0<=c);break}}}finally{Vo=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?na(r):""}function yg(e){switch(e.tag){case 26:case 27:case 5:return na(e.type);case 16:return na("Lazy");case 13:return na("Suspense");case 19:return na("SuspenseList");case 0:case 15:return Fo(e.type,!1);case 11:return Fo(e.type.render,!1);case 1:return Fo(e.type,!0);case 31:return na("Activity");default:return""}}function Pu(e){try{var t="";do t+=yg(e),e=e.return;while(e);return t}catch(r){return`
|
|
47
|
+
Error generating stack: `+r.message+`
|
|
48
|
+
`+r.stack}}function ar(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 vg(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 ul(e){e._valueTracker||(e._valueTracker=vg(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 dl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var bg=/[\n"\\]/g;function nr(e){return e.replace(bg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Go(e,t,r,n,c,f,y,w){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=""+ar(t)):e.value!==""+ar(t)&&(e.value=""+ar(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?Io(e,y,ar(t)):r!=null?Io(e,y,ar(r)):n!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+ar(w):e.removeAttribute("name")}function Bu(e,t,r,n,c,f,y,w){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?""+ar(r):"",t=t!=null?""+ar(t):r,w||t===e.value||(e.value=t),e.defaultValue=t}n=n??c,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=w?e.checked:!!n,e.defaultChecked=!!n,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y)}function Io(e,t,r){t==="number"&&dl(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function la(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=""+ar(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=""+ar(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+ar(r):""}function Vu(e,t,r,n){if(t==null){if(n!=null){if(r!=null)throw Error(i(92));if(B(n)){if(1<n.length)throw Error(i(93));n=n[0]}r=n}r==null&&(r=""),t=r}r=ar(t),e.defaultValue=r,n=e.textContent,n===r&&n!==""&&n!==null&&(e.value=n)}function oa(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var jg=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 Fu(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||jg.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Gu(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&&Fu(e,c,n)}else for(var f in t)t.hasOwnProperty(f)&&Fu(e,f,t[f])}function $o(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ng=/^[\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 fl(e){return Ng.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ko=null;function Yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ia=null,ca=null;function Iu(e){var t=ct(e);if(t&&(e=t.stateNode)){var r=e[rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Go(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="'+nr(""+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));Go(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&&la(e,!!r.multiple,t,!1)}}}var Xo=!1;function $u(e,t,r){if(Xo)return e(t,r);Xo=!0;try{var n=e(t);return n}finally{if(Xo=!1,(ia!==null||ca!==null)&&(Ql(),ia&&(t=ia,e=ca,ca=ia=null,Iu(t),e)))for(t=0;t<e.length;t++)Iu(e[t])}}function Ja(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 Hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jo=!1;if(Hr)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Jo=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Jo=!1}var os=null,Qo=null,ml=null;function Ku(){if(ml)return ml;var e,t=Qo,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 ml=c.slice(e,1<n?1-n:void 0)}function hl(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 pl(){return!0}function Yu(){return!1}function Ht(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 w in e)e.hasOwnProperty(w)&&(r=e[w],this[w]=r?r(f):f[w]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?pl:Yu,this.isPropagationStopped=Yu,this}return v(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=pl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=pl)},persist:function(){},isPersistent:pl}),t}var zs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gl=Ht(zs),Za=v({},zs,{view:0,detail:0}),Sg=Ht(Za),Zo,Wo,Wa,xl=v({},Za,{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!==Wa&&(Wa&&e.type==="mousemove"?(Zo=e.screenX-Wa.screenX,Wo=e.screenY-Wa.screenY):Wo=Zo=0,Wa=e),Zo)},movementY:function(e){return"movementY"in e?e.movementY:Wo}}),Xu=Ht(xl),Cg=v({},xl,{dataTransfer:0}),Eg=Ht(Cg),kg=v({},Za,{relatedTarget:0}),ei=Ht(kg),Ag=v({},zs,{animationName:0,elapsedTime:0,pseudoElement:0}),Tg=Ht(Ag),Rg=v({},zs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mg=Ht(Rg),Og=v({},zs,{data:0}),Ju=Ht(Og),Dg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zg={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"},Lg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ug(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Lg[e])?!!t[e]:!1}function ti(){return Ug}var Pg=v({},Za,{key:function(e){if(e.key){var t=Dg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=hl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zg[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"?hl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?hl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_g=Ht(Pg),Hg=v({},xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qu=Ht(Hg),Bg=v({},Za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ti}),qg=Ht(Bg),Vg=v({},zs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fg=Ht(Vg),Gg=v({},xl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ig=Ht(Gg),$g=v({},zs,{newState:0,oldState:0}),Kg=Ht($g),Yg=[9,13,27,32],ri=Hr&&"CompositionEvent"in window,en=null;Hr&&"documentMode"in document&&(en=document.documentMode);var Xg=Hr&&"TextEvent"in window&&!en,Zu=Hr&&(!ri||en&&8<en&&11>=en),Wu=" ",ed=!1;function td(e,t){switch(e){case"keyup":return Yg.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 ua=!1;function Jg(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(ua)return e==="compositionend"||!ri&&td(e,t)?(e=Ku(),ml=Qo=os=null,ua=!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 Zg={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"?!!Zg[e.type]:t==="textarea"}function ad(e,t,r,n){ia?ca?ca.push(n):ca=[n]:ia=n,t=so(t,"onChange"),0<t.length&&(r=new gl("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var tn=null,rn=null;function Wg(e){Hm(e,0)}function yl(e){var t=pe(e);if(Hu(t))return e}function nd(e,t){if(e==="change")return t}var ld=!1;if(Hr){var si;if(Hr){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(){tn&&(tn.detachEvent("onpropertychange",cd),rn=tn=null)}function cd(e){if(e.propertyName==="value"&&yl(rn)){var t=[];ad(t,rn,e,Yo(e)),$u(Wg,t)}}function e0(e,t,r){e==="focusin"?(id(),tn=t,rn=r,tn.attachEvent("onpropertychange",cd)):e==="focusout"&&id()}function t0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yl(rn)}function r0(e,t){if(e==="click")return yl(t)}function s0(e,t){if(e==="input"||e==="change")return yl(t)}function a0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:a0;function sn(e,t){if($t(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(!Oe.call(t,c)||!$t(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=dl(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=dl(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 n0=Hr&&"documentMode"in document&&11>=document.documentMode,da=null,li=null,an=null,oi=!1;function hd(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;oi||da==null||da!==dl(n)||(n=da,"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}),an&&sn(an,n)||(an=n,n=so(li,"onSelect"),0<n.length&&(t=new gl("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=da)))}function Ls(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var fa={animationend:Ls("Animation","AnimationEnd"),animationiteration:Ls("Animation","AnimationIteration"),animationstart:Ls("Animation","AnimationStart"),transitionrun:Ls("Transition","TransitionRun"),transitionstart:Ls("Transition","TransitionStart"),transitioncancel:Ls("Transition","TransitionCancel"),transitionend:Ls("Transition","TransitionEnd")},ii={},pd={};Hr&&(pd=document.createElement("div").style,"AnimationEvent"in window||(delete fa.animationend.animation,delete fa.animationiteration.animation,delete fa.animationstart.animation),"TransitionEvent"in window||delete fa.transitionend.transition);function Us(e){if(ii[e])return ii[e];if(!fa[e])return e;var t=fa[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in pd)return ii[e]=t[r];return e}var gd=Us("animationend"),xd=Us("animationiteration"),yd=Us("animationstart"),l0=Us("transitionrun"),o0=Us("transitionstart"),i0=Us("transitioncancel"),vd=Us("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 yr(e,t){bd.set(e,t),Ds(t,[e])}var jd=new WeakMap;function lr(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 or=[],ma=0,ui=0;function vl(){for(var e=ma,t=ui=ma=0;t<e;){var r=or[t];or[t++]=null;var n=or[t];or[t++]=null;var c=or[t];or[t++]=null;var f=or[t];if(or[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 bl(e,t,r,n){or[ma++]=e,or[ma++]=t,or[ma++]=r,or[ma++]=n,ui|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function di(e,t,r,n){return bl(e,t,r,n),jl(e)}function ha(e,t){return bl(e,null,null,t),jl(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-pt(r),e=f.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=r|536870912),f):null}function jl(e){if(50<Rn)throw Rn=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 pa={};function c0(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 Kt(e,t,r,n){return new c0(e,t,r,n)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Br(e,t){var r=e.alternate;return r===null?(r=Kt(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 wl(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=dx(e,r,$.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Kt(31,r,t,c),e.elementType=te,e.lanes=f,e;case A:return Ps(r.children,c,f,t);case C:y=8,c|=24;break;case M:return e=Kt(12,r,t,c|2),e.elementType=M,e.lanes=f,e;case W:return e=Kt(13,r,t,c),e.elementType=W,e.lanes=f,e;case se:return e=Kt(19,r,t,c),e.elementType=se,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:case T:y=10;break e;case N:y=9;break e;case V:y=11;break e;case re:y=14;break e;case F:y=16,n=null;break e}y=29,r=Error(i(130,e===null?"null":typeof e,"")),n=null}return t=Kt(y,r,t,c),t.elementType=e,t.type=n,t.lanes=f,t}function Ps(e,t,r,n){return e=Kt(7,e,n,t),e.lanes=r,e}function mi(e,t,r){return e=Kt(6,e,null,t),e.lanes=r,e}function hi(e,t,r){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ga=[],xa=0,Nl=null,Sl=0,ir=[],cr=0,_s=null,qr=1,Vr="";function Hs(e,t){ga[xa++]=Sl,ga[xa++]=Nl,Nl=e,Sl=t}function Sd(e,t,r){ir[cr++]=qr,ir[cr++]=Vr,ir[cr++]=_s,_s=e;var n=qr;e=Vr;var c=32-pt(n)-1;n&=~(1<<c),r+=1;var f=32-pt(t)+c;if(30<f){var y=c-c%5;f=(n&(1<<y)-1).toString(32),n>>=y,c-=y,qr=1<<32-pt(t)+c|r<<c|n,Vr=f+e}else qr=1<<f|r<<c|n,Vr=e}function pi(e){e.return!==null&&(Hs(e,1),Sd(e,1,0))}function gi(e){for(;e===Nl;)Nl=ga[--xa],ga[xa]=null,Sl=ga[--xa],ga[xa]=null;for(;e===_s;)_s=ir[--cr],ir[cr]=null,Vr=ir[--cr],ir[cr]=null,qr=ir[--cr],ir[cr]=null}var Ut=null,ot=null,Fe=!1,Bs=null,kr=!1,xi=Error(i(519));function qs(e){var t=Error(i(418,""));throw on(lr(t,e)),xi}function Cd(e){var t=e.stateNode,r=e.type,n=e.memoizedProps;switch(t[Ze]=e,t[rt]=n,r){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(r=0;r<On.length;r++)He(On[r],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),Bu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),ul(t);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),Vu(t,n.value,n.defaultValue,n.children),ul(t)}r=n.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||n.suppressHydrationWarning===!0||Fm(t.textContent,r)?(n.popover!=null&&(He("beforetoggle",t),He("toggle",t)),n.onScroll!=null&&He("scroll",t),n.onScrollEnd!=null&&He("scrollend",t),n.onClick!=null&&(t.onclick=ao),t=!0):t=!1,t||qs(e)}function Ed(e){for(Ut=e.return;Ut;)switch(Ut.tag){case 5:case 13:kr=!1;return;case 27:case 3:kr=!0;return;default:Ut=Ut.return}}function nn(e){if(e!==Ut)return!1;if(!Fe)return Ed(e),Fe=!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&&ot&&qs(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){ot=br(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++;e=e.nextSibling}ot=null}}else t===27?(t=ot,Ns(e.type)?(e=Pc,Pc=null,ot=e):ot=t):ot=Ut?br(e.stateNode.nextSibling):null;return!0}function ln(){ot=Ut=null,Fe=!1}function kd(){var e=Bs;return e!==null&&(Vt===null?Vt=e:Vt.push.apply(Vt,e),Bs=null),e}function on(e){Bs===null?Bs=[e]:Bs.push(e)}var yi=_(null),Vs=null,Fr=null;function is(e,t,r){H(yi,t._currentValue),t._currentValue=r}function Gr(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 w=f;f=c;for(var D=0;D<t.length;D++)if(w.context===t[D]){f.lanes|=r,w=f.alternate,w!==null&&(w.lanes|=r),vi(f.return,r,e),n||(y=null);break e}f=w.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 cn(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 w=c.type;$t(c.pendingProps.value,y.value)||(e!==null?e.push(w):e=[w])}}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(_n):e=[_n])}c=c.return}e!==null&&bi(t,e,r,n),t.flags|=262144}function Cl(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fs(e){Vs=e,Fr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return Ad(Vs,e)}function El(e,t){return Vs===null&&Fs(e),Ad(e,t)}function Ad(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Fr===null){if(e===null)throw Error(i(308));Fr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fr=Fr.next=t;return r}var u0=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()})}},d0=a.unstable_scheduleCallback,f0=a.unstable_NormalPriority,xt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ji(){return{controller:new u0,data:new Map,refCount:0}}function un(e){e.refCount--,e.refCount===0&&d0(f0,function(){e.controller.abort()})}var dn=null,wi=0,ya=0,va=null;function m0(e,t){if(dn===null){var r=dn=[];wi=0,ya=Sc(),va={status:"pending",value:void 0,then:function(n){r.push(n)}}}return wi++,t.then(Td,Td),t}function Td(){if(--wi===0&&dn!==null){va!==null&&(va.status="fulfilled");var e=dn;dn=null,ya=0,va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function h0(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=j.S;j.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&m0(e,t),Rd!==null&&Rd(e,t)};var Gs=_(null);function Ni(){var e=Gs.current;return e!==null?e:We.pooledCache}function kl(e,t){t===null?H(Gs,Gs.current):H(Gs,t.pool)}function Md(){var e=Ni();return e===null?null:{parent:xt._currentValue,pool:e}}var fn=Error(i(460)),Od=Error(i(474)),Al=Error(i(542)),Si={then:function(){}};function Dd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Tl(){}function zd(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Tl,Tl),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ud(e),e;default:if(typeof t.status=="string")t.then(Tl,Tl);else{if(e=We,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,Ud(e),e}throw mn=t,fn}}var mn=null;function Ld(){if(mn===null)throw Error(i(459));var e=mn;return mn=null,e}function Ud(e){if(e===fn||e===Al)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,(Ie&2)!==0){var c=n.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),n.pending=t,t=jl(e),wd(e,null,r),t}return bl(e,n,t,r),jl(e)}function hn(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,me(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 pn(){if(Ai){var e=va;if(e!==null)throw e}}function gn(e,t,r,n){Ai=!1;var c=e.updateQueue;cs=!1;var f=c.firstBaseUpdate,y=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var D=w,I=D.next;D.next=null,y===null?f=I:y.next=I,y=D;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,w=ne.lastBaseUpdate,w!==y&&(w===null?ne.firstBaseUpdate=I:w.next=I,ne.lastBaseUpdate=D))}if(f!==null){var ce=c.baseState;y=0,ne=I=D=null,w=f;do{var X=w.lane&-536870913,Q=X!==w.lane;if(Q?(Be&X)===X:(n&X)===X){X!==0&&X===ya&&(Ai=!0),ne!==null&&(ne=ne.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var Ee=e,Ne=w;X=t;var Xe=r;switch(Ne.tag){case 1:if(Ee=Ne.payload,typeof Ee=="function"){ce=Ee.call(Xe,ce,X);break e}ce=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Ne.payload,X=typeof Ee=="function"?Ee.call(Xe,ce,X):Ee,X==null)break e;ce=v({},ce,X);break e;case 2:cs=!0}}X=w.callback,X!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=c.callbacks,Q===null?c.callbacks=[X]:Q.push(X))}else Q={lane:X,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ne===null?(I=ne=Q,D=ce):ne=ne.next=Q,y|=X;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;Q=w,w=Q.next,Q.next=null,c.lastBaseUpdate=Q,c.shared.pending=null}}while(!0);ne===null&&(D=ce),c.baseState=D,c.firstBaseUpdate=I,c.lastBaseUpdate=ne,f===null&&(c.shared.lanes=0),vs|=y,e.lanes=y,e.memoizedState=ce}}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 ba=_(null),Rl=_(0);function Hd(e,t){e=Qr,H(Rl,e),H(ba,t),Qr=e|t.baseLanes}function Ti(){H(Rl,Qr),H(ba,ba.current)}function Ri(){Qr=Rl.current,Z(ba),Z(Rl)}var fs=0,De=null,Ke=null,ft=null,Ml=!1,ja=!1,Is=!1,Ol=0,xn=0,wa=null,p0=0;function ut(){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(!$t(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,j.H=e===null||e.memoizedState===null?Nf:Sf,Is=!1,f=r(n,c),Is=!1,ja&&(f=qd(t,r,n,c)),Bd(e),f}function Bd(e){j.H=_l;var t=Ke!==null&&Ke.next!==null;if(fs=0,ft=Ke=De=null,Ml=!1,xn=0,wa=null,t)throw Error(i(300));e===null||bt||(e=e.dependencies,e!==null&&Cl(e)&&(bt=!0))}function qd(e,t,r,n){De=e;var c=0;do{if(ja&&(wa=null),xn=0,ja=!1,25<=c)throw Error(i(301));if(c+=1,ft=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)}j.H=w0,f=t(r,n)}while(ja);return f}function g0(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?yn(t):t,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(De.flags|=1024),t}function Di(){var e=Ol!==0;return Ol=0,e}function zi(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Li(e){if(Ml){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ml=!1}fs=0,ft=Ke=De=null,ja=!1,xn=Ol=0,wa=null}function Bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?De.memoizedState=ft=e:ft=ft.next=e,ft}function mt(){if(Ke===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=ft===null?De.memoizedState:ft.next;if(t!==null)ft=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},ft===null?De.memoizedState=ft=e:ft=ft.next=e}return ft}function Ui(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yn(e){var t=xn;return xn+=1,wa===null&&(wa=[]),e=zd(wa,e,t),t=De,(ft===null?t.memoizedState:ft.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Nf:Sf),e}function Dl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yn(e);if(e.$$typeof===T)return Mt(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=Ui(),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]=ie;return t.index++,r}function Ir(e,t){return typeof t=="function"?t(e):t}function zl(e){var t=mt();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 w=y=null,D=null,I=t,ne=!1;do{var ce=I.lane&-536870913;if(ce!==I.lane?(Be&ce)===ce:(fs&ce)===ce){var X=I.revertLane;if(X===0)D!==null&&(D=D.next={lane:0,revertLane:0,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),ce===ya&&(ne=!0);else if((fs&X)===X){I=I.next,X===ya&&(ne=!0);continue}else ce={lane:0,revertLane:I.revertLane,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},D===null?(w=D=ce,y=f):D=D.next=ce,De.lanes|=X,vs|=X;ce=I.action,Is&&r(f,ce),f=I.hasEagerState?I.eagerState:r(f,ce)}else X={lane:ce,revertLane:I.revertLane,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},D===null?(w=D=X,y=f):D=D.next=X,De.lanes|=ce,vs|=ce;I=I.next}while(I!==null&&I!==t);if(D===null?y=f:D.next=w,!$t(f,e.memoizedState)&&(bt=!0,ne&&(r=va,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=mt(),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);$t(f,t.memoizedState)||(bt=!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=mt(),f=Fe;if(f){if(r===void 0)throw Error(i(407));r=r()}else r=t();var y=!$t((Ke||c).memoizedState,r);y&&(c.memoizedState=r,bt=!0),c=c.queue;var w=Id.bind(null,n,c,e);if(vn(2048,8,w,[e]),c.getSnapshot!==t||y||ft!==null&&ft.memoizedState.tag&1){if(n.flags|=2048,Na(9,Ll(),Gd.bind(null,n,c,r,t),null),We===null)throw Error(i(349));f||(fs&124)!==0||Fd(n,t,r)}return r}function Fd(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=De.updateQueue,t===null?(t=Ui(),De.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Gd(e,t,r,n){t.value=r,t.getSnapshot=n,$d(t)&&Kd(e)}function Id(e,t,r){return r(function(){$d(t)&&Kd(e)})}function $d(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!$t(e,r)}catch{return!0}}function Kd(e){var t=ha(e,2);t!==null&&Zt(t,e,2)}function Bi(e){var t=Bt();if(typeof e=="function"){var r=e;if(e=r(),Is){zt(!0);try{r()}finally{zt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:e},t}function Yd(e,t,r,n){return e.baseState=r,_i(e,Ke,typeof n=="function"?n:Ir)}function x0(e,t,r,n,c){if(Pl(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)}};j.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=j.T,y={};j.T=y;try{var w=r(c,n),D=j.S;D!==null&&D(y,w),Jd(e,t,w)}catch(I){qi(e,t,I)}finally{j.T=f}}else try{f=r(c,n),Jd(e,t,f)}catch(I){qi(e,t,I)}}function Jd(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(n){Qd(e,t,n)},function(n){return qi(e,t,n)}):Qd(e,t,r)}function Qd(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(Fe){var r=We.formState;if(r!==null){e:{var n=De;if(Fe){if(ot){t:{for(var c=ot,f=kr;c.nodeType!==8;){if(!f){c=null;break t}if(c=br(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){ot=br(c.nextSibling),n=c.data==="F!";break e}}qs(n)}n=!1}n&&(t=r[0])}}return r=Bt(),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=$i.bind(null,De,!1,n.queue),n=Bt(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,r=x0.bind(null,De,c,f,r),c.dispatch=r,n.memoizedState=e,[t,r,!1]}function tf(e){var t=mt();return rf(t,Ke,e)}function rf(e,t,r){if(t=_i(e,t,Wd)[0],e=zl(Ir)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=yn(t)}catch(y){throw y===fn?Al:y}else n=t;t=mt();var c=t.queue,f=c.dispatch;return r!==t.memoizedState&&(De.flags|=2048,Na(9,Ll(),y0.bind(null,c,r),null)),[n,f,e]}function y0(e,t){e.action=t}function sf(e){var t=mt(),r=Ke;if(r!==null)return rf(t,r,e);mt(),t=t.memoizedState,r=mt();var n=r.queue.dispatch;return r.memoizedState=e,[t,n,!1]}function Na(e,t,r,n){return e={tag:e,create:r,deps:n,inst:t,next:null},t=De.updateQueue,t===null&&(t=Ui(),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 Ll(){return{destroy:void 0,resource:void 0}}function af(){return mt().memoizedState}function Ul(e,t,r,n){var c=Bt();n=n===void 0?null:n,De.flags|=e,c.memoizedState=Na(1|t,Ll(),r,n)}function vn(e,t,r,n){var c=mt();n=n===void 0?null:n;var f=c.memoizedState.inst;Ke!==null&&n!==null&&Mi(n,Ke.memoizedState.deps)?c.memoizedState=Na(t,f,r,n):(De.flags|=e,c.memoizedState=Na(1|t,f,r,n))}function nf(e,t){Ul(8390656,8,e,t)}function lf(e,t){vn(2048,8,e,t)}function of(e,t){return vn(4,2,e,t)}function cf(e,t){return vn(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,vn(4,4,uf.bind(null,t,e),r)}function Vi(){}function ff(e,t){var r=mt();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=mt();t=t===void 0?null:t;var n=r.memoizedState;if(t!==null&&Mi(t,n[1]))return n[0];if(n=e(),Is){zt(!0);try{e()}finally{zt(!1)}}return r.memoizedState=[n,t],n}function Fi(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 $t(r,t)?r:ba.current!==null?(e=Fi(e,r,n),$t(e,t)||(bt=!0),e):(fs&42)===0?(bt=!0,e.memoizedState=r):(e=gm(),De.lanes|=e,vs|=e,t)}function pf(e,t,r,n,c){var f=k.p;k.p=f!==0&&8>f?f:8;var y=j.T,w={};j.T=w,$i(e,!1,t,r);try{var D=c(),I=j.S;if(I!==null&&I(w,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ne=h0(D,n);bn(e,t,ne,Qt(e))}else bn(e,t,n,Qt(e))}catch(ce){bn(e,t,{then:function(){},status:"rejected",reason:ce},Qt())}finally{k.p=f,j.T=y}}function v0(){}function Gi(e,t,r,n){if(e.tag!==5)throw Error(i(476));var c=gf(e).queue;pf(e,c,t,L,r===null?v0: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:Ir,lastRenderedState:L},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,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;bn(e,t,{},Qt())}function Ii(){return Mt(_n)}function yf(){return mt().memoizedState}function vf(){return mt().memoizedState}function b0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Qt();e=us(r);var n=ds(t,e,r);n!==null&&(Zt(n,t,r),hn(n,t,r)),t={cache:ji()},e.payload=t;return}t=t.return}}function j0(e,t,r){var n=Qt();r={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},Pl(e)?jf(t,r):(r=di(e,t,r,n),r!==null&&(Zt(r,e,n),wf(r,t,n)))}function bf(e,t,r){var n=Qt();bn(e,t,r,n)}function bn(e,t,r,n){var c={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(Pl(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,w=f(y,r);if(c.hasEagerState=!0,c.eagerState=w,$t(w,y))return bl(e,t,c,0),We===null&&vl(),!1}catch{}finally{}if(r=di(e,t,c,n),r!==null)return Zt(r,e,n),wf(r,t,n),!0}return!1}function $i(e,t,r,n){if(n={lane:2,revertLane:Sc(),action:n,hasEagerState:!1,eagerState:null,next:null},Pl(e)){if(t)throw Error(i(479))}else t=di(e,r,n,2),t!==null&&Zt(t,e,2)}function Pl(e){var t=e.alternate;return e===De||t!==null&&t===De}function jf(e,t){ja=Ml=!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,me(e,r)}}var _l={readContext:Mt,use:Dl,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut},Nf={readContext:Mt,use:Dl,useCallback:function(e,t){return Bt().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:nf,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Ul(4194308,4,uf.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ul(4194308,4,e,t)},useInsertionEffect:function(e,t){Ul(4,2,e,t)},useMemo:function(e,t){var r=Bt();t=t===void 0?null:t;var n=e();if(Is){zt(!0);try{e()}finally{zt(!1)}}return r.memoizedState=[n,t],n},useReducer:function(e,t,r){var n=Bt();if(r!==void 0){var c=r(t);if(Is){zt(!0);try{r(t)}finally{zt(!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=j0.bind(null,De,e),[n.memoizedState,e]},useRef:function(e){var t=Bt();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=Bt();return Fi(r,e,t)},useTransition:function(){var e=Bi(!1);return e=pf.bind(null,De,e.queue,!0,!1),Bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var n=De,c=Bt();if(Fe){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),We===null)throw Error(i(349));(Be&124)!==0||Fd(n,t,r)}c.memoizedState=r;var f={value:r,getSnapshot:t};return c.queue=f,nf(Id.bind(null,n,f,e),[e]),n.flags|=2048,Na(9,Ll(),Gd.bind(null,n,f,r,t),null),r},useId:function(){var e=Bt(),t=We.identifierPrefix;if(Fe){var r=Vr,n=qr;r=(n&~(1<<32-pt(n)-1)).toString(32)+r,t="«"+t+"R"+r,r=Ol++,0<r&&(t+="H"+r.toString(32)),t+="»"}else r=p0++,t="«"+t+"r"+r.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Ii,useFormState:ef,useActionState:ef,useOptimistic:function(e){var t=Bt();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=$i.bind(null,De,!0,r),r.dispatch=t,[e,t]},useMemoCache:Pi,useCacheRefresh:function(){return Bt().memoizedState=b0.bind(null,De)}},Sf={readContext:Mt,use:Dl,useCallback:ff,useContext:Mt,useEffect:lf,useImperativeHandle:df,useInsertionEffect:of,useLayoutEffect:cf,useMemo:mf,useReducer:zl,useRef:af,useState:function(){return zl(Ir)},useDebugValue:Vi,useDeferredValue:function(e,t){var r=mt();return hf(r,Ke.memoizedState,e,t)},useTransition:function(){var e=zl(Ir)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:yn(e),t]},useSyncExternalStore:Vd,useId:yf,useHostTransitionStatus:Ii,useFormState:tf,useActionState:tf,useOptimistic:function(e,t){var r=mt();return Yd(r,Ke,e,t)},useMemoCache:Pi,useCacheRefresh:vf},w0={readContext:Mt,use:Dl,useCallback:ff,useContext:Mt,useEffect:lf,useImperativeHandle:df,useInsertionEffect:of,useLayoutEffect:cf,useMemo:mf,useReducer:Hi,useRef:af,useState:function(){return Hi(Ir)},useDebugValue:Vi,useDeferredValue:function(e,t){var r=mt();return Ke===null?Fi(r,e,t):hf(r,Ke.memoizedState,e,t)},useTransition:function(){var e=Hi(Ir)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:yn(e),t]},useSyncExternalStore:Vd,useId:yf,useHostTransitionStatus:Ii,useFormState:sf,useActionState:sf,useOptimistic:function(e,t){var r=mt();return Ke!==null?Yd(r,Ke,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Pi,useCacheRefresh:vf},Sa=null,jn=0;function Hl(e){var t=jn;return jn+=1,Sa===null&&(Sa=[]),zd(Sa,e,t)}function wn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Bl(e,t){throw t.$$typeof===b?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 G=q.deletions;G===null?(q.deletions=[P],q.flags|=16):G.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=Br(q,P),q.index=0,q.sibling=null,q}function f(q,P,G){return q.index=G,e?(G=q.alternate,G!==null?(G=G.index,G<P?(q.flags|=67108866,P):G):(q.flags|=67108866,P)):(q.flags|=1048576,P)}function y(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function w(q,P,G,oe){return P===null||P.tag!==6?(P=mi(G,q.mode,oe),P.return=q,P):(P=c(P,G),P.return=q,P)}function D(q,P,G,oe){var ge=G.type;return ge===A?ne(q,P,G.props.children,oe,G.key):P!==null&&(P.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===F&&Cf(ge)===P.type)?(P=c(P,G.props),wn(P,G),P.return=q,P):(P=wl(G.type,G.key,G.props,null,q.mode,oe),wn(P,G),P.return=q,P)}function I(q,P,G,oe){return P===null||P.tag!==4||P.stateNode.containerInfo!==G.containerInfo||P.stateNode.implementation!==G.implementation?(P=hi(G,q.mode,oe),P.return=q,P):(P=c(P,G.children||[]),P.return=q,P)}function ne(q,P,G,oe,ge){return P===null||P.tag!==7?(P=Ps(G,q.mode,oe,ge),P.return=q,P):(P=c(P,G),P.return=q,P)}function ce(q,P,G){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=mi(""+P,q.mode,G),P.return=q,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case E:return G=wl(P.type,P.key,P.props,null,q.mode,G),wn(G,P),G.return=q,G;case O:return P=hi(P,q.mode,G),P.return=q,P;case F:var oe=P._init;return P=oe(P._payload),ce(q,P,G)}if(B(P)||U(P))return P=Ps(P,q.mode,G,null),P.return=q,P;if(typeof P.then=="function")return ce(q,Hl(P),G);if(P.$$typeof===T)return ce(q,El(q,P),G);Bl(q,P)}return null}function X(q,P,G,oe){var ge=P!==null?P.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return ge!==null?null:w(q,P,""+G,oe);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case E:return G.key===ge?D(q,P,G,oe):null;case O:return G.key===ge?I(q,P,G,oe):null;case F:return ge=G._init,G=ge(G._payload),X(q,P,G,oe)}if(B(G)||U(G))return ge!==null?null:ne(q,P,G,oe,null);if(typeof G.then=="function")return X(q,P,Hl(G),oe);if(G.$$typeof===T)return X(q,P,El(q,G),oe);Bl(q,G)}return null}function Q(q,P,G,oe,ge){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return q=q.get(G)||null,w(P,q,""+oe,ge);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case E:return q=q.get(oe.key===null?G:oe.key)||null,D(P,q,oe,ge);case O:return q=q.get(oe.key===null?G:oe.key)||null,I(P,q,oe,ge);case F:var Le=oe._init;return oe=Le(oe._payload),Q(q,P,G,oe,ge)}if(B(oe)||U(oe))return q=q.get(G)||null,ne(P,q,oe,ge,null);if(typeof oe.then=="function")return Q(q,P,G,Hl(oe),ge);if(oe.$$typeof===T)return Q(q,P,G,El(P,oe),ge);Bl(P,oe)}return null}function Ee(q,P,G,oe){for(var ge=null,Le=null,je=P,Ce=P=0,wt=null;je!==null&&Ce<G.length;Ce++){je.index>Ce?(wt=je,je=null):wt=je.sibling;var qe=X(q,je,G[Ce],oe);if(qe===null){je===null&&(je=wt);break}e&&je&&qe.alternate===null&&t(q,je),P=f(qe,P,Ce),Le===null?ge=qe:Le.sibling=qe,Le=qe,je=wt}if(Ce===G.length)return r(q,je),Fe&&Hs(q,Ce),ge;if(je===null){for(;Ce<G.length;Ce++)je=ce(q,G[Ce],oe),je!==null&&(P=f(je,P,Ce),Le===null?ge=je:Le.sibling=je,Le=je);return Fe&&Hs(q,Ce),ge}for(je=n(je);Ce<G.length;Ce++)wt=Q(je,q,Ce,G[Ce],oe),wt!==null&&(e&&wt.alternate!==null&&je.delete(wt.key===null?Ce:wt.key),P=f(wt,P,Ce),Le===null?ge=wt:Le.sibling=wt,Le=wt);return e&&je.forEach(function(As){return t(q,As)}),Fe&&Hs(q,Ce),ge}function Ne(q,P,G,oe){if(G==null)throw Error(i(151));for(var ge=null,Le=null,je=P,Ce=P=0,wt=null,qe=G.next();je!==null&&!qe.done;Ce++,qe=G.next()){je.index>Ce?(wt=je,je=null):wt=je.sibling;var As=X(q,je,qe.value,oe);if(As===null){je===null&&(je=wt);break}e&&je&&As.alternate===null&&t(q,je),P=f(As,P,Ce),Le===null?ge=As:Le.sibling=As,Le=As,je=wt}if(qe.done)return r(q,je),Fe&&Hs(q,Ce),ge;if(je===null){for(;!qe.done;Ce++,qe=G.next())qe=ce(q,qe.value,oe),qe!==null&&(P=f(qe,P,Ce),Le===null?ge=qe:Le.sibling=qe,Le=qe);return Fe&&Hs(q,Ce),ge}for(je=n(je);!qe.done;Ce++,qe=G.next())qe=Q(je,q,Ce,qe.value,oe),qe!==null&&(e&&qe.alternate!==null&&je.delete(qe.key===null?Ce:qe.key),P=f(qe,P,Ce),Le===null?ge=qe:Le.sibling=qe,Le=qe);return e&&je.forEach(function(Nx){return t(q,Nx)}),Fe&&Hs(q,Ce),ge}function Xe(q,P,G,oe){if(typeof G=="object"&&G!==null&&G.type===A&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case E:e:{for(var ge=G.key;P!==null;){if(P.key===ge){if(ge=G.type,ge===A){if(P.tag===7){r(q,P.sibling),oe=c(P,G.props.children),oe.return=q,q=oe;break e}}else if(P.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===F&&Cf(ge)===P.type){r(q,P.sibling),oe=c(P,G.props),wn(oe,G),oe.return=q,q=oe;break e}r(q,P);break}else t(q,P);P=P.sibling}G.type===A?(oe=Ps(G.props.children,q.mode,oe,G.key),oe.return=q,q=oe):(oe=wl(G.type,G.key,G.props,null,q.mode,oe),wn(oe,G),oe.return=q,q=oe)}return y(q);case O:e:{for(ge=G.key;P!==null;){if(P.key===ge)if(P.tag===4&&P.stateNode.containerInfo===G.containerInfo&&P.stateNode.implementation===G.implementation){r(q,P.sibling),oe=c(P,G.children||[]),oe.return=q,q=oe;break e}else{r(q,P);break}else t(q,P);P=P.sibling}oe=hi(G,q.mode,oe),oe.return=q,q=oe}return y(q);case F:return ge=G._init,G=ge(G._payload),Xe(q,P,G,oe)}if(B(G))return Ee(q,P,G,oe);if(U(G)){if(ge=U(G),typeof ge!="function")throw Error(i(150));return G=ge.call(G),Ne(q,P,G,oe)}if(typeof G.then=="function")return Xe(q,P,Hl(G),oe);if(G.$$typeof===T)return Xe(q,P,El(q,G),oe);Bl(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,P!==null&&P.tag===6?(r(q,P.sibling),oe=c(P,G),oe.return=q,q=oe):(r(q,P),oe=mi(G,q.mode,oe),oe.return=q,q=oe),y(q)):r(q,P)}return function(q,P,G,oe){try{jn=0;var ge=Xe(q,P,G,oe);return Sa=null,ge}catch(je){if(je===fn||je===Al)throw je;var Le=Kt(29,je,null,q.mode);return Le.lanes=oe,Le.return=q,Le}finally{}}}var Ca=Ef(!0),kf=Ef(!1),ur=_(null),Ar=null;function ms(e){var t=e.alternate;H(yt,yt.current&1),H(ur,e),Ar===null&&(t===null||ba.current!==null||t.memoizedState!==null)&&(Ar=e)}function Af(e){if(e.tag===22){if(H(yt,yt.current),H(ur,e),Ar===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Ar=e)}}else hs()}function hs(){H(yt,yt.current),H(ur,ur.current)}function $r(e){Z(ur),Ar===e&&(Ar=null),Z(yt)}var yt=_(0);function ql(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==="$?"||Uc(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 Ki(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:v({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Yi={enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Qt(),c=us(n);c.payload=t,r!=null&&(c.callback=r),t=ds(e,c,n),t!==null&&(Zt(t,e,n),hn(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Qt(),c=us(n);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=ds(e,c,n),t!==null&&(Zt(t,e,n),hn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Qt(),n=us(r);n.tag=2,t!=null&&(n.callback=t),t=ds(e,n,r),t!==null&&(Zt(t,e,r),hn(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?!sn(r,n)||!sn(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=v({},r));for(var c in e)r[c]===void 0&&(r[c]=e[c])}return r}var Vl=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){Vl(e)}function Of(e){console.error(e)}function Df(e){Vl(e)}function Fl(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function zf(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(){Fl(e,t)},r}function Lf(e){return e=us(e),e.tag=3,e}function Uf(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(){zf(t,r,n)}}var y=r.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){zf(t,r,n),typeof c!="function"&&(bs===null?bs=new Set([this]):bs.add(this));var w=n.stack;this.componentDidCatch(n.value,{componentStack:w!==null?w:""})})}function N0(e,t,r,n,c){if(r.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=r.alternate,t!==null&&cn(t,r,c,!0),r=ur.current,r!==null){switch(r.tag){case 13:return Ar===null?vc():r.alternate===null&&it===0&&(it=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(Fe)return t=ur.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==xi&&(e=Error(i(422),{cause:n}),on(lr(e,r)))):(n!==xi&&(t=Error(i(423),{cause:n}),on(lr(t,r))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=lr(n,r),c=Xi(e.stateNode,n,c),ki(e,c),it!==4&&(it=2)),!1;var f=Error(i(520),{cause:n});if(f=lr(f,r),Tn===null?Tn=[f]:Tn.push(f),it!==4&&(it=2),t===null)return!0;n=lr(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),Uf(c,e,r,n),ki(r,c),!1}r=r.return}while(r!==null);return!1}var Pf=Error(i(461)),bt=!1;function St(e,t,r,n){t.child=e===null?kf(t,null,r,n):Ca(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 w in n)w!=="ref"&&(y[w]=n[w])}else y=n;return Fs(t),n=Oi(e,t,r,y,f,c),w=Di(),e!==null&&!bt?(zi(e,t,c),Kr(e,t,c)):(Fe&&w&&pi(t),t.flags|=1,St(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=wl(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:sn,r(y,n)&&e.ref===t.ref)return Kr(e,t,c)}return t.flags|=1,e=Br(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(sn(f,n)&&e.ref===t.ref)if(bt=!1,t.pendingProps=n=f,sc(e,c))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,Kr(e,t,c)}return Ji(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&&kl(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?(kl(t,f.cachePool),Hd(t,f),hs(),t.memoizedState=null):(e!==null&&kl(t,null),Ti(),hs());return St(e,t,c,r),t.child}function Vf(e,t,r,n){var c=Ni();return c=c===null?null:{parent:xt._currentValue,pool:c},t.memoizedState={baseLanes:r,cachePool:c},e!==null&&kl(t,null),Ti(),Af(t),e!==null&&cn(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 Ji(e,t,r,n,c){return Fs(t),r=Oi(e,t,r,n,void 0,c),n=Di(),e!==null&&!bt?(zi(e,t,c),Kr(e,t,c)):(Fe&&n&&pi(t),t.flags|=1,St(e,t,r,c),t.child)}function Ff(e,t,r,n,c,f){return Fs(t),t.updateQueue=null,r=qd(t,n,r,c),Bd(e),n=Di(),e!==null&&!bt?(zi(e,t,f),Kr(e,t,f)):(Fe&&n&&pi(t),t.flags|=1,St(e,t,r,f),t.child)}function Gf(e,t,r,n,c){if(Fs(t),t.stateNode===null){var f=pa,y=r.contextType;typeof y=="object"&&y!==null&&(f=Mt(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?Mt(y):pa,f.state=t.memoizedState,y=r.getDerivedStateFromProps,typeof y=="function"&&(Ki(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),gn(t,n,f,c),pn(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){f=t.stateNode;var w=t.memoizedProps,D=$s(r,w);f.props=D;var I=f.context,ne=r.contextType;y=pa,typeof ne=="object"&&ne!==null&&(y=Mt(ne));var ce=r.getDerivedStateFromProps;ne=typeof ce=="function"||typeof f.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ne||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(w||I!==y)&&Rf(t,f,n,y),cs=!1;var X=t.memoizedState;f.state=X,gn(t,n,f,c),pn(),I=t.memoizedState,w||X!==I||cs?(typeof ce=="function"&&(Ki(t,r,ce,n),I=t.memoizedState),(D=cs||Tf(t,r,D,n,X,I,y))?(ne||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=I),f.props=n,f.state=I,f.context=y,n=D):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{f=t.stateNode,Ei(e,t),y=t.memoizedProps,ne=$s(r,y),f.props=ne,ce=t.pendingProps,X=f.context,I=r.contextType,D=pa,typeof I=="object"&&I!==null&&(D=Mt(I)),w=r.getDerivedStateFromProps,(I=typeof w=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==ce||X!==D)&&Rf(t,f,n,D),cs=!1,X=t.memoizedState,f.state=X,gn(t,n,f,c),pn();var Q=t.memoizedState;y!==ce||X!==Q||cs||e!==null&&e.dependencies!==null&&Cl(e.dependencies)?(typeof w=="function"&&(Ki(t,r,w,n),Q=t.memoizedState),(ne=cs||Tf(t,r,ne,n,X,Q,D)||e!==null&&e.dependencies!==null&&Cl(e.dependencies))?(I||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(n,Q,D),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(n,Q,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=Q),f.props=n,f.state=Q,f.context=D,n=ne):(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=Ca(t,e.child,null,c),t.child=Ca(t,null,r,c)):St(e,t,r,c),t.memoizedState=f.state,e=t.child):e=Kr(e,t,c),e}function If(e,t,r,n){return ln(),t.flags|=256,St(e,t,r,n),t.child}var Qi={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|=dr),e}function $f(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:(yt.current&2)!==0),y&&(c=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Fe){if(c?ms(t):hs(),Fe){var w=ot,D;if(D=w){e:{for(D=w,w=kr;D.nodeType!==8;){if(!w){w=null;break e}if(D=br(D.nextSibling),D===null){w=null;break e}}w=D}w!==null?(t.memoizedState={dehydrated:w,treeContext:_s!==null?{id:qr,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},D=Kt(18,null,null,0),D.stateNode=w,D.return=t,t.child=D,Ut=t,ot=null,D=!0):D=!1}D||qs(t)}if(w=t.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return Uc(w)?t.lanes=32:t.lanes=536870912,null;$r(t)}return w=n.children,n=n.fallback,c?(hs(),c=t.mode,w=Il({mode:"hidden",children:w},c),n=Ps(n,c,r,null),w.return=t,n.return=t,w.sibling=n,t.child=w,c=t.child,c.memoizedState=Zi(r),c.childLanes=Wi(e,y,r),t.memoizedState=Qi,n):(ms(t),ec(t,w))}if(D=e.memoizedState,D!==null&&(w=D.dehydrated,w!==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,w=t.mode,n=Il({mode:"visible",children:n.children},w),c=Ps(c,w,r,null),c.flags|=2,n.return=t,c.return=t,n.sibling=c,t.child=n,Ca(t,e.child,null,r),n=t.child,n.memoizedState=Zi(r),n.childLanes=Wi(e,y,r),t.memoizedState=Qi,t=c);else if(ms(t),Uc(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var I=y.dgst;y=I,n=Error(i(419)),n.stack="",n.digest=y,on({value:n,source:null,stack:null}),t=tc(e,t,r)}else if(bt||cn(e,t,r,!1),y=(r&e.childLanes)!==0,bt||y){if(y=We,y!==null&&(n=r&-r,n=(n&42)!==0?1:ae(n),n=(n&(y.suspendedLanes|r))!==0?0:n,n!==0&&n!==D.retryLane))throw D.retryLane=n,ha(e,n),Zt(y,e,n),Pf;w.data==="$?"||vc(),t=tc(e,t,r)}else w.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,ot=br(w.nextSibling),Ut=t,Fe=!0,Bs=null,kr=!1,e!==null&&(ir[cr++]=qr,ir[cr++]=Vr,ir[cr++]=_s,qr=e.id,Vr=e.overflow,_s=t),t=ec(t,n.children),t.flags|=4096);return t}return c?(hs(),c=n.fallback,w=t.mode,D=e.child,I=D.sibling,n=Br(D,{mode:"hidden",children:n.children}),n.subtreeFlags=D.subtreeFlags&65011712,I!==null?c=Br(I,c):(c=Ps(c,w,r,null),c.flags|=2),c.return=t,n.return=t,n.sibling=c,t.child=n,n=c,c=t.child,w=e.child.memoizedState,w===null?w=Zi(r):(D=w.cachePool,D!==null?(I=xt._currentValue,D=D.parent!==I?{parent:I,pool:I}:D):D=Md(),w={baseLanes:w.baseLanes|r,cachePool:D}),c.memoizedState=w,c.childLanes=Wi(e,y,r),t.memoizedState=Qi,n):(ms(t),r=e.child,e=r.sibling,r=Br(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=Il({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Il(e,t){return e=Kt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function tc(e,t,r){return Ca(t,e.child,null,r),e=ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Kf(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(St(e,t,n.children,r),n=yt.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&&Kf(e,r,t);else if(e.tag===19)Kf(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(yt,n),c){case"forwards":for(r=t.child,c=null;r!==null;)e=r.alternate,e!==null&&ql(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&&ql(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 Kr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),vs|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(cn(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=Br(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Br(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&&Cl(e)))}function S0(e,t,r){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),is(t,xt,e.memoizedState.cache),ln();break;case 27:case 5:Se(t);break;case 4:de(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?$f(e,t,r):(ms(t),e=Kr(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||(cn(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(yt,yt.current),n)break;return null;case 22:case 23:return t.lanes=0,qf(e,t,r);case 24:is(t,xt,e.memoizedState.cache)}return Kr(e,t,r)}function Xf(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!sc(e,r)&&(t.flags&128)===0)return bt=!1,S0(e,t,r);bt=(e.flags&131072)!==0}else bt=!1,Fe&&(t.flags&1048576)!==0&&Sd(t,Sl,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=Gf(null,t,n,e,r)):(t.tag=0,t=Ji(null,t,n,e,r));else{if(n!=null){if(c=n.$$typeof,c===V){t.tag=11,t=_f(null,t,n,e,r);break e}else if(c===re){t.tag=14,t=Hf(null,t,n,e,r);break e}}throw t=K(n)||n,Error(i(306,t,""))}}return t;case 0:return Ji(e,t,t.type,t.pendingProps,r);case 1:return n=t.type,c=$s(n,t.pendingProps),Gf(e,t,n,c,r);case 3:e:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));n=t.pendingProps;var f=t.memoizedState;c=f.element,Ei(e,t),gn(t,n,null,r);var y=t.memoizedState;if(n=y.cache,is(t,xt,n),n!==f.cache&&bi(t,[xt],r,!0),pn(),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=If(e,t,n,r);break e}else if(n!==c){c=lr(Error(i(424)),t),on(c),t=If(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(ot=br(e.firstChild),Ut=t,Fe=!0,Bs=null,kr=!0,r=kf(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ln(),n===c){t=Kr(e,t,r);break e}St(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:Fe||(r=t.type,e=t.pendingProps,n=no(ee.current).createElement(r),n[Ze]=t,n[rt]=e,Et(n,r,e),ke(n),t.stateNode=n):t.memoizedState=Wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&Fe&&(n=t.stateNode=Jm(t.type,t.pendingProps,ee.current),Ut=t,kr=!0,c=ot,Ns(t.type)?(Pc=c,ot=br(n.firstChild)):ot=c),St(e,t,t.pendingProps.children,r),Gl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fe&&((c=n=ot)&&(n=Z0(n,t.type,t.pendingProps,kr),n!==null?(t.stateNode=n,Ut=t,ot=br(n.firstChild),kr=!1,c=!0):c=!1),c||qs(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,g0,null,null,r),_n._currentValue=c),Gl(e,t),St(e,t,n,r),t.child;case 6:return e===null&&Fe&&((e=r=ot)&&(r=W0(r,t.pendingProps,kr),r!==null?(t.stateNode=r,Ut=t,ot=null,e=!0):e=!1),e||qs(t)),null;case 13:return $f(e,t,r);case 4:return de(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ca(t,null,n,r):St(e,t,n,r),t.child;case 11:return _f(e,t,t.type,t.pendingProps,r);case 7:return St(e,t,t.pendingProps,r),t.child;case 8:return St(e,t,t.pendingProps.children,r),t.child;case 12:return St(e,t,t.pendingProps.children,r),t.child;case 10:return n=t.pendingProps,is(t,t.type,n.value),St(e,t,n.children,r),t.child;case 9:return c=t.type._context,n=t.pendingProps.children,Fs(t),c=Mt(c),n=n(c),t.flags|=1,St(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=Il(n,r),r.ref=t.ref,t.child=r,r.return=t,t=r):(r=Br(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 Fs(t),n=Mt(xt),e===null?(c=Ni(),c===null&&(c=We,f=ji(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=r),c=f),t.memoizedState={parent:n,cache:c},Ci(t),is(t,xt,c)):((e.lanes&r)!==0&&(Ei(e,t),gn(t,null,null,r),pn()),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,xt,n)):(n=f.cache,is(t,xt,n),n!==c.cache&&bi(t,[xt],r,!0))),St(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Yr(e){e.flags|=4}function Jf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t)){if(t=ur.current,t!==null&&((Be&4194048)===Be?Ar!==null:(Be&62914560)!==Be&&(Be&536870912)===0||t!==Ar))throw mn=Si,Od;e.flags|=8192}}function $l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pr():536870912,e.lanes|=t,Ta|=t)}function Nn(e,t){if(!Fe)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 C0(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),Gr(xt),we(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(nn(t)?Yr(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?(Yr(t),r!==null?(st(t),Jf(t,r)):(st(t),t.flags&=-16777217)):r?r!==e.memoizedState?(Yr(t),st(t),Jf(t,r)):(st(t),t.flags&=-16777217):(e.memoizedProps!==n&&Yr(t),st(t),t.flags&=-16777217),null;case 27:be(t),r=ee.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Yr(t);else{if(!n){if(t.stateNode===null)throw Error(i(166));return st(t),null}e=$.current,nn(t)?Cd(t):(e=Jm(c,n,r),t.stateNode=e,Yr(t))}return st(t),null;case 5:if(be(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Yr(t);else{if(!n){if(t.stateNode===null)throw Error(i(166));return st(t),null}if(e=$.current,nn(t))Cd(t);else{switch(c=no(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[Ze]=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(Et(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&&Yr(t)}}return st(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Yr(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(i(166));if(e=ee.current,nn(t)){if(e=t.stateNode,r=t.memoizedProps,n=null,c=Ut,c!==null)switch(c.tag){case 27:case 5:n=c.memoizedProps}e[Ze]=t,e=!!(e.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||Fm(e.nodeValue,r)),e||qs(t)}else e=no(e).createTextNode(n),e[Ze]=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=nn(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[Ze]=t}else ln(),(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?($r(t),t):($r(t),null)}if($r(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 we(),e===null&&Ac(t.stateNode.containerInfo),st(t),null;case 10:return Gr(t.type),st(t),null;case 19:if(Z(yt),c=t.memoizedState,c===null)return st(t),null;if(n=(t.flags&128)!==0,f=c.rendering,f===null)if(n)Nn(c,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ql(e),f!==null){for(t.flags|=128,Nn(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(yt,yt.current&1|2),t.child}e=e.sibling}c.tail!==null&&Ue()>Xl&&(t.flags|=128,n=!0,Nn(c,!1),t.lanes=4194304)}else{if(!n)if(e=ql(f),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,$l(t,e),Nn(c,!0),c.tail===null&&c.tailMode==="hidden"&&!f.alternate&&!Fe)return st(t),null}else 2*Ue()-c.renderingStartTime>Xl&&r!==536870912&&(t.flags|=128,n=!0,Nn(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=Ue(),t.sibling=null,e=yt.current,H(yt,n?e&1|2:e&1),t):(st(t),null);case 22:case 23:return $r(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),Gr(xt),st(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function E0(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 Gr(xt),we(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 13:if($r(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Z(yt),null;case 4:return we(),null;case 10:return Gr(t.type),null;case 22:case 23:return $r(t),Ri(),e!==null&&Z(Gs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gr(xt),null;case 25:return null;default:return null}}function Qf(e,t){switch(gi(t),t.tag){case 3:Gr(xt),we();break;case 26:case 27:case 5:be(t);break;case 4:we();break;case 13:$r(t);break;case 19:Z(yt);break;case 10:Gr(t.type);break;case 22:case 23:$r(t),Ri(),e!==null&&Z(Gs);break;case 24:Gr(xt)}}function Sn(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(w){Qe(t,t.return,w)}}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,w=y.destroy;if(w!==void 0){y.destroy=void 0,c=t;var D=r,I=w;try{I()}catch(ne){Qe(c,D,ne)}}}n=n.next}while(n!==f)}}catch(ne){Qe(t,t.return,ne)}}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 Cn(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 Tr(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=ao));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]);Et(t,n,r),t[Ze]=e,t[rt]=r}catch(f){Qe(e,e.return,f)}}var Xr=!1,dt=!1,oc=!1,sm=typeof WeakSet=="function"?WeakSet:Set,jt=null;function k0(e,t){if(e=e.containerInfo,Mc=fo,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,w=-1,D=-1,I=0,ne=0,ce=e,X=null;t:for(;;){for(var Q;ce!==r||c!==0&&ce.nodeType!==3||(w=y+c),ce!==f||n!==0&&ce.nodeType!==3||(D=y+n),ce.nodeType===3&&(y+=ce.nodeValue.length),(Q=ce.firstChild)!==null;)X=ce,ce=Q;for(;;){if(ce===e)break t;if(X===r&&++I===c&&(w=y),X===f&&++ne===n&&(D=y),(Q=ce.nextSibling)!==null)break;ce=X,X=ce.parentNode}ce=Q}r=w===-1||D===-1?null:{start:w,end:D}}else r=null}r=r||{start:0,end:0}}else r=null;for(Oc={focusedElem:e,selectionRange:r},fo=!1,jt=t;jt!==null;)if(t=jt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,jt=e;else for(;jt!==null;){switch(t=jt,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,jt=e;break}jt=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&&Sn(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&&Cn(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&&Cn(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=U0.bind(null,r),ex(e,r))));break;case 22:if(n=r.memoizedState!==null||Xr,!n){t=t!==null&&t.memoizedState!==null||dt,c=Xr;var f=dt;Xr=n,(dt=t)&&!f?xs(e,r,(r.subtreeFlags&8772)!==0):gs(e,r),Xr=c,dt=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&>(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 et=null,qt=!1;function Jr(e,t,r){for(r=r.child;r!==null;)lm(e,t,r),r=r.sibling}function lm(e,t,r){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(rr,r)}catch{}switch(r.tag){case 26:dt||Tr(r,t),Jr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:dt||Tr(r,t);var n=et,c=qt;Ns(r.type)&&(et=r.stateNode,qt=!1),Jr(e,t,r),zn(r.stateNode),et=n,qt=c;break;case 5:dt||Tr(r,t);case 6:if(n=et,c=qt,et=null,Jr(e,t,r),et=n,qt=c,et!==null)if(qt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(r.stateNode)}catch(f){Qe(r,t,f)}else try{et.removeChild(r.stateNode)}catch(f){Qe(r,t,f)}break;case 18:et!==null&&(qt?(e=et,Ym(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Vn(e)):Ym(et,r.stateNode));break;case 4:n=et,c=qt,et=r.stateNode.containerInfo,qt=!0,Jr(e,t,r),et=n,qt=c;break;case 0:case 11:case 14:case 15:dt||ps(2,r,t),dt||ps(4,r,t),Jr(e,t,r);break;case 1:dt||(Tr(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"&&Wf(r,t,n)),Jr(e,t,r);break;case 21:Jr(e,t,r);break;case 22:dt=(n=dt)||r.memoizedState!==null,Jr(e,t,r),dt=n;break;default:Jr(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{Vn(e)}catch(r){Qe(t,t.return,r)}}function A0(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=A0(e);t.forEach(function(n){var c=P0.bind(null,e,n);r.has(n)||(r.add(n),n.then(c,c))})}function Yt(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,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(Ns(w.type)){et=w.stateNode,qt=!1;break e}break;case 5:et=w.stateNode,qt=!1;break e;case 3:case 4:et=w.stateNode.containerInfo,qt=!0;break e}w=w.return}if(et===null)throw Error(i(160));lm(f,y,c),et=null,qt=!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 vr=null;function im(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Yt(t,e),Xt(e),n&4&&(ps(3,e,e.return),Sn(3,e),ps(5,e,e.return));break;case 1:Yt(t,e),Xt(e),n&512&&(dt||r===null||Tr(r,r.return)),n&64&&Xr&&(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=vr;if(Yt(t,e),Xt(e),n&512&&(dt||r===null||Tr(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[_t]||f[Ze]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(n),c.head.insertBefore(f,c.querySelector("head > title"))),Et(f,n,r),f[Ze]=e,ke(f),n=f;break e;case"link":var y=rh("link","href",c).get(n+(r.href||""));if(y){for(var w=0;w<y.length;w++)if(f=y[w],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(w,1);break t}}f=c.createElement(n),Et(f,n,r),c.head.appendChild(f);break;case"meta":if(y=rh("meta","content",c).get(n+(r.content||""))){for(w=0;w<y.length;w++)if(f=y[w],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(w,1);break t}}f=c.createElement(n),Et(f,n,r),c.head.appendChild(f);break;default:throw Error(i(468,n))}f[Ze]=e,ke(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:Yt(t,e),Xt(e),n&512&&(dt||r===null||Tr(r,r.return)),r!==null&&n&4&&ac(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Yt(t,e),Xt(e),n&512&&(dt||r===null||Tr(r,r.return)),e.flags&32){c=e.stateNode;try{oa(c,"")}catch(Q){Qe(e,e.return,Q)}}n&4&&e.stateNode!=null&&(c=e.memoizedProps,ac(e,c,r!==null?r.memoizedProps:c)),n&1024&&(oc=!0);break;case 6:if(Yt(t,e),Xt(e),n&4){if(e.stateNode===null)throw Error(i(162));n=e.memoizedProps,r=e.stateNode;try{r.nodeValue=n}catch(Q){Qe(e,e.return,Q)}}break;case 3:if(io=null,c=vr,vr=lo(t.containerInfo),Yt(t,e),vr=c,Xt(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Vn(t.containerInfo)}catch(Q){Qe(e,e.return,Q)}oc&&(oc=!1,cm(e));break;case 4:n=vr,vr=lo(e.stateNode.containerInfo),Yt(t,e),Xt(e),vr=n;break;case 12:Yt(t,e),Xt(e);break;case 13:Yt(t,e),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hc=Ue()),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,I=Xr,ne=dt;if(Xr=I||c,dt=ne||D,Yt(t,e),dt=ne,Xr=I,Xt(e),n&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(r===null||D||Xr||dt||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{w=D.stateNode;var ce=D.memoizedProps.style,X=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;w.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Q){Qe(D,D.return,Q)}}}else if(t.tag===6){if(r===null){D=t;try{D.stateNode.nodeValue=c?"":D.memoizedProps}catch(Q){Qe(D,D.return,Q)}}}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:Yt(t,e),Xt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ic(e,n)));break;case 30:break;case 21:break;default:Yt(t,e),Xt(e)}}function Xt(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&&(oa(y,""),r.flags&=-33);var w=nc(e);Kl(e,w,y);break;case 3:case 4:var D=r.stateNode.containerInfo,I=nc(e);lc(e,I,D);break;default:throw Error(i(161))}}catch(ne){Qe(e,e.return,ne)}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:Tr(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&Wf(t,t.return,r),Ks(t);break;case 27:zn(t.stateNode);case 26:case 5:Tr(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),Sn(4,f);break;case 1:if(xs(c,f,r),n=f,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(I){Qe(n,n.return,I)}if(n=f,c=n.updateQueue,c!==null){var w=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],w)}catch(I){Qe(n,n.return,I)}}r&&y&64&&Zf(f),Cn(f,f.return);break;case 27:rm(f);case 26:case 5:xs(c,f,r),r&&n===null&&y&4&&em(f),Cn(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),Cn(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&&un(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&&un(e))}function Rr(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:Rr(e,t,r,n),c&2048&&Sn(9,t);break;case 1:Rr(e,t,r,n);break;case 3:Rr(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&&un(e)));break;case 12:if(c&2048){Rr(e,t,r,n),e=t.stateNode;try{var f=t.memoizedProps,y=f.id,w=f.onPostCommit;typeof w=="function"&&w(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Qe(t,t.return,D)}}else Rr(e,t,r,n);break;case 13:Rr(e,t,r,n);break;case 23:break;case 22:f=t.stateNode,y=t.alternate,t.memoizedState!==null?f._visibility&2?Rr(e,t,r,n):En(e,t):f._visibility&2?Rr(e,t,r,n):(f._visibility|=2,Ea(e,t,r,n,(t.subtreeFlags&10256)!==0)),c&2048&&cc(y,t);break;case 24:Rr(e,t,r,n),c&2048&&uc(t.alternate,t);break;default:Rr(e,t,r,n)}}function Ea(e,t,r,n,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var f=e,y=t,w=r,D=n,I=y.flags;switch(y.tag){case 0:case 11:case 15:Ea(f,y,w,D,c),Sn(8,y);break;case 23:break;case 22:var ne=y.stateNode;y.memoizedState!==null?ne._visibility&2?Ea(f,y,w,D,c):En(f,y):(ne._visibility|=2,Ea(f,y,w,D,c)),c&&I&2048&&cc(y.alternate,y);break;case 24:Ea(f,y,w,D,c),c&&I&2048&&uc(y.alternate,y);break;default:Ea(f,y,w,D,c)}t=t.sibling}}function En(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:En(r,n),c&2048&&cc(n.alternate,n);break;case 24:En(r,n),c&2048&&uc(n.alternate,n);break;default:En(r,n)}t=t.sibling}}var kn=8192;function ka(e){if(e.subtreeFlags&kn)for(e=e.child;e!==null;)dm(e),e=e.sibling}function dm(e){switch(e.tag){case 26:ka(e),e.flags&kn&&e.memoizedState!==null&&mx(vr,e.memoizedState,e.memoizedProps);break;case 5:ka(e);break;case 3:case 4:var t=vr;vr=lo(e.stateNode.containerInfo),ka(e),vr=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=kn,kn=16777216,ka(e),kn=t):ka(e));break;default:ka(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 An(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];jt=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:An(e),e.flags&2048&&ps(9,e,e.return);break;case 3:An(e);break;case 12:An(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yl(e)):An(e);break;default:An(e)}}function Yl(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];jt=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),Yl(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,Yl(t));break;default:Yl(t)}e=e.sibling}}function hm(e,t){for(;jt!==null;){var r=jt;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:un(r.memoizedState.cache)}if(n=r.child,n!==null)n.return=r,jt=n;else e:for(r=e;jt!==null;){n=jt;var c=n.sibling,f=n.return;if(nm(n),n===r){jt=null;break e}if(c!==null){c.return=f,jt=c;break e}jt=f}}}var T0={getCacheForType:function(e){var t=Mt(xt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r}},R0=typeof WeakMap=="function"?WeakMap:Map,Ie=0,We=null,_e=null,Be=0,$e=0,Jt=null,ys=!1,Aa=!1,dc=!1,Qr=0,it=0,vs=0,Ys=0,fc=0,dr=0,Ta=0,Tn=null,Vt=null,mc=!1,hc=0,Xl=1/0,Jl=null,bs=null,Ct=0,js=null,Ra=null,Ma=0,pc=0,gc=null,pm=null,Rn=0,xc=null;function Qt(){if((Ie&2)!==0&&Be!==0)return Be&-Be;if(j.T!==null){var e=ya;return e!==0?e:Sc()}return Gt()}function gm(){dr===0&&(dr=(Be&536870912)===0||Fe?Ms():536870912);var e=ur.current;return e!==null&&(e.flags|=32),dr}function Zt(e,t,r){(e===We&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(Oa(e,0),ws(e,Be,dr,!1)),Cr(e,r),((Ie&2)===0||e!==We)&&(e===We&&((Ie&2)===0&&(Ys|=r),it===4&&ws(e,Be,dr,!1)),Mr(e))}function xm(e,t,r){if((Ie&6)!==0)throw Error(i(327));var n=!r&&(t&124)===0&&(t&e.expiredLanes)===0||Nr(e,t),c=n?D0(e,t):bc(e,t,!0),f=n;do{if(c===0){Aa&&!n&&ws(e,t,0,!1);break}else{if(r=e.current.alternate,f&&!M0(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 w=e;c=Tn;var D=w.current.memoizedState.isDehydrated;if(D&&(Oa(w,y).flags|=256),y=bc(w,y,!1),y!==2){if(dc&&!D){w.errorRecoveryDisabledLanes|=f,Ys|=f,c=4;break e}f=Vt,Vt=c,f!==null&&(Vt===null?Vt=f:Vt.push.apply(Vt,f))}c=y}if(f=!1,c!==2)continue}}if(c===1){Oa(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,dr,!ys);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=hc+300-Ue(),10<c)){if(ws(n,t,dr,!ys),gr(n,0,!0)!==0)break e;n.timeoutHandle=$m(ym.bind(null,n,r,Vt,Jl,mc,t,dr,Ys,Ta,ys,f,2,-0,0),c);break e}ym(n,r,Vt,Jl,mc,t,dr,Ys,Ta,ys,f,0,-0,0)}}break}while(!0);Mr(e)}function ym(e,t,r,n,c,f,y,w,D,I,ne,ce,X,Q){if(e.timeoutHandle=-1,ce=t.subtreeFlags,(ce&8192||(ce&16785408)===16785408)&&(Pn={stylesheets:null,count:0,unsuspend:fx},dm(t),ce=hx(),ce!==null)){e.cancelPendingCommit=ce(Cm.bind(null,e,t,f,r,n,c,y,w,D,ne,1,X,Q)),ws(e,f,y,!I);return}Cm(e,t,f,r,n,c,y,w,D)}function M0(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(!$t(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&=~Ys,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var f=31-pt(c),y=1<<f;n[f]=-1,c&=~y}r!==0&&Os(e,r,t)}function Ql(){return(Ie&6)===0?(Mn(0),!1):!0}function yc(){if(_e!==null){if($e===0)var e=_e.return;else e=_e,Fr=Vs=null,Li(e),Sa=null,jn=0,e=_e;for(;e!==null;)Qf(e.alternate,e),e=e.return;_e=null}}function Oa(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,X0(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),yc(),We=e,_e=r=Br(e.current,null),Be=t,$e=0,Jt=null,ys=!1,Aa=Nr(e,t),dc=!1,Ta=dr=fc=Ys=vs=it=0,Vt=Tn=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-pt(n),f=1<<c;t|=e[c],n&=~f}return Qr=t,vl(),r}function vm(e,t){De=null,j.H=_l,t===fn||t===Al?(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,Jt=t,_e===null&&(it=1,Fl(e,lr(t,e.current)))}function bm(){var e=j.H;return j.H=_l,e===null?_l:e}function jm(){var e=j.A;return j.A=T0,e}function vc(){it=4,ys||(Be&4194048)!==Be&&ur.current!==null||(Aa=!0),(vs&134217727)===0&&(Ys&134217727)===0||We===null||ws(We,Be,dr,!1)}function bc(e,t,r){var n=Ie;Ie|=2;var c=bm(),f=jm();(We!==e||Be!==t)&&(Jl=null,Oa(e,t)),t=!1;var y=it;e:do try{if($e!==0&&_e!==null){var w=_e,D=Jt;switch($e){case 8:yc(),y=6;break e;case 3:case 2:case 9:case 6:ur.current===null&&(t=!0);var I=$e;if($e=0,Jt=null,Da(e,w,D,I),r&&Aa){y=0;break e}break;default:I=$e,$e=0,Jt=null,Da(e,w,D,I)}}O0(),y=it;break}catch(ne){vm(e,ne)}while(!0);return t&&e.shellSuspendCounter++,Fr=Vs=null,Ie=n,j.H=c,j.A=f,_e===null&&(We=null,Be=0,vl()),y}function O0(){for(;_e!==null;)wm(_e)}function D0(e,t){var r=Ie;Ie|=2;var n=bm(),c=jm();We!==e||Be!==t?(Jl=null,Xl=Ue()+500,Oa(e,t)):Aa=Nr(e,t);e:do try{if($e!==0&&_e!==null){t=_e;var f=Jt;t:switch($e){case 1:$e=0,Jt=null,Da(e,t,f,1);break;case 2:case 9:if(Dd(f)){$e=0,Jt=null,Nm(t);break}t=function(){$e!==2&&$e!==9||We!==e||($e=7),Mr(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,Jt=null,Nm(t)):($e=0,Jt=null,Da(e,t,f,7));break;case 5:var y=null;switch(_e.tag){case 26:y=_e.memoizedState;case 5:case 27:var w=_e;if(!y||ah(y)){$e=0,Jt=null;var D=w.sibling;if(D!==null)_e=D;else{var I=w.return;I!==null?(_e=I,Zl(I)):_e=null}break t}}$e=0,Jt=null,Da(e,t,f,5);break;case 6:$e=0,Jt=null,Da(e,t,f,6);break;case 8:yc(),it=6;break e;default:throw Error(i(462))}}z0();break}catch(ne){vm(e,ne)}while(!0);return Fr=Vs=null,j.H=n,j.A=c,Ie=r,_e!==null?0:(We=null,Be=0,vl(),it)}function z0(){for(;_e!==null&&!nt();)wm(_e)}function wm(e){var t=Xf(e.alternate,e,Qr);e.memoizedProps=e.pendingProps,t===null?Zl(e):_e=t}function Nm(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Ff(r,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=Ff(r,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:Li(t);default:Qf(r,t),t=_e=Nd(t,Qr),t=Xf(r,t,Qr)}e.memoizedProps=e.pendingProps,t===null?Zl(e):_e=t}function Da(e,t,r,n){Fr=Vs=null,Li(t),Sa=null,jn=0;var c=t.return;try{if(N0(e,c,t,r,Be)){it=1,Fl(e,lr(r,e.current)),_e=null;return}}catch(f){if(c!==null)throw _e=c,f;it=1,Fl(e,lr(r,e.current)),_e=null;return}t.flags&32768?(Fe||n===1?e=!0:Aa||(Be&536870912)!==0?e=!1:(ys=e=!0,(n===2||n===9||n===3||n===6)&&(n=ur.current,n!==null&&n.tag===13&&(n.flags|=16384))),Sm(t,e)):Zl(t)}function Zl(e){var t=e;do{if((t.flags&32768)!==0){Sm(t,ys);return}e=t.return;var r=C0(t.alternate,t,Qr);if(r!==null){_e=r;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);it===0&&(it=5)}function Sm(e,t){do{var r=E0(e.alternate,e);if(r!==null){r.flags&=32767,_e=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=r}while(e!==null);it=6,_e=null}function Cm(e,t,r,n,c,f,y,w,D){e.cancelPendingCommit=null;do Wl();while(Ct!==0);if((Ie&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,sa(e,r,f,y,w,D),e===We&&(_e=We=null,Be=0),Ra=t,js=e,Ma=r,pc=f,gc=c,pm=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_0(er,function(){return Rm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=j.T,j.T=null,c=k.p,k.p=2,y=Ie,Ie|=4;try{k0(e,t,r)}finally{Ie=y,k.p=c,j.T=n}}Ct=1,Em(),km(),Am()}}function Em(){if(Ct===1){Ct=0;var e=js,t=Ra,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=j.T,j.T=null;var n=k.p;k.p=2;var c=Ie;Ie|=4;try{im(t,e);var f=Oc,y=md(e.containerInfo),w=f.focusedElem,D=f.selectionRange;if(y!==w&&w&&w.ownerDocument&&fd(w.ownerDocument.documentElement,w)){if(D!==null&&ni(w)){var I=D.start,ne=D.end;if(ne===void 0&&(ne=I),"selectionStart"in w)w.selectionStart=I,w.selectionEnd=Math.min(ne,w.value.length);else{var ce=w.ownerDocument||document,X=ce&&ce.defaultView||window;if(X.getSelection){var Q=X.getSelection(),Ee=w.textContent.length,Ne=Math.min(D.start,Ee),Xe=D.end===void 0?Ne:Math.min(D.end,Ee);!Q.extend&&Ne>Xe&&(y=Xe,Xe=Ne,Ne=y);var q=dd(w,Ne),P=dd(w,Xe);if(q&&P&&(Q.rangeCount!==1||Q.anchorNode!==q.node||Q.anchorOffset!==q.offset||Q.focusNode!==P.node||Q.focusOffset!==P.offset)){var G=ce.createRange();G.setStart(q.node,q.offset),Q.removeAllRanges(),Ne>Xe?(Q.addRange(G),Q.extend(P.node,P.offset)):(G.setEnd(P.node,P.offset),Q.addRange(G))}}}}for(ce=[],Q=w;Q=Q.parentNode;)Q.nodeType===1&&ce.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ce.length;w++){var oe=ce[w];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}fo=!!Mc,Oc=Mc=null}finally{Ie=c,k.p=n,j.T=r}}e.current=t,Ct=2}}function km(){if(Ct===2){Ct=0;var e=js,t=Ra,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=j.T,j.T=null;var n=k.p;k.p=2;var c=Ie;Ie|=4;try{am(e,t.alternate,t)}finally{Ie=c,k.p=n,j.T=r}}Ct=3}}function Am(){if(Ct===4||Ct===3){Ct=0,kt();var e=js,t=Ra,r=Ma,n=pm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ct=5:(Ct=0,Ra=js=null,Tm(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(bs=null),he(r),t=t.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(rr,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=j.T,c=k.p,k.p=2,j.T=null;try{for(var f=e.onRecoverableError,y=0;y<n.length;y++){var w=n[y];f(w.value,{componentStack:w.stack})}}finally{j.T=t,k.p=c}}(Ma&3)!==0&&Wl(),Mr(e),c=e.pendingLanes,(r&4194090)!==0&&(c&42)!==0?e===xc?Rn++:(Rn=0,xc=e):Rn=0,Mn(0)}}function Tm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,un(t)))}function Wl(e){return Em(),km(),Am(),Rm()}function Rm(){if(Ct!==5)return!1;var e=js,t=pc;pc=0;var r=he(Ma),n=j.T,c=k.p;try{k.p=32>r?32:r,j.T=null,r=gc,gc=null;var f=js,y=Ma;if(Ct=0,Ra=js=null,Ma=0,(Ie&6)!==0)throw Error(i(331));var w=Ie;if(Ie|=4,mm(f.current),um(f,f.current,y,r),Ie=w,Mn(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(rr,f)}catch{}return!0}finally{k.p=c,j.T=n,Tm(e,t)}}function Mm(e,t,r){t=lr(r,t),t=Xi(e.stateNode,t,2),e=ds(e,t,2),e!==null&&(Cr(e,2),Mr(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=lr(r,e),r=Lf(2),n=ds(t,r,2),n!==null&&(Uf(r,n,t,e),Cr(n,2),Mr(n));break}}t=t.return}}function jc(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new R0;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=L0.bind(null,e,t,r),t.then(e,e))}function L0(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,We===e&&(Be&r)===r&&(it===4||it===3&&(Be&62914560)===Be&&300>Ue()-hc?(Ie&2)===0&&Oa(e,0):fc|=r,Ta===Be&&(Ta=0)),Mr(e)}function Om(e,t){t===0&&(t=Pr()),e=ha(e,t),e!==null&&(Cr(e,t),Mr(e))}function U0(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Om(e,r)}function P0(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 _0(e,t){return ue(e,t)}var eo=null,za=null,wc=!1,to=!1,Nc=!1,Xs=0;function Mr(e){e!==za&&e.next===null&&(za===null?eo=za=e:za=za.next=e),to=!0,wc||(wc=!0,B0())}function Mn(e,t){if(!Nc&&to){Nc=!0;do for(var r=!1,n=eo;n!==null;){if(e!==0){var c=n.pendingLanes;if(c===0)var f=0;else{var y=n.suspendedLanes,w=n.pingedLanes;f=(1<<31-pt(42|e)+1)-1,f&=c&~(y&~w),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(r=!0,Um(n,f))}else f=Be,f=gr(n,n===We?f:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(f&3)===0||Nr(n,f)||(r=!0,Um(n,f));n=n.next}while(r);Nc=!1}}function H0(){Dm()}function Dm(){to=wc=!1;var e=0;Xs!==0&&(Y0()&&(e=Xs),Xs=0);for(var t=Ue(),r=null,n=eo;n!==null;){var c=n.next,f=zm(n,t);f===0?(n.next=null,r===null?eo=c:r.next=c,c===null&&(za=r)):(r=n,(e!==0||(f&3)!==0)&&(to=!0)),n=c}Mn(e)}function zm(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var y=31-pt(f),w=1<<y,D=c[y];D===-1?((w&r)===0||(w&n)!==0)&&(c[y]=ra(w,t)):D<=t&&(e.expiredLanes|=w),f&=~w}if(t=We,r=Be,r=gr(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&&Te(n),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Nr(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(n!==null&&Te(n),he(r)){case 2:case 8:r=Wt;break;case 32:r=er;break;case 268435456:r=as;break;default:r=er}return n=Lm.bind(null,e),r=ue(r,n),e.callbackPriority=t,e.callbackNode=r,t}return n!==null&&n!==null&&Te(n),e.callbackPriority=2,e.callbackNode=null,2}function Lm(e,t){if(Ct!==0&&Ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Wl()&&e.callbackNode!==r)return null;var n=Be;return n=gr(e,e===We?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(xm(e,n,t),zm(e,Ue()),e.callbackNode!=null&&e.callbackNode===r?Lm.bind(null,e):null)}function Um(e,t){if(Wl())return null;xm(e,t,!0)}function B0(){J0(function(){(Ie&6)!==0?ue(wr,H0):Dm()})}function Sc(){return Xs===0&&(Xs=Ms()),Xs}function Pm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fl(""+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 q0(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 w=new gl("action","action",null,n,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Xs!==0){var D=y?_m(c,y):new FormData(c);Gi(r,{pending:!0,data:D,method:c.method,action:f},null,D)}}else typeof f=="function"&&(w.preventDefault(),D=y?_m(c,y):new FormData(c),Gi(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],V0=Ec.toLowerCase(),F0=Ec[0].toUpperCase()+Ec.slice(1);yr(V0,"on"+F0)}yr(gd,"onAnimationEnd"),yr(xd,"onAnimationIteration"),yr(yd,"onAnimationStart"),yr("dblclick","onDoubleClick"),yr("focusin","onFocus"),yr("focusout","onBlur"),yr(l0,"onTransitionRun"),yr(o0,"onTransitionStart"),yr(i0,"onTransitionCancel"),yr(vd,"onTransitionEnd"),aa("onMouseEnter",["mouseout","mouseover"]),aa("onMouseLeave",["mouseout","mouseover"]),aa("onPointerEnter",["pointerout","pointerover"]),aa("onPointerLeave",["pointerout","pointerover"]),Ds("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ds("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ds("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ds("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ds("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ds("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var On="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(On));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 w=n[y],D=w.instance,I=w.currentTarget;if(w=w.listener,D!==f&&c.isPropagationStopped())break e;f=w,c.currentTarget=I;try{f(c)}catch(ne){Vl(ne)}c.currentTarget=null,f=D}else for(y=0;y<n.length;y++){if(w=n[y],D=w.instance,I=w.currentTarget,w=w.listener,D!==f&&c.isPropagationStopped())break e;f=w,c.currentTarget=I;try{f(c)}catch(ne){Vl(ne)}c.currentTarget=null,f=D}}}}function He(e,t){var r=t[lt];r===void 0&&(r=t[lt]=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 ro="_reactListening"+Math.random().toString(36).slice(2);function Ac(e){if(!e[ro]){e[ro]=!0,Je.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[ro]||(t[ro]=!0,kc("selectionchange",!1,t))}}function Bm(e,t,r,n){switch(uh(t)){case 2:var c=xx;break;case 8:c=yx;break;default:c=Vc}r=c.bind(null,t,r,e),c=void 0,!Jo||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 w=n.stateNode.containerInfo;if(w===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(;w!==null;){if(y=Lt(w),y===null)return;if(D=y.tag,D===5||D===6||D===26||D===27){n=f=y;continue e}w=w.parentNode}}n=n.return}$u(function(){var I=f,ne=Yo(r),ce=[];e:{var X=bd.get(e);if(X!==void 0){var Q=gl,Ee=e;switch(e){case"keypress":if(hl(r)===0)break e;case"keydown":case"keyup":Q=_g;break;case"focusin":Ee="focus",Q=ei;break;case"focusout":Ee="blur",Q=ei;break;case"beforeblur":case"afterblur":Q=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":Q=Xu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=Eg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=qg;break;case gd:case xd:case yd:Q=Tg;break;case vd:Q=Fg;break;case"scroll":case"scrollend":Q=Sg;break;case"wheel":Q=Ig;break;case"copy":case"cut":case"paste":Q=Mg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Qu;break;case"toggle":case"beforetoggle":Q=Kg}var Ne=(t&4)!==0,Xe=!Ne&&(e==="scroll"||e==="scrollend"),q=Ne?X!==null?X+"Capture":null:X;Ne=[];for(var P=I,G;P!==null;){var oe=P;if(G=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||G===null||q===null||(oe=Ja(P,q),oe!=null&&Ne.push(Dn(P,oe,G))),Xe)break;P=P.return}0<Ne.length&&(X=new Q(X,Ee,null,r,ne),ce.push({event:X,listeners:Ne}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",X&&r!==Ko&&(Ee=r.relatedTarget||r.fromElement)&&(Lt(Ee)||Ee[xr]))break e;if((Q||X)&&(X=ne.window===ne?ne:(X=ne.ownerDocument)?X.defaultView||X.parentWindow:window,Q?(Ee=r.relatedTarget||r.toElement,Q=I,Ee=Ee?Lt(Ee):null,Ee!==null&&(Xe=d(Ee),Ne=Ee.tag,Ee!==Xe||Ne!==5&&Ne!==27&&Ne!==6)&&(Ee=null)):(Q=null,Ee=I),Q!==Ee)){if(Ne=Xu,oe="onMouseLeave",q="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=Qu,oe="onPointerLeave",q="onPointerEnter",P="pointer"),Xe=Q==null?X:pe(Q),G=Ee==null?X:pe(Ee),X=new Ne(oe,P+"leave",Q,r,ne),X.target=Xe,X.relatedTarget=G,oe=null,Lt(ne)===I&&(Ne=new Ne(q,P+"enter",Ee,r,ne),Ne.target=G,Ne.relatedTarget=Xe,oe=Ne),Xe=oe,Q&&Ee)t:{for(Ne=Q,q=Ee,P=0,G=Ne;G;G=La(G))P++;for(G=0,oe=q;oe;oe=La(oe))G++;for(;0<P-G;)Ne=La(Ne),P--;for(;0<G-P;)q=La(q),G--;for(;P--;){if(Ne===q||q!==null&&Ne===q.alternate)break t;Ne=La(Ne),q=La(q)}Ne=null}else Ne=null;Q!==null&&qm(ce,X,Q,Ne,!1),Ee!==null&&Xe!==null&&qm(ce,Xe,Ee,Ne,!0)}}e:{if(X=I?pe(I):window,Q=X.nodeName&&X.nodeName.toLowerCase(),Q==="select"||Q==="input"&&X.type==="file")var ge=nd;else if(sd(X))if(ld)ge=s0;else{ge=t0;var Le=e0}else Q=X.nodeName,!Q||Q.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?I&&$o(I.elementType)&&(ge=nd):ge=r0;if(ge&&(ge=ge(e,I))){ad(ce,ge,r,ne);break e}Le&&Le(e,X,I),e==="focusout"&&I&&X.type==="number"&&I.memoizedProps.value!=null&&Io(X,"number",X.value)}switch(Le=I?pe(I):window,e){case"focusin":(sd(Le)||Le.contentEditable==="true")&&(da=Le,li=I,an=null);break;case"focusout":an=li=da=null;break;case"mousedown":oi=!0;break;case"contextmenu":case"mouseup":case"dragend":oi=!1,hd(ce,r,ne);break;case"selectionchange":if(n0)break;case"keydown":case"keyup":hd(ce,r,ne)}var je;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 ua?td(e,r)&&(Ce="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&(Zu&&r.locale!=="ko"&&(ua||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&ua&&(je=Ku()):(os=ne,Qo="value"in os?os.value:os.textContent,ua=!0)),Le=so(I,Ce),0<Le.length&&(Ce=new Ju(Ce,e,null,r,ne),ce.push({event:Ce,listeners:Le}),je?Ce.data=je:(je=rd(r),je!==null&&(Ce.data=je)))),(je=Xg?Jg(e,r):Qg(e,r))&&(Ce=so(I,"onBeforeInput"),0<Ce.length&&(Le=new Ju("onBeforeInput","beforeinput",null,r,ne),ce.push({event:Le,listeners:Ce}),Le.data=je)),q0(ce,e,I,r,ne)}Hm(ce,t)})}function Dn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function so(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=Ja(e,r),c!=null&&n.unshift(Dn(e,c,f)),c=Ja(e,t),c!=null&&n.push(Dn(e,c,f))),e.tag===3)return n;e=e.return}return[]}function La(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 w=r,D=w.alternate,I=w.stateNode;if(w=w.tag,D!==null&&D===n)break;w!==5&&w!==26&&w!==27||I===null||(D=I,c?(I=Ja(r,f),I!=null&&y.unshift(Dn(r,I,D))):c||(I=Ja(r,f),I!=null&&y.push(Dn(r,I,D)))),r=r.return}y.length!==0&&e.push({event:t,listeners:y})}var I0=/\r\n?/g,$0=/\u0000|\uFFFD/g;function Vm(e){return(typeof e=="string"?e:""+e).replace(I0,`
|
|
49
|
+
`).replace($0,"")}function Fm(e,t){return t=Vm(t),Vm(e)===t}function ao(){}function Ye(e,t,r,n,c,f){switch(r){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||oa(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&oa(e,""+n);break;case"className":cl(e,"class",n);break;case"tabIndex":cl(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":cl(e,r,n);break;case"style":Gu(e,n,f);break;case"data":if(t!=="object"){cl(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=fl(""+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"&&Ye(e,t,"name",c.name,c,null),Ye(e,t,"formEncType",c.formEncType,c,null),Ye(e,t,"formMethod",c.formMethod,c,null),Ye(e,t,"formTarget",c.formTarget,c,null)):(Ye(e,t,"encType",c.encType,c,null),Ye(e,t,"method",c.method,c,null),Ye(e,t,"target",c.target,c,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(r);break}n=fl(""+n),e.setAttribute(r,n);break;case"onClick":n!=null&&(e.onclick=ao);break;case"onScroll":n!=null&&He("scroll",e);break;case"onScrollEnd":n!=null&&He("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=fl(""+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":He("beforetoggle",e),He("toggle",e),il(e,"popover",n);break;case"xlinkActuate":_r(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":_r(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":_r(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":_r(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":_r(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":_r(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":_r(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":_r(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":_r(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":il(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=wg.get(r)||r,il(e,r,n))}}function Rc(e,t,r,n,c,f){switch(r){case"style":Gu(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"?oa(e,n):(typeof n=="number"||typeof n=="bigint")&&oa(e,""+n);break;case"onScroll":n!=null&&He("scroll",e);break;case"onScrollEnd":n!=null&&He("scrollend",e);break;case"onClick":n!=null&&(e.onclick=ao);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rt.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,""):il(e,r,n)}}}function Et(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("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:Ye(e,t,f,y,r,null)}}c&&Ye(e,t,"srcSet",r.srcSet,r,null),n&&Ye(e,t,"src",r.src,r,null);return;case"input":He("invalid",e);var w=f=y=c=null,D=null,I=null;for(n in r)if(r.hasOwnProperty(n)){var ne=r[n];if(ne!=null)switch(n){case"name":c=ne;break;case"type":y=ne;break;case"checked":D=ne;break;case"defaultChecked":I=ne;break;case"value":f=ne;break;case"defaultValue":w=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,t));break;default:Ye(e,t,n,ne,r,null)}}Bu(e,f,w,D,I,y,c,!1),ul(e);return;case"select":He("invalid",e),n=y=f=null;for(c in r)if(r.hasOwnProperty(c)&&(w=r[c],w!=null))switch(c){case"value":f=w;break;case"defaultValue":y=w;break;case"multiple":n=w;default:Ye(e,t,c,w,r,null)}t=f,r=y,e.multiple=!!n,t!=null?la(e,!!n,t,!1):r!=null&&la(e,!!n,r,!0);return;case"textarea":He("invalid",e),f=c=n=null;for(y in r)if(r.hasOwnProperty(y)&&(w=r[y],w!=null))switch(y){case"value":n=w;break;case"defaultValue":c=w;break;case"children":f=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:Ye(e,t,y,w,r,null)}Vu(e,n,c,f),ul(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:Ye(e,t,D,n,r,null)}return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(n=0;n<On.length;n++)He(On[n],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("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(I in r)if(r.hasOwnProperty(I)&&(n=r[I],n!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ye(e,t,I,n,r,null)}return;default:if($o(t)){for(ne in r)r.hasOwnProperty(ne)&&(n=r[ne],n!==void 0&&Rc(e,t,ne,n,r,void 0));return}}for(w in r)r.hasOwnProperty(w)&&(n=r[w],n!=null&&Ye(e,t,w,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,w=null,D=null,I=null,ne=null;for(Q in r){var ce=r[Q];if(r.hasOwnProperty(Q)&&ce!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":D=ce;default:n.hasOwnProperty(Q)||Ye(e,t,Q,null,n,ce)}}for(var X in n){var Q=n[X];if(ce=r[X],n.hasOwnProperty(X)&&(Q!=null||ce!=null))switch(X){case"type":f=Q;break;case"name":c=Q;break;case"checked":I=Q;break;case"defaultChecked":ne=Q;break;case"value":y=Q;break;case"defaultValue":w=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,t));break;default:Q!==ce&&Ye(e,t,X,Q,n,ce)}}Go(e,y,w,D,I,ne,f,c);return;case"select":Q=y=w=X=null;for(f in r)if(D=r[f],r.hasOwnProperty(f)&&D!=null)switch(f){case"value":break;case"multiple":Q=D;default:n.hasOwnProperty(f)||Ye(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":w=f;break;case"multiple":y=f;default:f!==D&&Ye(e,t,c,f,n,D)}t=w,r=y,n=Q,X!=null?la(e,!!r,X,!1):!!n!=!!r&&(t!=null?la(e,!!r,t,!0):la(e,!!r,r?[]:"",!1));return;case"textarea":Q=X=null;for(w in r)if(c=r[w],r.hasOwnProperty(w)&&c!=null&&!n.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ye(e,t,w,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":Q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&Ye(e,t,y,c,n,f)}qu(e,X,Q);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:Ye(e,t,Ee,null,n,X)}for(D in n)if(X=n[D],Q=r[D],n.hasOwnProperty(D)&&X!==Q&&(X!=null||Q!=null))switch(D){case"selected":e.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:Ye(e,t,D,X,n,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ne in r)X=r[Ne],r.hasOwnProperty(Ne)&&X!=null&&!n.hasOwnProperty(Ne)&&Ye(e,t,Ne,null,n,X);for(I in n)if(X=n[I],Q=r[I],n.hasOwnProperty(I)&&X!==Q&&(X!=null||Q!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,t));break;default:Ye(e,t,I,X,n,Q)}return;default:if($o(t)){for(var Xe in r)X=r[Xe],r.hasOwnProperty(Xe)&&X!==void 0&&!n.hasOwnProperty(Xe)&&Rc(e,t,Xe,void 0,n,X);for(ne in n)X=n[ne],Q=r[ne],!n.hasOwnProperty(ne)||X===Q||X===void 0&&Q===void 0||Rc(e,t,ne,X,n,Q);return}}for(var q in r)X=r[q],r.hasOwnProperty(q)&&X!=null&&!n.hasOwnProperty(q)&&Ye(e,t,q,null,n,X);for(ce in n)X=n[ce],Q=r[ce],!n.hasOwnProperty(ce)||X===Q||X==null&&Q==null||Ye(e,t,ce,X,n,Q)}var Mc=null,Oc=null;function no(e){return e.nodeType===9?e:e.ownerDocument}function Gm(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 Im(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 zc=null;function Y0(){var e=window.event;return e&&e.type==="popstate"?e===zc?!1:(zc=e,!0):(zc=null,!1)}var $m=typeof setTimeout=="function"?setTimeout:void 0,X0=typeof clearTimeout=="function"?clearTimeout:void 0,Km=typeof Promise=="function"?Promise:void 0,J0=typeof queueMicrotask=="function"?queueMicrotask:typeof Km<"u"?function(e){return Km.resolve(null).then(e).catch(Q0)}:$m;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&&zn(y.documentElement),r&2&&zn(y.body),r&4)for(r=y.head,zn(r),y=r.firstChild;y;){var w=y.nextSibling,D=y.nodeName;y[_t]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&y.rel.toLowerCase()==="stylesheet"||r.removeChild(y),y=w}}if(c===0){e.removeChild(f),Vn(t);return}c--}else r==="$"||r==="$?"||r==="$!"?c++:n=r.charCodeAt(0)-48;else n=0;r=f}while(r);Vn(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),gt(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function Z0(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[_t])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=br(e.nextSibling),e===null)break}return null}function W0(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=br(e.nextSibling),e===null))return null;return e}function Uc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function ex(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 br(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 Jm(e,t,r){switch(t=no(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 zn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var fr=new Map,Qm=new Set;function lo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Zr=k.d;k.d={f:tx,r:rx,D:sx,C:ax,L:nx,m:lx,X:ix,S:ox,M:cx};function tx(){var e=Zr.f(),t=Ql();return e||t}function rx(e){var t=ct(e);t!==null&&t.tag===5&&t.type==="form"?xf(t):Zr.r(e)}var Ua=typeof document>"u"?null:document;function Zm(e,t,r){var n=Ua;if(n&&typeof t=="string"&&t){var c=nr(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),Qm.has(c)||(Qm.add(c),e={rel:e,crossOrigin:r,href:t},n.querySelector(c)===null&&(t=n.createElement("link"),Et(t,"link",e),ke(t),n.head.appendChild(t)))}}function sx(e){Zr.D(e),Zm("dns-prefetch",e,null)}function ax(e,t){Zr.C(e,t),Zm("preconnect",e,t)}function nx(e,t,r){Zr.L(e,t,r);var n=Ua;if(n&&e&&t){var c='link[rel="preload"][as="'+nr(t)+'"]';t==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+nr(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+nr(r.imageSizes)+'"]')):c+='[href="'+nr(e)+'"]';var f=c;switch(t){case"style":f=Pa(e);break;case"script":f=_a(e)}fr.has(f)||(e=v({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),fr.set(f,e),n.querySelector(c)!==null||t==="style"&&n.querySelector(Ln(f))||t==="script"&&n.querySelector(Un(f))||(t=n.createElement("link"),Et(t,"link",e),ke(t),n.head.appendChild(t)))}}function lx(e,t){Zr.m(e,t);var r=Ua;if(r&&e){var n=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+nr(n)+'"][href="'+nr(e)+'"]',f=c;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=_a(e)}if(!fr.has(f)&&(e=v({rel:"modulepreload",href:e},t),fr.set(f,e),r.querySelector(c)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Un(f)))return}n=r.createElement("link"),Et(n,"link",e),ke(n),r.head.appendChild(n)}}}function ox(e,t,r){Zr.S(e,t,r);var n=Ua;if(n&&e){var c=Re(n).hoistableStyles,f=Pa(e);t=t||"default";var y=c.get(f);if(!y){var w={loading:0,preload:null};if(y=n.querySelector(Ln(f)))w.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},r),(r=fr.get(f))&&_c(e,r);var D=y=n.createElement("link");ke(D),Et(D,"link",e),D._p=new Promise(function(I,ne){D.onload=I,D.onerror=ne}),D.addEventListener("load",function(){w.loading|=1}),D.addEventListener("error",function(){w.loading|=2}),w.loading|=4,oo(y,t,n)}y={type:"stylesheet",instance:y,count:1,state:w},c.set(f,y)}}}function ix(e,t){Zr.X(e,t);var r=Ua;if(r&&e){var n=Re(r).hoistableScripts,c=_a(e),f=n.get(c);f||(f=r.querySelector(Un(c)),f||(e=v({src:e,async:!0},t),(t=fr.get(c))&&Hc(e,t),f=r.createElement("script"),ke(f),Et(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},n.set(c,f))}}function cx(e,t){Zr.M(e,t);var r=Ua;if(r&&e){var n=Re(r).hoistableScripts,c=_a(e),f=n.get(c);f||(f=r.querySelector(Un(c)),f||(e=v({src:e,async:!0,type:"module"},t),(t=fr.get(c))&&Hc(e,t),f=r.createElement("script"),ke(f),Et(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)?lo(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=Pa(r.href),r=Re(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=Pa(r.href);var f=Re(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(Ln(e)))&&!f._p&&(y.instance=f,y.state.loading=5),fr.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},fr.set(e,r),f||ux(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=_a(r),r=Re(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 Pa(e){return'href="'+nr(e)+'"'}function Ln(e){return'link[rel="stylesheet"]['+e+"]"}function eh(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function ux(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}),Et(t,"link",r),ke(t),e.head.appendChild(t))}function _a(e){return'[src="'+nr(e)+'"]'}function Un(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~="'+nr(r.href)+'"]');if(n)return t.instance=n,ke(n),n;var c=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ke(n),Et(n,"style",c),oo(n,r.precedence,e),t.instance=n;case"stylesheet":c=Pa(r.href);var f=e.querySelector(Ln(c));if(f)return t.state.loading|=4,t.instance=f,ke(f),f;n=eh(r),(c=fr.get(c))&&_c(n,c),f=(e.ownerDocument||e).createElement("link"),ke(f);var y=f;return y._p=new Promise(function(w,D){y.onload=w,y.onerror=D}),Et(f,"link",n),t.state.loading|=4,oo(f,r.precedence,e),t.instance=f;case"script":return f=_a(r.src),(c=e.querySelector(Un(f)))?(t.instance=c,ke(c),c):(n=r,(c=fr.get(f))&&(n=v({},r),Hc(n,c)),e=e.ownerDocument||e,c=e.createElement("script"),ke(c),Et(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,oo(n,r.precedence,e));return t.instance}function oo(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 w=n[y];if(w.dataset.precedence===t)f=w;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 io=null;function rh(e,t,r){if(io===null){var n=new Map,c=io=new Map;c.set(r,n)}else c=io,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[_t]||f[Ze]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(t)||"";y=e+y;var w=n.get(y);w?w.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 dx(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 Pn=null;function fx(){}function mx(e,t,r){if(Pn===null)throw Error(i(475));var n=Pn;if(t.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var c=Pa(r.href),f=e.querySelector(Ln(c));if(f){e=f._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=co.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=f,ke(f);return}f=e.ownerDocument||e,r=eh(r),(c=fr.get(c))&&_c(r,c),f=f.createElement("link"),ke(f);var y=f;y._p=new Promise(function(w,D){y.onload=w,y.onerror=D}),Et(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=co.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}function hx(){if(Pn===null)throw Error(i(475));var e=Pn;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 co(){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 uo=null;function Bc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uo=new Map,t.forEach(px,e),uo=null,co.call(e))}function px(e,t){if(!(t.state.loading&4)){var r=uo.get(e);if(r)var n=r.get(null);else{r=new Map,uo.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=co.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 _n={$$typeof:T,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function gx(e,t,r,n,c,f,y,w){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=Sr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sr(0),this.hiddenUpdates=Sr(null),this.identifierPrefix=n,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function nh(e,t,r,n,c,f,y,w,D,I,ne,ce){return e=new gx(e,t,r,y,w,D,I,ce),t=1,f===!0&&(t|=24),f=Kt(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=pa,e):pa}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&&(Zt(r,e,t),hn(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=ha(e,67108864);t!==null&&Zt(t,e,67108864),qc(e,67108864)}}var fo=!0;function xx(e,t,r,n){var c=j.T;j.T=null;var f=k.p;try{k.p=2,Vc(e,t,r,n)}finally{k.p=f,j.T=c}}function yx(e,t,r,n){var c=j.T;j.T=null;var f=k.p;try{k.p=8,Vc(e,t,r,n)}finally{k.p=f,j.T=c}}function Vc(e,t,r,n){if(fo){var c=Fc(n);if(c===null)Tc(e,t,n,mo,r),dh(e,n);else if(bx(c,e,t,r,n))n.stopPropagation();else if(dh(e,n),t&4&&-1<vx.indexOf(e)){for(;c!==null;){var f=ct(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=sr(f.pendingLanes);if(y!==0){var w=f;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var D=1<<31-pt(y);w.entanglements[1]|=D,y&=~D}Mr(f),(Ie&6)===0&&(Xl=Ue()+500,Mn(0))}}break;case 13:w=ha(f,2),w!==null&&Zt(w,f,2),Ql(),qc(f,2)}if(f=Fc(n),f===null&&Tc(e,t,n,mo,r),f===c)break;c=f}c!==null&&n.stopPropagation()}else Tc(e,t,n,null,r)}}function Fc(e){return e=Yo(e),Gc(e)}var mo=null;function Gc(e){if(mo=null,e=Lt(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 mo=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(At()){case wr:return 2;case Wt:return 8;case er:case tr:return 32;case as:return 268435456;default:return 32}default:return 32}}var Ic=!1,Ss=null,Cs=null,Es=null,Hn=new Map,Bn=new Map,ks=[],vx="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":Hn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bn.delete(t.pointerId)}}function qn(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=ct(t),t!==null&&ch(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function bx(e,t,r,n,c){switch(t){case"focusin":return Ss=qn(Ss,e,t,r,n,c),!0;case"dragenter":return Cs=qn(Cs,e,t,r,n,c),!0;case"mouseover":return Es=qn(Es,e,t,r,n,c),!0;case"pointerover":var f=c.pointerId;return Hn.set(f,qn(Hn.get(f)||null,e,t,r,n,c)),!0;case"gotpointercapture":return f=c.pointerId,Bn.set(f,qn(Bn.get(f)||null,e,t,r,n,c)),!0}return!1}function fh(e){var t=Lt(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,Ve(e.priority,function(){if(r.tag===13){var n=Qt();n=ae(n);var c=ha(r,n);c!==null&&Zt(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 ho(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Fc(e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Ko=n,r.target.dispatchEvent(n),Ko=null}else return t=ct(r),t!==null&&ch(t),e.blockedOn=r,!1;t.shift()}return!0}function mh(e,t,r){ho(e)&&r.delete(t)}function jx(){Ic=!1,Ss!==null&&ho(Ss)&&(Ss=null),Cs!==null&&ho(Cs)&&(Cs=null),Es!==null&&ho(Es)&&(Es=null),Hn.forEach(mh),Bn.forEach(mh)}function po(e,t){e.blockedOn===t&&(e.blockedOn=null,Ic||(Ic=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,jx)))}var go=null;function hh(e){go!==e&&(go=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){go===e&&(go=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(Gc(n||r)===null)continue;break}var f=ct(r);f!==null&&(e.splice(t,3),t-=3,Gi(f,{pending:!0,data:c,method:r.method,action:n},n,c))}}))}function Vn(e){function t(D){return po(D,e)}Ss!==null&&po(Ss,e),Cs!==null&&po(Cs,e),Es!==null&&po(Es,e),Hn.forEach(t),Bn.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 w=null;if(f&&f.hasAttribute("formAction")){if(c=f,y=f[rt]||null)w=y.formAction;else if(Gc(c)!==null)continue}else w=y.action;typeof w=="function"?r[n+1]=w:(r.splice(n,3),n-=3),hh(r)}}}function $c(e){this._internalRoot=e}xo.prototype.render=$c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var r=t.current,n=Qt();oh(r,n,e,t,null,null)},xo.prototype.unmount=$c.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[xr]=null}};function xo(e){this._internalRoot=e}xo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gt();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"));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=g(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var wx={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yo.isDisabled&&yo.supportsFiber)try{rr=yo.inject(wx),ht=yo}catch{}}return Gn.createRoot=function(e,t){if(!u(e))throw Error(i(299));var r=!1,n="",c=Mf,f=Of,y=Df,w=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&&(w=t.unstable_transitionCallbacks)),t=nh(e,1,!1,null,null,r,n,c,f,y,w,null),e[xr]=t.current,Ac(e),new $c(t)},Gn.hydrateRoot=function(e,t,r){if(!u(e))throw Error(i(299));var n=!1,c="",f=Mf,y=Of,w=Df,D=null,I=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&&(w=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(D=r.unstable_transitionCallbacks),r.formState!==void 0&&(I=r.formState)),t=nh(e,1,!0,t,r??null,n,c,f,y,w,D,I),t.context=lh(null),r=t.current,n=Qt(),n=ae(n),c=us(n),c.callback=null,ds(r,c,n),r=n,t.current.lanes=r,Cr(t,r),Mr(t),e[xr]=t.current,Ac(e),new xo(t)},Gn.version="19.1.1",Gn}var Ch;function Ox(){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=Mx(),Xc.exports}var Dx=Ox();const Eh=cp(Dx);/**
|
|
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 zx(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 Ux(l,o,null,a)}function tt(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function mr(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Lx(){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||Lx()}}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 Ux(a,l,o,i={}){let{window:u=document.defaultView,v5Compat:d=!1}=i,m=u.history,h="POP",g=null,p=v();p==null&&(p=0,m.replaceState({...m.state,idx:p},""));function v(){return(m.state||{idx:null}).idx}function b(){h="POP";let M=v(),R=M==null?null:M-p;p=M,g&&g({action:h,location:C.location,delta:R})}function E(M,R){h="PUSH";let N=au(C.location,M,R);p=v()+1;let T=Ah(N,p),V=C.createHref(N);try{m.pushState(T,"",V)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;u.location.assign(V)}d&&g&&g({action:h,location:C.location,delta:1})}function O(M,R){h="REPLACE";let N=au(C.location,M,R);p=v();let T=Ah(N,p),V=C.createHref(N);m.replaceState(T,"",V),d&&g&&g({action:h,location:C.location,delta:0})}function A(M){return Px(M)}let C={get action(){return h},get location(){return a(u,m)},listen(M){if(g)throw new Error("A history only accepts one active listener");return u.addEventListener(kh,b),g=M,()=>{u.removeEventListener(kh,b),g=null}},createHref(M){return l(u,M)},createURL:A,encodeLocation(M){let R=A(M);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:E,replace:O,go(M){return m.go(M)}};return C}function Px(a,l=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),tt(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 up(a,l,o="/"){return _x(a,l,o,!1)}function _x(a,l,o,i){let u=typeof l=="string"?Ga(l):l,d=rs(u.pathname||"/",o);if(d==null)return null;let m=dp(a);Hx(m);let h=null;for(let g=0;h==null&&g<m.length;++g){let p=Jx(d);h=Yx(m[g],p,i)}return h}function dp(a,l=[],o=[],i="",u=!1){let d=(m,h,g=u,p)=>{let v={relativePath:p===void 0?m.path||"":p,caseSensitive:m.caseSensitive===!0,childrenIndex:h,route:m};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(i)&&g)return;tt(v.relativePath.startsWith(i),`Absolute route path "${v.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(i.length)}let b=es([i,v.relativePath]),E=o.concat(v);m.children&&m.children.length>0&&(tt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),dp(m.children,l,E,b,g)),!(m.path==null&&!m.index)&&l.push({path:b,score:$x(b,m.index),routesMeta:E})};return a.forEach((m,h)=>{var g;if(m.path===""||!((g=m.path)!=null&&g.includes("?")))d(m,h);else for(let p of fp(m.path))d(m,h,!0,p)}),l}function fp(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=fp(i.join("/")),h=[];return h.push(...m.map(g=>g===""?d:[d,g].join("/"))),u&&h.push(...m),h.map(g=>a.startsWith("/")&&g===""?"/":g)}function Hx(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 Bx=/^:[\w-]+$/,qx=3,Vx=2,Fx=1,Gx=10,Ix=-2,Th=a=>a==="*";function $x(a,l){let o=a.split("/"),i=o.length;return o.some(Th)&&(i+=Ix),l&&(i+=Vx),o.filter(u=>!Th(u)).reduce((u,d)=>u+(Bx.test(d)?qx:d===""?Fx: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 Yx(a,l,o=!1){let{routesMeta:i}=a,u={},d="/",m=[];for(let h=0;h<i.length;++h){let g=i[h],p=h===i.length-1,v=d==="/"?l:l.slice(d.length)||"/",b=Ao({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},v),E=g.route;if(!b&&p&&o&&!i[i.length-1].route.index&&(b=Ao({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!b)return null;Object.assign(u,b.params),m.push({params:u,pathname:es([d,b.pathname]),pathnameBase:ey(es([d,b.pathnameBase])),route:E}),b.pathnameBase!=="/"&&(d=es([d,b.pathnameBase]))}return m}function Ao(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=Xx(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((p,{paramName:v,isOptional:b},E)=>{if(v==="*"){let A=h[E]||"";m=d.slice(0,d.length-A.length).replace(/(.)\/+$/,"$1")}const O=h[E];return b&&!O?p[v]=void 0:p[v]=(O||"").replace(/%2F/g,"/"),p},{}),pathname:d,pathnameBase:m,pattern:a}}function Xx(a,l=!1,o=!0){mr(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,g)=>(i.push({paramName:h,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).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 Jx(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return mr(!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 rs(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:Zx(o,l):l,search:ty(i),hash:ry(u)}}function Zx(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 Wx(a){return a.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function xu(a){let l=Wx(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},tt(!u.pathname||!u.pathname.includes("?"),Wc("?","pathname","search",u)),tt(!u.pathname||!u.pathname.includes("#"),Wc("#","pathname","hash",u)),tt(!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 b=l.length-1;if(!i&&m.startsWith("..")){let E=m.split("/");for(;E[0]==="..";)E.shift(),b-=1;u.pathname=E.join("/")}h=b>=0?l[b]:"/"}let g=Qx(u,h),p=m&&m!=="/"&&m.endsWith("/"),v=(d||m===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(p||v)&&(g.pathname+="/"),g}var es=a=>a.join("/").replace(/\/\/+/g,"/"),ey=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),ty=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,ry=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;function sy(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}var mp=["POST","PUT","PATCH","DELETE"];new Set(mp);var ay=["GET",...mp];new Set(ay);var Ia=x.createContext(null);Ia.displayName="DataRouter";var Lo=x.createContext(null);Lo.displayName="DataRouterState";x.createContext(!1);var hp=x.createContext({isTransitioning:!1});hp.displayName="ViewTransition";var ny=x.createContext(new Map);ny.displayName="Fetchers";var ly=x.createContext(null);ly.displayName="Await";var jr=x.createContext(null);jr.displayName="Navigation";var rl=x.createContext(null);rl.displayName="Location";var hr=x.createContext({outlet:null,matches:[],isDataRoute:!1});hr.displayName="Route";var vu=x.createContext(null);vu.displayName="RouteError";function oy(a,{relative:l}={}){tt($a(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=x.useContext(jr),{hash:u,pathname:d,search:m}=sl(a,{relative:l}),h=d;return o!=="/"&&(h=d==="/"?o:es([o,d])),i.createHref({pathname:h,search:m,hash:u})}function $a(){return x.useContext(rl)!=null}function ss(){return tt($a(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(rl).location}var pp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function gp(a){x.useContext(jr).static||x.useLayoutEffect(a)}function zr(){let{isDataRoute:a}=x.useContext(hr);return a?wy():iy()}function iy(){tt($a(),"useNavigate() may be used only in the context of a <Router> component.");let a=x.useContext(Ia),{basename:l,navigator:o}=x.useContext(jr),{matches:i}=x.useContext(hr),{pathname:u}=ss(),d=JSON.stringify(xu(i)),m=x.useRef(!1);return gp(()=>{m.current=!0}),x.useCallback((g,p={})=>{if(mr(m.current,pp),!m.current)return;if(typeof g=="number"){o.go(g);return}let v=yu(g,JSON.parse(d),u,p.relative==="path");a==null&&l!=="/"&&(v.pathname=v.pathname==="/"?l:es([l,v.pathname])),(p.replace?o.replace:o.push)(v,p.state,p)},[l,o,d,u,a])}var cy=x.createContext(null);function uy(a){let l=x.useContext(hr).outlet;return l&&x.createElement(cy.Provider,{value:a},l)}function xp(){let{matches:a}=x.useContext(hr),l=a[a.length-1];return l?l.params:{}}function sl(a,{relative:l}={}){let{matches:o}=x.useContext(hr),{pathname:i}=ss(),u=JSON.stringify(xu(o));return x.useMemo(()=>yu(a,JSON.parse(u),i,l==="path"),[a,u,i,l])}function dy(a,l){return yp(a,l)}function yp(a,l,o,i,u){var N;tt($a(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=x.useContext(jr),{matches:m}=x.useContext(hr),h=m[m.length-1],g=h?h.params:{},p=h?h.pathname:"/",v=h?h.pathnameBase:"/",b=h&&h.route;{let T=b&&b.path||"";vp(p,!b||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${T}">) 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="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let E=ss(),O;if(l){let T=typeof l=="string"?Ga(l):l;tt(v==="/"||((N=T.pathname)==null?void 0:N.startsWith(v)),`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 "${v}" but pathname "${T.pathname}" was given in the \`location\` prop.`),O=T}else O=E;let A=O.pathname||"/",C=A;if(v!=="/"){let T=v.replace(/^\//,"").split("/");C="/"+A.replace(/^\//,"").split("/").slice(T.length).join("/")}let M=up(a,{pathname:C});mr(b||M!=null,`No routes matched location "${O.pathname}${O.search}${O.hash}" `),mr(M==null||M[M.length-1].route.element!==void 0||M[M.length-1].route.Component!==void 0||M[M.length-1].route.lazy!==void 0,`Matched leaf route at location "${O.pathname}${O.search}${O.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=gy(M&&M.map(T=>Object.assign({},T,{params:Object.assign({},g,T.params),pathname:es([v,d.encodeLocation?d.encodeLocation(T.pathname).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?v:es([v,d.encodeLocation?d.encodeLocation(T.pathnameBase).pathname:T.pathnameBase])})),m,o,i,u);return l&&R?x.createElement(rl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...O},navigationType:"POP"}},R):R}function fy(){let a=jy(),l=sy(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=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:d},"ErrorBoundary")," or"," ",x.createElement("code",{style:d},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},l),o?x.createElement("pre",{style:u},o):null,m)}var my=x.createElement(fy,null),hy=class extends x.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?x.createElement(hr.Provider,{value:this.props.routeContext},x.createElement(vu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function py({routeContext:a,match:l,children:o}){let i=x.useContext(Ia);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),x.createElement(hr.Provider,{value:a},o)}function gy(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 p=d.findIndex(v=>v.route.id&&(m==null?void 0:m[v.route.id])!==void 0);tt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),d=d.slice(0,Math.min(d.length,p+1))}let h=!1,g=-1;if(o)for(let p=0;p<d.length;p++){let v=d[p];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(g=p),v.route.id){let{loaderData:b,errors:E}=o,O=v.route.loader&&!b.hasOwnProperty(v.route.id)&&(!E||E[v.route.id]===void 0);if(v.route.lazy||O){h=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}return d.reduceRight((p,v,b)=>{let E,O=!1,A=null,C=null;o&&(E=m&&v.route.id?m[v.route.id]:void 0,A=v.route.errorElement||my,h&&(g<0&&b===0?(vp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,C=null):g===b&&(O=!0,C=v.route.hydrateFallbackElement||null)));let M=l.concat(d.slice(0,b+1)),R=()=>{let N;return E?N=A:O?N=C:v.route.Component?N=x.createElement(v.route.Component,null):v.route.element?N=v.route.element:N=p,x.createElement(py,{match:v,routeContext:{outlet:p,matches:M,isDataRoute:o!=null},children:N})};return o&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?x.createElement(hy,{location:o.location,revalidation:o.revalidation,component:A,error:E,children:R(),routeContext:{outlet:null,matches:M,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 xy(a){let l=x.useContext(Ia);return tt(l,bu(a)),l}function yy(a){let l=x.useContext(Lo);return tt(l,bu(a)),l}function vy(a){let l=x.useContext(hr);return tt(l,bu(a)),l}function ju(a){let l=vy(a),o=l.matches[l.matches.length-1];return tt(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function by(){return ju("useRouteId")}function jy(){var i;let a=x.useContext(vu),l=yy("useRouteError"),o=ju("useRouteError");return a!==void 0?a:(i=l.errors)==null?void 0:i[o]}function wy(){let{router:a}=xy("useNavigate"),l=ju("useNavigate"),o=x.useRef(!1);return gp(()=>{o.current=!0}),x.useCallback(async(u,d={})=>{mr(o.current,pp),o.current&&(typeof u=="number"?a.navigate(u):await a.navigate(u,{fromRouteId:l,...d}))},[a,l])}var Rh={};function vp(a,l,o){!l&&!Rh[a]&&(Rh[a]=!0,mr(!1,o))}x.memo(Ny);function Ny({routes:a,future:l,state:o,unstable_onError:i}){return yp(a,void 0,o,i,l)}function To({to:a,replace:l,state:o,relative:i}){tt($a(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=x.useContext(jr);mr(!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}=x.useContext(hr),{pathname:m}=ss(),h=zr(),g=yu(a,xu(d),m,i==="path"),p=JSON.stringify(g);return x.useEffect(()=>{h(JSON.parse(p),{replace:l,state:o,relative:i})},[h,p,i,l,o]),null}function bp(a){return uy(a.context)}function Pt(a){tt(!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 Sy({basename:a="/",children:l=null,location:o,navigationType:i="POP",navigator:u,static:d=!1}){tt(!$a(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),h=x.useMemo(()=>({basename:m,navigator:u,static:d,future:{}}),[m,u,d]);typeof o=="string"&&(o=Ga(o));let{pathname:g="/",search:p="",hash:v="",state:b=null,key:E="default"}=o,O=x.useMemo(()=>{let A=rs(g,m);return A==null?null:{location:{pathname:A,search:p,hash:v,state:b,key:E},navigationType:i}},[m,g,p,v,b,E,i]);return mr(O!=null,`<Router basename="${m}"> is not able to match the URL "${g}${p}${v}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:x.createElement(jr.Provider,{value:h},x.createElement(rl.Provider,{children:l,value:O}))}function Cy({children:a,location:l}){return dy(nu(a),l)}function nu(a,l=[]){let o=[];return x.Children.forEach(a,(i,u)=>{if(!x.isValidElement(i))return;let d=[...l,u];if(i.type===x.Fragment){o.push.apply(o,nu(i.props.children,d));return}tt(i.type===Pt,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),tt(!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 Co="get",Eo="application/x-www-form-urlencoded";function Uo(a){return a!=null&&typeof a.tagName=="string"}function Ey(a){return Uo(a)&&a.tagName.toLowerCase()==="button"}function ky(a){return Uo(a)&&a.tagName.toLowerCase()==="form"}function Ay(a){return Uo(a)&&a.tagName.toLowerCase()==="input"}function Ty(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function Ry(a,l){return a.button===0&&(!l||l==="_self")&&!Ty(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 My(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 vo=null;function Oy(){if(vo===null)try{new FormData(document.createElement("form"),0),vo=!1}catch{vo=!0}return vo}var Dy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function eu(a){return a!=null&&!Dy.has(a)?(mr(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Eo}"`),null):a}function zy(a,l){let o,i,u,d,m;if(ky(a)){let h=a.getAttribute("action");i=h?rs(h,l):null,o=a.getAttribute("method")||Co,u=eu(a.getAttribute("enctype"))||Eo,d=new FormData(a)}else if(Ey(a)||Ay(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 g=a.getAttribute("formaction")||h.getAttribute("action");if(i=g?rs(g,l):null,o=a.getAttribute("formmethod")||h.getAttribute("method")||Co,u=eu(a.getAttribute("formenctype"))||eu(h.getAttribute("enctype"))||Eo,d=new FormData(h,a),!Oy()){let{name:p,type:v,value:b}=a;if(v==="image"){let E=p?`${p}.`:"";d.append(`${E}x`,"0"),d.append(`${E}y`,"0")}else p&&d.append(p,b)}}else{if(Uo(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Co,i=null,u=Eo,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 Ly(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&&rs(i.pathname,l)==="/"?i.pathname=`${l.replace(/\/$/,"")}/_root.${o}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${o}`,i}async function Uy(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 Py(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 _y(a,l,o){let i=await Promise.all(a.map(async u=>{let d=l.routes[u.route.id];if(d){let m=await Uy(d,o);return m.links?m.links():[]}return[]}));return Vy(i.flat(1).filter(Py).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=(g,p)=>o[p]?g.route.id!==o[p].route.id:!0,h=(g,p)=>{var v;return o[p].pathname!==g.pathname||((v=o[p].route.path)==null?void 0:v.endsWith("*"))&&o[p].params["*"]!==g.params["*"]};return d==="assets"?l.filter((g,p)=>m(g,p)||h(g,p)):d==="data"?l.filter((g,p)=>{var b;let v=i.routes[g.route.id];if(!v||!v.hasLoader)return!1;if(m(g,p)||h(g,p))return!0;if(g.route.shouldRevalidate){let E=g.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((b=o[0])==null?void 0:b.params)||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function Hy(a,l,{includeHydrateFallback:o}={}){return By(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 By(a){return[...new Set(a)]}function qy(a){let l={},o=Object.keys(a).sort();for(let i of o)l[i]=a[i];return l}function Vy(a,l){let o=new Set;return new Set(l),a.reduce((i,u)=>{let d=JSON.stringify(qy(u));return o.has(d)||(o.add(d),i.push({key:d,link:u})),i},[])}function jp(){let a=x.useContext(Ia);return wu(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function Fy(){let a=x.useContext(Lo);return wu(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Nu=x.createContext(void 0);Nu.displayName="FrameworkContext";function wp(){let a=x.useContext(Nu);return wu(a,"You must render this element inside a <HydratedRouter> element"),a}function Gy(a,l){let o=x.useContext(Nu),[i,u]=x.useState(!1),[d,m]=x.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:p,onMouseLeave:v,onTouchStart:b}=l,E=x.useRef(null);x.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let C=R=>{R.forEach(N=>{m(N.isIntersecting)})},M=new IntersectionObserver(C,{threshold:.5});return E.current&&M.observe(E.current),()=>{M.disconnect()}}},[a]),x.useEffect(()=>{if(i){let C=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(C)}}},[i]);let O=()=>{u(!0)},A=()=>{u(!1),m(!1)};return o?a!=="intent"?[d,E,{}]:[d,E,{onFocus:In(h,O),onBlur:In(g,A),onMouseEnter:In(p,O),onMouseLeave:In(v,A),onTouchStart:In(b,O)}]:[!1,E,{}]}function In(a,l){return o=>{a&&a(o),o.defaultPrevented||l(o)}}function Iy({page:a,...l}){let{router:o}=jp(),i=x.useMemo(()=>up(o.routes,a,o.basename),[o.routes,a,o.basename]);return i?x.createElement(Ky,{page:a,matches:i,...l}):null}function $y(a){let{manifest:l,routeModules:o}=wp(),[i,u]=x.useState([]);return x.useEffect(()=>{let d=!1;return _y(a,l,o).then(m=>{d||u(m)}),()=>{d=!0}},[a,l,o]),i}function Ky({page:a,matches:l,...o}){let i=ss(),{manifest:u,routeModules:d}=wp(),{basename:m}=jp(),{loaderData:h,matches:g}=Fy(),p=x.useMemo(()=>Mh(a,l,g,u,i,"data"),[a,l,g,u,i]),v=x.useMemo(()=>Mh(a,l,g,u,i,"assets"),[a,l,g,u,i]),b=x.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let A=new Set,C=!1;if(l.forEach(R=>{var T;let N=u.routes[R.route.id];!N||!N.hasLoader||(!p.some(V=>V.route.id===R.route.id)&&R.route.id in h&&((T=d[R.route.id])!=null&&T.shouldRevalidate)||N.hasClientLoader?C=!0:A.add(R.route.id))}),A.size===0)return[];let M=Ly(a,m,"data");return C&&A.size>0&&M.searchParams.set("_routes",l.filter(R=>A.has(R.route.id)).map(R=>R.route.id).join(",")),[M.pathname+M.search]},[m,h,i,u,p,l,a,d]),E=x.useMemo(()=>Hy(v,u),[v,u]),O=$y(v);return x.createElement(x.Fragment,null,b.map(A=>x.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...o})),E.map(A=>x.createElement("link",{key:A,rel:"modulepreload",href:A,...o})),O.map(({key:A,link:C})=>x.createElement("link",{key:A,nonce:o.nonce,...C})))}function Yy(...a){return l=>{a.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var Np=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Np&&(window.__reactRouterVersion="7.8.2")}catch{}function Xy({basename:a,children:l,window:o}){let i=x.useRef();i.current==null&&(i.current=zx({window:o,v5Compat:!0}));let u=i.current,[d,m]=x.useState({action:u.action,location:u.location}),h=x.useCallback(g=>{x.startTransition(()=>m(g))},[m]);return x.useLayoutEffect(()=>u.listen(h),[u,h]),x.createElement(Sy,{basename:a,children:l,location:d.location,navigationType:d.action,navigator:u})}var Sp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cp=x.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:u,reloadDocument:d,replace:m,state:h,target:g,to:p,preventScrollReset:v,viewTransition:b,...E},O){let{basename:A}=x.useContext(jr),C=typeof p=="string"&&Sp.test(p),M,R=!1;if(typeof p=="string"&&C&&(M=p,Np))try{let te=new URL(window.location.href),ie=p.startsWith("//")?new URL(te.protocol+p):new URL(p),z=rs(ie.pathname,A);ie.origin===te.origin&&z!=null?p=z+ie.search+ie.hash:R=!0}catch{mr(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let N=oy(p,{relative:u}),[T,V,W]=Gy(i,E),se=Zy(p,{replace:m,state:h,target:g,preventScrollReset:v,relative:u,viewTransition:b});function re(te){l&&l(te),te.defaultPrevented||se(te)}let F=x.createElement("a",{...E,...W,href:M||N,onClick:R||d?l:re,ref:Yy(O,V),target:g,"data-discover":!C&&o==="render"?"true":void 0});return T&&!C?x.createElement(x.Fragment,null,F,x.createElement(Iy,{page:N})):F});Cp.displayName="Link";var Ep=x.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:u=!1,style:d,to:m,viewTransition:h,children:g,...p},v){let b=sl(m,{relative:p.relative}),E=ss(),O=x.useContext(Lo),{navigator:A,basename:C}=x.useContext(jr),M=O!=null&&av(b)&&h===!0,R=A.encodeLocation?A.encodeLocation(b).pathname:b.pathname,N=E.pathname,T=O&&O.navigation&&O.navigation.location?O.navigation.location.pathname:null;o||(N=N.toLowerCase(),T=T?T.toLowerCase():null,R=R.toLowerCase()),T&&C&&(T=rs(T,C)||T);const V=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let W=N===R||!u&&N.startsWith(R)&&N.charAt(V)==="/",se=T!=null&&(T===R||!u&&T.startsWith(R)&&T.charAt(R.length)==="/"),re={isActive:W,isPending:se,isTransitioning:M},F=W?l:void 0,te;typeof i=="function"?te=i(re):te=[i,W?"active":null,se?"pending":null,M?"transitioning":null].filter(Boolean).join(" ");let ie=typeof d=="function"?d(re):d;return x.createElement(Cp,{...p,"aria-current":F,className:te,ref:v,style:ie,to:m,viewTransition:h},typeof g=="function"?g(re):g)});Ep.displayName="NavLink";var Jy=x.forwardRef(({discover:a="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:u,state:d,method:m=Co,action:h,onSubmit:g,relative:p,preventScrollReset:v,viewTransition:b,...E},O)=>{let A=rv(),C=sv(h,{relative:p}),M=m.toLowerCase()==="get"?"get":"post",R=typeof h=="string"&&Sp.test(h),N=T=>{if(g&&g(T),T.defaultPrevented)return;T.preventDefault();let V=T.nativeEvent.submitter,W=(V==null?void 0:V.getAttribute("formmethod"))||m;A(V||T.currentTarget,{fetcherKey:l,method:W,navigate:o,replace:u,state:d,relative:p,preventScrollReset:v,viewTransition:b})};return x.createElement("form",{ref:O,method:M,action:C,onSubmit:i?g:N,...E,"data-discover":!R&&a==="render"?"true":void 0})});Jy.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 kp(a){let l=x.useContext(Ia);return tt(l,Qy(a)),l}function Zy(a,{target:l,replace:o,state:i,preventScrollReset:u,relative:d,viewTransition:m}={}){let h=zr(),g=ss(),p=sl(a,{relative:d});return x.useCallback(v=>{if(Ry(v,l)){v.preventDefault();let b=o!==void 0?o:Qn(g)===Qn(p);h(a,{replace:b,state:i,preventScrollReset:u,relative:d,viewTransition:m})}},[g,h,p,o,i,l,a,u,d,m])}function Wy(a){mr(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=x.useRef(lu(a)),o=x.useRef(!1),i=ss(),u=x.useMemo(()=>My(i.search,o.current?null:l.current),[i.search]),d=zr(),m=x.useCallback((h,g)=>{const p=lu(typeof h=="function"?h(new URLSearchParams(u)):h);o.current=!0,d("?"+p,g)},[d,u]);return[u,m]}var ev=0,tv=()=>`__${String(++ev)}__`;function rv(){let{router:a}=kp("useSubmit"),{basename:l}=x.useContext(jr),o=by();return x.useCallback(async(i,u={})=>{let{action:d,method:m,encType:h,formData:g,body:p}=zy(i,l);if(u.navigate===!1){let v=u.fetcherKey||tv();await a.fetch(v,o,u.action||d,{preventScrollReset:u.preventScrollReset,formData:g,body:p,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await a.navigate(u.action||d,{preventScrollReset:u.preventScrollReset,formData:g,body:p,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 sv(a,{relative:l}={}){let{basename:o}=x.useContext(jr),i=x.useContext(hr);tt(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),d={...sl(a||".",{relative:l})},m=ss();if(a==null){d.search=m.search;let h=new URLSearchParams(d.search),g=h.getAll("index");if(g.some(v=>v==="")){h.delete("index"),g.filter(b=>b).forEach(b=>h.append("index",b));let v=h.toString();d.search=v?`?${v}`:""}}return(!a||a===".")&&u.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:es([o,d.pathname])),Qn(d)}function av(a,{relative:l}={}){let o=x.useContext(hp);tt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=kp("useViewTransitionState"),u=sl(a,{relative:l});if(!o.isTransitioning)return!1;let d=rs(o.currentLocation.pathname,i)||o.currentLocation.pathname,m=rs(o.nextLocation.pathname,i)||o.nextLocation.pathname;return Ao(u.pathname,m)!=null||Ao(u.pathname,d)!=null}const nv=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},Su=()=>{const l=nv().basePath||"";return l&&!l.startsWith("/")?"/"+l:l},lv=()=>Su()+"/api",Cu=a=>{const l=lv(),o=a.startsWith("/")?a:"/"+a;return l+o},ov=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"}}},ko=[],iv=a=>{ko.push(a)},Eu=async(a,l={})=>{let o=a.toString(),i={...l};try{for(const d of ko)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 ko)d.response&&(u=await d.response(u));return u}catch(u){let d=u;for(const m of ko)m.error&&(d=await m.error(d));throw d}},Po=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={})=>Po(a,{...l,method:"GET"}),Nt=(a,l,o={})=>Po(a,{...o,method:"POST",headers:{"Content-Type":"application/json",...o.headers},body:l?JSON.stringify(l):void 0}),Ft=(a,l,o={})=>Po(a,{...o,method:"PUT",headers:{"Content-Type":"application/json",...o.headers},body:l?JSON.stringify(l):void 0}),Zn=(a,l={})=>Po(a,{...l,method:"DELETE"}),ku="mcphub_token",al=()=>localStorage.getItem(ku),Ap=a=>{localStorage.setItem(ku,a)},Ro=()=>{localStorage.removeItem(ku)},cv={request:async(a,l)=>{const o=new Headers(l.headers),i=localStorage.getItem("i18nextLng")||"en";o.set("Accept-Language",i);const u=al();return u&&o.set("x-auth-token",u),{url:a,config:{...l,headers:o}}},response:async a=>(a.status===401&&Ro(),a),error:async a=>(console.error("Auth interceptor error:",a),a)},uv=()=>{iv(cv)},dv=async a=>{try{const l=await Nt("/auth/login",a);return l.success&&l.token?(Ap(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"}}},fv=async a=>{try{const l=await Nt("/auth/register",a);return l.success&&l.token?(Ap(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"}}},mv=async()=>{if(!al())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"}}},hv=async a=>{if(!al())return{success:!1,message:"No authentication token"};try{return await Nt("/auth/change-password",a)}catch(o){return console.error("Change password error:",o),{success:!1,message:"An error occurred while changing password"}}},pv=()=>{Ro()},gv=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}}},Or={isAuthenticated:!1,loading:!0,user:null,error:null},Tp=x.createContext({auth:Or,login:async()=>({success:!1}),register:async()=>!1,logout:()=>{}}),xv=({children:a})=>{const[l,o]=x.useState(Or);x.useEffect(()=>{(async()=>{const{skipAuth:h,permissions:g}=await gv();if(h){o({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:g},error:null});return}if(!al()){o({...Or,loading:!1});return}try{const v=await mv();v.success&&v.user?o({isAuthenticated:!0,loading:!1,user:v.user,error:null}):(Ro(),o({...Or,loading:!1}))}catch{Ro(),o({...Or,loading:!1})}})()},[]);const i=async(m,h)=>{try{const g=await dv({username:m,password:h});return g.success&&g.token&&g.user?(o({isAuthenticated:!0,loading:!1,user:g.user,error:null}),{success:!0,isUsingDefaultPassword:g.isUsingDefaultPassword}):(o({...Or,loading:!1,error:g.message||"Authentication failed"}),{success:!1})}catch{return o({...Or,loading:!1,error:"Authentication failed"}),{success:!1}}},u=async(m,h,g=!1)=>{try{const p=await fv({username:m,password:h,isAdmin:g});return p.success&&p.token&&p.user?(o({isAuthenticated:!0,loading:!1,user:p.user,error:null}),!0):(o({...Or,loading:!1,error:p.message||"Registration failed"}),!1)}catch{return o({...Or,loading:!1,error:"Registration failed"}),!1}},d=()=>{pv(),o({...Or,loading:!1})};return s.jsx(Tp.Provider,{value:{auth:l,login:i,register:u,logout:d},children:a})},Ws=()=>x.useContext(Tp),yv=(a,l,o,i)=>{var d,m,h,g;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);Zs(u[0])&&(u[0]=`react-i18next:: ${u[0]}`),(g=(h=a==null?void 0:a.services)==null?void 0:h.logger)!=null&&g.warn?a.services.logger.warn(...u):console!=null&&console.warn&&console.warn(...u)},Oh={},ou=(a,l,o,i)=>{Zs(o)&&Oh[o]||(Zs(o)&&(Oh[o]=new Date),yv(a,l,o,i))},Rp=(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,Rp(a,o))},Dh=(a,l,o,i)=>{if(Zs(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,Rp(a,i))},vv=(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}}),Zs=a=>typeof a=="string",bv=a=>typeof a=="object"&&a!==null,jv=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,wv={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Nv=a=>wv[a],Sv=a=>a.replace(jv,Nv);let cu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Sv};const Cv=(a={})=>{cu={...cu,...a}},Ev=()=>cu;let Mp;const kv=a=>{Mp=a},Av=()=>Mp,Tv={type:"3rdParty",init(a){Cv(a.options.react),kv(a)}},Rv=x.createContext();class Mv{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(o=>{this.usedNamespaces[o]||(this.usedNamespaces[o]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Ov=(a,l)=>{const o=x.useRef();return x.useEffect(()=>{o.current=a},[a,l]),o.current},Op=(a,l,o,i)=>a.getFixedT(l,o,i),Dv=(a,l,o,i)=>x.useCallback(Op(a,l,o,i),[a,l,o,i]),ve=(a,l={})=>{var V,W,se,re;const{i18n:o}=l,{i18n:i,defaultNS:u}=x.useContext(Rv)||{},d=o||i||Av();if(d&&!d.reportNamespaces&&(d.reportNamespaces=new Mv),!d){ou(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const F=(ie,z)=>Zs(z)?z:bv(z)&&Zs(z.defaultValue)?z.defaultValue:Array.isArray(ie)?ie[ie.length-1]:ie,te=[F,{},!1];return te.t=F,te.i18n={},te.ready=!1,te}(V=d.options.react)!=null&&V.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={...Ev(),...d.options.react,...l},{useSuspense:h,keyPrefix:g}=m;let p=u||((W=d.options)==null?void 0:W.defaultNS);p=Zs(p)?[p]:p||["translation"],(re=(se=d.reportNamespaces).addUsedNamespaces)==null||re.call(se,p);const v=(d.isInitialized||d.initializedStoreOnce)&&p.every(F=>vv(F,d,m)),b=Dv(d,l.lng||null,m.nsMode==="fallback"?p:p[0],g),E=()=>b,O=()=>Op(d,l.lng||null,m.nsMode==="fallback"?p:p[0],g),[A,C]=x.useState(E);let M=p.join();l.lng&&(M=`${l.lng}${M}`);const R=Ov(M),N=x.useRef(!0);x.useEffect(()=>{const{bindI18n:F,bindI18nStore:te}=m;N.current=!0,!v&&!h&&(l.lng?Dh(d,l.lng,p,()=>{N.current&&C(O)}):iu(d,p,()=>{N.current&&C(O)})),v&&R&&R!==M&&N.current&&C(O);const ie=()=>{N.current&&C(O)};return F&&(d==null||d.on(F,ie)),te&&(d==null||d.store.on(te,ie)),()=>{N.current=!1,d&&F&&(F==null||F.split(" ").forEach(z=>d.off(z,ie))),te&&d&&te.split(" ").forEach(z=>d.store.off(z,ie))}},[d,M]),x.useEffect(()=>{N.current&&v&&C(E)},[d,g,v]);const T=[A,d,v];if(T.t=A,T.i18n=d,T.ready=v,v||!v&&!h)return T;throw new Promise(F=>{l.lng?Dh(d,l.lng,p,()=>F()):iu(d,p,()=>F())})};/**
|
|
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 zv=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lv=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,o,i)=>i?i.toUpperCase():o.toLowerCase()),zh=a=>{const l=Lv(a);return l.charAt(0).toUpperCase()+l.slice(1)},Dp=(...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 Uv={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 Pv=x.forwardRef(({color:a="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:d,iconNode:m,...h},g)=>x.createElement("svg",{ref:g,...Uv,width:l,height:l,stroke:a,strokeWidth:i?Number(o)*24/Number(l):o,className:Dp("lucide",u),...h},[...m.map(([p,v])=>x.createElement(p,v)),...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=x.forwardRef(({className:i,...u},d)=>x.createElement(Pv,{ref:d,iconNode:l,className:Dp(`lucide-${zv(zh(a))}`,`lucide-${a}`,i),...u}));return o.displayName=zh(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 _v=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ka=at("check",_v);/**
|
|
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 Hv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_o=at("chevron-down",Hv);/**
|
|
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 Bv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Au=at("chevron-right",Bv);/**
|
|
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 qv=[["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",qv);/**
|
|
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 Vv=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],zp=at("circle-check-big",Vv);/**
|
|
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 Fv=[["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"}]],Lp=at("circle-x",Fv);/**
|
|
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"}]],Mo=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 Iv=[["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",Iv);/**
|
|
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"}]],Yv=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 Xv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Jv=at("info",Xv);/**
|
|
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"}]],Zv=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 Wv=[["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"}]],Up=at("loader",Wv);/**
|
|
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 eb=[["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"}]],tb=at("log-out",eb);/**
|
|
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 rb=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],sb=at("moon",rb);/**
|
|
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 ab=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Pp=at("play",ab);/**
|
|
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 nb=[["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"}]],lb=at("refresh-cw",nb);/**
|
|
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 ob=[["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"}]],ib=at("settings",ob);/**
|
|
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 cb=[["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"}]],Ho=at("square-pen",cb);/**
|
|
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 ub=[["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"}]],db=at("sun",ub);/**
|
|
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 fb=[["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"}]],_p=at("trash",fb);/**
|
|
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 mb=[["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"}]],hb=at("user",mb);/**
|
|
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 pb=[["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"}]],gb=at("wrench",pb);/**
|
|
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 xb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wn=at("x",xb);function Hp(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=Hp(a[l]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function yb(){for(var a,l,o=0,i="",u=arguments.length;o<u;o++)(a=arguments[o])&&(l=Hp(a))&&(i&&(i+=" "),i+=l);return i}const Ru="-",vb=a=>{const l=jb(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:m=>{const h=m.split(Ru);return h[0]===""&&h.length!==1&&h.shift(),Bp(h,l)||bb(m)},getConflictingClassGroupIds:(m,h)=>{const g=o[m]||[];return h&&i[m]?[...g,...i[m]]:g}}},Bp=(a,l)=>{var m;if(a.length===0)return l.classGroupId;const o=a[0],i=l.nextPart.get(o),u=i?Bp(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=/^\[(.+)\]$/,bb=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}},jb=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:Uh(l,u);d.classGroupId=o;return}if(typeof u=="function"){if(wb(u)){uu(u(i),l,o,i);return}l.validators.push({validator:u,classGroupId:o});return}Object.entries(u).forEach(([d,m])=>{uu(m,Uh(l,d),o,i)})})},Uh=(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},wb=a=>a.isThemeGetter,Nb=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=":",Sb=fu.length,Cb=a=>{const{prefix:l,experimentalParseClassName:o}=a;let i=u=>{const d=[];let m=0,h=0,g=0,p;for(let A=0;A<u.length;A++){let C=u[A];if(m===0&&h===0){if(C===fu){d.push(u.slice(g,A)),g=A+Sb;continue}if(C==="/"){p=A;continue}}C==="["?m++:C==="]"?m--:C==="("?h++:C===")"&&h--}const v=d.length===0?u:u.substring(g),b=Eb(v),E=b!==v,O=p&&p>g?p-g:void 0;return{modifiers:d,hasImportantModifier:E,baseClassName:b,maybePostfixModifierPosition:O}};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},Eb=a=>a.endsWith(du)?a.substring(0,a.length-1):a.startsWith(du)?a.substring(1):a,kb=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}},Ab=a=>({cache:Nb(a.cacheSize),parseClassName:Cb(a),sortModifiers:kb(a),...vb(a)}),Tb=/\s+/,Rb=(a,l)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:u,sortModifiers:d}=l,m=[],h=a.trim().split(Tb);let g="";for(let p=h.length-1;p>=0;p-=1){const v=h[p],{isExternal:b,modifiers:E,hasImportantModifier:O,baseClassName:A,maybePostfixModifierPosition:C}=o(v);if(b){g=v+(g.length>0?" "+g:g);continue}let M=!!C,R=i(M?A.substring(0,C):A);if(!R){if(!M){g=v+(g.length>0?" "+g:g);continue}if(R=i(A),!R){g=v+(g.length>0?" "+g:g);continue}M=!1}const N=d(E).join(":"),T=O?N+du:N,V=T+R;if(m.includes(V))continue;m.push(V);const W=u(R,M);for(let se=0;se<W.length;++se){const re=W[se];m.push(T+re)}g=v+(g.length>0?" "+g:g)}return g};function Mb(){let a=0,l,o,i="";for(;a<arguments.length;)(l=arguments[a++])&&(o=qp(l))&&(i&&(i+=" "),i+=o);return i}const qp=a=>{if(typeof a=="string")return a;let l,o="";for(let i=0;i<a.length;i++)a[i]&&(l=qp(a[i]))&&(o&&(o+=" "),o+=l);return o};function Ob(a,...l){let o,i,u,d=m;function m(g){const p=l.reduce((v,b)=>b(v),a());return o=Ab(p),i=o.cache.get,u=o.cache.set,d=h,h(g)}function h(g){const p=i(g);if(p)return p;const v=Rb(g,o);return u(g,v),v}return function(){return d(Mb.apply(null,arguments))}}const vt=a=>{const l=o=>o[a]||[];return l.isThemeGetter=!0,l},Vp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Db=/^\d+\/\d+$/,zb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lb=/\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$/,Ub=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ha=a=>Db.test(a),ze=a=>!!a&&!Number.isNaN(Number(a)),Ts=a=>!!a&&Number.isInteger(Number(a)),tu=a=>a.endsWith("%")&&ze(a.slice(0,-1)),Wr=a=>zb.test(a),Hb=()=>!0,Bb=a=>Lb.test(a)&&!Ub.test(a),Gp=()=>!1,qb=a=>Pb.test(a),Vb=a=>_b.test(a),Fb=a=>!xe(a)&&!ye(a),Gb=a=>Ya(a,Kp,Gp),xe=a=>Vp.test(a),Js=a=>Ya(a,Yp,Bb),ru=a=>Ya(a,Xb,ze),Ph=a=>Ya(a,Ip,Gp),Ib=a=>Ya(a,$p,Vb),bo=a=>Ya(a,Xp,qb),ye=a=>Fp.test(a),$n=a=>Xa(a,Yp),$b=a=>Xa(a,Jb),_h=a=>Xa(a,Ip),Kb=a=>Xa(a,Kp),Yb=a=>Xa(a,$p),jo=a=>Xa(a,Xp,!0),Ya=(a,l,o)=>{const i=Vp.exec(a);return i?i[1]?l(i[1]):o(i[2]):!1},Xa=(a,l,o=!1)=>{const i=Fp.exec(a);return i?i[1]?l(i[1]):o:!1},Ip=a=>a==="position"||a==="percentage",$p=a=>a==="image"||a==="url",Kp=a=>a==="length"||a==="size"||a==="bg-size",Yp=a=>a==="length",Xb=a=>a==="number",Jb=a=>a==="family-name",Xp=a=>a==="shadow",Qb=()=>{const a=vt("color"),l=vt("font"),o=vt("text"),i=vt("font-weight"),u=vt("tracking"),d=vt("leading"),m=vt("breakpoint"),h=vt("container"),g=vt("spacing"),p=vt("radius"),v=vt("shadow"),b=vt("inset-shadow"),E=vt("text-shadow"),O=vt("drop-shadow"),A=vt("blur"),C=vt("perspective"),M=vt("aspect"),R=vt("ease"),N=vt("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...V(),ye,xe],se=()=>["auto","hidden","clip","visible","scroll"],re=()=>["auto","contain","none"],F=()=>[ye,xe,g],te=()=>[Ha,"full","auto",...F()],ie=()=>[Ts,"none","subgrid",ye,xe],z=()=>["auto",{span:["full",Ts,ye,xe]},Ts,ye,xe],U=()=>[Ts,"auto",ye,xe],J=()=>["auto","min","max","fr",ye,xe],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...F()],k=()=>[Ha,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],L=()=>[a,ye,xe],le=()=>[...V(),_h,Ph,{position:[ye,xe]}],S=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",Kb,Gb,{size:[ye,xe]}],Z=()=>[tu,$n,Js],H=()=>["","none","full",p,ye,xe],$=()=>["",ze,$n,Js],fe=()=>["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=()=>[ze,tu,_h,Ph],de=()=>["","none",A,ye,xe],we=()=>["none",ze,ye,xe],Se=()=>["none",ze,ye,xe],be=()=>[ze,ye,xe],Oe=()=>[Ha,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wr],breakpoint:[Wr],color:[Hb],container:[Wr],"drop-shadow":[Wr],ease:["in","out","in-out"],font:[Fb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wr],shadow:[Wr],spacing:["px",ze],text:[Wr],"text-shadow":[Wr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ha,xe,ye,M]}],container:["container"],columns:[{columns:[ze,xe,ye,h]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:se()}],"overflow-x":[{"overflow-x":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:re()}],"overscroll-x":[{"overscroll-x":re()}],"overscroll-y":[{"overscroll-y":re()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{start:te()}],end:[{end:te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[Ts,"auto",ye,xe]}],basis:[{basis:[Ha,"full","auto",h,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,Ha,"auto","initial","none",xe]}],grow:[{grow:["",ze,ye,xe]}],shrink:[{shrink:["",ze,ye,xe]}],order:[{order:[Ts,"first","last","none",ye,xe]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[h,"screen",...k()]}],"min-w":[{"min-w":[h,"screen","none",...k()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[m]},...k()]}],h:[{h:["screen","lh",...k()]}],"min-h":[{"min-h":["screen","lh","none",...k()]}],"max-h":[{"max-h":["screen","lh",...k()]}],"font-size":[{text:["base",o,$n,Js]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ye,ru]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tu,xe]}],"font-family":[{font:[$b,xe,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,ye,xe]}],"line-clamp":[{"line-clamp":[ze,"none",ye,ru]}],leading:[{leading:[d,...F()]}],"list-image":[{"list-image":["none",ye,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,xe]}],"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:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",ye,Js]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[ze,"auto",ye,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,xe]}],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",ye,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:S()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ts,ye,xe],radial:["",ye,xe],conic:[Ts,ye,xe]},Yb,Ib]}],"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:$()}],"border-w-x":[{"border-x":$()}],"border-w-y":[{"border-y":$()}],"border-w-s":[{"border-s":$()}],"border-w-e":[{"border-e":$()}],"border-w-t":[{"border-t":$()}],"border-w-r":[{"border-r":$()}],"border-w-b":[{"border-b":$()}],"border-w-l":[{"border-l":$()}],"divide-x":[{"divide-x":$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"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:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,ye,xe]}],"outline-w":[{outline:["",ze,$n,Js]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",v,jo,bo]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",b,jo,bo]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[ze,Js]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",E,jo,bo]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[ze,ye,xe]}],"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":[ze]}],"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":[ye,xe]}],"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":V()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"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:le()}],"mask-repeat":[{mask:S()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,xe]}],filter:[{filter:["","none",ye,xe]}],blur:[{blur:de()}],brightness:[{brightness:[ze,ye,xe]}],contrast:[{contrast:[ze,ye,xe]}],"drop-shadow":[{"drop-shadow":["","none",O,jo,bo]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",ze,ye,xe]}],"hue-rotate":[{"hue-rotate":[ze,ye,xe]}],invert:[{invert:["",ze,ye,xe]}],saturate:[{saturate:[ze,ye,xe]}],sepia:[{sepia:["",ze,ye,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,xe]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[ze,ye,xe]}],"backdrop-contrast":[{"backdrop-contrast":[ze,ye,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,ye,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,ye,xe]}],"backdrop-invert":[{"backdrop-invert":["",ze,ye,xe]}],"backdrop-opacity":[{"backdrop-opacity":[ze,ye,xe]}],"backdrop-saturate":[{"backdrop-saturate":[ze,ye,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,ye,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",ye,xe]}],ease:[{ease:["linear","initial",R,ye,xe]}],delay:[{delay:[ze,ye,xe]}],animate:[{animate:["none",N,ye,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ye,xe]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[ye,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"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",ye,xe]}],"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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",ye,xe]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[ze,$n,Js,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"]}},Zb=Ob(Qb);function ts(...a){return Zb(yb(a))}const Wb=({message:a,type:l="info",duration:o=3e3,onClose:i,visible:u})=>{const{t:d}=ve();x.useEffect(()=>{if(u){const p=setTimeout(()=>{i()},o);return()=>clearTimeout(p)}},[u,o,i]);const m={success:s.jsx(Ka,{className:"w-5 h-5 text-green-500"}),error:s.jsx(Wn,{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"},g={success:"text-green-800",error:"text-red-800",info:"text-blue-800",warning:"text-yellow-800"};return s.jsx("div",{className:ts("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:ts("text-sm font-medium",g[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:ts("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(Wn,{className:"h-5 w-5"})]})})})]})})},Jp=x.createContext(void 0),nl=()=>{const a=x.useContext(Jp);if(!a)throw new Error("useToast must be used within a ToastProvider");return a},e1=({children:a})=>{const[l,o]=x.useState({message:"",type:"info",visible:!1,duration:3e3}),i=x.useCallback((d,m="info",h=3e3)=>{o({message:d,type:m,visible:!0,duration:h})},[]),u=x.useCallback(()=>{o(d=>({...d,visible:!1}))},[]);return s.jsxs(Jp.Provider,{value:{showToast:i},children:[a,s.jsx(Wb,{message:l.message,type:l.type,duration:l.duration,onClose:u,visible:l.visible})]})},Qp=x.createContext(void 0),t1=()=>{const a=x.useContext(Qp);if(!a)throw new Error("useTheme must be used within a ThemeProvider");return a},r1=({children:a})=>{const[l,o]=x.useState(()=>localStorage.getItem("theme")||"system"),[i,u]=x.useState("light"),d=m=>{o(m),localStorage.setItem("theme",m)};return x.useEffect(()=>{const m=()=>{const g=window.document.documentElement,p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",v=l==="system"?p:l;u(v),v==="dark"?(console.log("Applying dark mode to HTML root element"),g.classList.add("dark"),document.body.style.backgroundColor="#111827"):(console.log("Removing dark mode from HTML root element"),g.classList.remove("dark"),document.body.style.backgroundColor="")},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})},wo={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},Zp=x.createContext(void 0),s1=({children:a})=>{const{t:l}=ve(),{auth:o}=Ws(),[i,u]=x.useState([]),[d,m]=x.useState(null),[h,g]=x.useState(0),[p,v]=x.useState(!0),[b,E]=x.useState(0),O=x.useRef(null),A=x.useRef(0),C=x.useRef(0),M=3e3,R=()=>{O.current&&(clearInterval(O.current),O.current=null)},N=x.useCallback(ie=>{const z=(ie==null?void 0:ie.immediate)??!0;R();const U=async()=>{try{console.log("[ServerContext] Fetching servers from API...");const J=await Ge("/servers");C.current=Date.now(),J&&J.success&&Array.isArray(J.data)?u(J.data):J&&Array.isArray(J)?u(J):(console.error("Invalid server data format:",J),u([])),m(null)}catch(J){console.error("Error fetching servers during normal polling:",J),navigator.onLine?J instanceof TypeError&&(J.message.includes("NetworkError")||J.message.includes("Failed to fetch"))?m(l("errors.serverConnection")):m(l("errors.serverFetch")):m(l("errors.network"))}};z&&U(),O.current=setInterval(U,wo.normal.pollingInterval)},[l]);x.useEffect(()=>{o.isAuthenticated?(console.log("[ServerContext] User authenticated, triggering refresh"),g(ie=>ie+1)):(console.log("[ServerContext] User not authenticated, clearing data and stopping polling"),R(),u([]),v(!1),m(null))},[o.isAuthenticated]),x.useEffect(()=>{if(!o.isAuthenticated){console.log("[ServerContext] User not authenticated, skipping polling setup");return}h>0&&(A.current=0,E(0));const ie=async()=>{try{console.log("[ServerContext] Initial fetch - attempt",A.current+1);const z=await Ge("/servers");return C.current=Date.now(),z&&z.success&&Array.isArray(z.data)?(u(z.data),v(!1),N({immediate:!1}),!0):z&&Array.isArray(z)?(u(z),v(!1),N({immediate:!1}),!0):(console.error("Invalid server data format:",z),u([]),v(!1),N({immediate:!1}),!0)}catch(z){return A.current+=1,console.error(`Initial loading attempt ${A.current} failed:`,z),E(A.current),navigator.onLine?m(l("errors.initialStartup")):m(l("errors.network")),A.current>=wo.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),v(!1),R(),N()),!1}};return p?(R(),ie(),O.current=setInterval(ie,wo.startup.pollingInterval),console.log(`Started initial polling with interval: ${wo.startup.pollingInterval}ms`)):N(),()=>{R()}},[h,l,p,N]);const T=x.useCallback(()=>{R(),p&&(v(!0),A.current=0,E(0)),g(ie=>ie+1)},[p]),V=x.useCallback(()=>{const z=Date.now()-C.current;console.log("[ServerContext] refreshIfNeeded called, time since last fetch:",z,"ms"),z>=M?(console.log("[ServerContext] Triggering refresh (exceeded MIN_REFRESH_INTERVAL:",M,"ms)"),T()):console.log("[ServerContext] Skipping refresh (MIN_REFRESH_INTERVAL:",M,"ms, time since last:",z,"ms)")},[T]),W=x.useCallback(()=>{g(ie=>ie+1)},[]),se=x.useCallback(async ie=>{try{const z=await Ge("/settings");if(z&&z.success&&z.data&&z.data.mcpServers&&z.data.mcpServers[ie.name]){const U=z.data.mcpServers[ie.name];return{name:ie.name,status:ie.status,tools:ie.tools||[],config:U}}else return console.error("Failed to get server config from settings:",z),m(l("server.invalidConfig",{serverName:ie.name})),null}catch(z){return console.error("Error fetching server settings:",z),m(z instanceof Error?z.message:String(z)),null}},[l]),re=x.useCallback(async ie=>{try{const z=encodeURIComponent(ie),U=await Zn(`/servers/${z}`);return!U||!U.success?(m((U==null?void 0:U.message)||l("server.deleteError",{serverName:ie})),!1):(g(J=>J+1),!0)}catch(z){return m(l("errors.general")+": "+(z instanceof Error?z.message:String(z))),!1}},[l]),F=x.useCallback(async(ie,z)=>{try{const U=encodeURIComponent(ie.name),J=await Nt(`/servers/${U}/toggle`,{enabled:z});return!J||!J.success?(console.error("Failed to toggle server:",J),m((J==null?void 0:J.message)||l("server.toggleError",{serverName:ie.name})),!1):(g(K=>K+1),!0)}catch(U){return console.error("Error toggling server:",U),m(U instanceof Error?U.message:String(U)),!1}},[l]),te={servers:i,error:d,setError:m,isLoading:p,fetchAttempts:b,triggerRefresh:T,refreshIfNeeded:V,handleServerAdd:W,handleServerEdit:se,handleServerRemove:re,handleServerToggle:F};return s.jsx(Zp.Provider,{value:te,children:a})},a1=()=>{const a=x.useContext(Zp);if(a===void 0)throw new Error("useServerContext must be used within a ServerProvider");return a},Wp=()=>{const{t:a}=ve(),{theme:l,setTheme:o}=t1(),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(sb,{className:"h-5 w-5"}):s.jsx(db,{className:"h-5 w-5"})})},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:"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"})]})},eg=()=>{const{i18n:a}=ve(),[l,o]=x.useState(!1),[i,u]=x.useState(a.language),d=[{code:"en",label:"English"},{code:"zh",label:"中文"},{code:"fr",label:"Français"}];x.useEffect(()=>{u(a.language)},[a.language]),x.useEffect(()=>{const g=p=>{p.target.closest(".language-dropdown")||o(!1)};return l&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[l]);const m=g=>{localStorage.setItem("i18nextLng",g),o(!1),window.location.reload()},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(n1,{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(g=>s.jsx("button",{onClick:()=>m(g.code),className:`flex items-center w-full px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${i.startsWith(g.code)?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,children:g.label},g.code))})})]})},l1=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"})]})},o1=({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.10.0"}),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(l1,{className:"h-5 w-5"})}),s.jsx(Wp,{}),s.jsx(eg,{})]})]})})},Kn=({permissions:a,fallback:l=null,children:o})=>tg(a)?s.jsx(s.Fragment,{children:o}):s.jsx(s.Fragment,{children:l}),tg=a=>{const{auth:l}=Ws();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))},i1="https://registry.npmjs.org",c1="@samanhappy/mcphub",rg=async()=>{try{const a=await fetch(`${i1}/${c1}/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}},sg=(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},u1=({isOpen:a,onClose:l,version:o})=>{const{t:i}=ve(),[u,d]=x.useState(!1),[m,h]=x.useState(""),[g,p]=x.useState(!1),v=async()=>{p(!0);try{const b=await rg();b&&(h(b),d(sg(o,b)>0))}catch(b){console.error("Failed to check for updates:",b)}finally{p(!1)}};return x.useEffect(()=>{a&&v()},[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(Wn,{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:v,disabled:g,className:`mt-4 inline-flex items-center px-4 py-2 border border-gray-200 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium btn-secondary
|
|
196
|
+
${g?"text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800":"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600"} focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500`,children:[s.jsx(lb,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),i(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},d1=({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(Wn,{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},f1=({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(Wn,{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},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.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"})]})},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("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"})]})},p1=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"})]})},g1=({collapsed:a,version:l})=>{var re;const{t:o,i18n:i}=ve(),u=zr(),{auth:d,logout:m}=Ws(),[h,g]=x.useState(!1),[p,v]=x.useState(!1),[b,E]=x.useState(!1),[O,A]=x.useState(!1),[C,M]=x.useState(!1),R=x.useRef(null);x.useEffect(()=>{(async()=>{try{const te=await rg();te&&v(sg(l,te)>0)}catch(te){console.error("Error checking for new version:",te)}})()},[l]),x.useEffect(()=>{const F=te=>{R.current&&!R.current.contains(te.target)&&g(!1)};return document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[]);const N=()=>{u("/settings"),g(!1)},T=()=>{m(),u("/login")},V=()=>{E(!0),g(!1)},W=()=>{A(!0),g(!1)},se=()=>{M(!0),g(!1)};return s.jsxs("div",{ref:R,className:"relative",children:[s.jsxs("button",{onClick:()=>g(!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(hb,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),p&&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:((re=d.user)==null?void 0:re.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(p1,{className:"h-4 w-4 mr-2"}),o("sponsor.label")]}),i.language==="zh"?s.jsxs("button",{onClick:se,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("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(h1,{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(ib,{className:"h-4 w-4 mr-2"}),o("nav.settings")]}),s.jsxs("button",{onClick:V,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(Jv,{className:"h-4 w-4 mr-2"}),o("about.title"),p&&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:T,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(tb,{className:"h-4 w-4 mr-2"}),o("app.logout")]})]}),s.jsx(u1,{isOpen:b,onClose:()=>E(!1),version:l}),s.jsx(d1,{open:O,onOpenChange:A}),s.jsx(f1,{open:C,onOpenChange:M})]})},x1=({collapsed:a})=>{var d;const{t:l}=ve(),{auth:o}=Ws(),i="0.10.0",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&&tg("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(Ep,{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(g1,{collapsed:a,version:i})})]})},y1=({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})}),v1=()=>{const[a,l]=Fa.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(o1,{onToggleSidebar:o}),s.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[s.jsx(x1,{collapsed:a}),s.jsx(y1,{children:s.jsx(bp,{})})]})]})},b1=({redirectPath:a="/login"})=>{const{t:l}=ve(),{auth:o}=Ws();return o.loading?s.jsx("div",{className:"flex items-center justify-center h-screen",children:l("app.loading")}):o.isAuthenticated?s.jsx(bp,{}):s.jsx(To,{to:a,replace:!0})},j1=({isOpen:a,onClose:l})=>{const{t:o}=ve(),i=zr();if(!a)return null;const u=()=>{l(),i("/settings"),setTimeout(()=>{const h=document.querySelector('[data-section="password"]');if(h){h.scrollIntoView({behavior:"smooth",block:"start"});const g=h.querySelector('[role="button"]');g&&!h.querySelector(".mt-4")&&g.click()}},100)},d=h=>{h.target===h.currentTarget&&l()},m=h=>{h.key==="Escape"&&l()};return s.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:d,onKeyDown:m,tabIndex:-1,children:s.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full transform transition-all duration-200 ease-out",role:"dialog","aria-modal":"true","aria-labelledby":"password-warning-title","aria-describedby":"password-warning-message",children:s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("svg",{className:"w-6 h-6 text-yellow-600 dark:text-yellow-400",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"})})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{id:"password-warning-title",className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:o("auth.defaultPasswordWarning")}),s.jsx("p",{id:"password-warning-message",className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:o("auth.defaultPasswordMessage")})]})]}),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 dark:text-gray-300 hover:text-gray-800 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors duration-150 btn-secondary",children:o("common.cancel")}),s.jsx("button",{onClick:u,className:"px-4 py-2 bg-yellow-600 hover:bg-yellow-700 text-white rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 btn-warning",autoFocus:!0,children:o("auth.goToSettings")})]})]})})})},w1=()=>{const{t:a}=ve(),[l,o]=x.useState(""),[i,u]=x.useState(""),[d,m]=x.useState(null),[h,g]=x.useState(!1),[p,v]=x.useState(!1),{login:b}=Ws(),E=zr(),O=async C=>{C.preventDefault(),m(null),g(!0);try{if(!l||!i){m(a("auth.emptyFields")),g(!1);return}const M=await b(l,i);M.success?M.isUsingDefaultPassword?v(!0):E("/"):m(a("auth.loginFailed"))}catch{m(a("auth.loginError"))}finally{g(!1)}},A=()=>{v(!1),E("/")};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(Wp,{}),s.jsx(eg,{})]}),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:O,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:C=>o(C.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:C=>u(C.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")})})]})]})]})}),s.jsx(j1,{isOpen:p,onClose:A})]})},ll=a=>{const l=a1(),{refreshIfNeeded:o}=l;return x.useEffect(()=>{a!=null&&a.refreshOnMount&&o()},[a==null?void 0:a.refreshOnMount,o]),l},N1=()=>{const{t:a}=ve(),{servers:l,error:o,setError:i,isLoading:u}=ll({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,oauthRequired:l.filter(h=>h.status==="oauth_required").length},m={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting",oauth_required:"status.oauthRequired"};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,g)=>{var p,v;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.jsxs("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":h.status==="oauth_required"?"status-badge-oauth-required":"status-badge-connecting"}`,children:[h.status==="oauth_required"&&"🔐 ",a(m[h.status]||h.status)]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((p=h.tools)==null?void 0:p.length)||0}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((v=h.prompts)==null?void 0:v.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:"✗"})})]},g)})})]})})]})]})},S1="modulepreload",C1=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(v){return Promise.all(v.map(b=>Promise.resolve(b).then(E=>({status:"fulfilled",value:E}),E=>({status:"rejected",reason:E}))))};const h=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),p=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=m(o.map(v=>{if(v=C1(v,i),v in Hh)return;Hh[v]=!0;const b=v.endsWith(".css"),E=b?'[rel="stylesheet"]':"";if(!!i)for(let C=h.length-1;C>=0;C--){const M=h[C];if(M.href===v&&(!b||M.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${E}`))return;const A=document.createElement("link");if(A.rel=b?"stylesheet":S1,b||(A.as="script"),A.crossOrigin="",A.href=v,p&&A.setAttribute("nonce",p),document.head.appendChild(A),b)return new Promise((C,M)=>{A.addEventListener("load",C),A.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${v}`)))})}))}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)})},E1={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 No({children:a,variant:l="default",className:o,onClick:i}){return s.jsx("span",{className:ts("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",E1[l],i?"cursor-pointer":"",o),onClick:i,children:a})}const k1=({status:a,onAuthClick:l})=>{const{t:o}=ve(),i={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline",oauth_required:"status-badge-oauth-required"},u={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting",oauth_required:"status.oauthRequired"},d=a==="oauth_required";return s.jsxs("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${i[a]} ${d&&l?"cursor-pointer hover:opacity-80":""}`,onClick:d&&l?m=>l(m):void 0,title:d?o("status.clickToAuthorize"):void 0,children:[d&&"🔐 ",o(u[a]||a)]})},ag=async(a,l)=>{try{const o=l?`/tools/${l}/${a.toolName}`:"/tools/call",i=await Nt(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"}}},A1=async(a,l,o)=>{try{const i=await Nt(`/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"}}},ng=async(a,l,o)=>{try{const i=await Ft(`/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"}}},T1=Object.freeze(Object.defineProperty({__proto__:null,callTool:ag,toggleTool:A1,updateToolDescription:ng},Symbol.toStringTag,{value:"Module"})),ea=()=>{const{t:a}=ve(),{showToast:l}=nl(),[o,i]=x.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!1,bearerAuthKey:"",skipAuth:!1}),[u,d]=x.useState({bearerAuthKey:""}),[m,h]=x.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[g,p]=x.useState({enabled:!1,dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[v,b]=x.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[E,O]=x.useState("-"),[A,C]=x.useState(!1),[M,R]=x.useState(null),[N,T]=x.useState(0),V=x.useCallback(()=>{T(B=>B+1)},[]),W=x.useCallback(async()=>{var B,j,k,L,le,S,_,Z,H,$;C(!0),R(null);try{const fe=await Ge("/settings");fe.success&&((j=(B=fe.data)==null?void 0:B.systemConfig)!=null&&j.routing)&&i({enableGlobalRoute:fe.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:fe.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:fe.data.systemConfig.routing.enableBearerAuth??!1,bearerAuthKey:fe.data.systemConfig.routing.bearerAuthKey||"",skipAuth:fe.data.systemConfig.routing.skipAuth??!1}),fe.success&&((L=(k=fe.data)==null?void 0:k.systemConfig)!=null&&L.install)&&h({pythonIndexUrl:fe.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:fe.data.systemConfig.install.npmRegistry||"",baseUrl:fe.data.systemConfig.install.baseUrl||"http://localhost:3000"}),fe.success&&((S=(le=fe.data)==null?void 0:le.systemConfig)!=null&&S.smartRouting)&&p({enabled:fe.data.systemConfig.smartRouting.enabled??!1,dbUrl:fe.data.systemConfig.smartRouting.dbUrl||"",openaiApiBaseUrl:fe.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:fe.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:fe.data.systemConfig.smartRouting.openaiApiEmbeddingModel||""}),fe.success&&((Z=(_=fe.data)==null?void 0:_.systemConfig)!=null&&Z.mcpRouter)&&b({apiKey:fe.data.systemConfig.mcpRouter.apiKey||"",referer:fe.data.systemConfig.mcpRouter.referer||"https://www.mcphubx.com",title:fe.data.systemConfig.mcpRouter.title||"MCPHub",baseUrl:fe.data.systemConfig.mcpRouter.baseUrl||"https://api.mcprouter.to/v1"}),fe.success&&(($=(H=fe.data)==null?void 0:H.systemConfig)==null?void 0:$.nameSeparator)!==void 0&&O(fe.data.systemConfig.nameSeparator)}catch(fe){console.error("Failed to fetch settings:",fe),R(fe instanceof Error?fe.message:"Failed to fetch settings"),l(a("errors.failedToFetchSettings"))}finally{C(!1)}},[a]),se=async(B,j)=>{C(!0),R(null);try{const k=await Ft("/system-config",{routing:{[B]:j}});return k.success?(i({...o,[B]:j}),l(a("settings.systemConfigUpdated")),!0):(l(k.message||a("errors.failedToUpdateRouteConfig")),!1)}catch(k){return console.error("Failed to update routing config:",k),R(k instanceof Error?k.message:"Failed to update routing config"),l(a("errors.failedToUpdateRouteConfig")),!1}finally{C(!1)}},re=async(B,j)=>{C(!0),R(null);try{const k=await Ft("/system-config",{install:{[B]:j}});return k.success?(h({...m,[B]:j}),l(a("settings.systemConfigUpdated")),!0):(l(k.message||a("errors.failedToUpdateSystemConfig")),!1)}catch(k){return console.error("Failed to update system config:",k),R(k instanceof Error?k.message:"Failed to update system config"),l(a("errors.failedToUpdateSystemConfig")),!1}finally{C(!1)}},F=async(B,j)=>{C(!0),R(null);try{const k=await Ft("/system-config",{smartRouting:{[B]:j}});return k.success?(p({...g,[B]:j}),l(a("settings.systemConfigUpdated")),!0):(l(k.message||a("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(k){console.error("Failed to update smart routing config:",k);const L=k instanceof Error?k.message:"Failed to update smart routing config";return R(L),l(L),!1}finally{C(!1)}},te=async B=>{C(!0),R(null);try{const j=await Ft("/system-config",{smartRouting:B});return j.success?(p({...g,...B}),l(a("settings.systemConfigUpdated")),!0):(l(j.message||a("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(j){console.error("Failed to update smart routing config:",j);const k=j instanceof Error?j.message:"Failed to update smart routing config";return R(k),l(k),!1}finally{C(!1)}},ie=async B=>{C(!0),R(null);try{const j=await Ft("/system-config",{routing:B});return j.success?(i({...o,...B}),l(a("settings.systemConfigUpdated")),!0):(l(j.message||a("errors.failedToUpdateRouteConfig")),!1)}catch(j){return console.error("Failed to update routing config:",j),R(j instanceof Error?j.message:"Failed to update routing config"),l(a("errors.failedToUpdateRouteConfig")),!1}finally{C(!1)}},z=async(B,j)=>{C(!0),R(null);try{const k=await Ft("/system-config",{mcpRouter:{[B]:j}});return k.success?(b({...v,[B]:j}),l(a("settings.systemConfigUpdated")),!0):(l(k.message||a("errors.failedToUpdateSystemConfig")),!1)}catch(k){console.error("Failed to update MCPRouter config:",k);const L=k instanceof Error?k.message:"Failed to update MCPRouter config";return R(L),l(L),!1}finally{C(!1)}},U=async B=>{C(!0),R(null);try{const j=await Ft("/system-config",{mcpRouter:B});return j.success?(b({...v,...B}),l(a("settings.systemConfigUpdated")),!0):(l(j.message||a("errors.failedToUpdateSystemConfig")),!1)}catch(j){console.error("Failed to update MCPRouter config:",j);const k=j instanceof Error?j.message:"Failed to update MCPRouter config";return R(k),l(k),!1}finally{C(!1)}},J=async B=>{C(!0),R(null);try{const j=await Ft("/system-config",{nameSeparator:B});return j.success?(O(B),l(a("settings.restartRequired"),"info"),!0):(l(j.message||a("errors.failedToUpdateSystemConfig")),!1)}catch(j){console.error("Failed to update name separator:",j);const k=j instanceof Error?j.message:"Failed to update name separator";return R(k),l(k),!1}finally{C(!1)}},K=async B=>{C(!0),R(null);try{return await Ge(`/mcp-settings/export?serverName=${B||""}`)}catch(j){console.error("Failed to export MCP settings:",j);const k=j instanceof Error?j.message:"Failed to export MCP settings";R(k),l(k)}finally{C(!1)}};return x.useEffect(()=>{W()},[W,N]),x.useEffect(()=>{o&&d({bearerAuthKey:o.bearerAuthKey})},[o]),{routingConfig:o,tempRoutingConfig:u,setTempRoutingConfig:d,installConfig:m,smartRoutingConfig:g,mcpRouterConfig:v,nameSeparator:E,loading:A,error:M,setError:R,triggerRefresh:V,fetchSettings:W,updateRoutingConfig:se,updateInstallConfig:re,updateSmartRoutingConfig:F,updateSmartRoutingConfigBatch:te,updateRoutingConfigBatch:ie,updateMCPRouterConfig:z,updateMCPRouterConfigBatch:U,updateNameSeparator:J,exportMCPSettings:K}},Qs=({checked:a,onCheckedChange:l,disabled:o=!1})=>s.jsx("button",{type:"button",role:"switch","aria-checked":a,disabled:o,className:ts("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:ts("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",a?"translate-x-6":"translate-x-1")})}),lg=({schema:a,onSubmit:l,onCancel:o,loading:i=!1,storageKey:u,title:d})=>{const{t:m}=ve(),[h,g]=x.useState({}),[p,v]=x.useState({}),[b,E]=x.useState(!1),[O,A]=x.useState(""),[C,M]=x.useState(""),R=x.useMemo(()=>(U=>{const J=K=>{if(typeof K=="object"&&K!==null){const B=K;return{type:B.type||"string",description:B.description,enum:B.enum,default:B.default,properties:B.properties?Object.fromEntries(Object.entries(B.properties).map(([j,k])=>[j,J(k)])):void 0,required:B.required,items:B.items?J(B.items):void 0}}return{type:"string"}};return{type:U.type,properties:U.properties?Object.fromEntries(Object.entries(U.properties).map(([K,B])=>[K,J(B)])):void 0,required:U.required}})(a),[a]);x.useEffect(()=>{const z=(J,K="")=>{const B={};return J.type==="object"&&J.properties&&Object.entries(J.properties).forEach(([j,k])=>{const L=K?`${K}.${j}`:j;k.default!==void 0?B[j]=k.default:k.type==="string"?B[j]="":k.type==="number"||k.type==="integer"?B[j]=0:k.type==="boolean"?B[j]=!1:k.type==="array"?B[j]=[]:k.type==="object"&&(k.properties?B[j]=z(k,L):B[j]={})}),B};let U=z(R);if(u)try{const J=localStorage.getItem(u);if(J){const K=JSON.parse(J);U={...U,...K}}}catch(J){console.warn("Failed to load saved form data:",J)}g(U)},[R,u]),x.useEffect(()=>{b&&Object.keys(h).length>0&&(A(JSON.stringify(h,null,2)),M(""))},[b,h]);const N=z=>{A(z),M("");try{const U=JSON.parse(z);if(g(U),u)try{localStorage.setItem(u,JSON.stringify(U))}catch(J){console.warn("Failed to save form data to localStorage:",J)}}catch{M(m("tool.invalidJsonFormat"))}},T=()=>{A(JSON.stringify(h,null,2)),M(""),E(!0)},V=()=>{if(O.trim())try{const z=JSON.parse(O);g(z),M(""),E(!1)}catch{M(m("tool.fixJsonBeforeSwitching"));return}else E(!1)},W=(z,U)=>{g(J=>{const K={...J},B=z.split(".");let j=K;for(let k=0;k<B.length-1;k++)j[B[k]]||(j[B[k]]={}),j=j[B[k]];if(j[B[B.length-1]]=U,u)try{localStorage.setItem(u,JSON.stringify(K))}catch(k){console.warn("Failed to save form data to localStorage:",k)}return K}),p[z]&&v(J=>{const K={...J};return delete K[z],K})},se=()=>{const z={},U=(J,K,B="")=>{J.type==="object"&&J.properties&&Object.entries(J.properties).forEach(([j,k])=>{var S;const L=B?`${B}.${j}`:j,le=F(K,L);if((S=J.required)!=null&&S.includes(j)&&(le==null||le==="")){z[L]=`${j} is required`;return}le!=null&&le!==""&&(k.type==="string"&&typeof le!="string"?z[L]=`${j} must be a string`:k.type==="number"&&typeof le!="number"?z[L]=`${j} must be a number`:k.type==="integer"&&(!Number.isInteger(le)||typeof le!="number")?z[L]=`${j} must be an integer`:k.type==="boolean"&&typeof le!="boolean"?z[L]=`${j} must be a boolean`:k.type==="array"&&Array.isArray(le)?k.items&&le.forEach((_,Z)=>{var H;((H=k.items)==null?void 0:H.type)==="object"&&k.items.properties&&U(k.items,_,`${L}.${Z}`)}):k.type==="object"&&typeof le=="object"&&U(k,le,L))})};return U(R,h),v(z),Object.keys(z).length===0},re=z=>{z.preventDefault(),se()&&l(h)},F=(z,U)=>U.split(".").reduce((J,K)=>J==null?void 0:J[K],z),te=(z,U,J,K)=>{const B=J==null?void 0:J[z];return U.type==="string"?U.enum?s.jsxs("select",{value:B||"",onChange:j=>K(j.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")}),U.enum.map((j,k)=>s.jsx("option",{value:j,children:j},k))]}):s.jsx("input",{type:"text",value:B||"",onChange:j=>K(j.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:U.description||m("tool.enterKey",{key:z})}):U.type==="number"||U.type==="integer"?s.jsx("input",{type:"number",step:U.type==="integer"?"1":"any",value:B??"",onChange:j=>{const k=j.target.value===""?"":U.type==="integer"?parseInt(j.target.value):parseFloat(j.target.value);K(k)},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"}):U.type==="boolean"?s.jsx("input",{type:"checkbox",checked:B||!1,onChange:j=>K(j.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):s.jsx("input",{type:"text",value:B||"",onChange:j=>K(j.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:U.description||m("tool.enterKey",{key:z})})},ie=(z,U,J="")=>{var k,L,le,S,_,Z,H,$,fe,ee,Y,de,we,Se;const K=J?`${J}.${z}`:z,B=F(h,K),j=p[K];if(U.type==="array"){const be=F(h,K)||[];return s.jsxs("div",{className:"mb-6",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?(L=(k=F(R,J))==null?void 0:k.required)==null?void 0:L.includes(z):(le=R.required)==null?void 0:le.includes(z))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),s.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[be.map((Oe,ue)=>{var Te,nt,kt;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:ue+1})}),s.jsx("button",{type:"button",onClick:()=>{const Ue=[...be];Ue.splice(ue,1),W(K,Ue)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((Te=U.items)==null?void 0:Te.type)==="string"&&U.items.enum?s.jsxs("select",{value:Oe||"",onChange:Ue=>{const At=[...be];At[ue]=Ue.target.value,W(K,At)},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")}),U.items.enum.map((Ue,At)=>s.jsx("option",{value:Ue,children:Ue},At))]}):((nt=U.items)==null?void 0:nt.type)==="object"&&U.items.properties?s.jsx("div",{className:"space-y-3",children:Object.entries(U.items.properties).map(([Ue,At])=>{var wr,Wt;return s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Ue,((Wt=(wr=U.items)==null?void 0:wr.required)==null?void 0:Wt.includes(Ue))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),te(Ue,At,Oe,er=>{const tr=[...be];tr[ue]={...tr[ue],[Ue]:er},W(K,tr)})]},Ue)})}):s.jsx("input",{type:"text",value:Oe||"",onChange:Ue=>{const At=[...be];At[ue]=Ue.target.value,W(K,At)},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:((kt=U.items)==null?void 0:kt.type)||"value"})})]},ue)}),s.jsx("button",{type:"button",onClick:()=>{var ue;const Oe=((ue=U.items)==null?void 0:ue.type)==="object"?{}:"";W(K,[...be,Oe])},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:z})})]}),j&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]},K)}return U.type==="object"?U.properties?s.jsxs("div",{className:"mb-6",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?(_=(S=F(R,J))==null?void 0:S.required)==null?void 0:_.includes(z):(Z=R.required)==null?void 0:Z.includes(z))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),s.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(U.properties).map(([be,Oe])=>ie(be,Oe,K))}),j&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]},K):s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?($=(H=F(R,J))==null?void 0:H.required)==null?void 0:$.includes(z):(fe=R.required)==null?void 0:fe.includes(z))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"}),s.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),U.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),s.jsx("textarea",{value:typeof B=="object"?JSON.stringify(B,null,2):B||"{}",onChange:be=>{try{const Oe=JSON.parse(be.target.value);W(K,Oe)}catch{W(K,be.target.value)}},placeholder:`{
|
|
198
|
+
"key": "value"
|
|
199
|
+
}`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${j?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),j&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]},K):U.type==="string"?U.enum?s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?!1:(ee=R.required)==null?void 0:ee.includes(z))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),s.jsxs("select",{value:B||"",onChange:be=>W(K,be.target.value),className:`w-full border rounded-md px-3 py-2 ${j?"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")}),U.enum.map((be,Oe)=>s.jsx("option",{value:be,children:be},Oe))]}),j&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]},K):s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?!1:(Y=R.required)==null?void 0:Y.includes(z))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),s.jsx("input",{type:"text",value:B||"",onChange:be=>W(K,be.target.value),className:`w-full border rounded-md px-3 py-2 ${j?"border-red":"border-gray-200"} focus:outline-none form-input`}),j&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]},K):U.type==="number"||U.type==="integer"?s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?!1:(de=R.required)==null?void 0:de.includes(z))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),s.jsx("input",{type:"number",step:U.type==="integer"?"1":"any",value:B??"",onChange:be=>{const Oe=be.target.value===""?"":U.type==="integer"?parseInt(be.target.value):parseFloat(be.target.value);W(K,Oe)},className:`w-full border rounded-md px-3 py-2 form-input ${j?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),j&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]},K):U.type==="boolean"?s.jsxs("div",{className:"mb-4",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",checked:B||!1,onChange:be=>W(K,be.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:[z,(J?!1:(we=R.required)==null?void 0:we.includes(z))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),U.description&&s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:U.description}),j&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]},K):s.jsxs("div",{className:"mb-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?!1:(Se=R.required)==null?void 0:Se.includes(z))&&s.jsx("span",{className:"text-status-red ml-1",children:"*"}),s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",U.type,")"]})]}),U.description&&s.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),s.jsx("input",{type:"text",value:B||"",onChange:be=>W(K,be.target.value),placeholder:m("tool.enterValue",{type:U.type}),className:`w-full border rounded-md px-3 py-2 ${j?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),j&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]},K)};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:V,className:`px-3 py-1 text-sm rounded-md transition-colors ${b?"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:T,className:`px-3 py-1 text-sm rounded-md transition-colors ${b?"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")})]})]}),b?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:O,onChange:z=>N(z.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 ${C?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),C&&s.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]}),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 z=JSON.parse(O);l(z)}catch{M(m("tool.invalidJsonFormat"))}},disabled:i||!!C,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:re,className:"space-y-4",children:[Object.entries(R.properties||{}).map(([z,U])=>ie(z,U)),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")})]})]})},R1=({result:a,onClose:l})=>{const{t:o}=ve(),i=a.content,u=m=>Array.isArray(m)?m.map((h,g)=>s.jsx("div",{className:"mb-3 last:mb-0",children:d(h)},g)):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(zp,{size:20,className:"text-status-green"}):s.jsx(Lp,{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 M1(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 O1=({tool:a,server:l,onToggle:o,onDescriptionUpdate:i})=>{const{t:u}=ve(),{nameSeparator:d}=ea(),[m,h]=x.useState(!1),[g,p]=x.useState(!1),[v,b]=x.useState(!1),[E,O]=x.useState(null),[A,C]=x.useState(!1),[M,R]=x.useState(a.description||""),N=x.useRef(null),T=x.useRef(null),[V,W]=x.useState(0);x.useEffect(()=>{A&&N.current&&(N.current.focus(),V>0&&(N.current.style.width=`${V+20}px`))},[A,V]),x.useEffect(()=>{!A&&T.current&&W(T.current.offsetWidth)},[A,M]);const se=x.useCallback(()=>`mcphub_tool_form_${l?`${l}_`:""}${a.name}`,[a.name,l]),re=x.useCallback(()=>{localStorage.removeItem(se())},[se]),F=j=>{o&&o(a.name,j)},te=()=>{C(!0)},ie=async()=>{try{const j=await ng(l,a.name,M);j.success?(C(!1),i&&i(a.name,M)):(R(a.description||""),console.error("Failed to update tool description:",j.error))}catch(j){console.error("Error updating tool description:",j),R(a.description||""),C(!1)}},z=j=>{R(j.target.value)},U=j=>{j.key==="Enter"?ie():j.key==="Escape"&&(R(a.description||""),C(!1))},J=async j=>{b(!0);try{j=Object.fromEntries(Object.entries(j).filter(([L,le])=>!M1(le)));const k=await ag({toolName:a.name,arguments:j},l);O(k)}catch(k){O({success:!1,error:k instanceof Error?k.message:"Unknown error occurred"})}finally{b(!1)}},K=()=>{p(!1),re(),O(null)},B=()=>{O(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:A?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:M,onChange:z,onKeyDown:U,onClick:j=>j.stopPropagation(),style:{minWidth:"100px",width:V>0?`${V+20}px`:"auto"}}),s.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:j=>{j.stopPropagation(),ie()},children:s.jsx(Ka,{size:16})})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:T,children:M||u("tool.noDescription")}),s.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:j=>{j.stopPropagation(),te()},children:s.jsx(Ho,{size:14})})]})})]})}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"flex items-center space-x-2",onClick:j=>j.stopPropagation(),children:s.jsx(Qs,{checked:a.enabled??!0,onCheckedChange:F,disabled:v})}),s.jsxs("button",{onClick:j=>{j.stopPropagation(),h(!0),p(!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:v||!a.enabled,children:[v?s.jsx(Up,{size:14,className:"animate-spin"}):s.jsx(Pp,{size:14}),s.jsx("span",{children:u(v?"tool.running":"tool.run")})]}),s.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:m?s.jsx(_o,{size:18}):s.jsx(Au,{size:18})})]})]}),m&&s.jsxs("div",{className:"mt-4 space-y-4",children:[!g&&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)})]}),g&&s.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[s.jsx(lg,{schema:a.inputSchema||{type:"object"},onSubmit:J,onCancel:K,loading:v,storageKey:se(),title:u("tool.runToolWithName",{name:a.name.replace(l+d,"")})}),E&&s.jsx("div",{className:"mt-4",children:s.jsx(R1,{result:E,onClose:B})})]})]})]})},og=async(a,l)=>{try{const o=await Nt(`/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"}}},D1=async(a,l,o)=>{try{const i=await Nt(`/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"}}},z1=Object.freeze(Object.defineProperty({__proto__:null,getPrompt:og,togglePrompt:D1},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(zp,{size:20,className:"text-status-green"}):s.jsx(Lp,{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")})})]})})]})},L1=({prompt:a,server:l,onToggle:o,onDescriptionUpdate:i})=>{const{t:u}=ve(),{nameSeparator:d}=ea(),[m,h]=x.useState(!1),[g,p]=x.useState(!1),[v,b]=x.useState(!1),[E,O]=x.useState(null),[A,C]=x.useState(!1),[M,R]=x.useState(a.description||""),N=x.useRef(null),T=x.useRef(null),[V,W]=x.useState(0);x.useEffect(()=>{A&&N.current&&(N.current.focus(),V>0&&(N.current.style.width=`${V+20}px`))},[A,V]),x.useEffect(()=>{!A&&T.current&&W(T.current.offsetWidth)},[A,M]);const se=x.useCallback(()=>`mcphub_prompt_form_${l?`${l}_`:""}${a.name}`,[a.name,l]),re=x.useCallback(()=>{localStorage.removeItem(se())},[se]),F=k=>{o&&o(a.name,k)},te=()=>{C(!0)},ie=async()=>{C(!1),i&&i(a.name,M)},z=k=>{R(k.target.value)},U=k=>{k.key==="Enter"?ie():k.key==="Escape"&&(R(a.description||""),C(!1))},J=async k=>{b(!0);try{const L=await og({promptName:a.name,arguments:k},l);console.log("GetPrompt result:",L),O({success:L.success,data:L.data,error:L.error})}catch(L){O({success:!1,error:L instanceof Error?L.message:"Unknown error occurred"})}finally{b(!1)}},K=()=>{p(!1),re(),O(null)},B=()=>{O(null)},j=()=>{if(!a.arguments||a.arguments.length===0)return{type:"object",properties:{},required:[]};const k={},L=[];return a.arguments.forEach(le=>{k[le.name]={type:"string",description:le.description||""},le.required&&L.push(le.name)}),{type:"object",properties:k,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:A?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:M,onChange:z,onKeyDown:U,onClick:k=>k.stopPropagation(),style:{minWidth:"100px",width:V>0?`${V+20}px`:"auto"}}),s.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:k=>{k.stopPropagation(),ie()},children:s.jsx(Ka,{size:16})})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:T,children:M||u("tool.noDescription")}),s.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:k=>{k.stopPropagation(),te()},children:s.jsx(Ho,{size:14})})]})})]})}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"flex items-center space-x-2",onClick:k=>k.stopPropagation(),children:a.enabled!==void 0&&s.jsx(Qs,{checked:a.enabled,onCheckedChange:F,disabled:v})}),s.jsxs("button",{onClick:k=>{k.stopPropagation(),h(!0),p(!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:v||!a.enabled,children:[v?s.jsx(Up,{size:14,className:"animate-spin"}):s.jsx(Pp,{size:14}),s.jsx("span",{children:u(v?"tool.running":"tool.run")})]}),s.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:m?s.jsx(_o,{size:18}):s.jsx(Au,{size:18})})]})]}),m&&s.jsxs("div",{className:"mt-4 space-y-4",children:[g&&s.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[s.jsx(lg,{schema:j(),onSubmit:J,onCancel:K,loading:v,storageKey:se(),title:u("prompt.runPromptWithName",{name:a.name.replace(l+d,"")})}),E&&s.jsx("div",{className:"mt-4",children:s.jsx(qh,{result:E,onClose:B})})]}),!g&&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((k,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:k.name}),k.required&&s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),k.description&&s.jsx("p",{className:"text-sm text-gray-600 mt-1",children:k.description})]}),s.jsx("div",{className:"text-xs text-gray-500 ml-2",children:k.title||""})]},L))})]}),!g&&E&&s.jsx("div",{className:"mt-4",children:s.jsx(qh,{result:E,onClose:B})})]})]})},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 J,K;const{t:d}=ve(),{showToast:m}=nl(),[h,g]=x.useState(!1),[p,v]=x.useState(!1),[b,E]=x.useState(!1),[O,A]=x.useState(!1),[C,M]=x.useState(!1),R=x.useRef(null);x.useEffect(()=>{const B=j=>{R.current&&!R.current.contains(j.target)&&A(!1)};return document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[]);const{exportMCPSettings:N}=ea(),T=B=>{B.stopPropagation(),v(!0)},V=B=>{B.stopPropagation(),o(a)},W=async B=>{if(B.stopPropagation(),!(b||!i)){E(!0);try{await i(a,a.enabled===!1)}finally{E(!1)}}},se=B=>{B.stopPropagation(),A(!O)},re=B=>{if(B.stopPropagation(),!!a.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(a.error).then(()=>{M(!0),m(d("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>M(!1),2e3)});else{const j=document.createElement("textarea");j.value=a.error,j.style.position="fixed",j.style.left="-9999px",document.body.appendChild(j),j.focus(),j.select();try{document.execCommand("copy"),M(!0),m(d("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>M(!1),2e3)}catch(k){m(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",k)}document.body.removeChild(j)}},F=async B=>{B.stopPropagation();try{const j=await N(a.name),k=JSON.stringify(j.data,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(k),m(d("common.copySuccess")||"Copied to clipboard","success");else{const L=document.createElement("textarea");L.value=k,L.style.position="fixed",L.style.left="-9999px",document.body.appendChild(L),L.focus(),L.select();try{document.execCommand("copy"),m(d("common.copySuccess")||"Copied to clipboard","success")}catch(le){m(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",le)}document.body.removeChild(L)}}catch(j){console.error("Error copying server configuration:",j),m(d("common.copyFailed")||"Copy failed","error")}},te=()=>{l(a.name),v(!1)},ie=async(B,j)=>{try{const{toggleTool:k}=await Bh(async()=>{const{toggleTool:le}=await Promise.resolve().then(()=>T1);return{toggleTool:le}},[],import.meta.url),L=await k(a.name,B,j);L.success?(m(d(j?"tool.enableSuccess":"tool.disableSuccess",{name:B}),"success"),u&&u()):m(L.error||d("tool.toggleFailed"),"error")}catch(k){console.error("Error toggling tool:",k),m(d("tool.toggleFailed"),"error")}},z=async(B,j)=>{try{const{togglePrompt:k}=await Bh(async()=>{const{togglePrompt:le}=await Promise.resolve().then(()=>z1);return{togglePrompt:le}},void 0,import.meta.url),L=await k(a.name,B,j);L.success?(m(d(j?"tool.enableSuccess":"tool.disableSuccess",{name:B}),"success"),u&&u()):m(L.error||d("tool.toggleFailed"),"error")}catch(k){console.error("Error toggling prompt:",k),m(d("tool.toggleFailed"),"error")}},U=B=>{var j;if(B.stopPropagation(),(j=a.oauth)!=null&&j.authorizationUrl){const le=window.screen.width/2-300,S=window.screen.height/2-700/2;window.open(a.oauth.authorizationUrl,"OAuth Authorization",`width=600,height=700,left=${le},top=${S}`),m(d("status.oauthWindowOpened"),"info")}};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:()=>g(!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(k1,{status:a.status,onAuthClick:U}),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:[((J=a.tools)==null?void 0:J.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:[((K=a.prompts)==null?void 0:K.length)||0," ",d("server.prompts")]})]}),a.error&&s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"cursor-pointer",onClick:se,"aria-label":d("server.viewErrorDetails"),children:s.jsx(Tu,{className:"text-red-500 hover:text-red-600",size:18})}),O&&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:re,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:d("common.copy"),children:C?s.jsx(Ka,{size:14,className:"text-green-500"}):s.jsx(Mo,{size:14})})]}),s.jsx("button",{onClick:B=>{B.stopPropagation(),A(!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:F,className:"px-3 py-1 btn-secondary",children:d("server.copy")}),s.jsx("button",{onClick:V,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 ${b?"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:b,children:b?d("common.processing"):a.enabled!==!1?d("server.disable"):d("server.enable")})}),s.jsx("button",{onClick:T,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(_o,{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,j)=>s.jsx(O1,{server:a.name,tool:B,onToggle:ie},j))})]}),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,j)=>s.jsx(L1,{server:a.name,prompt:B,onToggle:z},j))})]})]})]}),s.jsx(Mu,{isOpen:p,onClose:()=>v(!1),onConfirm:te,serverName:a.name})]})},ol=({onSubmit:a,onCancel:l,initialData:o=null,modalTitle:i,formError:u=null})=>{var S,_,Z,H,$,fe,ee,Y,de,we,Se,be,Oe,ue,Te,nt,kt,Ue,At,wr,Wt,er,tr,as,ns,Rs,rr,ht,zt,pt,ls,pr,ta,Lr,Ur,sr,gr,Nr,ra,Ms,Pr,Sr,Cr,sa,Os;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(([ae,he])=>({key:ae,value:he,description:""})),g=me=>{var he;const ae=(he=me==null?void 0:me.config)==null?void 0:he.oauth;return{clientId:(ae==null?void 0:ae.clientId)||"",clientSecret:(ae==null?void 0:ae.clientSecret)||"",scopes:ae!=null&&ae.scopes?ae.scopes.join(" "):"",accessToken:(ae==null?void 0:ae.accessToken)||"",refreshToken:(ae==null?void 0:ae.refreshToken)||"",authorizationEndpoint:(ae==null?void 0:ae.authorizationEndpoint)||"",tokenEndpoint:(ae==null?void 0:ae.tokenEndpoint)||"",resource:(ae==null?void 0:ae.resource)||""}},[p,v]=x.useState(m()),[b,E]=x.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},oauth:g(o),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:((S=o.config.openapi.security)==null?void 0:S.type)||"none",apiKeyName:((Z=(_=o.config.openapi.security)==null?void 0:_.apiKey)==null?void 0:Z.name)||"",apiKeyIn:(($=(H=o.config.openapi.security)==null?void 0:H.apiKey)==null?void 0:$.in)||"header",apiKeyValue:((ee=(fe=o.config.openapi.security)==null?void 0:fe.apiKey)==null?void 0:ee.value)||"",httpScheme:((de=(Y=o.config.openapi.security)==null?void 0:Y.http)==null?void 0:de.scheme)||"bearer",httpCredentials:((Se=(we=o.config.openapi.security)==null?void 0:we.http)==null?void 0:Se.credentials)||"",oauth2Token:((Oe=(be=o.config.openapi.security)==null?void 0:be.oauth2)==null?void 0:Oe.token)||"",openIdConnectUrl:((Te=(ue=o.config.openapi.security)==null?void 0:ue.openIdConnect)==null?void 0:Te.url)||"",openIdConnectToken:((kt=(nt=o.config.openapi.security)==null?void 0:nt.openIdConnect)==null?void 0:kt.token)||"",passthroughHeaders:o.config.openapi.passthroughHeaders?o.config.openapi.passthroughHeaders.join(", "):""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none",passthroughHeaders:""}}),[O,A]=x.useState(o&&o.config&&o.config.env?Object.entries(o.config.env).map(([me,ae])=>({key:me,value:ae})):[]),[C,M]=x.useState(o&&o.config&&o.config.headers?Object.entries(o.config.headers).map(([me,ae])=>({key:me,value:ae})):[]),[R,N]=x.useState(!1),[T,V]=x.useState(!1),[W,se]=x.useState(null),re=!!o,F=me=>{const{name:ae,value:he}=me.target;E({...b,[ae]:he})},te=me=>{const ae=me.split(" ").filter(he=>he.trim()!=="");E({...b,arguments:me,args:ae})},ie=me=>{v(me),E(ae=>({...ae,type:me}))},z=(me,ae,he)=>{const Gt=[...O];Gt[me][ae]=he,A(Gt)},U=()=>{A([...O,{key:"",value:""}])},J=me=>{const ae=[...O];ae.splice(me,1),A(ae)},K=(me,ae,he)=>{const Gt=[...C];Gt[me][ae]=he,M(Gt)},B=()=>{M([...C,{key:"",value:""}])},j=me=>{const ae=[...C];ae.splice(me,1),M(ae)},k=(me,ae)=>{E(he=>({...he,oauth:{...he.oauth||{},[me]:ae}}))},L=(me,ae)=>{E(he=>({...he,options:{...he.options,[me]:ae}}))},le=async me=>{var ae,he,Gt;me.preventDefault(),se(null);try{const Ve={};O.forEach(({key:lt,value:Tt})=>{lt.trim()&&(Ve[lt.trim()]=Tt)});const Pe={};C.forEach(({key:lt,value:Tt})=>{lt.trim()&&(Pe[lt.trim()]=Tt)});const Ze={};(ae=b.options)!=null&&ae.timeout&&b.options.timeout!==6e4&&(Ze.timeout=b.options.timeout),(he=b.options)!=null&&he.resetTimeoutOnProgress&&(Ze.resetTimeoutOnProgress=b.options.resetTimeoutOnProgress),(Gt=b.options)!=null&&Gt.maxTotalTimeout&&(Ze.maxTotalTimeout=b.options.maxTotalTimeout);const rt=(()=>{if(!b.oauth)return;const{clientId:lt,clientSecret:Tt,scopes:Er,accessToken:It,refreshToken:_t,authorizationEndpoint:gt,tokenEndpoint:Lt,resource:ct}=b.oauth,pe={};if(lt&<.trim()&&(pe.clientId=lt.trim()),Tt&&Tt.trim()&&(pe.clientSecret=Tt.trim()),Er&&Er.trim()){const Re=Er.split(/[\s,]+/).map(ke=>ke.trim()).filter(ke=>ke.length>0);Re.length>0&&(pe.scopes=Re)}return It&&It.trim()&&(pe.accessToken=It.trim()),_t&&_t.trim()&&(pe.refreshToken=_t.trim()),gt&>.trim()&&(pe.authorizationEndpoint=gt.trim()),Lt&&Lt.trim()&&(pe.tokenEndpoint=Lt.trim()),ct&&ct.trim()&&(pe.resource=ct.trim()),Object.keys(pe).length>0?pe:void 0})(),xr={name:b.name,config:{type:p,...p==="openapi"?{openapi:(()=>{var Tt,Er,It,_t,gt,Lt,ct;const lt={version:((Tt=b.openapi)==null?void 0:Tt.version)||"3.1.0"};if(((Er=b.openapi)==null?void 0:Er.inputMode)==="url")lt.url=((It=b.openapi)==null?void 0:It.url)||"";else if(((_t=b.openapi)==null?void 0:_t.inputMode)==="schema"&&((gt=b.openapi)!=null&>.schema))try{lt.schema=JSON.parse(b.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(Lt=b.openapi)!=null&&Lt.securityType&&b.openapi.securityType!=="none"&&(lt.security={type:b.openapi.securityType,...b.openapi.securityType==="apiKey"&&{apiKey:{name:b.openapi.apiKeyName||"",in:b.openapi.apiKeyIn||"header",value:b.openapi.apiKeyValue||""}},...b.openapi.securityType==="http"&&{http:{scheme:b.openapi.httpScheme||"bearer",credentials:b.openapi.httpCredentials||""}},...b.openapi.securityType==="oauth2"&&{oauth2:{token:b.openapi.oauth2Token||""}},...b.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:b.openapi.openIdConnectUrl||"",token:b.openapi.openIdConnectToken||""}}}),(ct=b.openapi)!=null&&ct.passthroughHeaders&&b.openapi.passthroughHeaders.trim()&&(lt.passthroughHeaders=b.openapi.passthroughHeaders.split(",").map(pe=>pe.trim()).filter(pe=>pe.length>0)),lt})(),...Object.keys(Pe).length>0?{headers:Pe}:{}}:p==="sse"||p==="streamable-http"?{url:b.url,...Object.keys(Pe).length>0?{headers:Pe}:{},...rt?{oauth:rt}:{}}:{command:b.command,args:b.args,env:Object.keys(Ve).length>0?Ve:void 0},...Object.keys(Ze).length>0?{options:Ze}:{}}};a(xr)}catch(Ve){se(`Error: ${Ve instanceof Error?Ve.message:String(Ve)}`)}};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:"✕"})]}),(W||u)&&s.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:u||W}),s.jsxs("form",{onSubmit:le,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:b.name,onChange:F,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: time-mcp",required:!0,disabled:re})]}),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:()=>ie("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:()=>ie("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:()=>ie("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:()=>ie("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:((Ue=b.openapi)==null?void 0:Ue.inputMode)==="url",onChange:()=>E(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:((At=b.openapi)==null?void 0:At.inputMode)==="schema",onChange:()=>E(me=>({...me,openapi:{...me.openapi,inputMode:"schema"}})),className:"mr-1"}),s.jsx("label",{htmlFor:"input-mode-schema",children:d("server.openapi.inputModeSchema")})]})]})]}),((wr=b.openapi)==null?void 0:wr.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:((Wt=b.openapi)==null?void 0:Wt.url)||"",onChange:me=>E(ae=>({...ae,openapi:{...ae.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"&&((er=b.openapi)==null?void 0:er.inputMode)==="url"})]}),((tr=b.openapi)==null?void 0:tr.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:((as=b.openapi)==null?void 0:as.schema)||"",onChange:me=>E(ae=>({...ae,openapi:{...ae.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"&&((ns=b.openapi)==null?void 0:ns.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:((Rs=b.openapi)==null?void 0:Rs.securityType)||"none",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,securityType:me.target.value,url:((he=ae.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")})]})]}),((rr=b.openapi)==null?void 0:rr.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:((ht=b.openapi)==null?void 0:ht.apiKeyName)||"",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,apiKeyName:me.target.value,url:((he=ae.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:((zt=b.openapi)==null?void 0:zt.apiKeyIn)||"header",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,apiKeyIn:me.target.value,url:((he=ae.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:((pt=b.openapi)==null?void 0:pt.apiKeyValue)||"",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,apiKeyValue:me.target.value,url:((he=ae.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"})]})]})]}),((ls=b.openapi)==null?void 0:ls.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:((pr=b.openapi)==null?void 0:pr.httpScheme)||"bearer",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,httpScheme:me.target.value,url:((he=ae.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:((ta=b.openapi)==null?void 0:ta.httpCredentials)||"",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,httpCredentials:me.target.value,url:((he=ae.openapi)==null?void 0:he.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((Lr=b.openapi)==null?void 0:Lr.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((Ur=b.openapi)==null?void 0:Ur.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:((sr=b.openapi)==null?void 0:sr.oauth2Token)||"",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,oauth2Token:me.target.value,url:((he=ae.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"})]})})]}),((gr=b.openapi)==null?void 0:gr.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:((Nr=b.openapi)==null?void 0:Nr.openIdConnectUrl)||"",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,openIdConnectUrl:me.target.value,url:((he=ae.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:((ra=b.openapi)==null?void 0:ra.openIdConnectToken)||"",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,openIdConnectToken:me.target.value,url:((he=ae.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:((Ms=b.openapi)==null?void 0:Ms.passthroughHeaders)||"",onChange:me=>E(ae=>{var he;return{...ae,openapi:{...ae.openapi,passthroughHeaders:me.target.value,url:((he=ae.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:B,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),C.map((me,ae)=>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=>K(ae,"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=>K(ae,"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:()=>j(ae),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:"-"})]},ae))]})]}):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:b.url,onChange:F,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:p==="streamable-http"?"e.g.: http://localhost:3000/mcp":"e.g.: http://localhost:3000/sse",required:p==="sse"||p==="streamable-http"})]}),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:B,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),C.map((me,ae)=>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=>K(ae,"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=>K(ae,"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:()=>j(ae),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:"-"})]},ae))]}),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:()=>V(!T),children:[s.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.oauth.sectionTitle")}),s.jsx("span",{className:"text-gray-500 text-sm",children:T?"▼":"▶"})]}),T&&s.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[s.jsx("p",{className:"text-xs text-gray-500 mb-3",children:d("server.oauth.sectionDescription")}),s.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.oauth.clientId")}),s.jsx("input",{type:"text",value:((Pr=b.oauth)==null?void 0:Pr.clientId)||"",onChange:me=>k("clientId",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:"client id",autoComplete:"off"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.oauth.clientSecret")}),s.jsx("input",{type:"password",value:((Sr=b.oauth)==null?void 0:Sr.clientSecret)||"",onChange:me=>k("clientSecret",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:"client secret",autoComplete:"off"})]})]})]})]})]}):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:b.command,onChange:F,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: npx",required:p==="stdio"})]}),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:b.arguments,onChange:me=>te(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:U,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),O.map((me,ae)=>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=>z(ae,"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=>z(ae,"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:()=>J(ae),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:"-"})]},ae))]})]}),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:()=>N(!R),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:R?"▼":"▶"})]}),R&&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:((Cr=b.options)==null?void 0:Cr.timeout)||6e4,onChange:me=>L("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:((sa=b.options)==null?void 0:sa.maxTotalTimeout)||"",onChange:me=>L("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:((Os=b.options)==null?void 0:Os.resetTimeoutOnProgress)||!1,onChange:me=>L("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(re?"server.save":"server.add")})]})]})]})},ig=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,g)=>u(h,`${m}[${g}]`)):d&&typeof d=="object"&&Object.entries(d).forEach(([h,g])=>{u(g,m?`${m}.${h}`:h)})};return u(a),Array.from(l)},P1=({onAdd:a})=>{const{t:l}=ve(),[o,i]=x.useState(!1),[u,d]=x.useState(null),[m,h]=x.useState(!1),[g,p]=x.useState(null),[v,b]=x.useState([]),E=()=>{i(!o),d(null),h(!1),p(null)},O=async()=>{g&&(await A(g),h(!1),p(null))},A=async M=>{try{d(null);const R=await Nt("/servers",M);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"))}},C=async M=>{try{const R=ig(M);R.length>0?(b(R),p(M),h(!0)):await A(M)}catch(R){console.error("Error processing server submission:",R),d(l("errors.serverAdd"))}};return s.jsxs("div",{children:[s.jsxs("button",{onClick:E,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(ol,{onSubmit:C,onCancel:E,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:v.map((M,R)=>s.jsxs("li",{className:"font-mono",children:["$",`{${M}}`]},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),p(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:O,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:l("server.confirmAndAdd")})]})]})})]})},_1=({server:a,onEdit:l,onCancel:o})=>{const{t:i}=ve(),[u,d]=x.useState(null),m=async h=>{try{d(null);const g=encodeURIComponent(a.name),p=await Ft(`/servers/${g}`,h);if(!p.success){p&&p.message?d(p.message):d(i("server.updateError",{serverName:a.name}));return}l()}catch(g){console.error("Error updating server:",g),navigator.onLine?g instanceof TypeError&&(g.message.includes("NetworkError")||g.message.includes("Failed to fetch"))?d(i("errors.serverConnection")):d(i("errors.serverUpdate",{serverName: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(ol,{onSubmit:m,onCancel:o,initialData:a,modalTitle:i("server.editTitle",{serverName:a.name}),formError:u})})},H1=({isOpen:a,onClose:l,onConfirm:o,title:i,message:u,confirmText:d,cancelText:m,variant:h="warning"})=>{const{t:g}=ve();if(!a)return null;const p=()=>{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:v,confirmClass:b}=p(),E=A=>{A.target===A.currentTarget&&l()},O=A=>{A.key==="Escape"?l():A.key==="Enter"&&o()};return s.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:E,onKeyDown:O,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:[v&&s.jsx("div",{className:"flex-shrink-0",children:v}),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||g("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 ${b} ${h==="danger"?"btn-danger":h==="warning"?"btn-warning":"btn-primary"}`,children:d||g("common.confirm")})]})]})})})},B1=({onSuccess:a,onCancel:l})=>{const{t:o}=ve(),[i,u]=x.useState(!1),[d,m]=x.useState(!1),[h,g]=x.useState(null),[p,v]=x.useState(null),[b,E]=x.useState(!1),[O,A]=x.useState(null),[C,M]=x.useState(""),[R,N]=x.useState(!1),[T,V]=x.useState(""),W=K=>{K.preventDefault(),u(!0)},se=K=>{K.preventDefault(),u(!1)},re=K=>{K.preventDefault(),u(!1);const B=K.dataTransfer.files;if(B.length>0){const j=B[0];j.name.endsWith(".dxt")?(v(j),g(null)):g(o("dxt.invalidFileType"))}},F=K=>{const B=K.target.files;if(B&&B.length>0){const j=B[0];j.name.endsWith(".dxt")?(v(j),g(null)):g(o("dxt.invalidFileType"))}},te=async()=>{if(!p){g(o("dxt.noFileSelected"));return}m(!0),g(null);try{const K=new FormData;K.append("dxtFile",p);const B=await Eu(Cu("/dxt/upload"),{method:"POST",body:K}),j=await B.json();if(!B.ok)throw new Error(j.message||`HTTP error! Status: ${B.status}`);if(j.success&&j.data)A(j.data.manifest),M(j.data.extractDir),E(!0);else throw new Error(j.message||o("dxt.uploadFailed"))}catch(K){console.error("DXT upload error:",K),g(K instanceof Error?K.message:o("dxt.uploadFailed"))}finally{m(!1)}},ie=async(K,B=!1)=>{var j;m(!0),g(null);try{const k=J(O,C,K);if(!B){const le=await Ge("/servers");if(le.success&&((j=le.data)==null?void 0:j.find(_=>_.name===K))){V(K),N(!0),m(!1);return}}let L;if(B?L=await Ft(`/servers/${encodeURIComponent(K)}`,{name:K,config:k}):L=await Nt("/servers",{name:K,config:k}),L.success)a(k);else throw new Error(L.message||o("dxt.installFailed"))}catch(k){console.error("DXT install error:",k),g(k instanceof Error?k.message:o("dxt.installFailed")),m(!1)}},z=()=>{N(!1),T&&ie(T,!0)},U=()=>{N(!1),V(""),m(!1)},J=(K,B,j)=>{var le;const k=((le=K.server)==null?void 0:le.mcp_config)||{},L={type:"stdio",command:k.command||"node",args:(k.args||[]).map(S=>S.replace("${__dirname}",B))};return k.env&&Object.keys(k.env).length>0&&(L.env={...k.env},Object.keys(L.env).forEach(S=>{typeof L.env[S]=="string"&&(L.env[S]=L.env[S].replace("${__dirname}",B))})),L};return b&&O?s.jsxs(s.Fragment,{children:[s.jsx(H1,{isOpen:R,onClose:U,onConfirm:z,title:o("dxt.serverExistsTitle"),message:o("dxt.serverExistsConfirm",{serverName:T}),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"),":"]})," ",O.display_name||O.name]}),s.jsxs("div",{children:[s.jsxs("strong",{children:[o("dxt.version"),":"]})," ",O.version]}),s.jsxs("div",{children:[s.jsxs("strong",{children:[o("dxt.description"),":"]})," ",O.description]}),O.author&&s.jsxs("div",{children:[s.jsxs("strong",{children:[o("dxt.author"),":"]})," ",O.author.name]}),O.tools&&O.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:O.tools.map((K,B)=>s.jsxs("li",{children:[K.name," - ",K.description]},B))})]})]})]}),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:O.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 K=document.getElementById("serverName"),B=(K==null?void 0:K.value.trim())||O.name;ie(B)},disabled:d,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:d?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":p?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:W,onDragLeave:se,onDrop:re,children:[p?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:p.name}),s.jsxs("p",{className:"text-xs text-gray-500",children:[(p.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:F,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:te,disabled:!p||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")})]})]})})},q1=({onSuccess:a,onCancel:l})=>{const{t:o}=ve(),[i,u]=x.useState(""),[d,m]=x.useState(null),[h,g]=x.useState(!1),[p,v]=x.useState(null),b=`STDIO example:
|
|
216
|
+
{
|
|
217
|
+
"mcpServers": {
|
|
218
|
+
"stdio-server-example": {
|
|
219
|
+
"command": "npx",
|
|
220
|
+
"args": ["-y", "mcp-server-example"]
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
SSE example:
|
|
226
|
+
{
|
|
227
|
+
"mcpServers": {
|
|
228
|
+
"sse-server-example": {
|
|
229
|
+
"type": "sse",
|
|
230
|
+
"url": "http://localhost:3000"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
HTTP example:
|
|
236
|
+
{
|
|
237
|
+
"mcpServers": {
|
|
238
|
+
"http-server-example": {
|
|
239
|
+
"type": "streamable-http",
|
|
240
|
+
"url": "http://localhost:3001",
|
|
241
|
+
"headers": {
|
|
242
|
+
"Content-Type": "application/json",
|
|
243
|
+
"Authorization": "Bearer your-token"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}`,E=C=>{try{const M=JSON.parse(C.trim());return!M.mcpServers||typeof M.mcpServers!="object"?(m(o("jsonImport.invalidFormat")),null):M}catch{return m(o("jsonImport.parseError")),null}},O=()=>{m(null);const C=E(i);if(!C)return;const M=Object.entries(C.mcpServers).map(([R,N])=>{const T={};return N.type==="sse"||N.type==="streamable-http"?(T.type=N.type,T.url=N.url,N.headers&&(T.headers=N.headers)):(T.type="stdio",T.command=N.command,T.args=N.args||[],N.env&&(T.env=N.env)),{name:R,config:T}});v(M)},A=async()=>{if(p){g(!0),m(null);try{let C=0;const M=[];for(const R of p)try{const N=await Nt("/servers",{name:R.name,config:R.config});N.success?C++:M.push(`${R.name}: ${N.message||o("jsonImport.addFailed")}`)}catch(N){M.push(`${R.name}: ${N instanceof Error?N.message:o("jsonImport.addFailed")}`)}M.length>0&&m(o("jsonImport.partialSuccess",{count:C,total:p.length})+`
|
|
248
|
+
`+M.join(`
|
|
249
|
+
`)),C>0&&a()}catch(C){console.error("Import error:",C),m(o("jsonImport.importFailed"))}finally{g(!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 shadow rounded-lg p-6 w-full max-w-4xl max-h-[90vh] 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("jsonImport.title")}),s.jsx("button",{onClick:l,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),d&&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 whitespace-pre-wrap",children:d})}),p?s.jsxs("div",{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:o("jsonImport.previewTitle")}),s.jsx("div",{className:"space-y-3",children:p.map((C,M)=>s.jsx("div",{className:"bg-gray-50 p-4 rounded-lg border border-gray-200",children:s.jsx("div",{className:"flex items-start justify-between",children:s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"font-medium text-gray-900",children:C.name}),s.jsxs("div",{className:"mt-2 space-y-1 text-sm text-gray-600",children:[s.jsxs("div",{children:[s.jsxs("strong",{children:[o("server.type"),":"]})," ",C.config.type||"stdio"]}),C.config.command&&s.jsxs("div",{children:[s.jsxs("strong",{children:[o("server.command"),":"]})," ",C.config.command]}),C.config.args&&C.config.args.length>0&&s.jsxs("div",{children:[s.jsxs("strong",{children:[o("server.arguments"),":"]})," ",C.config.args.join(" ")]}),C.config.url&&s.jsxs("div",{children:[s.jsxs("strong",{children:[o("server.url"),":"]})," ",C.config.url]}),C.config.env&&Object.keys(C.config.env).length>0&&s.jsxs("div",{children:[s.jsxs("strong",{children:[o("server.envVars"),":"]})," ",Object.keys(C.config.env).join(", ")]}),C.config.headers&&Object.keys(C.config.headers).length>0&&s.jsxs("div",{children:[s.jsxs("strong",{children:[o("server.headers"),":"]})," ",Object.keys(C.config.headers).join(", ")]})]})]})})},M))})]}),s.jsxs("div",{className:"flex justify-end space-x-4",children:[s.jsx("button",{onClick:()=>v(null),disabled:h,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:o("common.back")}),s.jsx("button",{onClick:A,disabled:h,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:h?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("jsonImport.importing")]}):o("jsonImport.import")})]})]}):s.jsxs("div",{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:o("jsonImport.inputLabel")}),s.jsx("textarea",{value:i,onChange:C=>u(C.target.value),className:"w-full h-96 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:b}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:o("jsonImport.inputHelp")})]}),s.jsxs("div",{className:"flex justify-end space-x-4",children:[s.jsx("button",{onClick:l,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:o("common.cancel")}),s.jsx("button",{onClick:O,disabled:!i.trim(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 btn-primary",children:o("jsonImport.preview")})]})]})]})})},V1=()=>{const{t:a}=ve(),l=zr(),{servers:o,error:i,setError:u,isLoading:d,handleServerAdd:m,handleServerEdit:h,handleServerRemove:g,handleServerToggle:p,triggerRefresh:v}=ll({refreshOnMount:!0}),[b,E]=x.useState(null),[O,A]=x.useState(!1),[C,M]=x.useState(!1),[R,N]=x.useState(!1),T=async F=>{const te=await h(F);te&&E(te)},V=()=>{E(null),v()},W=async()=>{A(!0);try{v(),await new Promise(F=>setTimeout(F,500))}finally{A(!1)}},se=F=>{M(!1),v()},re=()=>{N(!1),v()};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(P1,{onAdd:m}),s.jsxs("button",{onClick:()=>N(!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",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 01-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),a("jsonImport.button")]}),s.jsxs("button",{onClick:()=>M(!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:W,disabled: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 ${O?"opacity-70 cursor-not-allowed":""}`,children:[O?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((F,te)=>s.jsx(U1,{server:F,onRemove:g,onEdit:T,onToggle:p,onRefresh:v},te))}),b&&s.jsx(_1,{server:b,onEdit:V,onCancel:()=>E(null)}),C&&s.jsx(B1,{onSuccess:se,onCancel:()=>M(!1)}),R&&s.jsx(q1,{onSuccess:re,onCancel:()=>N(!1)})]})},Ou=()=>{const{t:a}=ve(),[l,o]=x.useState([]),[i,u]=x.useState(!0),[d,m]=x.useState(null),[h,g]=x.useState(0),p=x.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)}},[]),v=x.useCallback(()=>{g(R=>R+1)},[]),b=async(R,N,T=[])=>{try{const V=await Nt("/groups",{name:R,description:N,servers:T});return console.log("Group created successfully:",V),!V||!V.success?(m((V==null?void 0:V.message)||a("groups.createError")),V):(v(),V||null)}catch(V){return m(V instanceof Error?V.message:"Failed to create group"),null}},E=async(R,N)=>{try{const T=await Ft(`/groups/${R}`,N);return!T||!T.success?(m((T==null?void 0:T.message)||a("groups.updateError")),T):(v(),T||null)}catch(T){return m(T instanceof Error?T.message:"Failed to update group"),null}},O=async(R,N)=>{try{const T=await Ft(`/groups/${R}/servers/batch`,{servers:N});return!T||!T.success?(m((T==null?void 0:T.message)||a("groups.updateError")),null):(v(),T.data||null)}catch(T){return m(T instanceof Error?T.message:"Failed to update group servers"),null}},A=async R=>{try{const N=await Zn(`/groups/${R}`);return!N||!N.success?(m((N==null?void 0:N.message)||a("groups.deleteError")),N):(v(),N)}catch(N){return m(N instanceof Error?N.message:"Failed to delete group"),null}},C=async(R,N)=>{try{const T=await Nt(`/groups/${R}/servers`,{serverName:N});return!T||!T.success?(m((T==null?void 0:T.message)||a("groups.serverAddError")),null):(v(),T.data||null)}catch(T){return m(T instanceof Error?T.message:"Failed to add server to group"),null}},M=async(R,N)=>{try{const T=await Zn(`/groups/${R}/servers/${N}`);return!T||!T.success?(m((T==null?void 0:T.message)||a("groups.serverRemoveError")),null):(v(),T.data||null)}catch(T){return m(T instanceof Error?T.message:"Failed to remove server from group"),null}};return x.useEffect(()=>{p()},[p,h]),{groups:l,loading:i,error:d,setError:m,triggerRefresh:v,createGroup:b,updateGroup:E,updateGroupServers:O,deleteGroup:A,addServerToGroup:C,removeServerFromGroup:M}},cg=({servers:a,value:l,onChange:o,className:i})=>{const{t:u}=ve(),{nameSeparator:d}=ea(),[m,h]=x.useState(new Set),g=Fa.useMemo(()=>l.map(N=>typeof N=="string"?{name:N,tools:"all"}:{...N,tools:N.tools||"all"}),[l]),p=Fa.useMemo(()=>a.filter(N=>N.enabled!==!1),[a]);Fa.useEffect(()=>{const N=new Set(g.map(V=>V.name)),T=new Set(p.map(V=>V.name));h(V=>{const W=new Set;return V.forEach(se=>{(N.has(se)||T.has(se))&&W.add(se)}),W})},[g,p]);const v=N=>{if(g.findIndex(V=>V.name===N)>=0){const V=g.filter(W=>W.name!==N);o(V)}else{const V=[...g,{name:N,tools:"all"}];o(V)}},b=N=>{h(T=>{const V=new Set(T);return V.has(N)?V.delete(N):V.add(N),V})},E=(N,T,V=!1)=>{if(Array.isArray(T)&&T.length===0){const W=g.filter(se=>se.name!==N);o(W),V||h(se=>{const re=new Set(se);return re.delete(N),re})}else if(g.findIndex(se=>se.name===N)>=0){const se=g.map(re=>re.name===N?{...re,tools:T}:re);o(se)}else{const se=[...g,{name:N,tools:T}];o(se)}},O=(N,T)=>{var re;const V=p.find(F=>F.name===N);if(!V)return;const W=((re=V.tools)==null?void 0:re.map(F=>F.name.replace(`${N}${d}`,"")))||[],se=g.find(F=>F.name===N);if(!se){const F=[...g,{name:N,tools:[T]}];o(F);return}if(se.tools==="all"){const F=W.filter(te=>te!==T);E(N,F)}else if(Array.isArray(se.tools)){const F=se.tools;if(F.includes(T)){const te=F.filter(ie=>ie!==T);E(N,te)}else{const te=[...F,T];te.length===W.length?E(N,"all"):E(N,te)}}},A=N=>{const T=g.find(V=>V.name===N);return T?T.tools==="all":!1},C=N=>{const T=g.find(V=>V.name===N);return T?Array.isArray(T.tools)&&T.tools.length>0:!1},M=(N,T)=>{const V=g.find(W=>W.name===N);return V?V.tools==="all"?!0:Array.isArray(V.tools)?V.tools.includes(T):!1:!1},R=N=>{const T=p.find(V=>V.name===N);return(T==null?void 0:T.tools)||[]};return s.jsxs("div",{className:ts("space-y-4",i),children:[s.jsx("div",{className:"space-y-3",children:p.map(N=>{const T=A(N.name),V=C(N.name),W=m.has(N.name),se=R(N.name),re=g.find(F=>F.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:()=>b(N.name),children:[s.jsxs("div",{className:"flex items-center space-x-3",onClick:F=>{F.stopPropagation(),v(N.name)},children:[s.jsx("input",{type:"checkbox",checked:T||V,onChange:()=>v(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:[re&&re.tools!=="all"&&Array.isArray(re.tools)&&s.jsxs("span",{className:"text-sm text-green-600",children:["(",u("groups.toolsSelected")," ",re.tools.length,"/",se.length,")"]}),re&&re.tools==="all"&&s.jsxs("span",{className:"text-sm text-green-600",children:["(",u("groups.allTools")," ",se.length,"/",se.length,")"]}),se.length>0&&s.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:s.jsx("svg",{className:ts("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&&se.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:()=>{(re==null?void 0:re.tools)==="all"||Array.isArray(re==null?void 0:re.tools)&&re.tools.length===se.length?E(N.name,[],!0):E(N.name,"all")},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:(re==null?void 0:re.tools)==="all"||Array.isArray(re==null?void 0:re.tools)&&re.tools.length===se.length?u("groups.selectNone"):u("groups.selectAll")})]}),s.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:se.map(F=>{const te=F.name.replace(`${N.name}${d}`,""),ie=M(N.name,te);return s.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:ie,onChange:()=>O(N.name,te),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:te}),F.description&&s.jsx("span",{className:"text-gray-400 text-xs truncate",children:F.description})]},F.name)})})]})]},N.name)})}),p.length===0&&s.jsx("p",{className:"text-gray-500 text-sm",children:u("groups.noServerOptions")})]})},F1=({onAdd:a,onCancel:l})=>{const{t:o}=ve(),{createGroup:i}=Ou(),{servers:u}=ll(),[d,m]=x.useState([]),[h,g]=x.useState(null),[p,v]=x.useState(!1),[b,E]=x.useState({name:"",description:"",servers:[]});x.useEffect(()=>{m(u.filter(C=>C.enabled!==!1))},[u]);const O=C=>{const{name:M,value:R}=C.target;E(N=>({...N,[M]:R}))},A=async C=>{C.preventDefault(),v(!0),g(null);try{if(!b.name.trim()){g(o("groups.nameRequired")),v(!1);return}const M=await i(b.name,b.description,b.servers);if(!M||!M.success){g((M==null?void 0:M.message)||o("groups.createError")),v(!1);return}a()}catch(M){g(M instanceof Error?M.message:String(M)),v(!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: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:[o("groups.name")," *"]}),s.jsx("input",{type:"text",id:"name",name:"name",value:b.name,onChange:O,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(cg,{servers:d,value:b.servers,onChange:C=>E(M=>({...M,servers:C})),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:p,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:p,children:o(p?"common.submitting":"common.create")})]})]})]})})},G1=({group:a,onEdit:l,onCancel:o})=>{const{t:i}=ve(),{updateGroup:u}=Ou(),{servers:d}=ll(),[m,h]=x.useState([]),[g,p]=x.useState(null),[v,b]=x.useState(!1),[E,O]=x.useState({name:a.name,description:a.description||"",servers:a.servers||[]});x.useEffect(()=>{h(d.filter(M=>M.enabled!==!1))},[d]);const A=M=>{const{name:R,value:N}=M.target;O(T=>({...T,[R]:N}))},C=async M=>{M.preventDefault(),b(!0),p(null);try{if(!E.name.trim()){p(i("groups.nameRequired")),b(!1);return}const R=await u(a.id,{name:E.name,description:E.description,servers:E.servers});if(!R||!R.success){p((R==null?void 0:R.message)||i("groups.updateError")),b(!1);return}l()}catch(R){p(R instanceof Error?R.message:String(R)),b(!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")}),g&&s.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:g})]}),s.jsxs("form",{onSubmit:C,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:E.name,onChange:A,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder: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(cg,{servers:m,value:E.servers,onChange:M=>O(R=>({...R,servers:M})),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:v,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:v,children:i(v?"common.submitting":"common.save")})]})]})]})})},I1=({group:a,servers:l,onEdit:o,onDelete:i})=>{const{t:u}=ve(),{showToast:d}=nl(),{installConfig:m}=ea(),[h,g]=x.useState(!1),[p,v]=x.useState(!1),[b,E]=x.useState(!1),[O,A]=x.useState(null),C=x.useRef(null);x.useEffect(()=>{const z=U=>{C.current&&!C.current.contains(U.target)&&E(!1)};return document.addEventListener("mousedown",z),()=>{document.removeEventListener("mousedown",z)}},[]);const M=()=>{o(a)},R=()=>{g(!0)},N=()=>{i(a.id),g(!1)},T=z=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(z).then(()=>{v(!0),E(!1),d(u("common.copySuccess"),"success"),setTimeout(()=>v(!1),2e3)});else{const U=document.createElement("textarea");U.value=z,U.style.position="fixed",U.style.left="-9999px",document.body.appendChild(U),U.focus(),U.select();try{document.execCommand("copy"),v(!0),E(!1),d(u("common.copySuccess"),"success"),setTimeout(()=>v(!1),2e3)}catch(J){d(u("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",J)}document.body.removeChild(U)}},V=()=>{T(a.id)},W=()=>{T(`${m.baseUrl}/mcp/${a.id}`)},se=()=>{const z={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${a.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};T(JSON.stringify(z,null,2))},re=z=>z.map(U=>typeof U=="string"?U:U.name),F=z=>{const U=a.servers.find(J=>typeof J=="string"?J===z:J.name===z);return typeof U=="string"?{name:U,tools:"all"}:U},te=re(a.servers),ie=l.filter(z=>te.includes(z.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:C,children:[s.jsxs("button",{onClick:()=>E(!b),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:u("common.copy"),children:[p?s.jsx(Ka,{size:14,className:"text-green-500"}):s.jsx(Mo,{size:14}),s.jsx(_o,{size:12,className:"ml-1"})]}),b&&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:V,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[s.jsx(Mo,{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(Zv,{size:12,className:"mr-2"}),u("common.copyUrl")]}),s.jsxs("button",{onClick:se,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[s.jsx(Yv,{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:M,className:"text-gray-500 hover:text-gray-700",title:u("groups.edit"),children:s.jsx(Ho,{size:18})}),s.jsx("button",{onClick:R,className:"text-gray-500 hover:text-red-600",title:u("groups.delete"),children:s.jsx(_p,{size:18})})]})]}),s.jsx("div",{className:"mt-4",children:ie.length===0?s.jsx("p",{className:"text-gray-500 italic",children:u("groups.noServers")}):s.jsx("div",{className:"flex flex-wrap gap-2",children:ie.map(z=>{var L;const U=F(z.name),J=U&&U.tools!=="all"&&Array.isArray(U.tools),K=J&&Array.isArray(U==null?void 0:U.tools)?U.tools.length:((L=z.tools)==null?void 0:L.length)||0,B=O===z.name,j=()=>J&&Array.isArray(U==null?void 0:U.tools)?U.tools:z.tools&&z.tools.length>0?z.tools.map(le=>le.name):[],k=()=>{A(B?null:z.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:k,children:[s.jsx("span",{className:"font-medium text-gray-700 text-sm",children:z.name}),s.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${z.status==="connected"?"bg-green-500":z.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),K>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(gb,{size:12}),K]})]}),B&&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(J?"groups.selectedTools":"groups.allTools"),":"]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:j().map((le,S)=>s.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:le},S))})]})]},z.name)})})}),s.jsx(Mu,{isOpen:h,onClose:()=>g(!1),onConfirm:N,serverName:a.name,isGroup:!0})]})},$1=()=>{const{t:a}=ve(),{groups:l,loading:o,error:i,setError:u,deleteGroup:d,triggerRefresh:m}=Ou(),{servers:h}=ll({refreshOnMount:!0}),[g,p]=x.useState(null),[v,b]=x.useState(!1),E=R=>{p(R)},O=()=>{p(null),m()},A=async R=>{const N=await d(R);(!N||!N.success)&&u((N==null?void 0:N.message)||a("groups.deleteError"))},C=()=>{b(!0)},M=()=>{b(!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:C,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(I1,{group:R,servers:h,onEdit:E,onDelete:A},R.id))}),v&&s.jsx(F1,{onAdd:M,onCancel:M}),g&&s.jsx(G1,{group:g,onEdit:O,onCancel:()=>p(null)})]})},Du=()=>{const{t:a}=ve(),[l,o]=x.useState([]),[i,u]=x.useState(!0),[d,m]=x.useState(null),[h,g]=x.useState(0),p=x.useCallback(async()=>{try{u(!0);const A=await Ge("/users");if(!A.success){m(A.message||a("users.fetchError"));return}A&&A.success&&Array.isArray(A.data)?o(A.data):(console.error("Invalid user data format:",A),o([])),m(null)}catch(A){console.error("Error fetching users:",A),m(A instanceof Error?A.message:"Failed to fetch users"),o([])}finally{u(!1)}},[]),v=x.useCallback(()=>{g(A=>A+1)},[]),b=async A=>{try{const C=await Nt("/users",A);return v(),C}catch(C){return m(C instanceof Error?C.message:"Failed to create user"),null}},E=async(A,C)=>{try{const M=await Ft(`/users/${A}`,C);return v(),M||null}catch(M){return m(M instanceof Error?M.message:"Failed to update user"),null}},O=async A=>{try{const C=await Zn(`/users/${A}`);return C!=null&&C.success?(v(),C):(m((C==null?void 0:C.message)||a("users.deleteError")),C)}catch(C){return m(C instanceof Error?C.message:"Failed to delete user"),!1}};return x.useEffect(()=>{p()},[p,h]),{users:l,loading:i,error:d,setError:m,triggerRefresh:v,createUser:b,updateUser:E,deleteUser:O}},K1=({onAdd:a,onCancel:l})=>{const{t:o}=ve(),{createUser:i}=Du(),[u,d]=x.useState(null),[m,h]=x.useState(!1),[g,p]=x.useState({username:"",password:"",isAdmin:!1}),v=async E=>{if(E.preventDefault(),d(null),!g.username.trim()){d(o("users.usernameRequired"));return}if(!g.password.trim()){d(o("users.passwordRequired"));return}if(g.password.length<6){d(o("users.passwordTooShort"));return}h(!0);try{const O=await i(g);O!=null&&O.success?a():d((O==null?void 0:O.message)||o("users.createError"))}catch(O){d(O instanceof Error?O.message:o("users.createError"))}finally{h(!1)}},b=E=>{const{name:O,value:A,type:C,checked:M}=E.target;p(R=>({...R,[O]:C==="checkbox"?M: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:v,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:g.username,onChange:b,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:g.password,onChange:b,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:g.isAdmin,onChange:b,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")})]})]})})})},Y1=({user:a,onEdit:l,onCancel:o})=>{const{t:i}=ve(),{updateUser:u}=Du(),[d,m]=x.useState(null),[h,g]=x.useState(!1),[p,v]=x.useState({isAdmin:a.isAdmin,newPassword:"",confirmPassword:""}),b=async O=>{if(O.preventDefault(),m(null),p.newPassword&&p.newPassword!==p.confirmPassword){m(i("users.passwordMismatch"));return}if(p.newPassword&&p.newPassword.length<6){m(i("users.passwordTooShort"));return}g(!0);try{const A={isAdmin:p.isAdmin};p.newPassword&&(A.newPassword=p.newPassword);const C=await u(a.username,A);C!=null&&C.success?l():m((C==null?void 0:C.message)||i("users.updateError"))}catch(A){m(A instanceof Error?A.message:i("users.updateError"))}finally{g(!1)}},E=O=>{const{name:A,value:C,type:M,checked:R}=O.target;v(N=>({...N,[A]:M==="checkbox"?R:C}))};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:b,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:p.isAdmin,onChange:E,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:p.newPassword,onChange:E,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})]}),p.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:p.confirmPassword,onChange:E,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")})]})]})})})},X1=({user:a,currentUser:l,onEdit:o,onDelete:i})=>{const{t:u}=ve(),[d,m]=x.useState(!1),h=()=>{m(!0)},g=()=>{i(a.username),m(!1)},p=(l==null?void 0:l.username)===a.username,v=!p;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,p&&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(Ho,{size:18})}),v&&s.jsx("button",{onClick:h,className:"text-gray-500 hover:text-red-600",title:u("users.delete"),children:s.jsx(_p,{size:18})})]})]}),s.jsx(Mu,{isOpen:d,onClose:()=>m(!1),onConfirm:g,serverName:a.username,isGroup:!1,isUser:!0})]})},J1=()=>{const{t:a}=ve(),{auth:l}=Ws(),o=l.user,{users:i,loading:u,error:d,setError:m,deleteUser:h,triggerRefresh:g}=Du(),[p,v]=x.useState(null),[b,E]=x.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 O=N=>{v(N)},A=()=>{v(null),g()},C=async N=>{const T=await h(N);T!=null&&T.success||m((T==null?void 0:T.message)||a("users.deleteError"))},M=()=>{E(!0)},R=()=>{E(!1),g()};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:M,className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[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(X1,{user:N,currentUser:o,onEdit:O,onDelete:C},N.username))}),b&&s.jsx(K1,{onAdd:R,onCancel:R}),p&&s.jsx(Y1,{user:p,onEdit:A,onCancel:()=>v(null)})]})},Vh=a=>{const l=[];return a.length<8&&l.push("passwordMinLength"),/[a-zA-Z]/.test(a)||l.push("passwordRequireLetter"),/\d/.test(a)||l.push("passwordRequireNumber"),/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(a)||l.push("passwordRequireSpecial"),{isValid:l.length===0,errors:l}},Q1=({onSuccess:a,onCancel:l})=>{const{t:o}=ve(),[i,u]=x.useState({currentPassword:"",newPassword:""}),[d,m]=x.useState(""),[h,g]=x.useState(!1),[p,v]=x.useState(null),[b,E]=x.useState(!1),[O,A]=x.useState([]),C=R=>{const{name:N,value:T}=R.target;if(N==="confirmPassword")m(T);else if(u(V=>({...V,[N]:T})),N==="newPassword"){const V=Vh(T);A(V.errors)}},M=async R=>{R.preventDefault(),v(null);const N=Vh(i.newPassword);if(!N.isValid){v(o("auth.passwordStrengthError")),A(N.errors);return}if(i.newPassword!==d){v(o("auth.passwordsNotMatch"));return}g(!0);try{const T=await hv(i);T.success?(E(!0),a&&a()):v(T.message||o("auth.changePasswordError"))}catch{v(o("auth.changePasswordError"))}finally{g(!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")}),b?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:M,children:[p&&s.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:p}),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:C,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:C,required:!0,minLength:8}),i.newPassword&&O.length>0&&s.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[s.jsx("p",{className:"font-semibold mb-1",children:o("auth.passwordStrengthHint")}),s.jsx("ul",{className:"list-disc list-inside space-y-1",children:O.map(R=>s.jsx("li",{className:"text-red-600",children:o(`auth.${R}`)},R))})]}),i.newPassword&&O.length===0&&s.jsxs("p",{className:"mt-2 text-sm text-green-600",children:["✓ ",o("auth.passwordStrengthHint")]})]}),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:C,required:!0,minLength:8})]}),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 Z1(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 Yn={SETTINGS_SMART_ROUTING:"settings:smart_routing",SETTINGS_SKIP_AUTH:"settings:skip_auth",SETTINGS_INSTALL_CONFIG:"settings:install_config",SETTINGS_EXPORT_CONFIG:"settings:export_config"},W1=()=>{const{t:a}=ve(),l=zr(),{showToast:o}=nl(),[i,u]=x.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[d,m]=x.useState({dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[h,g]=x.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[p,v]=x.useState("-"),{routingConfig:b,tempRoutingConfig:E,setTempRoutingConfig:O,installConfig:A,smartRoutingConfig:C,mcpRouterConfig:M,nameSeparator:R,loading:N,updateRoutingConfig:T,updateRoutingConfigBatch:V,updateInstallConfig:W,updateSmartRoutingConfig:se,updateSmartRoutingConfigBatch:re,updateMCPRouterConfig:F,updateNameSeparator:te,exportMCPSettings:ie}=ea();x.useEffect(()=>{A&&u(A)},[A]),x.useEffect(()=>{C&&m({dbUrl:C.dbUrl||"",openaiApiBaseUrl:C.openaiApiBaseUrl||"",openaiApiKey:C.openaiApiKey||"",openaiApiEmbeddingModel:C.openaiApiEmbeddingModel||""})},[C]),x.useEffect(()=>{M&&g({apiKey:M.apiKey||"",referer:M.referer||"https://www.mcphubx.com",title:M.title||"MCPHub",baseUrl:M.baseUrl||"https://api.mcprouter.to/v1"})},[M]),x.useEffect(()=>{v(R)},[R]);const[z,U]=x.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,mcpRouterConfig:!1,nameSeparator:!1,password:!1,exportConfig:!1}),J=ue=>{U(Te=>({...Te,[ue]:!Te[ue]}))},K=async(ue,Te)=>{if(ue==="enableBearerAuth"&&Te===!0&&!E.bearerAuthKey&&!b.bearerAuthKey){const nt=Z1();B(nt),await V({enableBearerAuth:!0,bearerAuthKey:nt})&&O(Ue=>({...Ue,bearerAuthKey:nt}));return}await T(ue,Te)},B=ue=>{O(Te=>({...Te,bearerAuthKey:ue}))},j=async()=>{await T("bearerAuthKey",E.bearerAuthKey)},k=(ue,Te)=>{u({...i,[ue]:Te})},L=async ue=>{await W(ue,i[ue])},le=(ue,Te)=>{m({...d,[ue]:Te})},S=async ue=>{await se(ue,d[ue])},_=(ue,Te)=>{g({...h,[ue]:Te})},Z=async ue=>{await F(ue,h[ue])},H=async()=>{await te(p)},$=async ue=>{if(ue){const Te=d.dbUrl||C.dbUrl,nt=d.openaiApiKey||C.openaiApiKey;if(!Te||!nt){const Ue=[];Te||Ue.push(a("settings.dbUrl")),nt||Ue.push(a("settings.openaiApiKey")),o(a("settings.smartRoutingValidationError",{fields:Ue.join(", ")}));return}const kt={enabled:ue};d.dbUrl!==C.dbUrl&&(kt.dbUrl=d.dbUrl),d.openaiApiBaseUrl!==C.openaiApiBaseUrl&&(kt.openaiApiBaseUrl=d.openaiApiBaseUrl),d.openaiApiKey!==C.openaiApiKey&&(kt.openaiApiKey=d.openaiApiKey),d.openaiApiEmbeddingModel!==C.openaiApiEmbeddingModel&&(kt.openaiApiEmbeddingModel=d.openaiApiEmbeddingModel),await re(kt)}else await se("enabled",ue)},fe=()=>{setTimeout(()=>{l("/")},2e3)},[ee,Y]=x.useState(!1),[de,we]=x.useState(""),Se=async()=>{try{const ue=await ie();console.log("Fetched MCP settings:",ue);const Te=JSON.stringify(ue.data,null,2);we(Te)}catch(ue){console.error("Error fetching MCP settings:",ue),o(a("settings.exportError")||"Failed to fetch settings","error")}};x.useEffect(()=>{z.exportConfig&&!de&&Se()},[z.exportConfig]);const be=async()=>{if(de)try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(de),Y(!0),o(a("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>Y(!1),2e3);else{const ue=document.createElement("textarea");ue.value=de,ue.style.position="fixed",ue.style.left="-9999px",document.body.appendChild(ue),ue.focus(),ue.select();try{document.execCommand("copy"),Y(!0),o(a("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>Y(!1),2e3)}catch(Te){o(a("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",Te)}document.body.removeChild(ue)}}catch(ue){console.error("Error copying configuration:",ue),o(a("common.copyFailed")||"Copy failed","error")}},Oe=()=>{if(!de)return;const ue=new Blob([de],{type:"application/json"}),Te=URL.createObjectURL(ue),nt=document.createElement("a");nt.href=Te,nt.download="mcp_settings.json",document.body.appendChild(nt),nt.click(),document.body.removeChild(nt),URL.revokeObjectURL(Te),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:Yn.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:()=>J("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:z.smartRoutingConfig?"▼":"►"})]}),z.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:C.enabled,onCheckedChange:ue=>$(ue)})]}),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:ue=>le("dbUrl",ue.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:ue=>le("openaiApiKey",ue.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:ue=>le("openaiApiBaseUrl",ue.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:ue=>le("openaiApiEmbeddingModel",ue.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:Yn.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:()=>J("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:z.mcpRouterConfig?"▼":"►"})]}),z.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:ue=>_("apiKey",ue.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:ue=>_("baseUrl",ue.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:()=>J("nameSeparator"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.systemSettings")}),s.jsx("span",{className:"text-gray-500",children:z.nameSeparator?"▼":"►"})]}),z.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:p,onChange:ue=>v(ue.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:()=>J("routingConfig"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("pages.settings.routeConfig")}),s.jsx("span",{className:"text-gray-500",children:z.routingConfig?"▼":"►"})]}),z.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:b.enableBearerAuth,onCheckedChange:ue=>K("enableBearerAuth",ue)})]}),b.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:E.bearerAuthKey,onChange:ue=>B(ue.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||!b.enableBearerAuth}),s.jsx("button",{onClick:j,disabled:N||!b.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:b.enableGlobalRoute,onCheckedChange:ue=>K("enableGlobalRoute",ue)})]}),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:b.enableGroupNameRoute,onCheckedChange:ue=>K("enableGroupNameRoute",ue)})]}),s.jsx(Kn,{permissions:Yn.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:b.skipAuth,onCheckedChange:ue=>K("skipAuth",ue)})]})})]})]}),s.jsx(Kn,{permissions:Yn.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:()=>J("installConfig"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.installConfig")}),s.jsx("span",{className:"text-gray-500",children:z.installConfig?"▼":"►"})]}),z.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:ue=>k("baseUrl",ue.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:ue=>k("pythonIndexUrl",ue.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:ue=>k("npmRegistry",ue.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","data-section":"password",children:[s.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>J("password"),role:"button",children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("auth.changePassword")}),s.jsx("span",{className:"text-gray-500",children:z.password?"▼":"►"})]}),z.password&&s.jsx("div",{className:"max-w-lg mt-4",children:s.jsx(Q1,{onSuccess:fe})})]}),s.jsx(Kn,{permissions:Yn.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:()=>J("exportConfig"),children:[s.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.exportMcpSettings")}),s.jsx("span",{className:"text-gray-500",children:z.exportConfig?"▼":"►"})]}),z.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:be,disabled:!de,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(Mo,{size:16}),a(ee?"common.copied":"settings.copyToClipboard")]}),s.jsxs("button",{onClick:Oe,disabled:!de,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")]})]}),de&&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:de})})]})]})})]})})]})},e2=()=>{const{t:a}=ve(),[l,o]=x.useState([]),[i,u]=x.useState([]),[d,m]=x.useState([]),[h,g]=x.useState([]),[p,v]=x.useState(""),[b,E]=x.useState(""),[O,A]=x.useState(""),[C,M]=x.useState(!0),[R,N]=x.useState(null),[T,V]=x.useState(null),[W,se]=x.useState([]),[re,F]=x.useState(1),[te,ie]=x.useState(9),[z,U]=x.useState(1),J=x.useCallback(async()=>{try{M(!0);const ee=await Ge("/market/servers");ee&&ee.success&&Array.isArray(ee.data)?(u(ee.data),K(ee.data,re)):(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{M(!1)}},[a]),K=x.useCallback((ee,Y,de=te)=>{const we=ee.length,Se=Math.ceil(we/de);U(Se);const be=Math.max(1,Math.min(Y,Se));be!==Y&&F(be);const Oe=(be-1)*de,ue=ee.slice(Oe,Oe+de);o(ue)},[te]),B=x.useCallback(ee=>{F(ee),K(i,ee,te)},[i,K,te]),j=x.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)}},[]),k=x.useCallback(async()=>{try{const ee=await Ge("/market/tags");ee&&ee.success&&Array.isArray(ee.data)?g(ee.data):console.error("Invalid tags data format:",ee)}catch(ee){console.error("Error fetching tags:",ee)}},[]),L=x.useCallback(async ee=>{try{M(!0);const Y=await Ge(`/market/servers/${ee}`);return Y&&Y.success&&Y.data?(V(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{M(!1)}},[a]),le=x.useCallback(async ee=>{try{if(M(!0),A(ee),!ee.trim()){J();return}const Y=await Ge(`/market/servers/search?query=${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(u(Y.data),F(1),K(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{M(!1)}},[a,i,K,J]),S=x.useCallback(async ee=>{try{if(M(!0),v(ee),E(""),!ee){J();return}const Y=await Ge(`/market/categories/${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(u(Y.data),F(1),K(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{M(!1)}},[a,J,K]),_=x.useCallback(async ee=>{try{if(M(!0),E(ee),v(""),!ee){J();return}const Y=await Ge(`/market/tags/${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(u(Y.data),F(1),K(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{M(!1)}},[a,J,K]),Z=x.useCallback(async()=>{try{const ee=await Ge("/servers");if(ee&&ee.success&&Array.isArray(ee.data)){const Y=ee.data.map(de=>de.name);se(Y)}}catch(ee){console.error("Error fetching installed servers:",ee)}},[]),H=x.useCallback(ee=>W.includes(ee),[W]),$=x.useCallback(async(ee,Y)=>{var de,we;try{const Se=(de=ee.installations)!=null&&de.npm?"npm":Object.keys(ee.installations||{}).length>0?Object.keys(ee.installations)[0]:null;if(!Se||!((we=ee.installations)!=null&&we[Se]))return N(a("market.noInstallationMethod")),!1;const be=ee.installations[Se],Oe={name:ee.name,config:Y.type==="stdio"?{command:Y.command||be.command||"",args:Y.args||be.args||[],env:{...be.env,...Y.env}}:Y},ue=await Nt("/servers",Oe);if(!ue.success)throw new Error(ue.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]),fe=x.useCallback(ee=>{ie(ee),F(1),K(i,1,ee)},[i,K]);return x.useEffect(()=>{J(),j(),k(),Z()},[J,j,k,Z]),{servers:l,allServers:i,categories:d,tags:h,selectedCategory:p,selectedTag:b,searchQuery:O,loading:C,error:R,setError:N,currentServer:T,fetchMarketServers:J,fetchServerByName:L,searchServers:le,filterByCategory:S,filterByTag:_,installServer:$,currentPage:re,totalPages:z,serversPerPage:te,changePage:B,changeServersPerPage:fe,isServerInstalled:H}},t2=()=>{const{t:a}=ve(),[l,o]=x.useState([]),[i,u]=x.useState([]),[d,m]=x.useState([]),[h,g]=x.useState([]),[p,v]=x.useState(""),[b,E]=x.useState(""),[O,A]=x.useState(""),[C,M]=x.useState(!0),[R,N]=x.useState(null),[T,V]=x.useState(null),[W,se]=x.useState(1),[re,F]=x.useState(9),[te,ie]=x.useState(1),z=x.useCallback(async()=>{try{M(!0);const H=await Ge("/cloud/servers");H&&H.success&&Array.isArray(H.data)?(u(H.data),U(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 $=H instanceof Error?H.message:String(H);$==="MCPROUTER_API_KEY_NOT_CONFIGURED"||$.toLowerCase().includes("mcprouter api key not configured"),N($)}finally{M(!1)}},[a]),U=x.useCallback((H,$,fe=re)=>{const ee=H.length,Y=Math.ceil(ee/fe);ie(Y);const de=Math.max(1,Math.min($,Y));de!==$&&se(de);const we=(de-1)*fe,Se=H.slice(we,we+fe);o(Se)},[re]),J=x.useCallback(H=>{se(H),U(i,H,re)},[i,U,re]),K=x.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)}},[]),B=x.useCallback(async()=>{try{const H=await Ge("/cloud/tags");H&&H.success&&Array.isArray(H.data)?g(H.data):console.error("Invalid cloud market tags data format:",H)}catch(H){console.error("Error fetching cloud market tags:",H)}},[]),j=x.useCallback(async H=>{try{M(!0);const $=await Ge(`/cloud/servers/${H}`);return $&&$.success&&$.data?(V($.data),$.data):(console.error("Invalid cloud server data format:",$),N(a("cloud.serverNotFound")),null)}catch($){console.error(`Error fetching cloud server ${H}:`,$);const fe=$ instanceof Error?$.message:String($);return fe==="MCPROUTER_API_KEY_NOT_CONFIGURED"||fe.toLowerCase().includes("mcprouter api key not configured"),N(fe),null}finally{M(!1)}},[a]),k=x.useCallback(async H=>{try{if(M(!0),A(H),!H.trim()){z();return}const $=await Ge(`/cloud/servers/search?query=${encodeURIComponent(H)}`);$&&$.success&&Array.isArray($.data)?(u($.data),se(1),U($.data,1)):(console.error("Invalid cloud search results format:",$),N(a("cloud.searchError")))}catch($){console.error("Error searching cloud servers:",$),N($ instanceof Error?$.message:String($))}finally{M(!1)}},[a,i,U,z]),L=x.useCallback(async H=>{try{if(M(!0),v(H),E(""),!H){z();return}const $=await Ge(`/cloud/categories/${encodeURIComponent(H)}`);$&&$.success&&Array.isArray($.data)?(u($.data),se(1),U($.data,1)):(console.error("Invalid cloud category filter results format:",$),N(a("cloud.filterError")))}catch($){console.error("Error filtering cloud servers by category:",$),N($ instanceof Error?$.message:String($))}finally{M(!1)}},[a,z,U]),le=x.useCallback(async H=>{try{if(M(!0),E(H),v(""),!H){z();return}const $=await Ge(`/cloud/tags/${encodeURIComponent(H)}`);$&&$.success&&Array.isArray($.data)?(u($.data),se(1),U($.data,1)):(console.error("Invalid cloud tag filter results format:",$),N(a("cloud.tagFilterError")))}catch($){console.error("Error filtering cloud servers by tag:",$),N($ instanceof Error?$.message:String($))}finally{M(!1)}},[a,z,U]),S=x.useCallback(async H=>{try{const $=await Ge(`/cloud/servers/${H}/tools`);if(!$.success)throw console.error("Failed to fetch cloud server tools:",$),new Error($.message||"Failed to fetch cloud server tools");return $&&$.success&&Array.isArray($.data)?$.data:(console.error("Invalid cloud server tools data format:",$),[])}catch($){console.error(`Error fetching tools for cloud server ${H}:`,$);const fe=$ instanceof Error?$.message:String($);if(fe==="MCPROUTER_API_KEY_NOT_CONFIGURED"||fe.toLowerCase().includes("mcprouter api key not configured"))throw $;return[]}},[]),_=x.useCallback(async(H,$,fe)=>{try{const ee=await Nt(`/cloud/servers/${H}/tools/${$}/call`,{arguments:fe});if(ee&&ee.success)return ee.data;throw new Error(ee.message||"Failed to call tool")}catch(ee){throw console.error(`Error calling tool ${$} on cloud server ${H}:`,ee),ee}},[]),Z=x.useCallback(H=>{F(H),se(1),U(i,1,H)},[i,U]);return x.useEffect(()=>{z(),K(),B()},[z,K,B]),{servers:l,allServers:i,categories:d,tags:h,selectedCategory:p,selectedTag:b,searchQuery:O,loading:C,error:R,setError:N,currentServer:T,fetchCloudServers:z,fetchServerByName:j,searchServers:k,filterByCategory:L,filterByTag:le,fetchServerTools:S,callServerTool:_,currentPage:W,totalPages:te,serversPerPage:re,changePage:J,changeServersPerPage:Z}},r2=()=>{const{t:a}=ve(),[l,o]=x.useState([]),[i,u]=x.useState([]),[d,m]=x.useState(!0),[h,g]=x.useState(null),[p,v]=x.useState(""),[b,E]=x.useState(1),[O,A]=x.useState(9),[C,M]=x.useState(null),[R,N]=x.useState(!1),[T,V]=x.useState([]),[W]=x.useState(1),se=x.useCallback(async(j,k)=>{try{m(!0),g(null);const L=new URLSearchParams;L.append("limit",O.toString()),j&&L.append("cursor",j);const le=k!==void 0?k:p;le.trim()&&L.append("search",le.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===O&&!!_.metadata.nextCursor;N(Z),M(_.metadata.nextCursor||null),u(j?H=>[...H,..._.servers]:_.servers)}else console.error("Invalid registry servers data format:",_),g(a("registry.fetchError"))}else g(a("registry.fetchError"))}catch(L){console.error("Error fetching registry servers:",L);const le=L instanceof Error?L.message:String(L);g(le)}finally{m(!1)}},[a,O]),re=x.useCallback(async()=>{if(!R||!C)return;const j=T[T.length-1]||"";V(k=>[...k,j]),E(k=>k+1),await se(C,p)},[R,C,T,p,se]),F=x.useCallback(async()=>{if(b<=1)return;const j=[...T];j.pop();const k=j[j.length-1];V(j),E(L=>L-1),await se(k||void 0,p)},[b,T,p,se]),te=x.useCallback(async j=>{j!==b&&(j>b&&R?await re():j<b&&b>1&&await F())},[b,R,re,F]),ie=x.useCallback(async j=>{A(j),E(1),V([]),u([]),await se(void 0,p)},[p,se]),z=x.useCallback(async j=>{try{m(!0),g(null);const k=encodeURIComponent(j),L=await Ge(`/registry/servers/${k}/versions`);if(L&&L.success&&L.data){const le=L.data;return le.servers&&Array.isArray(le.servers)&&le.servers.length>0?le.servers[0]:(console.error("Invalid registry server data format:",le),g(a("registry.serverNotFound")),null)}else return g(a("registry.serverNotFound")),null}catch(k){console.error(`Error fetching registry server ${j}:`,k);const L=k instanceof Error?k.message:String(k);return g(L),null}finally{m(!1)}},[a]),U=x.useCallback(async j=>{try{g(null);const k=encodeURIComponent(j),L=await Ge(`/registry/servers/${k}/versions`);if(L&&L.success&&L.data){const le=L.data;return le.servers&&Array.isArray(le.servers)?le.servers:(console.error("Invalid registry server versions data format:",le),[])}else return[]}catch(k){console.error(`Error fetching versions for server ${j}:`,k);const L=k instanceof Error?k.message:String(k);return g(L),[]}},[]),J=x.useCallback(async(j,k)=>{try{g(null);const L=encodeURIComponent(j),le=encodeURIComponent(k),S=await Ge(`/registry/servers/${L}/versions/${le}`);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 ${k} for server ${j}:`,L);const le=L instanceof Error?L.message:String(L);return g(le),null}},[]),K=x.useCallback(async j=>{console.log("Searching registry servers with query:",j),v(j),E(1),V([]),u([]),await se(void 0,j)},[se]),B=x.useCallback(async()=>{v(""),E(1),V([]),u([]),await se(void 0,"")},[se]);return x.useEffect(()=>{se(void 0,p)},[]),{servers:l,allServers:i,loading:d,error:h,setError:g,searchQuery:p,searchServers:K,clearSearch:B,fetchServerByName:z,fetchServerVersions:U,fetchServerVersion:J,currentPage:b,totalPages:W,hasNextPage:R,hasPreviousPage:b>1,changePage:te,goToNextPage:re,goToPreviousPage:F,serversPerPage:O,changeServersPerPage:ie}},s2=({server:a,onClick:l})=>{var g,p,v,b;const{t:o}=ve(),i=E=>E.split(" ").map(O=>O.charAt(0)).join("").toUpperCase().slice(0,2),u=()=>{if(!a.tags||a.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const E=28,O=T=>T.length+3;let A=0,C=0;const M=[...a.tags].sort((T,V)=>T.length-V.length);for(C=0;C<M.length;C++){const T=O(M[C]);if(A+T>E)break;if(A+=T,C===M.length-1)return{tagsToShow:M,hasMore:!1,moreCount:0}}C===0&&M.length>0&&(C=1);const R=M.length-C,N=3+String(R).length+o("market.moreTags").length;return A+N<=E||C<1?{tagsToShow:M.slice(0,C),hasMore:!0,moreCount:R}:{tagsToShow:M.slice(0,Math.max(1,C-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(((g=a.author)==null?void 0:g.name)||o("market.unknown"))}),s.jsx("div",{children:s.jsx("p",{className:"text-xs font-medium text-gray-700",children:((p=a.author)==null?void 0:p.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:((v=a.categories)==null?void 0:v.length)>0?a.categories.map((E,O)=>s.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded whitespace-nowrap",children:E},O)):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:((b=a.tags)==null?void 0:b.length)>0?s.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[d.map((E,O)=>s.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0",children:["#",E]},O)),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:"-"})})})]})]})},a2=({server:a,onBack:l,onInstall:o,installing:i=!1,isInstalled:u=!1})=>{var te,ie;const{t:d}=ve(),[m,h]=x.useState(!1),[g,p]=x.useState(null),[v,b]=x.useState(!1),[E,O]=x.useState(null),[A,C]=x.useState([]),M=()=>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),p(null),b(!1),O(null)},N=async()=>{E&&(await T(E),b(!1),O(null))},T=async z=>{try{p(null),o(a,z.config),h(!1)}catch(U){console.error("Error installing server:",U),p(d("errors.serverInstall"))}},V=()=>{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 z=Object.keys(a.installations);if(z.length>0)return a.installations[z[0]]},se=async z=>{try{const U=ig(z);U.length>0?(C(U),O(z),b(!0)):await T(z)}catch(U){console.error("Error processing server installation:",U),p(d("errors.serverInstall"))}},re=M(),F=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:V,disabled:re.disabled,className:re.className,children:re.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:[(te=a.categories)==null?void 0:te.map((z,U)=>s.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:z},`cat-${U}`)),a.tags&&a.tags.map((z,U)=>s.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",z]},`tag-${U}`))]})]}),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(([z,U],J)=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:z}),s.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:U.description}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:U.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:U.example})})]},J))})]})})]}),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:(ie=a.tools)==null?void 0:ie.map((z,U)=>s.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[s.jsxs("h4",{className:"font-medium mb-2",children:[z.name,s.jsx("button",{type:"button",onClick:()=>{const J=document.getElementById(`schema-${U}`);J&&J.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:z.description}),s.jsx("div",{className:"mt-2",children:s.jsx("pre",{id:`schema-${U}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(z.inputSchema,null,2)})})]},U))})]}),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((z,U)=>s.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[s.jsx("h4",{className:"font-medium mb-2",children:z.title}),s.jsx("p",{className:"text-gray-600 mb-2",children:z.description}),s.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:z.prompt})]},U))})]}),s.jsx("div",{className:"mt-6 flex justify-end",children:s.jsx("button",{onClick:V,disabled:re.disabled,className:re.className,children:re.text})}),m&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx(ol,{onSubmit:se,onCancel:R,modalTitle:d("market.installServer",{name:a.display_name}),formError:g,initialData:{name:a.name,status:"disconnected",config:F?{command:F.command||"",args:F.args||[],env:F.env||{}}:void 0}})}),v&&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:A.map((z,U)=>s.jsxs("li",{className:"font-mono",children:["$",`{${z}}`]},U))})]})]})}),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:()=>{b(!1),O(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")})]})]})})]})},n2=({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(`
|
|
250
|
+
`).filter(g=>g.trim());for(const g of h)if(g.length>50&&g.length<=150)return g}return a.description?a.description.slice(0,150)+"...":o("cloud.noDescription")},d=h=>{try{const g=new Date(h),p=g.getFullYear(),v=(g.getMonth()+1).toString().padStart(2,"0"),b=g.getDate().toString().padStart(2,"0");return`${p}/${v}/${b}`}catch{return""}},m=h=>h.split(" ").map(g=>g.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=zr(),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")]})]})]})]})})},l2=({serverName:a,onBack:l,onCallTool:o,fetchServerTools:i,onInstall:u,installing:d=!1,isInstalled:m=!1})=>{const{t:h}=ve(),{mcpRouterConfig:g}=ea(),[p,v]=x.useState(null),[b,E]=x.useState(!0),[O,A]=x.useState(null),[C,M]=x.useState([]),[R,N]=x.useState(!1),[T,V]=x.useState(!1),[W,se]=x.useState(null),[re,F]=x.useState({}),[te,ie]=x.useState({}),[z,U]=x.useState({}),[J,K]=x.useState(!1),[B,j]=x.useState(null),k=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")},le=()=>{!m&&u&&(K(!0),j(null))},S=()=>{K(!1),j(null)},_=async Y=>{try{if(!p||!u)return;j(null),u(p,Y.config),K(!1)}catch(de){console.error("Error installing server:",de),j(h("errors.serverInstall"))}};x.useEffect(()=>{(async()=>{try{E(!0),A(null);const de=await Ge(`/cloud/servers/${a}`);de&&de.success&&de.data?(v(de.data),M(de.data.tools||[])):A(h("cloud.serverNotFound"))}catch(de){console.error("Failed to load server details:",de),A(de instanceof Error?de.message:String(de))}finally{E(!1)}})()},[a,h]),x.useEffect(()=>{(async()=>{if(p&&(!p.tools||p.tools.length===0)&&i){N(!0),V(!1);try{const de=await i(p.name);M(de)}catch(de){console.error("Failed to load tools:",de);const we=de instanceof Error?de.message:String(de);k(we)&&V(!0)}finally{N(!1)}}})()},[p==null?void 0:p.name,p==null?void 0:p.tools,i]);const Z=Y=>{try{const de=new Date(Y),we=de.getFullYear(),Se=String(de.getMonth()+1).padStart(2,"0"),be=String(de.getDate()).padStart(2,"0"),Oe=String(de.getHours()).padStart(2,"0"),ue=String(de.getMinutes()).padStart(2,"0"),Te=String(de.getSeconds()).padStart(2,"0");return`${we}-${Se}-${be} ${Oe}:${ue}:${Te}`}catch{return Y}},H=(Y,de,we)=>{ie(Se=>({...Se,[Y]:{...Se[Y],[de]:we}}))},$=async Y=>{if(!(!o||!p)){se(Y);try{const de=te[Y]||{},we=await o(p.server_key,Y,de);F(Se=>({...Se,[Y]:we}))}catch(de){console.error("Tool call failed:",de);const we=de instanceof Error?de.message:String(de);F(Se=>({...Se,[Y]:{error:we}}))}finally{se(null)}}},fe=Y=>{U(de=>({...de,[Y]:!de[Y]}))},ee=(Y,de,we)=>{var Oe;const Se=((Oe=te[Y.name])==null?void 0:Oe[de])||"",be=ue=>{let Te=ue.target.value;we.type==="number"||we.type==="integer"?Te=Te===""?void 0:Number(Te):we.type==="boolean"&&(Te=ue.target.value==="true"),H(Y.name,de,Te)};return we.type==="boolean"?s.jsxs("select",{value:Se===!0?"true":Se===!1?"false":"",onChange:be,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")})]}):we.type==="number"||we.type==="integer"?s.jsx("input",{type:"number",step:we.type==="integer"?"1":"any",value:Se||"",onChange:be,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:be,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")]})}),b?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")})]})}):O&&!k(O)?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:O})]})})}):p?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:p.title||p.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:p.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")," ",p.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(p.updated_at)]}),u&&!k(O||"")&&!T&&s.jsx("button",{onClick:le,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:p.description})]}),p.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:p.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"),C.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:C.length})]}),T&&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")})]}):C.length===0&&!T?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")})]}):C.length>0?s.jsx("div",{className:"space-y-4",children:C.map((Y,de)=>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:()=>$(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:()=>fe(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 ${z[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"})})]})]}),z[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(([we,Se])=>{var be;return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[we,((be=Y.inputSchema.required)==null?void 0:be.includes(we))&&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,we,Se)]},we)})})]}),re[Y.name]&&s.jsx("div",{className:"border-t border-gray-100 pt-4 mt-4",children:re[Y.name].error?s.jsx(s.Fragment,{children:k(re[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:re[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(re[Y.name],null,2)})})]})})]},de))}):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")})]})}),J&&p&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx(ol,{onSubmit:_,onCancel:S,modalTitle:h("cloud.installServer",{name:p.title||p.name}),formError:B,initialData:{name:p.name,status:"disconnected",config:{type:"streamable-http",url:p.server_url,headers:{Authorization:`Bearer ${g.apiKey||"<MCPROUTER_API_KEY>"}`,"HTTP-Referer":g.referer||"<YOUR_APP_URL>","X-Title":g.title||"<YOUR_APP_NAME>"}}}})})]})},o2=({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=T=>{if(!T)return"";try{const V=new Date(T),W=V.getFullYear(),se=(V.getMonth()+1).toString().padStart(2,"0"),re=V.getDate().toString().padStart(2,"0");return`${W}/${se}/${re}`}catch{return""}},p=i.icons&&i.icons.length>0?i.icons.find(V=>!V.theme||V.theme==="light")||i.icons[0]:null,v=u==null?void 0:u["io.modelcontextprotocol.registry/official"],b=v==null?void 0:v.isLatest,E=v==null?void 0:v.publishedAt,O=v==null?void 0:v.updatedAt,A=((R=i.packages)==null?void 0:R.length)||0,C=((N=i.remotes)==null?void 0:N.length)||0,M=A+C;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:[p?s.jsx("img",{src:p.src,alt:i.title,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0",onError:T=>{T.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:[b&&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()})}),M>0&&s.jsx("div",{className:"mb-3",children:s.jsxs("div",{className:"flex items-center space-x-4",children:[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:"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:[A," ",o(A===1?"registry.package":"registry.packages")]})]}),C>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:[C," ",o(C===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:(E||O)&&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(O||E)})]})}),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"})})]})]})]})]})},i2=({serverEntry:a,onBack:l,onInstall:o,installing:i=!1,isInstalled:u=!1,fetchVersions:d})=>{const{t:m}=ve(),{server:h,_meta:g}=a,[p,v]=x.useState(h.version),[b,E]=x.useState([]),[O,A]=x.useState(!1),[C,M]=x.useState(!1),[R,N]=x.useState(null),[T,V]=x.useState(null),[W,se]=x.useState(null),[re,F]=x.useState({packages:!0,remotes:!0,repository:!0}),te=g==null?void 0:g["io.modelcontextprotocol.registry/official"];x.useEffect(()=>{(async()=>{if(d){A(!0);try{const _=await d(h.name);E(_)}catch(_){console.error("Failed to load versions:",_)}finally{A(!1)}}})()},[h.name,d]);const z=h.icons&&h.icons.length>0?h.icons.find(_=>!_.theme||_.theme==="light")||h.icons[0]:null,U=S=>{if(!S)return"";try{return new Date(S).toLocaleDateString()}catch{return""}},J=S=>{F(_=>({..._,[S]:!_[S]}))},K=(S,_)=>{N(S),V(_),se(null),M(!0)},B=()=>{M(!1),se(null)},j=async S=>{try{if(!o||!T||!R)return;se(null);const _=S.config;o(h,_),M(!1)}catch(_){console.error("Error installing server:",_),se(m("errors.serverInstall"))}},k=()=>{if(!T||!R)return null;if(console.log("Building initial form data for:",T),R==="package"&&"identifier"in T){const S=T,_={};S.environmentVariables&&S.environmentVariables.forEach(H=>{_[H.name]=H.default||""});const Z=c2(S.registryType);return{name:h.name,status:"disconnected",config:{type:"stdio",command:Z,args:u2(Z,S),env:Object.keys(_).length>0?_:void 0}}}else if(R==="remote"&&"url"in T){const S=T,_={};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:()=>K("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))})]})]},_),le=(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:()=>K("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:[z?s.jsx("img",{src:z.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:[(te==null?void 0:te.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]}),(te==null?void 0:te.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:te.status}),s.jsxs("span",{className:"flex flex-wrap items-center gap-4 text-sm text-gray-600",children:[(te==null?void 0:te.publishedAt)&&s.jsxs("div",{children:[s.jsxs("span",{className:"font-medium",children:[m("registry.published"),":"]})," ",U(te.publishedAt)]}),(te==null?void 0:te.updatedAt)&&s.jsxs("div",{children:[s.jsxs("span",{className:"font-medium",children:[m("registry.updated"),":"]})," ",U(te.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:()=>J("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 ${re.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"})})]}),re.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:()=>J("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 ${re.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"})})]}),re.remotes&&s.jsx("div",{className:"space-y-3",children:h.remotes.map(le)})]}),h.repository&&s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>J("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 ${re.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"})})]}),re.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]})]})]}),C&&T&&R&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:s.jsx(ol,{onSubmit:j,onCancel:B,modalTitle:m("registry.installServer",{name:h.title||h.name}),formError:W,initialData:k()})})]})};function c2(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 u2(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 d2=({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 »"})]})},f2=({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"})})]})]}),Fh=()=>{const{t:a}=ve(),l=zr(),{serverName:o}=xp(),{showToast:i}=nl(),[u,d]=Wy(),m=u.get("tab")||"cloud",{servers:h,allServers:g,categories:p,loading:v,error:b,setError:E,searchServers:O,filterByCategory:A,filterByTag:C,selectedCategory:M,selectedTag:R,installServer:N,fetchServerByName:T,isServerInstalled:V,currentPage:W,totalPages:se,changePage:re,serversPerPage:F,changeServersPerPage:te}=e2(),{servers:ie,allServers:z,loading:U,error:J,setError:K,fetchServerTools:B,callServerTool:j,currentPage:k,totalPages:L,changePage:le,serversPerPage:S,changeServersPerPage:_}=t2(),{servers:Z,allServers:H,loading:$,error:fe,setError:ee,searchServers:Y,clearSearch:de,fetchServerByName:we,fetchServerVersions:Se,currentPage:be,totalPages:Oe,hasNextPage:ue,hasPreviousPage:Te,changePage:nt,goToNextPage:kt,goToPreviousPage:Ue,serversPerPage:At,changeServersPerPage:wr}=r2(),[Wt,er]=x.useState(null),[tr,as]=x.useState(null),[ns,Rs]=x.useState(null),[rr,ht]=x.useState(""),[zt,pt]=x.useState(""),[ls,pr]=x.useState(!1),[ta,Lr]=x.useState(new Set),[Ur,sr]=x.useState(new Set);x.useEffect(()=>{(async()=>{if(o)if(m==="cloud"){const Re=ie.find(ke=>ke.name===o);Re?as(Re):l("/market?tab=cloud")}else if(m==="registry"){console.log("Loading registry server details for:",o);const Re=await we(o);Re?Rs(Re):l("/market?tab=registry")}else{const Re=await T(o);Re?er(Re):l("/market?tab=local")}else er(null),as(null),Rs(null)})()},[o,m,ie,T,we,l]);const gr=pe=>{const Re=new URLSearchParams(u);Re.set("tab",pe),d(Re),o&&l("/market?"+Re.toString())},Nr=pe=>{pe.preventDefault(),m==="local"?O(rr):m==="registry"&&Y(zt)},ra=pe=>{m==="local"&&A(pe)},Ms=()=>{m==="local"?(ht(""),A(""),C("")):m==="registry"&&(pt(""),de())},Pr=pe=>{var Re;if(m==="cloud")l(`/market/${pe.name}?tab=cloud`);else if(m==="registry"){const ke=pe;console.log("Registry server clicked:",ke);const Je=(Re=ke.server)==null?void 0:Re.name;if(console.log("Server name extracted:",Je),Je){const Rt=`/market/${encodeURIComponent(Je)}?tab=registry`;console.log("Navigating to:",Rt),l(Rt)}else console.error("Server name is undefined in registry server:",ke)}else l(`/market/${pe.name}?tab=local`)},Sr=()=>{l(`/market?tab=${m}`)},Cr=async(pe,Re)=>{try{pr(!0),await N(pe,Re)&&i(a("market.installSuccess",{serverName:pe.display_name}),"success")}finally{pr(!1)}},sa=async(pe,Re)=>{try{pr(!0);const ke={name:pe.name,config:Re},Je=await Nt("/servers",ke);if(!Je.success){const Rt=(Je==null?void 0:Je.message)||a("server.addError");i(Rt,"error");return}Lr(Rt=>new Set(Rt).add(pe.name)),i(a("cloud.installSuccess",{name:pe.title||pe.name}),"success")}catch(ke){console.error("Error installing cloud server:",ke);const Je=ke instanceof Error?ke.message:String(ke);i(a("cloud.installError",{error:Je}),"error")}finally{pr(!1)}},Os=async(pe,Re)=>{try{pr(!0);const ke={name:pe.name,config:Re},Je=await Nt("/servers",ke);if(!Je.success){const Rt=(Je==null?void 0:Je.message)||a("server.addError");i(Rt,"error");return}sr(Rt=>new Set(Rt).add(pe.name)),i(a("registry.installSuccess",{name:pe.title||pe.name}),"success")}catch(ke){console.error("Error installing registry server:",ke);const Je=ke instanceof Error?ke.message:String(ke);i(a("registry.installError",{error:Je}),"error")}finally{pr(!1)}},me=async(pe,Re,ke)=>{try{const Je=await j(pe,Re,ke);return i(a("cloud.toolCallSuccess",{toolName:Re}),"success"),Je}catch(Je){const Rt=Je instanceof Error?Je.message:String(Je);throw ae(Rt)||i(a("cloud.toolCallError",{toolName:Re,error:Rt}),"error"),Je}},ae=pe=>pe==="MCPROUTER_API_KEY_NOT_CONFIGURED"||pe.toLowerCase().includes("mcprouter api key not configured"),he=pe=>{m==="local"?re(pe):m==="registry"?nt(pe):le(pe),window.scrollTo({top:0,behavior:"smooth"})},Gt=pe=>{const Re=parseInt(pe.target.value,10);m==="local"?te(Re):m==="registry"?wr(Re):_(Re)};if(Wt)return s.jsx(a2,{server:Wt,onBack:Sr,onInstall:Cr,installing:ls,isInstalled:V(Wt.name)});if(tr)return s.jsx(l2,{serverName:tr.name,onBack:Sr,onCallTool:me,fetchServerTools:B,onInstall:sa,installing:ls,isInstalled:ta.has(tr.name)});if(ns)return s.jsx(i2,{serverEntry:ns,onBack:Sr,onInstall:Os,installing:ls,isInstalled:Ur.has(ns.server.name),fetchVersions:Se});const Ve=m==="local",Pe=m==="registry",Ze=Ve?h:Pe?Z:ie,rt=Ve?g:Pe?H:z,xr=Ve?p:[],lt=Ve?v:Pe?$:U,Tt=Ve?b:Pe?fe:J,Er=Ve?E:Pe?ee:K,It=Ve?M:"",_t=Ve?R:"",gt=Ve?W:Pe?be:k,Lt=Ve?se:Pe?Oe:L,ct=Ve?F:Pe?At: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:()=>gr("cloud"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${!Ve&&!Pe?"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:()=>gr("local"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Ve?"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:()=>gr("registry"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Pe?"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")}),")"]})]})]})})}),Tt&&s.jsx(s.Fragment,{children:!Ve&&ae(Tt)?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:Tt}),s.jsx("button",{onClick:()=>Er(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"})})})]})})}),(Ve||Pe)&&s.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:s.jsxs("form",{onSubmit:Nr,className:"flex space-x-4 mb-0",children:[s.jsx("div",{className:"flex-grow",children:s.jsx("input",{type:"text",value:Pe?zt:rr,onChange:pe=>{Pe?pt(pe.target.value):ht(pe.target.value)},placeholder:a(Pe?"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(Pe?"registry.search":"market.search")}),(Ve&&(rr||It||_t)||Pe&&zt)&&s.jsx("button",{type:"button",onClick:Ms,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(Pe?"registry.clearFilters":"market.clearFilters")})]})}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[Ve&&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:xr.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")}),It&&s.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>A(""),children:a("market.clearCategoryFilter")})]}),s.jsx("div",{className:"flex flex-col gap-2",children:xr.map(pe=>s.jsx("button",{onClick:()=>ra(pe),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${It===pe?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:pe},pe))})]}):lt?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:lt?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")})]})}):Ze.length===0?s.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:s.jsx("p",{className:"text-gray-600",children:a(Ve?"market.noServers":Pe?"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:Ze.map((pe,Re)=>Ve?s.jsx(s2,{server:pe,onClick:Pr},Re):Pe?s.jsx(o2,{serverEntry:pe,onClick:Pr},Re):s.jsx(n2,{server:pe,onClick:Pr},Re))}),s.jsxs("div",{className:"flex items-center mb-4",children:[s.jsx("div",{className:"flex-[2] text-sm text-gray-500",children:Ve?a("market.showing",{from:(gt-1)*ct+1,to:Math.min(gt*ct,rt.length),total:rt.length}):Pe?a("registry.showing",{from:(gt-1)*ct+1,to:(gt-1)*ct+Ze.length,total:rt.length+(ue?"+":"")}):a("cloud.showing",{from:(gt-1)*ct+1,to:Math.min(gt*ct,rt.length),total:rt.length})}),s.jsx("div",{className:"flex-[4] flex justify-center",children:Pe?s.jsx(f2,{currentPage:gt,hasNextPage:ue,hasPreviousPage:Te,onNextPage:kt,onPreviousPage:Ue}):s.jsx(d2,{currentPage:gt,totalPages:Lt,onPageChange:he})}),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(Ve?"market.perPage":Pe?"registry.perPage":"cloud.perPage"),":"]}),s.jsxs("select",{id:"perPage",value:ct,onChange:Gt,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"})]})]})]})]})})]})]})},m2={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"},h2={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 p2({variant:a="default",size:l="default",className:o,disabled:i,children:u,...d}){return s.jsx("button",{className:ts("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",m2[a],h2[l],o),disabled:i,...d,children:u})}const g2=({logs:a,isLoading:l=!1,error:o=null,onClear:i})=>{const{t:u}=ve(),d=x.useRef(null),[m,h]=x.useState(!0),[g,p]=x.useState(""),[v,b]=x.useState(["info","error","warn","debug"]),[E,O]=x.useState(["main","child"]);x.useEffect(()=>{m&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[a,m]);const A=a.filter(N=>{const T=g?N.message.toLowerCase().includes(g.toLowerCase()):!0,V=v.includes(N.type),W=E.includes(N.source);return T&&V&&W}),C=N=>new Date(N).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),M=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:g,onChange:N=>p(N.target.value)}),s.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(N=>s.jsx(No,{variant:v.includes(N)?"default":"outline",className:`cursor-pointer ${v.includes(N)?M(N):""}`,onClick:()=>{v.includes(N)?b(T=>T.filter(V=>V!==N)):b(T=>[...T,N])},children:N},N))}),s.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(N=>s.jsx(No,{variant:E.includes(N)?"default":"outline",className:`cursor-pointer ${E.includes(N)?R(N):""}`,onClick:()=>{E.includes(N)?O(T=>T.filter(V=>V!==N)):O(T=>[...T,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(p2,{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}):A.length===0?s.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||v.length<4||E.length<2?u("logs.noMatch"):u("logs.noLogs")}):A.map((N,T)=>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:["[",C(N.timestamp),"]"]}),s.jsx(No,{className:`ml-2 mr-1 ${M(N.type)}`,children:N.type}),s.jsxs(No,{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}-${T}`))})]})},x2=async()=>{try{const a=await Zn("/logs");if(!a.success)throw new Error(a.error||"Failed to clear logs")}catch(a){throw console.error("Error clearing logs:",a),a}},y2=()=>{const[a,l]=x.useState([]),[o,i]=x.useState(!0),[u,d]=x.useState(null);return x.useEffect(()=>{let h=null,g=!0;const p=()=>{try{h&&h.close();const v=al();h=new EventSource(Cu(`/logs/stream?token=${v}`)),h.onmessage=b=>{if(g)try{const E=JSON.parse(b.data);E.type==="initial"?(l(E.logs),i(!1)):E.type==="log"&&l(O=>[...O,E.log])}catch(E){console.error("Error parsing SSE message:",E)}},h.onerror=()=>{g&&(h&&(h.close(),setTimeout(p,5e3)),d(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(v){if(!g)return;d(v instanceof Error?v:new Error("Failed to connect to log stream")),i(!1)}};return p(),()=>{g=!1,h&&h.close()}},[]),{logs:a,loading:o,error:u,clearLogs:async()=>{try{await x2(),l([])}catch(h){d(h instanceof Error?h:new Error("Failed to clear logs"))}}}},v2=()=>{const{t:a}=ve(),{logs:l,loading:o,error:i,clearLogs:u}=y2();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(g2,{logs:l,isLoading:o,error:i,onClear:u})})]})},b2=()=>{const{serverName:a}=xp();return s.jsx(To,{to:`/market/${a}?tab=cloud`,replace:!0})};function Gh(){const a=Su();return s.jsx(r1,{children:s.jsx(xv,{children:s.jsx(s1,{children:s.jsx(e1,{children:s.jsx(Xy,{basename:a,children:s.jsxs(Cy,{children:[s.jsx(Pt,{path:"/login",element:s.jsx(w1,{})}),s.jsx(Pt,{element:s.jsx(b1,{}),children:s.jsxs(Pt,{element:s.jsx(v1,{}),children:[s.jsx(Pt,{path:"/",element:s.jsx(N1,{})}),s.jsx(Pt,{path:"/servers",element:s.jsx(V1,{})}),s.jsx(Pt,{path:"/groups",element:s.jsx($1,{})}),s.jsx(Pt,{path:"/users",element:s.jsx(J1,{})}),s.jsx(Pt,{path:"/market",element:s.jsx(Fh,{})}),s.jsx(Pt,{path:"/market/:serverName",element:s.jsx(Fh,{})}),s.jsx(Pt,{path:"/cloud",element:s.jsx(To,{to:"/market?tab=cloud",replace:!0})}),s.jsx(Pt,{path:"/cloud/:serverName",element:s.jsx(b2,{})}),s.jsx(Pt,{path:"/logs",element:s.jsx(v2,{})}),s.jsx(Pt,{path:"/settings",element:s.jsx(W1,{})})]})}),s.jsx(Pt,{path:"*",element:s.jsx(To,{to:"/"})})]})})})})})})}const Ae=a=>typeof a=="string",Xn=()=>{let a,l;const o=new Promise((i,u)=>{a=i,l=u});return o.resolve=a,o.reject=l,o},Ih=a=>a==null?"":""+a,j2=(a,l,o)=>{a.forEach(i=>{l[i]&&(o[i]=l[i])})},w2=/###/g,$h=a=>a&&a.indexOf("###")>-1?a.replace(w2,"."):a,Kh=a=>!a||Ae(a),Jn=(a,l,o)=>{const i=Ae(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])}},Yh=(a,l,o)=>{const{obj:i,k:u}=Jn(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=Jn(a,m,Object);for(;h.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),h=Jn(a,m,Object),h!=null&&h.obj&&typeof h.obj[`${h.k}.${d}`]<"u"&&(h.obj=void 0);h.obj[`${h.k}.${d}`]=o},N2=(a,l,o,i)=>{const{obj:u,k:d}=Jn(a,l,Object);u[d]=u[d]||[],u[d].push(o)},Oo=(a,l)=>{const{obj:o,k:i}=Jn(a,l);if(o&&Object.prototype.hasOwnProperty.call(o,i))return o[i]},S2=(a,l,o)=>{const i=Oo(a,o);return i!==void 0?i:Oo(l,o)},ug=(a,l,o)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in a?Ae(a[i])||a[i]instanceof String||Ae(l[i])||l[i]instanceof String?o&&(a[i]=l[i]):ug(a[i],l[i],o):a[i]=l[i]);return a},Ba=a=>a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var C2={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const E2=a=>Ae(a)?a.replace(/[&<>"'\/]/g,l=>C2[l]):a;class k2{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 A2=[" ",",","?","!",";"],T2=new k2(20),R2=(a,l,o)=>{l=l||"",o=o||"";const i=A2.filter(m=>l.indexOf(m)<0&&o.indexOf(m)<0);if(i.length===0)return!0;const u=T2.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 g=d;g<i.length;++g)if(g!==d&&(h+=o),h+=i[g],m=u[h],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;d+=g-d+1;break}u=m}return u},el=a=>a==null?void 0:a.replace("_","-"),M2={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 Do{constructor(l,o={}){this.init(l,o)}init(l,o={}){this.prefix=o.prefix||"i18next:",this.logger=l||M2,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:(Ae(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[o](l))}create(l){return new Do(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new Do(this.logger,l)}}var Dr=new Do;class Bo{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 Xh extends Bo{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 p,v;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):Ae(i)&&d?h.push(...i.split(d)):h.push(i)));const g=Oo(this.data,h);return!g&&!o&&!i&&l.indexOf(".")>-1&&(l=h[0],o=h[1],i=h.slice(2).join(".")),g||!m||!Ae(i)?g:hu((v=(p=this.data)==null?void 0:p[l])==null?void 0:v[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),Yh(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)(Ae(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 g=Oo(this.data,h)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),u?ug(g,i,d):g={...g,...i},Yh(this.data,h,g),m.silent||this.emit("added",l,o,i)}removeResourceBundle(l,o){this.hasResourceBundle(l,o)&&delete this.data[l][o],this.removeNamespaces(o),this.emit("removed",l,o)}hasResourceBundle(l,o){return this.getResource(l,o)!==void 0}getResourceBundle(l,o){return o||(o=this.options.defaultNS),this.getResource(l,o)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const o=this.getDataByLanguage(l);return!!(o&&Object.keys(o)||[]).find(u=>o[u]&&Object.keys(o[u]).length>0)}toJSON(){return this.data}}var dg={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 fg=Symbol("i18next/PATH_KEY");function O2(){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===fg?a:(a.push(u),o=Proxy.revocable(i,l),o.proxy)},Proxy.revocable(Object.create(null),l).proxy}function pu(a,l){const{[fg]:o}=a(O2());return o.join((l==null?void 0:l.keySeparator)??".")}const Jh={},Qh=a=>!Ae(a)&&typeof a!="boolean"&&typeof a!="number";class zo extends Bo{constructor(l,o={}){super(),j2(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Dr.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&&!R2(l,i,u);if(m&&!h){const g=l.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:l,namespaces:Ae(d)?[d]:d};const p=l.split(i);(i!==u||i===u&&this.options.ns.indexOf(p[0])>-1)&&(d=p.shift()),l=p.join(u)}return{key:l,namespaces:Ae(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:g}=this.extractFromKey(l[l.length-1],u),p=g[g.length-1];let v=u.nsSeparator!==void 0?u.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=u.lng||this.language,E=u.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((b==null?void 0:b.toLowerCase())==="cimode")return E?d?{res:`${p}${v}${h}`,usedKey:h,exactUsedKey:h,usedLng:b,usedNS:p,usedParams:this.getUsedParamsDetails(u)}:`${p}${v}${h}`:d?{res:h,usedKey:h,exactUsedKey:h,usedLng:b,usedNS:p,usedParams:this.getUsedParamsDetails(u)}:h;const O=this.resolve(l,u);let A=O==null?void 0:O.res;const C=(O==null?void 0:O.usedKey)||h,M=(O==null?void 0:O.exactUsedKey)||h,R=["[object Number]","[object Function]","[object RegExp]"],N=u.joinArrays!==void 0?u.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,V=u.count!==void 0&&!Ae(u.count),W=zo.hasDefaultValue(u),se=V?this.pluralResolver.getSuffix(b,u.count,u):"",re=u.ordinal&&V?this.pluralResolver.getSuffix(b,u.count,{ordinal:!1}):"",F=V&&!u.ordinal&&u.count===0,te=F&&u[`defaultValue${this.options.pluralSeparator}zero`]||u[`defaultValue${se}`]||u[`defaultValue${re}`]||u.defaultValue;let ie=A;T&&!A&&W&&(ie=te);const z=Qh(ie),U=Object.prototype.toString.apply(ie);if(T&&ie&&z&&R.indexOf(U)<0&&!(Ae(N)&&Array.isArray(ie))){if(!u.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const J=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,ie,{...u,ns:g}):`key '${h} (${this.language})' returned an object instead of string.`;return d?(O.res=J,O.usedParams=this.getUsedParamsDetails(u),O):J}if(m){const J=Array.isArray(ie),K=J?[]:{},B=J?M:C;for(const j in ie)if(Object.prototype.hasOwnProperty.call(ie,j)){const k=`${B}${m}${j}`;W&&!A?K[j]=this.translate(k,{...u,defaultValue:Qh(te)?te[j]:void 0,joinArrays:!1,ns:g}):K[j]=this.translate(k,{...u,joinArrays:!1,ns:g}),K[j]===k&&(K[j]=ie[j])}A=K}}else if(T&&Ae(N)&&Array.isArray(A))A=A.join(N),A&&(A=this.extendTranslation(A,l,u,i));else{let J=!1,K=!1;!this.isValidLookup(A)&&W&&(J=!0,A=te),this.isValidLookup(A)||(K=!0,A=h);const j=(u.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&K?void 0:A,k=W&&te!==A&&this.options.updateMissing;if(K||J||k){if(this.logger.log(k?"updateKey":"missingKey",b,p,h,k?te:A),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 le=this.languageUtils.getFallbackCodes(this.options.fallbackLng,u.lng||this.language);if(this.options.saveMissingTo==="fallback"&&le&&le[0])for(let _=0;_<le.length;_++)L.push(le[_]);else this.options.saveMissingTo==="all"?L=this.languageUtils.toResolveHierarchy(u.lng||this.language):L.push(u.lng||this.language);const S=(_,Z,H)=>{var fe;const $=W&&H!==A?H:j;this.options.missingKeyHandler?this.options.missingKeyHandler(_,p,Z,$,k,u):(fe=this.backendConnector)!=null&&fe.saveMissing&&this.backendConnector.saveMissing(_,p,Z,$,k,u),this.emit("missingKey",_,p,Z,A)};this.options.saveMissing&&(this.options.saveMissingPlurals&&V?L.forEach(_=>{const Z=this.pluralResolver.getSuffixes(_,u);F&&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}`]||te)})}):S(L,h,te))}A=this.extendTranslation(A,l,u,O,i),K&&A===h&&this.options.appendNamespaceToMissingKey&&(A=`${p}${v}${h}`),(K||J)&&this.options.parseMissingKeyHandler&&(A=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${v}${h}`:h,J?A:void 0,u))}return d?(O.res=A,O.usedParams=this.getUsedParamsDetails(u),O):A}extendTranslation(l,o,i,u,d){var g,p;if((g=this.i18nFormat)!=null&&g.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||u.usedLng,u.usedNS,u.usedKey,{resolved:u});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const v=Ae(l)&&(((p=i==null?void 0:i.interpolation)==null?void 0:p.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let b;if(v){const O=l.match(this.interpolator.nestingRegexp);b=O&&O.length}let E=i.replace&&!Ae(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(E={...this.options.interpolation.defaultVariables,...E}),l=this.interpolator.interpolate(l,E,i.lng||this.language||u.usedLng,i),v){const O=l.match(this.interpolator.nestingRegexp),A=O&&O.length;b<A&&(i.nest=!1)}!i.lng&&u&&u.res&&(i.lng=this.language||u.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...O)=>(d==null?void 0:d[0])===O[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${O[0]} in key: ${o[0]}`),null):this.translate(...O,o),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,h=Ae(m)?[m]:m;return l!=null&&(h!=null&&h.length)&&i.applyPostProcessor!==!1&&(l=dg.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 Ae(l)&&(l=[l]),l.forEach(g=>{if(this.isValidLookup(i))return;const p=this.extractFromKey(g,o),v=p.key;u=v;let b=p.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const E=o.count!==void 0&&!Ae(o.count),O=E&&!o.ordinal&&o.count===0,A=o.context!==void 0&&(Ae(o.context)||typeof o.context=="number")&&o.context!=="",C=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);b.forEach(M=>{var R,N;this.isValidLookup(i)||(h=M,!Jh[`${C[0]}-${M}`]&&((R=this.utils)!=null&&R.hasLoadedNamespace)&&!((N=this.utils)!=null&&N.hasLoadedNamespace(h))&&(Jh[`${C[0]}-${M}`]=!0,this.logger.warn(`key "${u}" for languages "${C.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!!!")),C.forEach(T=>{var se;if(this.isValidLookup(i))return;m=T;const V=[v];if((se=this.i18nFormat)!=null&&se.addLookupKeys)this.i18nFormat.addLookupKeys(V,v,T,M,o);else{let re;E&&(re=this.pluralResolver.getSuffix(T,o.count,o));const F=`${this.options.pluralSeparator}zero`,te=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(E&&(o.ordinal&&re.indexOf(te)===0&&V.push(v+re.replace(te,this.options.pluralSeparator)),V.push(v+re),O&&V.push(v+F)),A){const ie=`${v}${this.options.contextSeparator||"_"}${o.context}`;V.push(ie),E&&(o.ordinal&&re.indexOf(te)===0&&V.push(ie+re.replace(te,this.options.pluralSeparator)),V.push(ie+re),O&&V.push(ie+F))}}let W;for(;W=V.pop();)this.isValidLookup(i)||(d=W,i=this.getResource(T,M,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&&!Ae(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 Zh{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Dr.create("languageUtils")}getScriptPartFromCode(l){if(l=el(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=el(l),!l||l.indexOf("-")<0)return l;const o=l.split("-");return this.formatLanguageCode(o[0])}formatLanguageCode(l){if(Ae(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)),Ae(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 Ae(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))):Ae(l)&&d(this.formatLanguageCode(l)),i.forEach(m=>{u.indexOf(m)<0&&d(this.formatLanguageCode(m))}),u}}const Wh={zero:0,one:1,two:2,few:3,many:4,other:5},ep={select:a=>a===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class D2{constructor(l,o={}){this.languageUtils=l,this.options=o,this.logger=Dr.create("pluralResolver"),this.pluralRulesCache={}}addRule(l,o){this.rules[l]=o}clearCache(){this.pluralRulesCache={}}getRule(l,o={}){const i=el(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!"),ep;if(!l.match(/-|_/))return ep;const g=this.languageUtils.getLanguagePartFromCode(l);m=this.getRule(g,o)}return this.pluralRulesCache[d]=m,m}needsPlural(l,o={}){let i=this.getRule(l,o);return i||(i=this.getRule("dev",o)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(l,o,i={}){return this.getSuffixes(l,i).map(u=>`${o}${u}`)}getSuffixes(l,o={}){let i=this.getRule(l,o);return i||(i=this.getRule("dev",o)),i?i.resolvedOptions().pluralCategories.sort((u,d)=>Wh[u]-Wh[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 tp=(a,l,o,i=".",u=!0)=>{let d=S2(a,l,o);return!d&&u&&Ae(o)&&(d=hu(a,o,i),d===void 0&&(d=hu(l,o,i))),d},su=a=>a.replace(/\$/g,"$$$$");class z2{constructor(l={}){var o;this.logger=Dr.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:g,formatSeparator:p,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:E,nestingPrefixEscaped:O,nestingSuffix:A,nestingSuffixEscaped:C,nestingOptionsSeparator:M,maxReplaces:R,alwaysFormat:N}=l.interpolation;this.escape=o!==void 0?o:E2,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=u!==void 0?u:!1,this.prefix=d?Ba(d):m||"{{",this.suffix=h?Ba(h):g||"}}",this.formatSeparator=p||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=E?Ba(E):O||Ba("$t("),this.nestingSuffix=A?Ba(A):C||Ba(")"),this.nestingOptionsSeparator=M||",",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 O;let d,m,h;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=A=>{if(A.indexOf(this.formatSeparator)<0){const N=tp(o,g,A,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,i,{...u,...o,interpolationkey:A}):N}const C=A.split(this.formatSeparator),M=C.shift().trim(),R=C.join(this.formatSeparator).trim();return this.format(tp(o,g,M,this.options.keySeparator,this.options.ignoreJSONStructure),R,i,{...u,...o,interpolationkey:M})};this.resetRegExp();const v=(u==null?void 0:u.missingInterpolationHandler)||this.options.missingInterpolationHandler,b=((O=u==null?void 0:u.interpolation)==null?void 0:O.skipOnVariables)!==void 0?u.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:A=>su(A)},{regex:this.regexp,safeValue:A=>this.escapeValue?su(this.escape(A)):su(A)}].forEach(A=>{for(h=0;d=A.regex.exec(l);){const C=d[1].trim();if(m=p(C),m===void 0)if(typeof v=="function"){const R=v(l,d,u);m=Ae(R)?R:""}else if(u&&Object.prototype.hasOwnProperty.call(u,C))m="";else if(b){m=d[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${l}`),m="";else!Ae(m)&&!this.useRawValueToEscape&&(m=Ih(m));const M=A.safeValue(m);if(l=l.replace(d[0],M),b?(A.regex.lastIndex+=m.length,A.regex.lastIndex-=d[0].length):A.regex.lastIndex=0,h++,h>=this.maxReplaces)break}}),l}nest(l,o,i={}){let u,d,m;const h=(g,p)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const b=g.split(new RegExp(`${v}[ ]*{`));let E=`{${b[1]}`;g=b[0],E=this.interpolate(E,m);const O=E.match(/'/g),A=E.match(/"/g);(((O==null?void 0:O.length)??0)%2===0&&!A||A.length%2!==0)&&(E=E.replace(/'/g,'"'));try{m=JSON.parse(E),p&&(m={...p,...m})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,C),`${g}${v}${E}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;u=this.nestingRegexp.exec(l);){let g=[];m={...i},m=m.replace&&!Ae(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;const p=/{.*}/.test(u[1])?u[1].lastIndexOf("}")+1:u[1].indexOf(this.formatSeparator);if(p!==-1&&(g=u[1].slice(p).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),u[1]=u[1].slice(0,p)),d=o(h.call(this,u[1].trim(),m),m),d&&u[0]===l&&!Ae(d))return d;Ae(d)||(d=Ih(d)),d||(this.logger.warn(`missed to resolve ${u[1]} for nesting ${l}`),d=""),g.length&&(d=g.reduce((v,b)=>this.format(v,b,i.lng,{...i,interpolationkey:u[1].trim()}),d.trim())),l=l.replace(u[0],d),this.regexp.lastIndex=0}return l}}const L2=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,...g]=m.split(":"),p=g.join(":").trim().replace(/^'+|'+$/g,""),v=h.trim();o[v]||(o[v]=p),p==="false"&&(o[v]=!1),p==="true"&&(o[v]=!0),isNaN(p)||(o[v]=parseInt(p,10))}})}return{formatName:l,formatOptions:o}},rp=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(el(i),u),l[m]=h),h(o)}},U2=a=>(l,o,i)=>a(el(o),i)(l);class P2{constructor(l={}){this.logger=Dr.create("formatter"),this.options=l,this.init(l)}init(l,o={interpolation:{}}){this.formatSeparator=o.interpolation.formatSeparator||",";const i=o.cacheInBuiltFormats?rp:U2;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()]=rp(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(g=>g.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,h)].join(this.formatSeparator)}return d.reduce((h,g)=>{var b;const{formatName:p,formatOptions:v}=L2(g);if(this.formats[p]){let E=h;try{const O=((b=u==null?void 0:u.formatParams)==null?void 0:b[u.interpolationkey])||{},A=O.locale||O.lng||u.locale||u.lng||i;E=this.formats[p](h,A,{...v,...u,...O})}catch(O){this.logger.warn(O)}return E}else this.logger.warn(`there was no format function for ${p}`);return h},l)}}const _2=(a,l)=>{a.pending[l]!==void 0&&(delete a.pending[l],a.pendingCount--)};class H2 extends Bo{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=Dr.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={},g={};return l.forEach(p=>{let v=!0;o.forEach(b=>{const E=`${p}|${b}`;!i.reload&&this.store.hasResourceBundle(p,b)?this.state[E]=2:this.state[E]<0||(this.state[E]===1?m[E]===void 0&&(m[E]=!0):(this.state[E]=1,v=!1,m[E]===void 0&&(m[E]=!0),d[E]===void 0&&(d[E]=!0),g[b]===void 0&&(g[b]=!0)))}),v||(h[p]=!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(g)}}loaded(l,o,i){const u=l.split("|"),d=u[0],m=u[1];o&&this.emit("failedLoading",d,m,o),!o&&i&&this.store.addResourceBundle(d,m,i,void 0,void 0,{skipCopy:!0}),this.state[l]=o?-1:2,o&&i&&(this.state[l]=0);const h={};this.queue.forEach(g=>{N2(g.loaded,[d],m),_2(g,l),o&&g.errors.push(o),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(p=>{h[p]||(h[p]={});const v=g.loaded[p];v.length&&v.forEach(b=>{h[p][b]===void 0&&(h[p][b]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(g=>!g.done)}read(l,o,i,u=0,d=this.retryTimeout,m){if(!l.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:o,fcName:i,tried:u,wait:d,callback:m});return}this.readingCalls++;const h=(p,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(p&&v&&u<this.maxRetries){setTimeout(()=>{this.read.call(this,l,o,i,u+1,d*2,m)},d);return}m(p,v)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const p=g(l,o);p&&typeof p.then=="function"?p.then(v=>h(null,v)).catch(h):h(null,p)}catch(p){h(p)}return}return g(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();Ae(l)&&(l=this.languageUtils.toResolveHierarchy(l)),Ae(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 g,p,v,b,E;if((p=(g=this.services)==null?void 0:g.utils)!=null&&p.hasLoadedNamespace&&!((b=(v=this.services)==null?void 0:v.utils)!=null&&b.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((E=this.backend)!=null&&E.create){const O={...m,isUpdate:d},A=this.backend.create.bind(this.backend);if(A.length<6)try{let C;A.length===5?C=A(l,o,i,u,O):C=A(l,o,i,u),C&&typeof C.then=="function"?C.then(M=>h(null,M)).catch(h):h(null,C)}catch(C){h(C)}else A(l,o,i,u,h,O)}!l||!l[0]||this.store.addResource(l[0],o,i,u)}}}const sp=()=>({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]),Ae(a[1])&&(l.defaultValue=a[1]),Ae(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}),ap=a=>{var l,o;return Ae(a.ns)&&(a.ns=[a.ns]),Ae(a.fallbackLng)&&(a.fallbackLng=[a.fallbackLng]),Ae(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},So=()=>{},B2=a=>{Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach(o=>{typeof a[o]=="function"&&(a[o]=a[o].bind(a))})};class tl extends Bo{constructor(l={},o){if(super(),this.options=ap(l),this.services={},this.logger=Dr,this.modules={external:[]},B2(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&&(Ae(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=sp();this.options={...i,...this.options,...ap(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=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Dr.init(u(this.modules.logger),this.options):Dr.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=P2;const v=new Zh(this.options);this.store=new Xh(this.options.resources,this.options);const b=this.services;b.logger=Dr,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new D2(v,{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"),p&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(b.formatter=u(p),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new z2(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new H2(u(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(O,...A)=>{this.emit(O,...A)}),this.modules.languageDetector&&(b.languageDetector=u(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=u(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new zo(this.services,this.options),this.translator.on("*",(O,...A)=>{this.emit(O,...A)}),this.modules.external.forEach(O=>{O.init&&O.init(this)})}if(this.format=this.options.interpolation.format,o||(o=So),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[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(p=>{this[p]=(...v)=>this.store[p](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...v)=>(this.store[p](...v),this)});const h=Xn(),g=()=>{const p=(v,b)=>{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(b),o(v,b)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),h}loadResources(l,o=So){var d,m;let i=o;const u=Ae(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=[],g=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(b=>{b!=="cimode"&&h.indexOf(b)<0&&h.push(b)})};u?g(u):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(v=>g(v)),(m=(d=this.options.preload)==null?void 0:d.forEach)==null||m.call(d,p=>g(p)),this.services.backendConnector.load(h,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(p)})}else i(null)}reloadResources(l,o,i){const u=Xn();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=So),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"&&dg.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=Xn();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,g)=>{g?this.isLanguageChangingTo===l&&(u(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,i.resolve((...p)=>this.t(...p)),o&&o(h,(...p)=>this.t(...p))},m=h=>{var v,b;!l&&!h&&this.services.languageDetector&&(h=[]);const g=Ae(h)?h:h&&h[0],p=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(Ae(h)?[h]:h);p&&(this.language||u(p),this.translator.language||this.translator.changeLanguage(p),(b=(v=this.services.languageDetector)==null?void 0:v.cacheUserLanguage)==null||b.call(v,p)),this.loadResources(p,E=>{d(E,p)})};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 g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([d,m].concat(h)):g={...m},g.lng=g.lng||u.lng,g.lngs=g.lngs||u.lngs,g.ns=g.ns||u.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||u.keyPrefix);const p=this.options.keySeparator||".";let v;return g.keyPrefix&&Array.isArray(d)?v=d.map(b=>(typeof b=="function"&&(b=pu(b,{...this.options,...m})),`${g.keyPrefix}${p}${b}`)):(typeof d=="function"&&(d=pu(d,{...this.options,...m})),v=g.keyPrefix?`${g.keyPrefix}${p}${d}`:d),this.t(v,g)};return Ae(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,g)=>{const p=this.services.backendConnector.state[`${h}|${g}`];return p===-1||p===0||p===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=Xn();return this.options.ns?(Ae(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=Xn();Ae(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 Zh(sp());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 tl(l,o)}cloneInstance(l={},o=So){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const u={...this.options,...l,isClone:!0},d=new tl(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((g,p)=>(g[p]={...this.store.data[p]},g[p]=Object.keys(g[p]).reduce((v,b)=>(v[b]={...g[p][b]},v),g[p]),g),{});d.store=new Xh(h,u),d.services.resourceStore=d.store}return d.translator=new zo(d.services,u),d.translator.on("*",(h,...g)=>{d.emit(h,...g)}),d.init(u,o),d.translator.options=u,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Dt=tl.createInstance();Dt.createInstance=tl.createInstance;Dt.createInstance;Dt.dir;Dt.init;Dt.loadResources;Dt.reloadResources;Dt.use;Dt.changeLanguage;Dt.getFixedT;Dt.t;Dt.exists;Dt.setDefaultNamespace;Dt.hasLoadedNamespace;Dt.loadNamespaces;Dt.loadLanguages;const{slice:q2,forEach:V2}=[];function F2(a){return V2.call(q2.call(arguments,1),l=>{if(l)for(const o in l)a[o]===void 0&&(a[o]=l[o])}),a}function G2(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 np=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,I2=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(!np.test(i.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${i.domain}`}if(i.path){if(!np.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},lp={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=I2(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 $2={name:"cookie",lookup(a){let{lookupCookie:l}=a;if(l&&typeof document<"u")return lp.read(l)||void 0},cacheUserLanguage(a,l){let{lookupCookie:o,cookieMinutes:i,cookieDomain:u,cookieOptions:d}=l;o&&typeof document<"u"&&lp.create(o,a,i,u,d)}},K2={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 g=m[h].indexOf("=");g>0&&m[h].substring(0,g)===l&&(o=m[h].substring(g+1))}}return o}},Y2={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 g=0;g<h.length;g++){const p=h[g].indexOf("=");p>0&&h[g].substring(0,p)===l&&(i=h[g].substring(p+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 qa=null;const op=()=>{if(qa!==null)return qa;try{if(qa=typeof window<"u"&&window.localStorage!==null,!qa)return!1;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{qa=!1}return qa};var X2={name:"localStorage",lookup(a){let{lookupLocalStorage:l}=a;if(l&&op())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(a,l){let{lookupLocalStorage:o}=l;o&&op()&&window.localStorage.setItem(o,a)}};let Va=null;const ip=()=>{if(Va!==null)return Va;try{if(Va=typeof window<"u"&&window.sessionStorage!==null,!Va)return!1;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Va=!1}return Va};var J2={name:"sessionStorage",lookup(a){let{lookupSessionStorage:l}=a;if(l&&ip())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(a,l){let{lookupSessionStorage:o}=l;o&&ip()&&window.sessionStorage.setItem(o,a)}},Q2={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}},Z2={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}},W2={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}},ej={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 mg=!1;try{document.cookie,mg=!0}catch{}const hg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];mg||hg.splice(1,1);const tj=()=>({order:hg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a});class pg{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=F2(o,this.options||{},tj()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=u=>u.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector($2),this.addDetector(K2),this.addDetector(X2),this.addDetector(J2),this.addDetector(Q2),this.addDetector(Z2),this.addDetector(W2),this.addDetector(ej),this.addDetector(Y2)}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&&!G2(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)}))}}pg.type="languageDetector";const rj={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"},sj={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..."},aj={viewProfile:"View profile",userCenter:"User Center"},nj={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"},lj={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},oj={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},ij={title:"Theme",light:"Light",dark:"Dark",system:"System"},cj={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",defaultPasswordWarning:"Default Password Security Warning",defaultPasswordMessage:"You are using the default password (admin123), which poses a security risk. Please change your password immediately to protect your account.",goToSettings:"Go to Settings",passwordStrengthError:"Password does not meet security requirements",passwordMinLength:"Password must be at least 8 characters long",passwordRequireLetter:"Password must contain at least one letter",passwordRequireNumber:"Password must contain at least one number",passwordRequireSpecial:"Password must contain at least one special character",passwordStrengthHint:"Password must be at least 8 characters and contain letters, numbers, and special characters"},uj={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:"Connection 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)"},oauth:{sectionTitle:"OAuth Configuration",sectionDescription:"Configure client credentials for OAuth-protected servers (optional).",clientId:"Client ID",clientSecret:"Client Secret",authorizationEndpoint:"Authorization Endpoint",tokenEndpoint:"Token Endpoint",scopes:"Scopes",scopesPlaceholder:"scope1 scope2",resource:"Resource / Audience",accessToken:"Access Token",refreshToken:"Refresh Token"}},dj={online:"Online",offline:"Offline",connecting:"Connecting",oauthRequired:"OAuth Required",clickToAuthorize:"Click to authorize with OAuth",oauthWindowOpened:"OAuth authorization window opened. Please complete the authorization."},fj={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"},mj={processing:"Processing...",save:"Save",cancel:"Cancel",back:"Back",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"},hj={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",cloud:"Cloud Market",logs:"Logs"},pj={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"}},gj={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"},xj={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"},yj={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"},vj={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}}"},bj={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"},jj={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}}"},wj={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}}"},Nj={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"},Sj={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"},Cj={button:"Import",title:"Import Servers from JSON",inputLabel:"Server Configuration JSON",inputHelp:"Paste your server configuration JSON. Supports STDIO, SSE, and HTTP (streamable-http) server types.",preview:"Preview",previewTitle:"Preview Servers to Import",import:"Import",importing:"Importing...",invalidFormat:"Invalid JSON format. The JSON must contain an 'mcpServers' object.",parseError:"Failed to parse JSON. Please check the format and try again.",addFailed:"Failed to add server",importFailed:"Failed to import servers",partialSuccess:"Imported {{count}} of {{total}} servers successfully. Some servers failed:"},Ej={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."},kj={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"}},Aj={authorizationFailed:"Authorization Failed",authorizationFailedError:"Error",authorizationFailedDetails:"Details",invalidRequest:"Invalid Request",missingStateParameter:"Missing required OAuth state parameter.",missingCodeParameter:"Missing required authorization code parameter.",serverNotFound:"Server Not Found",serverNotFoundMessage:"Could not find server associated with this authorization request.",sessionExpiredMessage:"The authorization session may have expired. Please try authorizing again.",authorizationSuccessful:"Authorization Successful",server:"Server",status:"Status",connected:"Connected",successMessage:"The server has been successfully authorized and connected.",autoCloseMessage:"This window will close automatically in 3 seconds...",closeNow:"Close Now",connectionError:"Connection Error",connectionErrorMessage:"Authorization was successful, but failed to connect to the server.",reconnectMessage:"Please try reconnecting from the dashboard.",configurationError:"Configuration Error",configurationErrorMessage:"Server transport does not support OAuth finishAuth(). Please ensure the server is configured with streamable-http transport.",internalError:"Internal Error",internalErrorMessage:"An unexpected error occurred while processing the OAuth callback.",closeWindow:"Close Window"},Tj={app:rj,about:sj,profile:aj,sponsor:nj,wechat:lj,discord:oj,theme:ij,auth:cj,server:uj,status:dj,errors:fj,common:mj,nav:hj,pages:pj,logs:gj,groups:xj,market:yj,cloud:vj,registry:bj,tool:jj,prompt:wj,settings:Nj,dxt:Sj,jsonImport:Cj,users:Ej,api:kj,oauthCallback:Aj},Rj={title:"MCPHub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCPHub"},Mj={title:"关于",versionInfo:"MCPHub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},Oj={viewProfile:"查看个人中心",userCenter:"个人中心"},Dj={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCPHub 的开发!",supportButton:"在 Ko-fi 上支持"},zj={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},Lj={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},Uj={title:"主题",light:"浅色",dark:"深色",system:"系统"},Pj={login:"登录",loginTitle:"登录 MCPHub",slogan:"统一的 MCP 服务器管理平台",subtitle:"模型上下文协议服务器的集中管理平台,通过灵活的路由策略组织、监控和扩展多个 MCP 服务器。",username:"用户名",password:"密码",loggingIn:"登录中...",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败",defaultPasswordWarning:"默认密码安全警告",defaultPasswordMessage:"您正在使用默认密码(admin123),这存在安全风险。为了保护您的账户安全,请立即修改密码。",goToSettings:"前往修改",passwordStrengthError:"密码不符合安全要求",passwordMinLength:"密码长度至少为 8 个字符",passwordRequireLetter:"密码必须包含至少一个字母",passwordRequireNumber:"密码必须包含至少一个数字",passwordRequireSpecial:"密码必须包含至少一个特殊字符",passwordStrengthHint:"密码必须至少 8 个字符,且包含字母、数字和特殊字符"},_j={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)"},oauth:{sectionTitle:"OAuth 配置",sectionDescription:"为需要 OAuth 的服务器配置客户端凭据(可选)。",clientId:"客户端 ID",clientSecret:"客户端密钥",authorizationEndpoint:"授权端点",tokenEndpoint:"令牌端点",scopes:"权限范围(Scopes)",scopesPlaceholder:"scope1 scope2",resource:"资源 / 受众",accessToken:"访问令牌",refreshToken:"刷新令牌"}},Hj={online:"在线",offline:"离线",connecting:"连接中",oauthRequired:"需要OAuth授权",clickToAuthorize:"点击进行OAuth授权",oauthWindowOpened:"OAuth授权窗口已打开,请完成授权。"},Bj={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},qj={processing:"处理中...",save:"保存",cancel:"取消",back:"返回",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:"可选值"},Vj={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",cloud:"云端市场",logs:"日志"},Fj={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:"系统日志"}},Gj={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},Ij={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:"配置工具"},$j={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:"确认并安装"},Kj={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}}"},Yj={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:"请求头"},Xj={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}}"},Jj={run:"获取",running:"获取中...",result:"提示词结果",error:"提示词错误",execution:"提示词执行",successful:"成功",failed:"失败",errorDetails:"错误详情:",noContent:"提示词执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",description:"描述",messages:"消息",noDescription:"无描述信息",runPromptWithName:"获取提示词: {{name}}"},Qj={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:"获取配置失败"},Zj={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:"覆盖"},Wj={button:"导入",title:"从 JSON 导入服务器",inputLabel:"服务器配置 JSON",inputHelp:"粘贴您的服务器配置 JSON。支持 STDIO、SSE 和 HTTP (streamable-http) 服务器类型。",preview:"预览",previewTitle:"预览要导入的服务器",import:"导入",importing:"导入中...",invalidFormat:"无效的 JSON 格式。JSON 必须包含 'mcpServers' 对象。",parseError:"解析 JSON 失败。请检查格式后重试。",addFailed:"添加服务器失败",importFailed:"导入服务器失败",partialSuccess:"成功导入 {{count}} / {{total}} 个服务器。部分服务器失败:"},ew={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}}' 吗?此操作无法撤消。"},tw={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:"服务器工具更新成功"}},rw={authorizationFailed:"授权失败",authorizationFailedError:"错误",authorizationFailedDetails:"详情",invalidRequest:"无效请求",missingStateParameter:"缺少必需的 OAuth 状态参数。",missingCodeParameter:"缺少必需的授权码参数。",serverNotFound:"服务器未找到",serverNotFoundMessage:"无法找到与此授权请求关联的服务器。",sessionExpiredMessage:"授权会话可能已过期。请重新进行授权。",authorizationSuccessful:"授权成功",server:"服务器",status:"状态",connected:"已连接",successMessage:"服务器已成功授权并连接。",autoCloseMessage:"此窗口将在 3 秒后自动关闭...",closeNow:"立即关闭",connectionError:"连接错误",connectionErrorMessage:"授权成功,但连接服务器失败。",reconnectMessage:"请尝试从控制面板重新连接。",configurationError:"配置错误",configurationErrorMessage:"服务器传输不支持 OAuth finishAuth()。请确保服务器配置为 streamable-http 传输。",internalError:"内部错误",internalErrorMessage:"处理 OAuth 回调时发生意外错误。",closeWindow:"关闭窗口"},sw={app:Rj,about:Mj,profile:Oj,sponsor:Dj,wechat:zj,discord:Lj,theme:Uj,auth:Pj,server:_j,status:Hj,errors:Bj,common:qj,nav:Vj,pages:Fj,logs:Gj,groups:Ij,market:$j,cloud:Kj,registry:Yj,tool:Xj,prompt:Jj,settings:Qj,dxt:Zj,jsonImport:Wj,users:ew,api:tw,oauthCallback:rw},aw={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"},nw={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..."},lw={viewProfile:"Voir le profil",userCenter:"Centre utilisateur"},ow={label:"Sponsor",title:"Soutenir le projet",rewardAlt:"QR Code de récompense",supportMessage:"Soutenez le développement de MCPHub en m'offrant un café !",supportButton:"Soutenir sur Ko-fi"},iw={label:"WeChat",title:"Se connecter via WeChat",qrCodeAlt:"QR Code WeChat",scanMessage:"Scannez ce QR code pour nous contacter sur WeChat"},cw={label:"Discord",title:"Rejoignez notre serveur Discord",community:"Rejoignez notre communauté grandissante sur Discord pour du support, des discussions et des mises à jour !"},uw={title:"Thème",light:"Clair",dark:"Sombre",system:"Système"},dw={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",defaultPasswordWarning:"Avertissement de sécurité du mot de passe par défaut",defaultPasswordMessage:"Vous utilisez le mot de passe par défaut (admin123), ce qui présente un risque de sécurité. Veuillez changer votre mot de passe immédiatement pour protéger votre compte.",goToSettings:"Aller aux paramètres",passwordStrengthError:"Le mot de passe ne répond pas aux exigences de sécurité",passwordMinLength:"Le mot de passe doit contenir au moins 8 caractères",passwordRequireLetter:"Le mot de passe doit contenir au moins une lettre",passwordRequireNumber:"Le mot de passe doit contenir au moins un chiffre",passwordRequireSpecial:"Le mot de passe doit contenir au moins un caractère spécial",passwordStrengthHint:"Le mot de passe doit contenir au moins 8 caractères et inclure des lettres, des chiffres et des caractères spéciaux"},fw={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 de la connexion",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)"},oauth:{sectionTitle:"Configuration OAuth",sectionDescription:"Configurez les identifiants client pour les serveurs protégés par OAuth (optionnel).",clientId:"Identifiant client",clientSecret:"Secret client",authorizationEndpoint:"Point de terminaison d'autorisation",tokenEndpoint:"Point de terminaison de jeton",scopes:"Scopes",scopesPlaceholder:"scope1 scope2",resource:"Ressource / Audience",accessToken:"Jeton d'accès",refreshToken:"Jeton d'actualisation"}},mw={online:"En ligne",offline:"Hors ligne",connecting:"Connexion en cours",oauthRequired:"OAuth requis",clickToAuthorize:"Cliquez pour autoriser avec OAuth",oauthWindowOpened:"Fenêtre d'autorisation OAuth ouverte. Veuillez compléter l'autorisation."},hw={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"},pw={processing:"En cours de traitement...",save:"Enregistrer",cancel:"Annuler",back:"Retour",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"},gw={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"},xw={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"}},yw={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"},vw={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"},bw={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"},jw={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}}"},ww={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"},Nw={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}}"},Sw={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}}"},Cw={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"},Ew={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"},kw={button:"Importer",title:"Importer des serveurs depuis JSON",inputLabel:"Configuration JSON du serveur",inputHelp:"Collez votre configuration JSON de serveur. Prend en charge les types de serveurs STDIO, SSE et HTTP (streamable-http).",preview:"Aperçu",previewTitle:"Aperçu des serveurs à importer",import:"Importer",importing:"Importation en cours...",invalidFormat:"Format JSON invalide. Le JSON doit contenir un objet 'mcpServers'.",parseError:"Échec de l'analyse du JSON. Veuillez vérifier le format et réessayer.",addFailed:"Échec de l'ajout du serveur",importFailed:"Échec de l'importation des serveurs",partialSuccess:"{{count}} serveur(s) sur {{total}} importé(s) avec succès. Certains serveurs ont échoué :"},Aw={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."},Tw={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"}},Rw={authorizationFailed:"Échec de l'autorisation",authorizationFailedError:"Erreur",authorizationFailedDetails:"Détails",invalidRequest:"Requête invalide",missingStateParameter:"Paramètre d'état OAuth requis manquant.",missingCodeParameter:"Paramètre de code d'autorisation requis manquant.",serverNotFound:"Serveur introuvable",serverNotFoundMessage:"Impossible de trouver le serveur associé à cette demande d'autorisation.",sessionExpiredMessage:"La session d'autorisation a peut-être expiré. Veuillez réessayer l'autorisation.",authorizationSuccessful:"Autorisation réussie",server:"Serveur",status:"État",connected:"Connecté",successMessage:"Le serveur a été autorisé et connecté avec succès.",autoCloseMessage:"Cette fenêtre se fermera automatiquement dans 3 secondes...",closeNow:"Fermer maintenant",connectionError:"Erreur de connexion",connectionErrorMessage:"L'autorisation a réussi, mais la connexion au serveur a échoué.",reconnectMessage:"Veuillez essayer de vous reconnecter à partir du tableau de bord.",configurationError:"Erreur de configuration",configurationErrorMessage:"Le transport du serveur ne prend pas en charge OAuth finishAuth(). Veuillez vous assurer que le serveur est configuré avec le transport streamable-http.",internalError:"Erreur interne",internalErrorMessage:"Une erreur inattendue s'est produite lors du traitement du callback OAuth.",closeWindow:"Fermer la fenêtre"},Mw={app:aw,about:nw,profile:lw,sponsor:ow,wechat:iw,discord:cw,theme:uw,auth:dw,server:fw,status:mw,errors:hw,common:pw,nav:gw,pages:xw,logs:yw,groups:vw,market:bw,cloud:jw,registry:ww,tool:Nw,prompt:Sw,settings:Cw,dxt:Ew,jsonImport:kw,users:Aw,api:Tw,oauthCallback:Rw};Dt.use(pg).use(Tv).init({resources:{en:{translation:Tj},zh:{translation:sw},fr:{translation:Mw}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const Ow=()=>{uv()};Ow();async function Dw(){try{console.log("Loading runtime configuration...");const a=await ov();console.log("Runtime configuration loaded:",a),window.__MCPHUB_CONFIG__=a,Eh.createRoot(document.getElementById("root")).render(s.jsx(Fa.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(Fa.StrictMode,{children:s.jsx(Gh,{})}))}}Dw();
|
|
251
|
+
//# sourceMappingURL=index-BP5IZhlg.js.map
|