@samanhappy/mcphub 0.9.5 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/DaoConfigService.js +210 -0
- package/dist/config/DaoConfigService.js.map +1 -0
- package/dist/config/configManager.js +123 -0
- package/dist/config/configManager.js.map +1 -0
- package/dist/config/migrationUtils.js +206 -0
- package/dist/config/migrationUtils.js.map +1 -0
- package/dist/controllers/logController.js +1 -1
- package/dist/controllers/logController.js.map +1 -1
- package/dist/controllers/marketController.js +1 -1
- package/dist/controllers/marketController.js.map +1 -1
- package/dist/controllers/openApiController.js +158 -7
- package/dist/controllers/openApiController.js.map +1 -1
- package/dist/controllers/promptController.js +1 -1
- package/dist/controllers/serverController.js +8 -9
- package/dist/controllers/serverController.js.map +1 -1
- package/dist/dao/DaoFactory.js +102 -0
- package/dist/dao/DaoFactory.js.map +1 -0
- package/dist/dao/GroupDao.js +156 -0
- package/dist/dao/GroupDao.js.map +1 -0
- package/dist/dao/ServerDao.js +117 -0
- package/dist/dao/ServerDao.js.map +1 -0
- package/dist/dao/SystemConfigDao.js +55 -0
- package/dist/dao/SystemConfigDao.js.map +1 -0
- package/dist/dao/UserConfigDao.js +72 -0
- package/dist/dao/UserConfigDao.js.map +1 -0
- package/dist/dao/UserDao.js +107 -0
- package/dist/dao/UserDao.js.map +1 -0
- package/dist/dao/base/BaseDao.js +49 -0
- package/dist/dao/base/BaseDao.js.map +1 -0
- package/dist/dao/base/JsonFileBaseDao.js +84 -0
- package/dist/dao/base/JsonFileBaseDao.js.map +1 -0
- package/dist/dao/examples.js +172 -0
- package/dist/dao/examples.js.map +1 -0
- package/dist/dao/index.js +11 -0
- package/dist/dao/index.js.map +1 -0
- package/dist/routes/index.js +4 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/scripts/dao-demo.js +226 -0
- package/dist/scripts/dao-demo.js.map +1 -0
- package/dist/services/mcpService.js +49 -71
- package/dist/services/mcpService.js.map +1 -1
- package/dist/services/openApiGeneratorService.js +44 -8
- package/dist/services/openApiGeneratorService.js.map +1 -1
- package/dist/services/sseService.js.map +1 -1
- package/dist/services/vectorSearchService.js +1 -1
- package/dist/services/vectorSearchService.js.map +1 -1
- package/frontend/dist/assets/index-ISu9ai3k.js +212 -0
- package/frontend/dist/assets/index-ISu9ai3k.js.map +1 -0
- package/frontend/dist/index.html +1 -1
- package/package.json +3 -1
- package/frontend/dist/assets/index-dsw9o-29.js +0 -212
- package/frontend/dist/assets/index-dsw9o-29.js.map +0 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))i(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function l(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(d){if(d.ep)return;d.ep=!0;const f=l(d);fetch(d.href,f)}})();function ng(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Pc={exports:{}},zr={};/**
|
|
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 fh;function bx(){if(fh)return zr;fh=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function l(i,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:r,type:i,key:m,ref:d!==void 0?d:null,props:f}}return zr.Fragment=o,zr.jsx=l,zr.jsxs=l,zr}var mh;function vx(){return mh||(mh=1,Pc.exports=bx()),Pc.exports}var n=vx(),qc={exports:{}},ke={};/**
|
|
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 hh;function wx(){if(hh)return ke;hh=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),N=Symbol.iterator;function j(w){return w===null||typeof w!="object"?null:(w=N&&w[N]||w["@@iterator"],typeof w=="function"?w:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,O={};function M(w,I,le){this.props=w,this.context=I,this.refs=O,this.updater=le||A}M.prototype.isReactComponent={},M.prototype.setState=function(w,I){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,I,"setState")},M.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function C(){}C.prototype=M.prototype;function T(w,I,le){this.props=w,this.context=I,this.refs=O,this.updater=le||A}var R=T.prototype=new C;R.constructor=T,D(R,M.prototype),R.isPureReactComponent=!0;var W=Array.isArray,Z={H:null,A:null,T:null,S:null,V:null},te=Object.prototype.hasOwnProperty;function ae(w,I,le,H,K,me){return le=me.ref,{$$typeof:r,type:w,key:I,ref:le!==void 0?le:null,props:me}}function F(w,I){return ae(w.type,I,void 0,void 0,void 0,w.props)}function oe(w){return typeof w=="object"&&w!==null&&w.$$typeof===r}function ie(w){var I={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(le){return I[le]})}var k=/\/+/g;function E(w,I){return typeof w=="object"&&w!==null&&w.key!=null?ie(""+w.key):I.toString(36)}function _(){}function q(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(_,_):(w.status="pending",w.then(function(I){w.status==="pending"&&(w.status="fulfilled",w.value=I)},function(I){w.status==="pending"&&(w.status="rejected",w.reason=I)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function G(w,I,le,H,K){var me=typeof w;(me==="undefined"||me==="boolean")&&(w=null);var J=!1;if(w===null)J=!0;else switch(me){case"bigint":case"string":case"number":J=!0;break;case"object":switch(w.$$typeof){case r:case o:J=!0;break;case y:return J=w._init,G(J(w._payload),I,le,H,K)}}if(J)return K=K(w),J=H===""?"."+E(w,0):H,W(K)?(le="",J!=null&&(le=J.replace(k,"$&/")+"/"),G(K,I,le,"",function(be){return be})):K!=null&&(oe(K)&&(K=F(K,le+(K.key==null||w&&w.key===K.key?"":(""+K.key).replace(k,"$&/")+"/")+J)),I.push(K)),1;J=0;var X=H===""?".":H+":";if(W(w))for(var de=0;de<w.length;de++)H=w[de],me=X+E(H,de),J+=G(H,I,le,me,K);else if(de=j(w),typeof de=="function")for(w=de.call(w),de=0;!(H=w.next()).done;)H=H.value,me=X+E(H,de++),J+=G(H,I,le,me,K);else if(me==="object"){if(typeof w.then=="function")return G(q(w),I,le,H,K);throw I=String(w),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return J}function S(w,I,le){if(w==null)return w;var H=[],K=0;return G(w,H,"","",function(me){return I.call(le,me,K++)}),H}function B(w){if(w._status===-1){var I=w._result;I=I(),I.then(function(le){(w._status===0||w._status===-1)&&(w._status=1,w._result=le)},function(le){(w._status===0||w._status===-1)&&(w._status=2,w._result=le)}),w._status===-1&&(w._status=0,w._result=I)}if(w._status===1)return w._result.default;throw w._result}var $=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)};function se(){}return ke.Children={map:S,forEach:function(w,I,le){S(w,function(){I.apply(this,arguments)},le)},count:function(w){var I=0;return S(w,function(){I++}),I},toArray:function(w){return S(w,function(I){return I})||[]},only:function(w){if(!oe(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},ke.Component=M,ke.Fragment=l,ke.Profiler=d,ke.PureComponent=T,ke.StrictMode=i,ke.Suspense=g,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,ke.__COMPILER_RUNTIME={__proto__:null,c:function(w){return Z.H.useMemoCache(w)}},ke.cache=function(w){return function(){return w.apply(null,arguments)}},ke.cloneElement=function(w,I,le){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var H=D({},w.props),K=w.key,me=void 0;if(I!=null)for(J in I.ref!==void 0&&(me=void 0),I.key!==void 0&&(K=""+I.key),I)!te.call(I,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&I.ref===void 0||(H[J]=I[J]);var J=arguments.length-2;if(J===1)H.children=le;else if(1<J){for(var X=Array(J),de=0;de<J;de++)X[de]=arguments[de+2];H.children=X}return ae(w.type,K,void 0,void 0,me,H)},ke.createContext=function(w){return w={$$typeof:m,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:f,_context:w},w},ke.createElement=function(w,I,le){var H,K={},me=null;if(I!=null)for(H in I.key!==void 0&&(me=""+I.key),I)te.call(I,H)&&H!=="key"&&H!=="__self"&&H!=="__source"&&(K[H]=I[H]);var J=arguments.length-2;if(J===1)K.children=le;else if(1<J){for(var X=Array(J),de=0;de<J;de++)X[de]=arguments[de+2];K.children=X}if(w&&w.defaultProps)for(H in J=w.defaultProps,J)K[H]===void 0&&(K[H]=J[H]);return ae(w,me,void 0,void 0,null,K)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(w){return{$$typeof:p,render:w}},ke.isValidElement=oe,ke.lazy=function(w){return{$$typeof:y,_payload:{_status:-1,_result:w},_init:B}},ke.memo=function(w,I){return{$$typeof:h,type:w,compare:I===void 0?null:I}},ke.startTransition=function(w){var I=Z.T,le={};Z.T=le;try{var H=w(),K=Z.S;K!==null&&K(le,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(se,$)}catch(me){$(me)}finally{Z.T=I}},ke.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},ke.use=function(w){return Z.H.use(w)},ke.useActionState=function(w,I,le){return Z.H.useActionState(w,I,le)},ke.useCallback=function(w,I){return Z.H.useCallback(w,I)},ke.useContext=function(w){return Z.H.useContext(w)},ke.useDebugValue=function(){},ke.useDeferredValue=function(w,I){return Z.H.useDeferredValue(w,I)},ke.useEffect=function(w,I,le){var H=Z.H;if(typeof le=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return H.useEffect(w,I)},ke.useId=function(){return Z.H.useId()},ke.useImperativeHandle=function(w,I,le){return Z.H.useImperativeHandle(w,I,le)},ke.useInsertionEffect=function(w,I){return Z.H.useInsertionEffect(w,I)},ke.useLayoutEffect=function(w,I){return Z.H.useLayoutEffect(w,I)},ke.useMemo=function(w,I){return Z.H.useMemo(w,I)},ke.useOptimistic=function(w,I){return Z.H.useOptimistic(w,I)},ke.useReducer=function(w,I,le){return Z.H.useReducer(w,I,le)},ke.useRef=function(w){return Z.H.useRef(w)},ke.useState=function(w){return Z.H.useState(w)},ke.useSyncExternalStore=function(w,I,le){return Z.H.useSyncExternalStore(w,I,le)},ke.useTransition=function(){return Z.H.useTransition()},ke.version="19.1.1",ke}var gh;function cu(){return gh||(gh=1,qc.exports=wx()),qc.exports}var b=cu();const Ms=ng(b);var Vc={exports:{}},Dr={},Gc={exports:{}},Kc={};/**
|
|
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 ph;function jx(){return ph||(ph=1,(function(r){function o(S,B){var $=S.length;S.push(B);e:for(;0<$;){var se=$-1>>>1,w=S[se];if(0<d(w,B))S[se]=B,S[$]=w,$=se;else break e}}function l(S){return S.length===0?null:S[0]}function i(S){if(S.length===0)return null;var B=S[0],$=S.pop();if($!==B){S[0]=$;e:for(var se=0,w=S.length,I=w>>>1;se<I;){var le=2*(se+1)-1,H=S[le],K=le+1,me=S[K];if(0>d(H,$))K<w&&0>d(me,H)?(S[se]=me,S[K]=$,se=K):(S[se]=H,S[le]=$,se=le);else if(K<w&&0>d(me,$))S[se]=me,S[K]=$,se=K;else break e}}return B}function d(S,B){var $=S.sortIndex-B.sortIndex;return $!==0?$:S.id-B.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();r.unstable_now=function(){return m.now()-p}}var g=[],h=[],y=1,N=null,j=3,A=!1,D=!1,O=!1,M=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function W(S){for(var B=l(h);B!==null;){if(B.callback===null)i(h);else if(B.startTime<=S)i(h),B.sortIndex=B.expirationTime,o(g,B);else break;B=l(h)}}function Z(S){if(O=!1,W(S),!D)if(l(g)!==null)D=!0,te||(te=!0,E());else{var B=l(h);B!==null&&G(Z,B.startTime-S)}}var te=!1,ae=-1,F=5,oe=-1;function ie(){return M?!0:!(r.unstable_now()-oe<F)}function k(){if(M=!1,te){var S=r.unstable_now();oe=S;var B=!0;try{e:{D=!1,O&&(O=!1,T(ae),ae=-1),A=!0;var $=j;try{t:{for(W(S),N=l(g);N!==null&&!(N.expirationTime>S&&ie());){var se=N.callback;if(typeof se=="function"){N.callback=null,j=N.priorityLevel;var w=se(N.expirationTime<=S);if(S=r.unstable_now(),typeof w=="function"){N.callback=w,W(S),B=!0;break t}N===l(g)&&i(g),W(S)}else i(g);N=l(g)}if(N!==null)B=!0;else{var I=l(h);I!==null&&G(Z,I.startTime-S),B=!1}}break e}finally{N=null,j=$,A=!1}B=void 0}}finally{B?E():te=!1}}}var E;if(typeof R=="function")E=function(){R(k)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,q=_.port2;_.port1.onmessage=k,E=function(){q.postMessage(null)}}else E=function(){C(k,0)};function G(S,B){ae=C(function(){S(r.unstable_now())},B)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(S){S.callback=null},r.unstable_forceFrameRate=function(S){0>S||125<S?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<S?Math.floor(1e3/S):5},r.unstable_getCurrentPriorityLevel=function(){return j},r.unstable_next=function(S){switch(j){case 1:case 2:case 3:var B=3;break;default:B=j}var $=j;j=B;try{return S()}finally{j=$}},r.unstable_requestPaint=function(){M=!0},r.unstable_runWithPriority=function(S,B){switch(S){case 1:case 2:case 3:case 4:case 5:break;default:S=3}var $=j;j=S;try{return B()}finally{j=$}},r.unstable_scheduleCallback=function(S,B,$){var se=r.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?se+$:se):$=se,S){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=$+w,S={id:y++,callback:B,priorityLevel:S,startTime:$,expirationTime:w,sortIndex:-1},$>se?(S.sortIndex=$,o(h,S),l(g)===null&&S===l(h)&&(O?(T(ae),ae=-1):O=!0,G(Z,$-se))):(S.sortIndex=w,o(g,S),D||A||(D=!0,te||(te=!0,E()))),S},r.unstable_shouldYield=ie,r.unstable_wrapCallback=function(S){var B=j;return function(){var $=j;j=B;try{return S.apply(this,arguments)}finally{j=$}}}})(Kc)),Kc}var xh;function Nx(){return xh||(xh=1,Gc.exports=jx()),Gc.exports}var $c={exports:{}},jt={};/**
|
|
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 yh;function Sx(){if(yh)return jt;yh=1;var r=cu();function o(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var i={d:{f:l,r:function(){throw Error(o(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,h,y){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:N==null?null:""+N,children:g,containerInfo:h,implementation:y}}var m=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,jt.createPortal=function(g,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(o(299));return f(g,h,null,y)},jt.flushSync=function(g){var h=m.T,y=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=y,i.d.f()}},jt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(g,h))},jt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},jt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,N=p(y,h.crossOrigin),j=typeof h.integrity=="string"?h.integrity:void 0,A=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:N,integrity:j,fetchPriority:A}):y==="script"&&i.d.X(g,{crossOrigin:N,integrity:j,fetchPriority:A,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},jt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=p(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},jt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,N=p(y,h.crossOrigin);i.d.L(g,y,{crossOrigin:N,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},jt.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=p(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},jt.requestFormReset=function(g){i.d.r(g)},jt.unstable_batchedUpdates=function(g,h){return g(h)},jt.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},jt.useFormStatus=function(){return m.H.useHostTransitionStatus()},jt.version="19.1.1",jt}var bh;function Cx(){if(bh)return $c.exports;bh=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),$c.exports=Sx(),$c.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 vh;function Ex(){if(vh)return Dr;vh=1;var r=Nx(),o=cu(),l=Cx();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(i(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,s=t;;){var c=a.return;if(c===null)break;var u=c.alternate;if(u===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===a)return p(c),e;if(u===s)return p(c),t;u=u.sibling}throw Error(i(188))}if(a.return!==s.return)a=c,s=u;else{for(var x=!1,v=c.child;v;){if(v===a){x=!0,a=c,s=u;break}if(v===s){x=!0,s=c,a=u;break}v=v.sibling}if(!x){for(v=u.child;v;){if(v===a){x=!0,a=u,s=c;break}if(v===s){x=!0,s=u,a=c;break}v=v.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==s)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function h(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=h(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,N=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),k=Symbol.iterator;function E(e){return e===null||typeof e!="object"?null:(e=k&&e[k]||e["@@iterator"],typeof e=="function"?e:null)}var _=Symbol.for("react.client.reference");function q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case M:return"Profiler";case O:return"StrictMode";case Z:return"Suspense";case te:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case R:return(e.displayName||"Context")+".Provider";case T:return(e._context.displayName||"Context")+".Consumer";case W:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return t=e.displayName||null,t!==null?t:q(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return q(e(t))}catch{}}return null}var G=Array.isArray,S=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},se=[],w=-1;function I(e){return{current:e}}function le(e){0>w||(e.current=se[w],se[w]=null,w--)}function H(e,t){w++,se[w]=e.current,e.current=t}var K=I(null),me=I(null),J=I(null),X=I(null);function de(e,t){switch(H(J,t),H(me,e),H(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pm(t),e=qm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}le(K),H(K,e)}function be(){le(K),le(me),le(J)}function je(e){e.memoizedState!==null&&H(X,e);var t=K.current,a=qm(t,e.type);t!==a&&(H(me,e),H(K,a))}function xe(e){me.current===e&&(le(K),le(me)),X.current===e&&(le(X),Tr._currentValue=$)}var Te=Object.prototype.hasOwnProperty,Be=r.unstable_scheduleCallback,rt=r.unstable_cancelCallback,wa=r.unstable_shouldYield,ca=r.unstable_requestPaint,Ue=r.unstable_now,bt=r.unstable_getCurrentPriorityLevel,ua=r.unstable_ImmediatePriority,da=r.unstable_UserBlockingPriority,Gt=r.unstable_NormalPriority,fa=r.unstable_LowPriority,gn=r.unstable_IdlePriority,Fe=r.log,pn=r.unstable_setDisableYieldValue,zt=null,lt=null;function Tt(e){if(typeof Fe=="function"&&pn(e),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(zt,e)}catch{}}var at=Math.clz32?Math.clz32:Hn,Bn=Math.log,Ka=Math.LN2;function Hn(e){return e>>>=0,e===0?32:31-(Bn(e)/Ka|0)|0}var Dt=256,ja=4194304;function vt(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 Ce(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,u=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var v=s&134217727;return v!==0?(s=v&~u,s!==0?c=vt(s):(x&=v,x!==0?c=vt(x):a||(a=v&~e,a!==0&&(c=vt(a))))):(v=s&~u,v!==0?c=vt(v):x!==0?c=vt(x):a||(a=s&~e,a!==0&&(c=vt(a)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:c}function ce(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ue(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 fe(){var e=Dt;return Dt<<=1,(Dt&4194048)===0&&(Dt=256),e}function dt(){var e=ja;return ja<<=1,(ja&62914560)===0&&(ja=4194304),e}function aa(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function na(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xn(e,t,a,s,c,u){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,z=e.expirationTimes,V=e.hiddenUpdates;for(a=x&~a;0<a;){var ee=31-at(a),re=1<<ee;v[ee]=0,z[ee]=-1;var Y=V[ee];if(Y!==null)for(V[ee]=null,ee=0;ee<Y.length;ee++){var Q=Y[ee];Q!==null&&(Q.lane&=-536870913)}a&=~re}s!==0&&Xr(e,s,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(x&~t))}function Xr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-at(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&4194090}function Ut(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-at(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function ma(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 Pn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Bs(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:lh(e.type))}function Qr(e,t){var a=B.p;try{return B.p=e,t()}finally{B.p=a}}var sa=Math.random().toString(36).slice(2),ot="__reactFiber$"+sa,St="__reactProps$"+sa,qn="__reactContainer$"+sa,Oo="__reactEvents$"+sa,cp="__reactListeners$"+sa,up="__reactHandles$"+sa,ku="__reactResources$"+sa,Hs="__reactMarker$"+sa;function zo(e){delete e[ot],delete e[St],delete e[Oo],delete e[cp],delete e[up]}function Vn(e){var t=e[ot];if(t)return t;for(var a=e.parentNode;a;){if(t=a[qn]||a[ot]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=$m(e);e!==null;){if(a=e[ot])return a;e=$m(e)}return t}e=a,a=e.parentNode}return null}function Gn(e){if(e=e[ot]||e[qn]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Ps(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Kn(e){var t=e[ku];return t||(t=e[ku]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ft(e){e[Hs]=!0}var Tu=new Set,Au={};function yn(e,t){$n(e,t),$n(e+"Capture",t)}function $n(e,t){for(Au[e]=t,e=0;e<t.length;e++)Tu.add(t[e])}var dp=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]*$"),Ru={},Mu={};function fp(e){return Te.call(Mu,e)?!0:Te.call(Ru,e)?!1:dp.test(e)?Mu[e]=!0:(Ru[e]=!0,!1)}function Zr(e,t,a){if(fp(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ir(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Na(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}var Do,Ou;function Fn(e){if(Do===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Do=t&&t[1]||"",Ou=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Do+e+Ou}var Uo=!1;function Lo(e,t){if(!e||Uo)return"";Uo=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Q){var Y=Q}Reflect.construct(e,[],re)}else{try{re.call()}catch(Q){Y=Q}e.call(re.prototype)}}else{try{throw Error()}catch(Q){Y=Q}(re=e())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Q){if(Q&&Y&&typeof Q.stack=="string")return[Q.stack,Y.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=s.DetermineComponentFrameRoot(),x=u[0],v=u[1];if(x&&v){var z=x.split(`
|
|
44
|
+
`),V=v.split(`
|
|
45
|
+
`);for(c=s=0;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;for(;c<V.length&&!V[c].includes("DetermineComponentFrameRoot");)c++;if(s===z.length||c===V.length)for(s=z.length-1,c=V.length-1;1<=s&&0<=c&&z[s]!==V[c];)c--;for(;1<=s&&0<=c;s--,c--)if(z[s]!==V[c]){if(s!==1||c!==1)do if(s--,c--,0>c||z[s]!==V[c]){var ee=`
|
|
46
|
+
`+z[s].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=s&&0<=c);break}}}finally{Uo=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fn(a):""}function mp(e){switch(e.tag){case 26:case 27:case 5:return Fn(e.type);case 16:return Fn("Lazy");case 13:return Fn("Suspense");case 19:return Fn("SuspenseList");case 0:case 15:return Lo(e.type,!1);case 11:return Lo(e.type.render,!1);case 1:return Lo(e.type,!0);case 31:return Fn("Activity");default:return""}}function zu(e){try{var t="";do t+=mp(e),e=e.return;while(e);return t}catch(a){return`
|
|
47
|
+
Error generating stack: `+a.message+`
|
|
48
|
+
`+a.stack}}function Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Du(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hp(e){var t=Du(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){s=""+x,u.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jr(e){e._valueTracker||(e._valueTracker=hp(e))}function Uu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=Du(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function Wr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var gp=/[\n"\\]/g;function $t(e){return e.replace(gp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function _o(e,t,a,s,c,u,x,v){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Bo(e,x,Kt(t)):a!=null?Bo(e,x,Kt(a)):s!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Kt(v):e.removeAttribute("name")}function Lu(e,t,a,s,c,u,x,v){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null))return;a=a!=null?""+Kt(a):"",t=t!=null?""+Kt(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=v?e.checked:!!s,e.defaultChecked=!!s,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x)}function Bo(e,t,a){t==="number"&&Wr(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Yn(e,t,a,s){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&s&&(e[a].defaultSelected=!0)}else{for(a=""+Kt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function _u(e,t,a){if(t!=null&&(t=""+Kt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Kt(a):""}function Bu(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(i(92));if(G(s)){if(1<s.length)throw Error(i(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=Kt(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s)}function Xn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var pp=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 Hu(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||pp.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Pu(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&Hu(e,c,s)}else for(var u in t)t.hasOwnProperty(u)&&Hu(e,u,t[u])}function Ho(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 xp=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"]]),yp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function el(e){return yp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Po=null;function qo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qn=null,Zn=null;function qu(e){var t=Gn(e);if(t&&(e=t.stateNode)){var a=e[St]||null;e:switch(e=t.stateNode,t.type){case"input":if(_o(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+$t(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[St]||null;if(!c)throw Error(i(90));_o(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&Uu(s)}break e;case"textarea":_u(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Yn(e,!!a.multiple,t,!1)}}}var Vo=!1;function Vu(e,t,a){if(Vo)return e(t,a);Vo=!0;try{var s=e(t);return s}finally{if(Vo=!1,(Qn!==null||Zn!==null)&&(Hl(),Qn&&(t=Qn,e=Zn,Zn=Qn=null,qu(t),e)))for(t=0;t<e.length;t++)qu(e[t])}}function qs(e,t){var a=e.stateNode;if(a===null)return null;var s=a[St]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var Sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Go=!1;if(Sa)try{var Vs={};Object.defineProperty(Vs,"passive",{get:function(){Go=!0}}),window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs)}catch{Go=!1}var $a=null,Ko=null,tl=null;function Gu(){if(tl)return tl;var e,t=Ko,a=t.length,s,c="value"in $a?$a.value:$a.textContent,u=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(s=1;s<=x&&t[a-s]===c[u-s];s++);return tl=c.slice(e,1<s?1-s:void 0)}function al(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function nl(){return!0}function Ku(){return!1}function At(e){function t(a,s,c,u,x){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=u,this.target=x,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(u):u[v]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?nl:Ku,this.isPropagationStopped=Ku,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=nl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=nl)},persist:function(){},isPersistent:nl}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sl=At(bn),Gs=y({},bn,{view:0,detail:0}),bp=At(Gs),$o,Fo,Ks,rl=y({},Gs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xo,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!==Ks&&(Ks&&e.type==="mousemove"?($o=e.screenX-Ks.screenX,Fo=e.screenY-Ks.screenY):Fo=$o=0,Ks=e),$o)},movementY:function(e){return"movementY"in e?e.movementY:Fo}}),$u=At(rl),vp=y({},rl,{dataTransfer:0}),wp=At(vp),jp=y({},Gs,{relatedTarget:0}),Yo=At(jp),Np=y({},bn,{animationName:0,elapsedTime:0,pseudoElement:0}),Sp=At(Np),Cp=y({},bn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ep=At(Cp),kp=y({},bn,{data:0}),Fu=At(kp),Tp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ap={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"},Rp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rp[e])?!!t[e]:!1}function Xo(){return Mp}var Op=y({},Gs,{key:function(e){if(e.key){var t=Tp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=al(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ap[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xo,charCode:function(e){return e.type==="keypress"?al(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?al(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zp=At(Op),Dp=y({},rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yu=At(Dp),Up=y({},Gs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xo}),Lp=At(Up),_p=y({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bp=At(_p),Hp=y({},rl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Pp=At(Hp),qp=y({},bn,{newState:0,oldState:0}),Vp=At(qp),Gp=[9,13,27,32],Qo=Sa&&"CompositionEvent"in window,$s=null;Sa&&"documentMode"in document&&($s=document.documentMode);var Kp=Sa&&"TextEvent"in window&&!$s,Xu=Sa&&(!Qo||$s&&8<$s&&11>=$s),Qu=" ",Zu=!1;function Iu(e,t){switch(e){case"keyup":return Gp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ju(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var In=!1;function $p(e,t){switch(e){case"compositionend":return Ju(t);case"keypress":return t.which!==32?null:(Zu=!0,Qu);case"textInput":return e=t.data,e===Qu&&Zu?null:e;default:return null}}function Fp(e,t){if(In)return e==="compositionend"||!Qo&&Iu(e,t)?(e=Gu(),tl=Ko=$a=null,In=!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 Xu&&t.locale!=="ko"?null:t.data;default:return null}}var Yp={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 Wu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Yp[e.type]:t==="textarea"}function ed(e,t,a,s){Qn?Zn?Zn.push(s):Zn=[s]:Qn=s,t=$l(t,"onChange"),0<t.length&&(a=new sl("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Fs=null,Ys=null;function Xp(e){Um(e,0)}function ll(e){var t=Ps(e);if(Uu(t))return e}function td(e,t){if(e==="change")return t}var ad=!1;if(Sa){var Zo;if(Sa){var Io="oninput"in document;if(!Io){var nd=document.createElement("div");nd.setAttribute("oninput","return;"),Io=typeof nd.oninput=="function"}Zo=Io}else Zo=!1;ad=Zo&&(!document.documentMode||9<document.documentMode)}function sd(){Fs&&(Fs.detachEvent("onpropertychange",rd),Ys=Fs=null)}function rd(e){if(e.propertyName==="value"&&ll(Ys)){var t=[];ed(t,Ys,e,qo(e)),Vu(Xp,t)}}function Qp(e,t,a){e==="focusin"?(sd(),Fs=t,Ys=a,Fs.attachEvent("onpropertychange",rd)):e==="focusout"&&sd()}function Zp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ll(Ys)}function Ip(e,t){if(e==="click")return ll(t)}function Jp(e,t){if(e==="input"||e==="change")return ll(t)}function Wp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:Wp;function Xs(e,t){if(Lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Te.call(t,c)||!Lt(e[c],t[c]))return!1}return!0}function ld(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function od(e,t){var a=ld(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ld(a)}}function id(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?id(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Jo(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 e0=Sa&&"documentMode"in document&&11>=document.documentMode,Jn=null,Wo=null,Qs=null,ei=!1;function ud(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ei||Jn==null||Jn!==Wr(s)||(s=Jn,"selectionStart"in s&&Jo(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Qs&&Xs(Qs,s)||(Qs=s,s=$l(Wo,"onSelect"),0<s.length&&(t=new sl("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=Jn)))}function vn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Wn={animationend:vn("Animation","AnimationEnd"),animationiteration:vn("Animation","AnimationIteration"),animationstart:vn("Animation","AnimationStart"),transitionrun:vn("Transition","TransitionRun"),transitionstart:vn("Transition","TransitionStart"),transitioncancel:vn("Transition","TransitionCancel"),transitionend:vn("Transition","TransitionEnd")},ti={},dd={};Sa&&(dd=document.createElement("div").style,"AnimationEvent"in window||(delete Wn.animationend.animation,delete Wn.animationiteration.animation,delete Wn.animationstart.animation),"TransitionEvent"in window||delete Wn.transitionend.transition);function wn(e){if(ti[e])return ti[e];if(!Wn[e])return e;var t=Wn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in dd)return ti[e]=t[a];return e}var fd=wn("animationend"),md=wn("animationiteration"),hd=wn("animationstart"),t0=wn("transitionrun"),a0=wn("transitionstart"),n0=wn("transitioncancel"),gd=wn("transitionend"),pd=new Map,ai="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(" ");ai.push("scrollEnd");function ra(e,t){pd.set(e,t),yn(t,[e])}var xd=new WeakMap;function Ft(e,t){if(typeof e=="object"&&e!==null){var a=xd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:zu(t)},xd.set(e,t),t)}return{value:e,source:t,stack:zu(t)}}var Yt=[],es=0,ni=0;function ol(){for(var e=es,t=ni=es=0;t<e;){var a=Yt[t];Yt[t++]=null;var s=Yt[t];Yt[t++]=null;var c=Yt[t];Yt[t++]=null;var u=Yt[t];if(Yt[t++]=null,s!==null&&c!==null){var x=s.pending;x===null?c.next=c:(c.next=x.next,x.next=c),s.pending=c}u!==0&&yd(a,c,u)}}function il(e,t,a,s){Yt[es++]=e,Yt[es++]=t,Yt[es++]=a,Yt[es++]=s,ni|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function si(e,t,a,s){return il(e,t,a,s),cl(e)}function ts(e,t){return il(e,null,null,t),cl(e)}function yd(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,u=e.return;u!==null;)u.childLanes|=a,s=u.alternate,s!==null&&(s.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-at(a),e=u.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),u):null}function cl(e){if(50<vr)throw vr=0,uc=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var as={};function s0(e,t,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,a,s){return new s0(e,t,a,s)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ca(e,t){var a=e.alternate;return a===null?(a=_t(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function bd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ul(e,t,a,s,c,u){var x=0;if(s=e,typeof e=="function")ri(e)&&(x=1);else if(typeof e=="string")x=lx(e,a,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case oe:return e=_t(31,a,t,c),e.elementType=oe,e.lanes=u,e;case D:return jn(a.children,c,u,t);case O:x=8,c|=24;break;case M:return e=_t(12,a,t,c|2),e.elementType=M,e.lanes=u,e;case Z:return e=_t(13,a,t,c),e.elementType=Z,e.lanes=u,e;case te:return e=_t(19,a,t,c),e.elementType=te,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case C:case R:x=10;break e;case T:x=9;break e;case W:x=11;break e;case ae:x=14;break e;case F:x=16,s=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),s=null}return t=_t(x,a,t,c),t.elementType=e,t.type=s,t.lanes=u,t}function jn(e,t,a,s){return e=_t(7,e,s,t),e.lanes=a,e}function li(e,t,a){return e=_t(6,e,null,t),e.lanes=a,e}function oi(e,t,a){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ns=[],ss=0,dl=null,fl=0,Xt=[],Qt=0,Nn=null,Ea=1,ka="";function Sn(e,t){ns[ss++]=fl,ns[ss++]=dl,dl=e,fl=t}function vd(e,t,a){Xt[Qt++]=Ea,Xt[Qt++]=ka,Xt[Qt++]=Nn,Nn=e;var s=Ea;e=ka;var c=32-at(s)-1;s&=~(1<<c),a+=1;var u=32-at(t)+c;if(30<u){var x=c-c%5;u=(s&(1<<x)-1).toString(32),s>>=x,c-=x,Ea=1<<32-at(t)+c|a<<c|s,ka=u+e}else Ea=1<<u|a<<c|s,ka=e}function ii(e){e.return!==null&&(Sn(e,1),vd(e,1,0))}function ci(e){for(;e===dl;)dl=ns[--ss],ns[ss]=null,fl=ns[--ss],ns[ss]=null;for(;e===Nn;)Nn=Xt[--Qt],Xt[Qt]=null,ka=Xt[--Qt],Xt[Qt]=null,Ea=Xt[--Qt],Xt[Qt]=null}var Ct=null,Ie=null,_e=!1,Cn=null,ha=!1,ui=Error(i(519));function En(e){var t=Error(i(418,""));throw Js(Ft(t,e)),ui}function wd(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[ot]=e,t[St]=s,a){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(a=0;a<jr.length;a++)ze(jr[a],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),Lu(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Jr(t);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),Bu(t,s.value,s.defaultValue,s.children),Jr(t)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||Hm(t.textContent,a)?(s.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),s.onScroll!=null&&ze("scroll",t),s.onScrollEnd!=null&&ze("scrollend",t),s.onClick!=null&&(t.onclick=Fl),t=!0):t=!1,t||En(e)}function jd(e){for(Ct=e.return;Ct;)switch(Ct.tag){case 5:case 13:ha=!1;return;case 27:case 3:ha=!0;return;default:Ct=Ct.return}}function Zs(e){if(e!==Ct)return!1;if(!_e)return jd(e),_e=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ec(e.type,e.memoizedProps)),a=!a),a&&Ie&&En(e),jd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){Ie=oa(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}Ie=null}}else t===27?(t=Ie,on(e.type)?(e=Rc,Rc=null,Ie=e):Ie=t):Ie=Ct?oa(e.stateNode.nextSibling):null;return!0}function Is(){Ie=Ct=null,_e=!1}function Nd(){var e=Cn;return e!==null&&(Ot===null?Ot=e:Ot.push.apply(Ot,e),Cn=null),e}function Js(e){Cn===null?Cn=[e]:Cn.push(e)}var di=I(null),kn=null,Ta=null;function Fa(e,t,a){H(di,t._currentValue),t._currentValue=a}function Aa(e){e._currentValue=di.current,le(di)}function fi(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function mi(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var x=c.child;u=u.firstContext;e:for(;u!==null;){var v=u;u=c;for(var z=0;z<t.length;z++)if(v.context===t[z]){u.lanes|=a,v=u.alternate,v!==null&&(v.lanes|=a),fi(u.return,a,e),s||(x=null);break e}u=v.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,u=x.alternate,u!==null&&(u.lanes|=a),fi(x,a,e),x=null}else x=c.child;if(x!==null)x.return=c;else for(x=c;x!==null;){if(x===e){x=null;break}if(c=x.sibling,c!==null){c.return=x.return,x=c;break}x=x.return}c=x}}function Ws(e,t,a,s){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var x=c.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var v=c.type;Lt(c.pendingProps.value,x.value)||(e!==null?e.push(v):e=[v])}}else if(c===X.current){if(x=c.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Tr):e=[Tr])}c=c.return}e!==null&&mi(t,e,a,s),t.flags|=262144}function ml(e){for(e=e.firstContext;e!==null;){if(!Lt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Tn(e){kn=e,Ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wt(e){return Sd(kn,e)}function hl(e,t){return kn===null&&Tn(e),Sd(e,t)}function Sd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ta===null){if(e===null)throw Error(i(308));Ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ta=Ta.next=t;return a}var r0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},l0=r.unstable_scheduleCallback,o0=r.unstable_NormalPriority,it={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hi(){return{controller:new r0,data:new Map,refCount:0}}function er(e){e.refCount--,e.refCount===0&&l0(o0,function(){e.controller.abort()})}var tr=null,gi=0,rs=0,ls=null;function i0(e,t){if(tr===null){var a=tr=[];gi=0,rs=xc(),ls={status:"pending",value:void 0,then:function(s){a.push(s)}}}return gi++,t.then(Cd,Cd),t}function Cd(){if(--gi===0&&tr!==null){ls!==null&&(ls.status="fulfilled");var e=tr;tr=null,rs=0,ls=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function c0(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var Ed=S.S;S.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&i0(e,t),Ed!==null&&Ed(e,t)};var An=I(null);function pi(){var e=An.current;return e!==null?e:$e.pooledCache}function gl(e,t){t===null?H(An,An.current):H(An,t.pool)}function kd(){var e=pi();return e===null?null:{parent:it._currentValue,pool:e}}var ar=Error(i(460)),Td=Error(i(474)),pl=Error(i(542)),xi={then:function(){}};function Ad(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xl(){}function Rd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(xl,xl),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Od(e),e;default:if(typeof t.status=="string")t.then(xl,xl);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Od(e),e}throw nr=t,ar}}var nr=null;function Md(){if(nr===null)throw Error(i(459));var e=nr;return nr=null,e}function Od(e){if(e===ar||e===pl)throw Error(i(483))}var Ya=!1;function yi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bi(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 Xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(He&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=cl(e),yd(e,null,a),t}return il(e,s,t,a),cl(e)}function sr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Ut(e,a)}}function vi(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?c=u=x:u=u.next=x,a=a.next}while(a!==null);u===null?c=u=t:u=u.next=t}else c=u=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var wi=!1;function rr(){if(wi){var e=ls;if(e!==null)throw e}}function lr(e,t,a,s){wi=!1;var c=e.updateQueue;Ya=!1;var u=c.firstBaseUpdate,x=c.lastBaseUpdate,v=c.shared.pending;if(v!==null){c.shared.pending=null;var z=v,V=z.next;z.next=null,x===null?u=V:x.next=V,x=z;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,v=ee.lastBaseUpdate,v!==x&&(v===null?ee.firstBaseUpdate=V:v.next=V,ee.lastBaseUpdate=z))}if(u!==null){var re=c.baseState;x=0,ee=V=z=null,v=u;do{var Y=v.lane&-536870913,Q=Y!==v.lane;if(Q?(De&Y)===Y:(s&Y)===Y){Y!==0&&Y===rs&&(wi=!0),ee!==null&&(ee=ee.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var Ne=e,ve=v;Y=t;var Ge=a;switch(ve.tag){case 1:if(Ne=ve.payload,typeof Ne=="function"){re=Ne.call(Ge,re,Y);break e}re=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=ve.payload,Y=typeof Ne=="function"?Ne.call(Ge,re,Y):Ne,Y==null)break e;re=y({},re,Y);break e;case 2:Ya=!0}}Y=v.callback,Y!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=c.callbacks,Q===null?c.callbacks=[Y]:Q.push(Y))}else Q={lane:Y,tag:v.tag,payload:v.payload,callback:v.callback,next:null},ee===null?(V=ee=Q,z=re):ee=ee.next=Q,x|=Y;if(v=v.next,v===null){if(v=c.shared.pending,v===null)break;Q=v,v=Q.next,Q.next=null,c.lastBaseUpdate=Q,c.shared.pending=null}}while(!0);ee===null&&(z=re),c.baseState=z,c.firstBaseUpdate=V,c.lastBaseUpdate=ee,u===null&&(c.shared.lanes=0),nn|=x,e.lanes=x,e.memoizedState=re}}function zd(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Dd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)zd(a[e],t)}var os=I(null),yl=I(0);function Ud(e,t){e=La,H(yl,e),H(os,t),La=e|t.baseLanes}function ji(){H(yl,La),H(os,os.current)}function Ni(){La=yl.current,le(os),le(yl)}var Za=0,Ae=null,qe=null,nt=null,bl=!1,is=!1,Rn=!1,vl=0,or=0,cs=null,u0=0;function et(){throw Error(i(321))}function Si(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Lt(e[a],t[a]))return!1;return!0}function Ci(e,t,a,s,c,u){return Za=u,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,S.H=e===null||e.memoizedState===null?bf:vf,Rn=!1,u=a(s,c),Rn=!1,is&&(u=_d(t,a,s,c)),Ld(e),u}function Ld(e){S.H=El;var t=qe!==null&&qe.next!==null;if(Za=0,nt=qe=Ae=null,bl=!1,or=0,cs=null,t)throw Error(i(300));e===null||mt||(e=e.dependencies,e!==null&&ml(e)&&(mt=!0))}function _d(e,t,a,s){Ae=e;var c=0;do{if(is&&(cs=null),or=0,is=!1,25<=c)throw Error(i(301));if(c+=1,nt=qe=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}S.H=x0,u=t(a,s)}while(is);return u}function d0(){var e=S.H,t=e.useState()[0];return t=typeof t.then=="function"?ir(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(Ae.flags|=1024),t}function Ei(){var e=vl!==0;return vl=0,e}function ki(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Ti(e){if(bl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bl=!1}Za=0,nt=qe=Ae=null,is=!1,or=vl=0,cs=null}function Rt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?Ae.memoizedState=nt=e:nt=nt.next=e,nt}function st(){if(qe===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=nt===null?Ae.memoizedState:nt.next;if(t!==null)nt=t,qe=e;else{if(e===null)throw Ae.alternate===null?Error(i(467)):Error(i(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},nt===null?Ae.memoizedState=nt=e:nt=nt.next=e}return nt}function Ai(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ir(e){var t=or;return or+=1,cs===null&&(cs=[]),e=Rd(cs,e,t),t=Ae,(nt===null?t.memoizedState:nt.next)===null&&(t=t.alternate,S.H=t===null||t.memoizedState===null?bf:vf),e}function wl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ir(e);if(e.$$typeof===R)return wt(e)}throw Error(i(438,String(e)))}function Ri(e){var t=null,a=Ae.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=Ae.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ai(),Ae.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=ie;return t.index++,a}function Ra(e,t){return typeof t=="function"?t(e):t}function jl(e){var t=st();return Mi(t,qe,e)}function Mi(e,t,a){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=a;var c=e.baseQueue,u=s.pending;if(u!==null){if(c!==null){var x=c.next;c.next=u.next,u.next=x}t.baseQueue=c=u,s.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var v=x=null,z=null,V=t,ee=!1;do{var re=V.lane&-536870913;if(re!==V.lane?(De&re)===re:(Za&re)===re){var Y=V.revertLane;if(Y===0)z!==null&&(z=z.next={lane:0,revertLane:0,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),re===rs&&(ee=!0);else if((Za&Y)===Y){V=V.next,Y===rs&&(ee=!0);continue}else re={lane:0,revertLane:V.revertLane,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},z===null?(v=z=re,x=u):z=z.next=re,Ae.lanes|=Y,nn|=Y;re=V.action,Rn&&a(u,re),u=V.hasEagerState?V.eagerState:a(u,re)}else Y={lane:re,revertLane:V.revertLane,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},z===null?(v=z=Y,x=u):z=z.next=Y,Ae.lanes|=re,nn|=re;V=V.next}while(V!==null&&V!==t);if(z===null?x=u:z.next=v,!Lt(u,e.memoizedState)&&(mt=!0,ee&&(a=ls,a!==null)))throw a;e.memoizedState=u,e.baseState=x,e.baseQueue=z,s.lastRenderedState=u}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Oi(e){var t=st(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,u=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do u=e(u,x.action),x=x.next;while(x!==c);Lt(u,t.memoizedState)||(mt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,s]}function Bd(e,t,a){var s=Ae,c=st(),u=_e;if(u){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!Lt((qe||c).memoizedState,a);x&&(c.memoizedState=a,mt=!0),c=c.queue;var v=qd.bind(null,s,c,e);if(cr(2048,8,v,[e]),c.getSnapshot!==t||x||nt!==null&&nt.memoizedState.tag&1){if(s.flags|=2048,us(9,Nl(),Pd.bind(null,s,c,a,t),null),$e===null)throw Error(i(349));u||(Za&124)!==0||Hd(s,t,a)}return a}function Hd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ae.updateQueue,t===null?(t=Ai(),Ae.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Pd(e,t,a,s){t.value=a,t.getSnapshot=s,Vd(t)&&Gd(e)}function qd(e,t,a){return a(function(){Vd(t)&&Gd(e)})}function Vd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Lt(e,a)}catch{return!0}}function Gd(e){var t=ts(e,2);t!==null&&Vt(t,e,2)}function zi(e){var t=Rt();if(typeof e=="function"){var a=e;if(e=a(),Rn){Tt(!0);try{a()}finally{Tt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:e},t}function Kd(e,t,a,s){return e.baseState=a,Mi(e,qe,typeof s=="function"?s:Ra)}function f0(e,t,a,s,c){if(Cl(e))throw Error(i(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){u.listeners.push(x)}};S.T!==null?a(!0):u.isTransition=!1,s(u),a=t.pending,a===null?(u.next=t.pending=u,$d(t,u)):(u.next=a.next,t.pending=a.next=u)}}function $d(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var u=S.T,x={};S.T=x;try{var v=a(c,s),z=S.S;z!==null&&z(x,v),Fd(e,t,v)}catch(V){Di(e,t,V)}finally{S.T=u}}else try{u=a(c,s),Fd(e,t,u)}catch(V){Di(e,t,V)}}function Fd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){Yd(e,t,s)},function(s){return Di(e,t,s)}):Yd(e,t,a)}function Yd(e,t,a){t.status="fulfilled",t.value=a,Xd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,$d(e,a)))}function Di(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,Xd(t),t=t.next;while(t!==s)}e.action=null}function Xd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qd(e,t){return t}function Zd(e,t){if(_e){var a=$e.formState;if(a!==null){e:{var s=Ae;if(_e){if(Ie){t:{for(var c=Ie,u=ha;c.nodeType!==8;){if(!u){c=null;break t}if(c=oa(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ie=oa(c.nextSibling),s=c.data==="F!";break e}}En(s)}s=!1}s&&(t=a[0])}}return a=Rt(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qd,lastRenderedState:t},a.queue=s,a=pf.bind(null,Ae,s),s.dispatch=a,s=zi(!1),u=Hi.bind(null,Ae,!1,s.queue),s=Rt(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=f0.bind(null,Ae,c,u,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function Id(e){var t=st();return Jd(t,qe,e)}function Jd(e,t,a){if(t=Mi(e,t,Qd)[0],e=jl(Ra)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=ir(t)}catch(x){throw x===ar?pl:x}else s=t;t=st();var c=t.queue,u=c.dispatch;return a!==t.memoizedState&&(Ae.flags|=2048,us(9,Nl(),m0.bind(null,c,a),null)),[s,u,e]}function m0(e,t){e.action=t}function Wd(e){var t=st(),a=qe;if(a!==null)return Jd(t,a,e);st(),t=t.memoizedState,a=st();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function us(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=Ai(),Ae.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Nl(){return{destroy:void 0,resource:void 0}}function ef(){return st().memoizedState}function Sl(e,t,a,s){var c=Rt();s=s===void 0?null:s,Ae.flags|=e,c.memoizedState=us(1|t,Nl(),a,s)}function cr(e,t,a,s){var c=st();s=s===void 0?null:s;var u=c.memoizedState.inst;qe!==null&&s!==null&&Si(s,qe.memoizedState.deps)?c.memoizedState=us(t,u,a,s):(Ae.flags|=e,c.memoizedState=us(1|t,u,a,s))}function tf(e,t){Sl(8390656,8,e,t)}function af(e,t){cr(2048,8,e,t)}function nf(e,t){return cr(4,2,e,t)}function sf(e,t){return cr(4,4,e,t)}function rf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function lf(e,t,a){a=a!=null?a.concat([e]):null,cr(4,4,rf.bind(null,t,e),a)}function Ui(){}function of(e,t){var a=st();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&Si(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function cf(e,t){var a=st();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&Si(t,s[1]))return s[0];if(s=e(),Rn){Tt(!0);try{e()}finally{Tt(!1)}}return a.memoizedState=[s,t],s}function Li(e,t,a){return a===void 0||(Za&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=fm(),Ae.lanes|=e,nn|=e,a)}function uf(e,t,a,s){return Lt(a,t)?a:os.current!==null?(e=Li(e,a,s),Lt(e,t)||(mt=!0),e):(Za&42)===0?(mt=!0,e.memoizedState=a):(e=fm(),Ae.lanes|=e,nn|=e,t)}function df(e,t,a,s,c){var u=B.p;B.p=u!==0&&8>u?u:8;var x=S.T,v={};S.T=v,Hi(e,!1,t,a);try{var z=c(),V=S.S;if(V!==null&&V(v,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ee=c0(z,s);ur(e,t,ee,qt(e))}else ur(e,t,s,qt(e))}catch(re){ur(e,t,{then:function(){},status:"rejected",reason:re},qt())}finally{B.p=u,S.T=x}}function h0(){}function _i(e,t,a,s){if(e.tag!==5)throw Error(i(476));var c=ff(e).queue;df(e,c,t,$,a===null?h0:function(){return mf(e),a(s)})}function ff(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:$},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function mf(e){var t=ff(e).next.queue;ur(e,t,{},qt())}function Bi(){return wt(Tr)}function hf(){return st().memoizedState}function gf(){return st().memoizedState}function g0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=qt();e=Xa(a);var s=Qa(t,e,a);s!==null&&(Vt(s,t,a),sr(s,t,a)),t={cache:hi()},e.payload=t;return}t=t.return}}function p0(e,t,a){var s=qt();a={lane:s,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Cl(e)?xf(t,a):(a=si(e,t,a,s),a!==null&&(Vt(a,e,s),yf(a,t,s)))}function pf(e,t,a){var s=qt();ur(e,t,a,s)}function ur(e,t,a,s){var c={lane:s,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Cl(e))xf(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var x=t.lastRenderedState,v=u(x,a);if(c.hasEagerState=!0,c.eagerState=v,Lt(v,x))return il(e,t,c,0),$e===null&&ol(),!1}catch{}finally{}if(a=si(e,t,c,s),a!==null)return Vt(a,e,s),yf(a,t,s),!0}return!1}function Hi(e,t,a,s){if(s={lane:2,revertLane:xc(),action:s,hasEagerState:!1,eagerState:null,next:null},Cl(e)){if(t)throw Error(i(479))}else t=si(e,a,s,2),t!==null&&Vt(t,e,2)}function Cl(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function xf(e,t){is=bl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function yf(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Ut(e,a)}}var El={readContext:wt,use:wl,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et},bf={readContext:wt,use:wl,useCallback:function(e,t){return Rt().memoizedState=[e,t===void 0?null:t],e},useContext:wt,useEffect:tf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Sl(4194308,4,rf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Sl(4194308,4,e,t)},useInsertionEffect:function(e,t){Sl(4,2,e,t)},useMemo:function(e,t){var a=Rt();t=t===void 0?null:t;var s=e();if(Rn){Tt(!0);try{e()}finally{Tt(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=Rt();if(a!==void 0){var c=a(t);if(Rn){Tt(!0);try{a(t)}finally{Tt(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=p0.bind(null,Ae,e),[s.memoizedState,e]},useRef:function(e){var t=Rt();return e={current:e},t.memoizedState=e},useState:function(e){e=zi(e);var t=e.queue,a=pf.bind(null,Ae,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ui,useDeferredValue:function(e,t){var a=Rt();return Li(a,e,t)},useTransition:function(){var e=zi(!1);return e=df.bind(null,Ae,e.queue,!0,!1),Rt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=Ae,c=Rt();if(_e){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),$e===null)throw Error(i(349));(De&124)!==0||Hd(s,t,a)}c.memoizedState=a;var u={value:a,getSnapshot:t};return c.queue=u,tf(qd.bind(null,s,u,e),[e]),s.flags|=2048,us(9,Nl(),Pd.bind(null,s,u,a,t),null),a},useId:function(){var e=Rt(),t=$e.identifierPrefix;if(_e){var a=ka,s=Ea;a=(s&~(1<<32-at(s)-1)).toString(32)+a,t="«"+t+"R"+a,a=vl++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=u0++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Bi,useFormState:Zd,useActionState:Zd,useOptimistic:function(e){var t=Rt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Hi.bind(null,Ae,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ri,useCacheRefresh:function(){return Rt().memoizedState=g0.bind(null,Ae)}},vf={readContext:wt,use:wl,useCallback:of,useContext:wt,useEffect:af,useImperativeHandle:lf,useInsertionEffect:nf,useLayoutEffect:sf,useMemo:cf,useReducer:jl,useRef:ef,useState:function(){return jl(Ra)},useDebugValue:Ui,useDeferredValue:function(e,t){var a=st();return uf(a,qe.memoizedState,e,t)},useTransition:function(){var e=jl(Ra)[0],t=st().memoizedState;return[typeof e=="boolean"?e:ir(e),t]},useSyncExternalStore:Bd,useId:hf,useHostTransitionStatus:Bi,useFormState:Id,useActionState:Id,useOptimistic:function(e,t){var a=st();return Kd(a,qe,e,t)},useMemoCache:Ri,useCacheRefresh:gf},x0={readContext:wt,use:wl,useCallback:of,useContext:wt,useEffect:af,useImperativeHandle:lf,useInsertionEffect:nf,useLayoutEffect:sf,useMemo:cf,useReducer:Oi,useRef:ef,useState:function(){return Oi(Ra)},useDebugValue:Ui,useDeferredValue:function(e,t){var a=st();return qe===null?Li(a,e,t):uf(a,qe.memoizedState,e,t)},useTransition:function(){var e=Oi(Ra)[0],t=st().memoizedState;return[typeof e=="boolean"?e:ir(e),t]},useSyncExternalStore:Bd,useId:hf,useHostTransitionStatus:Bi,useFormState:Wd,useActionState:Wd,useOptimistic:function(e,t){var a=st();return qe!==null?Kd(a,qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ri,useCacheRefresh:gf},ds=null,dr=0;function kl(e){var t=dr;return dr+=1,ds===null&&(ds=[]),Rd(ds,e,t)}function fr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Tl(e,t){throw t.$$typeof===N?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wf(e){var t=e._init;return t(e._payload)}function jf(e){function t(L,U){if(e){var P=L.deletions;P===null?(L.deletions=[U],L.flags|=16):P.push(U)}}function a(L,U){if(!e)return null;for(;U!==null;)t(L,U),U=U.sibling;return null}function s(L){for(var U=new Map;L!==null;)L.key!==null?U.set(L.key,L):U.set(L.index,L),L=L.sibling;return U}function c(L,U){return L=Ca(L,U),L.index=0,L.sibling=null,L}function u(L,U,P){return L.index=P,e?(P=L.alternate,P!==null?(P=P.index,P<U?(L.flags|=67108866,U):P):(L.flags|=67108866,U)):(L.flags|=1048576,U)}function x(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function v(L,U,P,ne){return U===null||U.tag!==6?(U=li(P,L.mode,ne),U.return=L,U):(U=c(U,P),U.return=L,U)}function z(L,U,P,ne){var he=P.type;return he===D?ee(L,U,P.props.children,ne,P.key):U!==null&&(U.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===F&&wf(he)===U.type)?(U=c(U,P.props),fr(U,P),U.return=L,U):(U=ul(P.type,P.key,P.props,null,L.mode,ne),fr(U,P),U.return=L,U)}function V(L,U,P,ne){return U===null||U.tag!==4||U.stateNode.containerInfo!==P.containerInfo||U.stateNode.implementation!==P.implementation?(U=oi(P,L.mode,ne),U.return=L,U):(U=c(U,P.children||[]),U.return=L,U)}function ee(L,U,P,ne,he){return U===null||U.tag!==7?(U=jn(P,L.mode,ne,he),U.return=L,U):(U=c(U,P),U.return=L,U)}function re(L,U,P){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=li(""+U,L.mode,P),U.return=L,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case j:return P=ul(U.type,U.key,U.props,null,L.mode,P),fr(P,U),P.return=L,P;case A:return U=oi(U,L.mode,P),U.return=L,U;case F:var ne=U._init;return U=ne(U._payload),re(L,U,P)}if(G(U)||E(U))return U=jn(U,L.mode,P,null),U.return=L,U;if(typeof U.then=="function")return re(L,kl(U),P);if(U.$$typeof===R)return re(L,hl(L,U),P);Tl(L,U)}return null}function Y(L,U,P,ne){var he=U!==null?U.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return he!==null?null:v(L,U,""+P,ne);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case j:return P.key===he?z(L,U,P,ne):null;case A:return P.key===he?V(L,U,P,ne):null;case F:return he=P._init,P=he(P._payload),Y(L,U,P,ne)}if(G(P)||E(P))return he!==null?null:ee(L,U,P,ne,null);if(typeof P.then=="function")return Y(L,U,kl(P),ne);if(P.$$typeof===R)return Y(L,U,hl(L,P),ne);Tl(L,P)}return null}function Q(L,U,P,ne,he){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return L=L.get(P)||null,v(U,L,""+ne,he);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case j:return L=L.get(ne.key===null?P:ne.key)||null,z(U,L,ne,he);case A:return L=L.get(ne.key===null?P:ne.key)||null,V(U,L,ne,he);case F:var Me=ne._init;return ne=Me(ne._payload),Q(L,U,P,ne,he)}if(G(ne)||E(ne))return L=L.get(P)||null,ee(U,L,ne,he,null);if(typeof ne.then=="function")return Q(L,U,P,kl(ne),he);if(ne.$$typeof===R)return Q(L,U,P,hl(U,ne),he);Tl(U,ne)}return null}function Ne(L,U,P,ne){for(var he=null,Me=null,ye=U,we=U=0,gt=null;ye!==null&&we<P.length;we++){ye.index>we?(gt=ye,ye=null):gt=ye.sibling;var Le=Y(L,ye,P[we],ne);if(Le===null){ye===null&&(ye=gt);break}e&&ye&&Le.alternate===null&&t(L,ye),U=u(Le,U,we),Me===null?he=Le:Me.sibling=Le,Me=Le,ye=gt}if(we===P.length)return a(L,ye),_e&&Sn(L,we),he;if(ye===null){for(;we<P.length;we++)ye=re(L,P[we],ne),ye!==null&&(U=u(ye,U,we),Me===null?he=ye:Me.sibling=ye,Me=ye);return _e&&Sn(L,we),he}for(ye=s(ye);we<P.length;we++)gt=Q(ye,L,we,P[we],ne),gt!==null&&(e&>.alternate!==null&&ye.delete(gt.key===null?we:gt.key),U=u(gt,U,we),Me===null?he=gt:Me.sibling=gt,Me=gt);return e&&ye.forEach(function(mn){return t(L,mn)}),_e&&Sn(L,we),he}function ve(L,U,P,ne){if(P==null)throw Error(i(151));for(var he=null,Me=null,ye=U,we=U=0,gt=null,Le=P.next();ye!==null&&!Le.done;we++,Le=P.next()){ye.index>we?(gt=ye,ye=null):gt=ye.sibling;var mn=Y(L,ye,Le.value,ne);if(mn===null){ye===null&&(ye=gt);break}e&&ye&&mn.alternate===null&&t(L,ye),U=u(mn,U,we),Me===null?he=mn:Me.sibling=mn,Me=mn,ye=gt}if(Le.done)return a(L,ye),_e&&Sn(L,we),he;if(ye===null){for(;!Le.done;we++,Le=P.next())Le=re(L,Le.value,ne),Le!==null&&(U=u(Le,U,we),Me===null?he=Le:Me.sibling=Le,Me=Le);return _e&&Sn(L,we),he}for(ye=s(ye);!Le.done;we++,Le=P.next())Le=Q(ye,L,we,Le.value,ne),Le!==null&&(e&&Le.alternate!==null&&ye.delete(Le.key===null?we:Le.key),U=u(Le,U,we),Me===null?he=Le:Me.sibling=Le,Me=Le);return e&&ye.forEach(function(yx){return t(L,yx)}),_e&&Sn(L,we),he}function Ge(L,U,P,ne){if(typeof P=="object"&&P!==null&&P.type===D&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case j:e:{for(var he=P.key;U!==null;){if(U.key===he){if(he=P.type,he===D){if(U.tag===7){a(L,U.sibling),ne=c(U,P.props.children),ne.return=L,L=ne;break e}}else if(U.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===F&&wf(he)===U.type){a(L,U.sibling),ne=c(U,P.props),fr(ne,P),ne.return=L,L=ne;break e}a(L,U);break}else t(L,U);U=U.sibling}P.type===D?(ne=jn(P.props.children,L.mode,ne,P.key),ne.return=L,L=ne):(ne=ul(P.type,P.key,P.props,null,L.mode,ne),fr(ne,P),ne.return=L,L=ne)}return x(L);case A:e:{for(he=P.key;U!==null;){if(U.key===he)if(U.tag===4&&U.stateNode.containerInfo===P.containerInfo&&U.stateNode.implementation===P.implementation){a(L,U.sibling),ne=c(U,P.children||[]),ne.return=L,L=ne;break e}else{a(L,U);break}else t(L,U);U=U.sibling}ne=oi(P,L.mode,ne),ne.return=L,L=ne}return x(L);case F:return he=P._init,P=he(P._payload),Ge(L,U,P,ne)}if(G(P))return Ne(L,U,P,ne);if(E(P)){if(he=E(P),typeof he!="function")throw Error(i(150));return P=he.call(P),ve(L,U,P,ne)}if(typeof P.then=="function")return Ge(L,U,kl(P),ne);if(P.$$typeof===R)return Ge(L,U,hl(L,P),ne);Tl(L,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,U!==null&&U.tag===6?(a(L,U.sibling),ne=c(U,P),ne.return=L,L=ne):(a(L,U),ne=li(P,L.mode,ne),ne.return=L,L=ne),x(L)):a(L,U)}return function(L,U,P,ne){try{dr=0;var he=Ge(L,U,P,ne);return ds=null,he}catch(ye){if(ye===ar||ye===pl)throw ye;var Me=_t(29,ye,null,L.mode);return Me.lanes=ne,Me.return=L,Me}finally{}}}var fs=jf(!0),Nf=jf(!1),Zt=I(null),ga=null;function Ia(e){var t=e.alternate;H(ct,ct.current&1),H(Zt,e),ga===null&&(t===null||os.current!==null||t.memoizedState!==null)&&(ga=e)}function Sf(e){if(e.tag===22){if(H(ct,ct.current),H(Zt,e),ga===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(ga=e)}}else Ja()}function Ja(){H(ct,ct.current),H(Zt,Zt.current)}function Ma(e){le(Zt),ga===e&&(ga=null),le(ct)}var ct=I(0);function Al(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Ac(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Pi(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var qi={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=qt(),c=Xa(s);c.payload=t,a!=null&&(c.callback=a),t=Qa(e,c,s),t!==null&&(Vt(t,e,s),sr(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=qt(),c=Xa(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Qa(e,c,s),t!==null&&(Vt(t,e,s),sr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=qt(),s=Xa(a);s.tag=2,t!=null&&(s.callback=t),t=Qa(e,s,a),t!==null&&(Vt(t,e,a),sr(t,e,a))}};function Cf(e,t,a,s,c,u,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,u,x):t.prototype&&t.prototype.isPureReactComponent?!Xs(a,s)||!Xs(c,u):!0}function Ef(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&qi.enqueueReplaceState(t,t.state,null)}function Mn(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}var Rl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function kf(e){Rl(e)}function Tf(e){console.error(e)}function Af(e){Rl(e)}function Ml(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Rf(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Vi(e,t,a){return a=Xa(a),a.tag=3,a.payload={element:null},a.callback=function(){Ml(e,t)},a}function Mf(e){return e=Xa(e),e.tag=3,e}function Of(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var u=s.value;e.payload=function(){return c(u)},e.callback=function(){Rf(t,a,s)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Rf(t,a,s),typeof c!="function"&&(sn===null?sn=new Set([this]):sn.add(this));var v=s.stack;this.componentDidCatch(s.value,{componentStack:v!==null?v:""})})}function y0(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&Ws(t,a,c,!0),a=Zt.current,a!==null){switch(a.tag){case 13:return ga===null?fc():a.alternate===null&&Je===0&&(Je=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===xi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),hc(e,s,c)),!1;case 22:return a.flags|=65536,s===xi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),hc(e,s,c)),!1}throw Error(i(435,a.tag))}return hc(e,s,c),fc(),!1}if(_e)return t=Zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==ui&&(e=Error(i(422),{cause:s}),Js(Ft(e,a)))):(s!==ui&&(t=Error(i(423),{cause:s}),Js(Ft(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Ft(s,a),c=Vi(e.stateNode,s,c),vi(e,c),Je!==4&&(Je=2)),!1;var u=Error(i(520),{cause:s});if(u=Ft(u,a),br===null?br=[u]:br.push(u),Je!==4&&(Je=2),t===null)return!0;s=Ft(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Vi(a.stateNode,s,e),vi(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(sn===null||!sn.has(u))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Mf(c),Of(c,e,a,s),vi(a,c),!1}a=a.return}while(a!==null);return!1}var zf=Error(i(461)),mt=!1;function pt(e,t,a,s){t.child=e===null?Nf(t,null,a,s):fs(t,e.child,a,s)}function Df(e,t,a,s,c){a=a.render;var u=t.ref;if("ref"in s){var x={};for(var v in s)v!=="ref"&&(x[v]=s[v])}else x=s;return Tn(t),s=Ci(e,t,a,x,u,c),v=Ei(),e!==null&&!mt?(ki(e,t,c),Oa(e,t,c)):(_e&&v&&ii(t),t.flags|=1,pt(e,t,s,c),t.child)}function Uf(e,t,a,s,c){if(e===null){var u=a.type;return typeof u=="function"&&!ri(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,Lf(e,t,u,s,c)):(e=ul(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Zi(e,c)){var x=u.memoizedProps;if(a=a.compare,a=a!==null?a:Xs,a(x,s)&&e.ref===t.ref)return Oa(e,t,c)}return t.flags|=1,e=Ca(u,s),e.ref=t.ref,e.return=t,t.child=e}function Lf(e,t,a,s,c){if(e!==null){var u=e.memoizedProps;if(Xs(u,s)&&e.ref===t.ref)if(mt=!1,t.pendingProps=s=u,Zi(e,c))(e.flags&131072)!==0&&(mt=!0);else return t.lanes=e.lanes,Oa(e,t,c)}return Gi(e,t,a,s,c)}function _f(e,t,a){var s=t.pendingProps,c=s.children,u=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if((t.flags&128)!==0){if(s=u!==null?u.baseLanes|a:a,e!==null){for(c=t.child=e.child,u=0;c!==null;)u=u|c.lanes|c.childLanes,c=c.sibling;t.childLanes=u&~s}else t.childLanes=0,t.child=null;return Bf(e,t,s,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gl(t,u!==null?u.cachePool:null),u!==null?Ud(t,u):ji(),Sf(t);else return t.lanes=t.childLanes=536870912,Bf(e,t,u!==null?u.baseLanes|a:a,a)}else u!==null?(gl(t,u.cachePool),Ud(t,u),Ja(),t.memoizedState=null):(e!==null&&gl(t,null),ji(),Ja());return pt(e,t,c,a),t.child}function Bf(e,t,a,s){var c=pi();return c=c===null?null:{parent:it._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&gl(t,null),ji(),Sf(t),e!==null&&Ws(e,t,s,!0),null}function Ol(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Gi(e,t,a,s,c){return Tn(t),a=Ci(e,t,a,s,void 0,c),s=Ei(),e!==null&&!mt?(ki(e,t,c),Oa(e,t,c)):(_e&&s&&ii(t),t.flags|=1,pt(e,t,a,c),t.child)}function Hf(e,t,a,s,c,u){return Tn(t),t.updateQueue=null,a=_d(t,s,a,c),Ld(e),s=Ei(),e!==null&&!mt?(ki(e,t,u),Oa(e,t,u)):(_e&&s&&ii(t),t.flags|=1,pt(e,t,a,u),t.child)}function Pf(e,t,a,s,c){if(Tn(t),t.stateNode===null){var u=as,x=a.contextType;typeof x=="object"&&x!==null&&(u=wt(x)),u=new a(s,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=qi,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=s,u.state=t.memoizedState,u.refs={},yi(t),x=a.contextType,u.context=typeof x=="object"&&x!==null?wt(x):as,u.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Pi(t,a,x,s),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(x=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),x!==u.state&&qi.enqueueReplaceState(u,u.state,null),lr(t,s,u,c),rr(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){u=t.stateNode;var v=t.memoizedProps,z=Mn(a,v);u.props=z;var V=u.context,ee=a.contextType;x=as,typeof ee=="object"&&ee!==null&&(x=wt(ee));var re=a.getDerivedStateFromProps;ee=typeof re=="function"||typeof u.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,ee||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(v||V!==x)&&Ef(t,u,s,x),Ya=!1;var Y=t.memoizedState;u.state=Y,lr(t,s,u,c),rr(),V=t.memoizedState,v||Y!==V||Ya?(typeof re=="function"&&(Pi(t,a,re,s),V=t.memoizedState),(z=Ya||Cf(t,a,z,s,Y,V,x))?(ee||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=V),u.props=s,u.state=V,u.context=x,s=z):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{u=t.stateNode,bi(e,t),x=t.memoizedProps,ee=Mn(a,x),u.props=ee,re=t.pendingProps,Y=u.context,V=a.contextType,z=as,typeof V=="object"&&V!==null&&(z=wt(V)),v=a.getDerivedStateFromProps,(V=typeof v=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(x!==re||Y!==z)&&Ef(t,u,s,z),Ya=!1,Y=t.memoizedState,u.state=Y,lr(t,s,u,c),rr();var Q=t.memoizedState;x!==re||Y!==Q||Ya||e!==null&&e.dependencies!==null&&ml(e.dependencies)?(typeof v=="function"&&(Pi(t,a,v,s),Q=t.memoizedState),(ee=Ya||Cf(t,a,ee,s,Y,Q,z)||e!==null&&e.dependencies!==null&&ml(e.dependencies))?(V||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(s,Q,z),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(s,Q,z)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=Q),u.props=s,u.state=Q,u.context=z,s=ee):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),s=!1)}return u=s,Ol(e,t),s=(t.flags&128)!==0,u||s?(u=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&s?(t.child=fs(t,e.child,null,c),t.child=fs(t,null,a,c)):pt(e,t,a,c),t.memoizedState=u.state,e=t.child):e=Oa(e,t,c),e}function qf(e,t,a,s){return Is(),t.flags|=256,pt(e,t,a,s),t.child}var Ki={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $i(e){return{baseLanes:e,cachePool:kd()}}function Fi(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=It),e}function Vf(e,t,a){var s=t.pendingProps,c=!1,u=(t.flags&128)!==0,x;if((x=u)||(x=e!==null&&e.memoizedState===null?!1:(ct.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(_e){if(c?Ia(t):Ja(),_e){var v=Ie,z;if(z=v){e:{for(z=v,v=ha;z.nodeType!==8;){if(!v){v=null;break e}if(z=oa(z.nextSibling),z===null){v=null;break e}}v=z}v!==null?(t.memoizedState={dehydrated:v,treeContext:Nn!==null?{id:Ea,overflow:ka}:null,retryLane:536870912,hydrationErrors:null},z=_t(18,null,null,0),z.stateNode=v,z.return=t,t.child=z,Ct=t,Ie=null,z=!0):z=!1}z||En(t)}if(v=t.memoizedState,v!==null&&(v=v.dehydrated,v!==null))return Ac(v)?t.lanes=32:t.lanes=536870912,null;Ma(t)}return v=s.children,s=s.fallback,c?(Ja(),c=t.mode,v=zl({mode:"hidden",children:v},c),s=jn(s,c,a,null),v.return=t,s.return=t,v.sibling=s,t.child=v,c=t.child,c.memoizedState=$i(a),c.childLanes=Fi(e,x,a),t.memoizedState=Ki,s):(Ia(t),Yi(t,v))}if(z=e.memoizedState,z!==null&&(v=z.dehydrated,v!==null)){if(u)t.flags&256?(Ia(t),t.flags&=-257,t=Xi(e,t,a)):t.memoizedState!==null?(Ja(),t.child=e.child,t.flags|=128,t=null):(Ja(),c=s.fallback,v=t.mode,s=zl({mode:"visible",children:s.children},v),c=jn(c,v,a,null),c.flags|=2,s.return=t,c.return=t,s.sibling=c,t.child=s,fs(t,e.child,null,a),s=t.child,s.memoizedState=$i(a),s.childLanes=Fi(e,x,a),t.memoizedState=Ki,t=c);else if(Ia(t),Ac(v)){if(x=v.nextSibling&&v.nextSibling.dataset,x)var V=x.dgst;x=V,s=Error(i(419)),s.stack="",s.digest=x,Js({value:s,source:null,stack:null}),t=Xi(e,t,a)}else if(mt||Ws(e,t,a,!1),x=(a&e.childLanes)!==0,mt||x){if(x=$e,x!==null&&(s=a&-a,s=(s&42)!==0?1:ma(s),s=(s&(x.suspendedLanes|a))!==0?0:s,s!==0&&s!==z.retryLane))throw z.retryLane=s,ts(e,s),Vt(x,e,s),zf;v.data==="$?"||fc(),t=Xi(e,t,a)}else v.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,Ie=oa(v.nextSibling),Ct=t,_e=!0,Cn=null,ha=!1,e!==null&&(Xt[Qt++]=Ea,Xt[Qt++]=ka,Xt[Qt++]=Nn,Ea=e.id,ka=e.overflow,Nn=t),t=Yi(t,s.children),t.flags|=4096);return t}return c?(Ja(),c=s.fallback,v=t.mode,z=e.child,V=z.sibling,s=Ca(z,{mode:"hidden",children:s.children}),s.subtreeFlags=z.subtreeFlags&65011712,V!==null?c=Ca(V,c):(c=jn(c,v,a,null),c.flags|=2),c.return=t,s.return=t,s.sibling=c,t.child=s,s=c,c=t.child,v=e.child.memoizedState,v===null?v=$i(a):(z=v.cachePool,z!==null?(V=it._currentValue,z=z.parent!==V?{parent:V,pool:V}:z):z=kd(),v={baseLanes:v.baseLanes|a,cachePool:z}),c.memoizedState=v,c.childLanes=Fi(e,x,a),t.memoizedState=Ki,s):(Ia(t),a=e.child,e=a.sibling,a=Ca(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Yi(e,t){return t=zl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function zl(e,t){return e=_t(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Xi(e,t,a){return fs(t,e.child,null,a),e=Yi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gf(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),fi(e.return,t,a)}function Qi(e,t,a,s,c){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=s,u.tail=a,u.tailMode=c)}function Kf(e,t,a){var s=t.pendingProps,c=s.revealOrder,u=s.tail;if(pt(e,t,s.children,a),s=ct.current,(s&2)!==0)s=s&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gf(e,a,t);else if(e.tag===19)Gf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(H(ct,s),c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Al(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Qi(t,!1,c,a,u);break;case"backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Al(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Qi(t,!0,a,null,u);break;case"together":Qi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Oa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),nn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Ws(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=Ca(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ca(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Zi(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ml(e)))}function b0(e,t,a){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Fa(t,it,e.memoizedState.cache),Is();break;case 27:case 5:je(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Fa(t,t.type,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ia(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Vf(e,t,a):(Ia(t),e=Oa(e,t,a),e!==null?e.sibling:null);Ia(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(Ws(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return Kf(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),H(ct,ct.current),s)break;return null;case 22:case 23:return t.lanes=0,_f(e,t,a);case 24:Fa(t,it,e.memoizedState.cache)}return Oa(e,t,a)}function $f(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)mt=!0;else{if(!Zi(e,a)&&(t.flags&128)===0)return mt=!1,b0(e,t,a);mt=(e.flags&131072)!==0}else mt=!1,_e&&(t.flags&1048576)!==0&&vd(t,fl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var s=t.elementType,c=s._init;if(s=c(s._payload),t.type=s,typeof s=="function")ri(s)?(e=Mn(s,e),t.tag=1,t=Pf(null,t,s,e,a)):(t.tag=0,t=Gi(null,t,s,e,a));else{if(s!=null){if(c=s.$$typeof,c===W){t.tag=11,t=Df(null,t,s,e,a);break e}else if(c===ae){t.tag=14,t=Uf(null,t,s,e,a);break e}}throw t=q(s)||s,Error(i(306,t,""))}}return t;case 0:return Gi(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=Mn(s,t.pendingProps),Pf(e,t,s,c,a);case 3:e:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));s=t.pendingProps;var u=t.memoizedState;c=u.element,bi(e,t),lr(t,s,null,a);var x=t.memoizedState;if(s=x.cache,Fa(t,it,s),s!==u.cache&&mi(t,[it],a,!0),rr(),s=x.element,u.isDehydrated)if(u={element:s,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=qf(e,t,s,a);break e}else if(s!==c){c=Ft(Error(i(424)),t),Js(c),t=qf(e,t,s,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ie=oa(e.firstChild),Ct=t,_e=!0,Cn=null,ha=!0,a=Nf(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Is(),s===c){t=Oa(e,t,a);break e}pt(e,t,s,a)}t=t.child}return t;case 26:return Ol(e,t),e===null?(a=Qm(t.type,null,t.pendingProps,null))?t.memoizedState=a:_e||(a=t.type,e=t.pendingProps,s=Yl(J.current).createElement(a),s[ot]=t,s[St]=e,yt(s,a,e),ft(s),t.stateNode=s):t.memoizedState=Qm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&_e&&(s=t.stateNode=Fm(t.type,t.pendingProps,J.current),Ct=t,ha=!0,c=Ie,on(t.type)?(Rc=c,Ie=oa(s.firstChild)):Ie=c),pt(e,t,t.pendingProps.children,a),Ol(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&_e&&((c=s=Ie)&&(s=Y0(s,t.type,t.pendingProps,ha),s!==null?(t.stateNode=s,Ct=t,Ie=oa(s.firstChild),ha=!1,c=!0):c=!1),c||En(t)),je(t),c=t.type,u=t.pendingProps,x=e!==null?e.memoizedProps:null,s=u.children,Ec(c,u)?s=null:x!==null&&Ec(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=Ci(e,t,d0,null,null,a),Tr._currentValue=c),Ol(e,t),pt(e,t,s,a),t.child;case 6:return e===null&&_e&&((e=a=Ie)&&(a=X0(a,t.pendingProps,ha),a!==null?(t.stateNode=a,Ct=t,Ie=null,e=!0):e=!1),e||En(t)),null;case 13:return Vf(e,t,a);case 4:return de(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=fs(t,null,s,a):pt(e,t,s,a),t.child;case 11:return Df(e,t,t.type,t.pendingProps,a);case 7:return pt(e,t,t.pendingProps,a),t.child;case 8:return pt(e,t,t.pendingProps.children,a),t.child;case 12:return pt(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,Fa(t,t.type,s.value),pt(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,Tn(t),c=wt(c),s=s(c),t.flags|=1,pt(e,t,s,a),t.child;case 14:return Uf(e,t,t.type,t.pendingProps,a);case 15:return Lf(e,t,t.type,t.pendingProps,a);case 19:return Kf(e,t,a);case 31:return s=t.pendingProps,a=t.mode,s={mode:s.mode,children:s.children},e===null?(a=zl(s,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=Ca(e.child,s),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return _f(e,t,a);case 24:return Tn(t),s=wt(it),e===null?(c=pi(),c===null&&(c=$e,u=hi(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=a),c=u),t.memoizedState={parent:s,cache:c},yi(t),Fa(t,it,c)):((e.lanes&a)!==0&&(bi(e,t),lr(t,null,null,a),rr()),c=e.memoizedState,u=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Fa(t,it,s)):(s=u.cache,Fa(t,it,s),s!==c.cache&&mi(t,[it],a,!0))),pt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function za(e){e.flags|=4}function Ff(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!eh(t)){if(t=Zt.current,t!==null&&((De&4194048)===De?ga!==null:(De&62914560)!==De&&(De&536870912)===0||t!==ga))throw nr=xi,Td;e.flags|=8192}}function Dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?dt():536870912,e.lanes|=t,ps|=t)}function mr(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function v0(e,t,a){var s=t.pendingProps;switch(ci(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Aa(it),be(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Zs(t)?za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nd())),Ze(t),null;case 26:return a=t.memoizedState,e===null?(za(t),a!==null?(Ze(t),Ff(t,a)):(Ze(t),t.flags&=-16777217)):a?a!==e.memoizedState?(za(t),Ze(t),Ff(t,a)):(Ze(t),t.flags&=-16777217):(e.memoizedProps!==s&&za(t),Ze(t),t.flags&=-16777217),null;case 27:xe(t),a=J.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==s&&za(t);else{if(!s){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}e=K.current,Zs(t)?wd(t):(e=Fm(c,s,a),t.stateNode=e,za(t))}return Ze(t),null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&za(t);else{if(!s){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}if(e=K.current,Zs(t))wd(t);else{switch(c=Yl(J.current),e){case 1:e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?c.createElement("select",{is:s.is}):c.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?c.createElement(a,{is:s.is}):c.createElement(a)}}e[ot]=t,e[St]=s;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)e.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=e;e:switch(yt(e,a,s),a){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&za(t)}}return Ze(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&za(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(i(166));if(e=J.current,Zs(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=Ct,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[ot]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||Hm(e.nodeValue,a)),e||En(t)}else e=Yl(e).createTextNode(s),e[ot]=t,t.stateNode=e}return Ze(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Zs(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[ot]=t}else Is(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),c=!1}else c=Nd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Ma(t),t):(Ma(t),null)}if(Ma(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=s!==null,e=e!==null&&e.memoizedState!==null,a){s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool);var u=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),u!==c&&(s.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),Dl(t,t.updateQueue),Ze(t),null;case 4:return be(),e===null&&wc(t.stateNode.containerInfo),Ze(t),null;case 10:return Aa(t.type),Ze(t),null;case 19:if(le(ct),c=t.memoizedState,c===null)return Ze(t),null;if(s=(t.flags&128)!==0,u=c.rendering,u===null)if(s)mr(c,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Al(e),u!==null){for(t.flags|=128,mr(c,!1),e=u.updateQueue,t.updateQueue=e,Dl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)bd(a,e),a=a.sibling;return H(ct,ct.current&1|2),t.child}e=e.sibling}c.tail!==null&&Ue()>_l&&(t.flags|=128,s=!0,mr(c,!1),t.lanes=4194304)}else{if(!s)if(e=Al(u),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Dl(t,e),mr(c,!0),c.tail===null&&c.tailMode==="hidden"&&!u.alternate&&!_e)return Ze(t),null}else 2*Ue()-c.renderingStartTime>_l&&a!==536870912&&(t.flags|=128,s=!0,mr(c,!1),t.lanes=4194304);c.isBackwards?(u.sibling=t.child,t.child=u):(e=c.last,e!==null?e.sibling=u:t.child=u,c.last=u)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Ue(),t.sibling=null,e=ct.current,H(ct,s?e&1|2:e&1),t):(Ze(t),null);case 22:case 23:return Ma(t),Ni(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),a=t.updateQueue,a!==null&&Dl(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&le(An),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Aa(it),Ze(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function w0(e,t){switch(ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Aa(it),be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 13:if(Ma(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ct),null;case 4:return be(),null;case 10:return Aa(t.type),null;case 22:case 23:return Ma(t),Ni(),e!==null&&le(An),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Aa(it),null;case 25:return null;default:return null}}function Yf(e,t){switch(ci(t),t.tag){case 3:Aa(it),be();break;case 26:case 27:case 5:xe(t);break;case 4:be();break;case 13:Ma(t);break;case 19:le(ct);break;case 10:Aa(t.type);break;case 22:case 23:Ma(t),Ni(),e!==null&&le(An);break;case 24:Aa(it)}}function hr(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var u=a.create,x=a.inst;s=u(),x.destroy=s}a=a.next}while(a!==c)}}catch(v){Ke(t,t.return,v)}}function Wa(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var u=c.next;s=u;do{if((s.tag&e)===e){var x=s.inst,v=x.destroy;if(v!==void 0){x.destroy=void 0,c=t;var z=a,V=v;try{V()}catch(ee){Ke(c,z,ee)}}}s=s.next}while(s!==u)}}catch(ee){Ke(t,t.return,ee)}}function Xf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Dd(t,a)}catch(s){Ke(e,e.return,s)}}}function Qf(e,t,a){a.props=Mn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Ke(e,t,s)}}function gr(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){Ke(e,t,c)}}function pa(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){Ke(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Ke(e,t,c)}else a.current=null}function Zf(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){Ke(e,e.return,c)}}function Ii(e,t,a){try{var s=e.stateNode;V0(s,e.type,a,t),s[St]=t}catch(c){Ke(e,e.return,c)}}function If(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&on(e.type)||e.tag===4}function Ji(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||If(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&&on(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 Wi(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Fl));else if(s!==4&&(s===27&&on(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Wi(e,t,a),e=e.sibling;e!==null;)Wi(e,t,a),e=e.sibling}function Ul(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&on(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ul(e,t,a),e=e.sibling;e!==null;)Ul(e,t,a),e=e.sibling}function Jf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);yt(t,s,a),t[ot]=e,t[St]=a}catch(u){Ke(e,e.return,u)}}var Da=!1,tt=!1,ec=!1,Wf=typeof WeakSet=="function"?WeakSet:Set,ht=null;function j0(e,t){if(e=e.containerInfo,Sc=Wl,e=cd(e),Jo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,u=s.focusNode;s=s.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var x=0,v=-1,z=-1,V=0,ee=0,re=e,Y=null;t:for(;;){for(var Q;re!==a||c!==0&&re.nodeType!==3||(v=x+c),re!==u||s!==0&&re.nodeType!==3||(z=x+s),re.nodeType===3&&(x+=re.nodeValue.length),(Q=re.firstChild)!==null;)Y=re,re=Q;for(;;){if(re===e)break t;if(Y===a&&++V===c&&(v=x),Y===u&&++ee===s&&(z=x),(Q=re.nextSibling)!==null)break;re=Y,Y=re.parentNode}re=Q}a=v===-1||z===-1?null:{start:v,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(Cc={focusedElem:e,selectionRange:a},Wl=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){switch(t=ht,u=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,c=u.memoizedProps,u=u.memoizedState,s=a.stateNode;try{var Ne=Mn(a.type,c,a.elementType===a.type);e=s.getSnapshotBeforeUpdate(Ne,u),s.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Ke(a,a.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Tc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Tc(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,ht=e;break}ht=t.return}}function em(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:en(e,a),s&4&&hr(5,a);break;case 1:if(en(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){Ke(a,a.return,x)}else{var c=Mn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Ke(a,a.return,x)}}s&64&&Xf(a),s&512&&gr(a,a.return);break;case 3:if(en(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Dd(e,t)}catch(x){Ke(a,a.return,x)}}break;case 27:t===null&&s&4&&Jf(a);case 26:case 5:en(e,a),t===null&&s&4&&Zf(a),s&512&&gr(a,a.return);break;case 12:en(e,a);break;case 13:en(e,a),s&4&&nm(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=M0.bind(null,a),Q0(e,a))));break;case 22:if(s=a.memoizedState!==null||Da,!s){t=t!==null&&t.memoizedState!==null||tt,c=Da;var u=tt;Da=s,(tt=t)&&!u?tn(e,a,(a.subtreeFlags&8772)!==0):en(e,a),Da=c,tt=u}break;case 30:break;default:en(e,a)}}function tm(e){var t=e.alternate;t!==null&&(e.alternate=null,tm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ye=null,Mt=!1;function Ua(e,t,a){for(a=a.child;a!==null;)am(e,t,a),a=a.sibling}function am(e,t,a){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount(zt,a)}catch{}switch(a.tag){case 26:tt||pa(a,t),Ua(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:tt||pa(a,t);var s=Ye,c=Mt;on(a.type)&&(Ye=a.stateNode,Mt=!1),Ua(e,t,a),Sr(a.stateNode),Ye=s,Mt=c;break;case 5:tt||pa(a,t);case 6:if(s=Ye,c=Mt,Ye=null,Ua(e,t,a),Ye=s,Mt=c,Ye!==null)if(Mt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(a.stateNode)}catch(u){Ke(a,t,u)}else try{Ye.removeChild(a.stateNode)}catch(u){Ke(a,t,u)}break;case 18:Ye!==null&&(Mt?(e=Ye,Km(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Or(e)):Km(Ye,a.stateNode));break;case 4:s=Ye,c=Mt,Ye=a.stateNode.containerInfo,Mt=!0,Ua(e,t,a),Ye=s,Mt=c;break;case 0:case 11:case 14:case 15:tt||Wa(2,a,t),tt||Wa(4,a,t),Ua(e,t,a);break;case 1:tt||(pa(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Qf(a,t,s)),Ua(e,t,a);break;case 21:Ua(e,t,a);break;case 22:tt=(s=tt)||a.memoizedState!==null,Ua(e,t,a),tt=s;break;default:Ua(e,t,a)}}function nm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Or(e)}catch(a){Ke(t,t.return,a)}}function N0(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Wf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Wf),t;default:throw Error(i(435,e.tag))}}function tc(e,t){var a=N0(e);t.forEach(function(s){var c=O0.bind(null,e,s);a.has(s)||(a.add(s),s.then(c,c))})}function Bt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],u=e,x=t,v=x;e:for(;v!==null;){switch(v.tag){case 27:if(on(v.type)){Ye=v.stateNode,Mt=!1;break e}break;case 5:Ye=v.stateNode,Mt=!1;break e;case 3:case 4:Ye=v.stateNode.containerInfo,Mt=!0;break e}v=v.return}if(Ye===null)throw Error(i(160));am(u,x,c),Ye=null,Mt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)sm(t,e),t=t.sibling}var la=null;function sm(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Bt(t,e),Ht(e),s&4&&(Wa(3,e,e.return),hr(3,e),Wa(5,e,e.return));break;case 1:Bt(t,e),Ht(e),s&512&&(tt||a===null||pa(a,a.return)),s&64&&Da&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=la;if(Bt(t,e),Ht(e),s&512&&(tt||a===null||pa(a,a.return)),s&4){var u=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":u=c.getElementsByTagName("title")[0],(!u||u[Hs]||u[ot]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(s),c.head.insertBefore(u,c.querySelector("head > title"))),yt(u,s,a),u[ot]=e,ft(u),s=u;break e;case"link":var x=Jm("link","href",c).get(s+(a.href||""));if(x){for(var v=0;v<x.length;v++)if(u=x[v],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(v,1);break t}}u=c.createElement(s),yt(u,s,a),c.head.appendChild(u);break;case"meta":if(x=Jm("meta","content",c).get(s+(a.content||""))){for(v=0;v<x.length;v++)if(u=x[v],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(v,1);break t}}u=c.createElement(s),yt(u,s,a),c.head.appendChild(u);break;default:throw Error(i(468,s))}u[ot]=e,ft(u),s=u}e.stateNode=s}else Wm(c,e.type,e.stateNode);else e.stateNode=Im(c,s,e.memoizedProps);else u!==s?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,s===null?Wm(c,e.type,e.stateNode):Im(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Ii(e,e.memoizedProps,a.memoizedProps)}break;case 27:Bt(t,e),Ht(e),s&512&&(tt||a===null||pa(a,a.return)),a!==null&&s&4&&Ii(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Bt(t,e),Ht(e),s&512&&(tt||a===null||pa(a,a.return)),e.flags&32){c=e.stateNode;try{Xn(c,"")}catch(Q){Ke(e,e.return,Q)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,Ii(e,c,a!==null?a.memoizedProps:c)),s&1024&&(ec=!0);break;case 6:if(Bt(t,e),Ht(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(Q){Ke(e,e.return,Q)}}break;case 3:if(Zl=null,c=la,la=Xl(t.containerInfo),Bt(t,e),la=c,Ht(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Or(t.containerInfo)}catch(Q){Ke(e,e.return,Q)}ec&&(ec=!1,rm(e));break;case 4:s=la,la=Xl(e.stateNode.containerInfo),Bt(t,e),Ht(e),la=s;break;case 12:Bt(t,e),Ht(e);break;case 13:Bt(t,e),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(oc=Ue()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tc(e,s)));break;case 22:c=e.memoizedState!==null;var z=a!==null&&a.memoizedState!==null,V=Da,ee=tt;if(Da=V||c,tt=ee||z,Bt(t,e),tt=ee,Da=V,Ht(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||z||Da||tt||On(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){z=a=t;try{if(u=z.stateNode,c)x=u.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{v=z.stateNode;var re=z.memoizedProps.style,Y=re!=null&&re.hasOwnProperty("display")?re.display:null;v.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(Q){Ke(z,z.return,Q)}}}else if(t.tag===6){if(a===null){z=t;try{z.stateNode.nodeValue=c?"":z.memoizedProps}catch(Q){Ke(z,z.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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,tc(e,a))));break;case 19:Bt(t,e),Ht(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tc(e,s)));break;case 30:break;case 21:break;default:Bt(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(If(s)){a=s;break}s=s.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,u=Ji(e);Ul(e,u,c);break;case 5:var x=a.stateNode;a.flags&32&&(Xn(x,""),a.flags&=-33);var v=Ji(e);Ul(e,v,x);break;case 3:case 4:var z=a.stateNode.containerInfo,V=Ji(e);Wi(e,V,z);break;default:throw Error(i(161))}}catch(ee){Ke(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function rm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;rm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function en(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)em(e,t.alternate,t),t=t.sibling}function On(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wa(4,t,t.return),On(t);break;case 1:pa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Qf(t,t.return,a),On(t);break;case 27:Sr(t.stateNode);case 26:case 5:pa(t,t.return),On(t);break;case 22:t.memoizedState===null&&On(t);break;case 30:On(t);break;default:On(t)}e=e.sibling}}function tn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,u=t,x=u.flags;switch(u.tag){case 0:case 11:case 15:tn(c,u,a),hr(4,u);break;case 1:if(tn(c,u,a),s=u,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(V){Ke(s,s.return,V)}if(s=u,c=s.updateQueue,c!==null){var v=s.stateNode;try{var z=c.shared.hiddenCallbacks;if(z!==null)for(c.shared.hiddenCallbacks=null,c=0;c<z.length;c++)zd(z[c],v)}catch(V){Ke(s,s.return,V)}}a&&x&64&&Xf(u),gr(u,u.return);break;case 27:Jf(u);case 26:case 5:tn(c,u,a),a&&s===null&&x&4&&Zf(u),gr(u,u.return);break;case 12:tn(c,u,a);break;case 13:tn(c,u,a),a&&x&4&&nm(c,u);break;case 22:u.memoizedState===null&&tn(c,u,a),gr(u,u.return);break;case 30:break;default:tn(c,u,a)}t=t.sibling}}function ac(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&er(a))}function nc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&er(e))}function xa(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)lm(e,t,a,s),t=t.sibling}function lm(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:xa(e,t,a,s),c&2048&&hr(9,t);break;case 1:xa(e,t,a,s);break;case 3:xa(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&er(e)));break;case 12:if(c&2048){xa(e,t,a,s),e=t.stateNode;try{var u=t.memoizedProps,x=u.id,v=u.onPostCommit;typeof v=="function"&&v(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Ke(t,t.return,z)}}else xa(e,t,a,s);break;case 13:xa(e,t,a,s);break;case 23:break;case 22:u=t.stateNode,x=t.alternate,t.memoizedState!==null?u._visibility&2?xa(e,t,a,s):pr(e,t):u._visibility&2?xa(e,t,a,s):(u._visibility|=2,ms(e,t,a,s,(t.subtreeFlags&10256)!==0)),c&2048&&ac(x,t);break;case 24:xa(e,t,a,s),c&2048&&nc(t.alternate,t);break;default:xa(e,t,a,s)}}function ms(e,t,a,s,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var u=e,x=t,v=a,z=s,V=x.flags;switch(x.tag){case 0:case 11:case 15:ms(u,x,v,z,c),hr(8,x);break;case 23:break;case 22:var ee=x.stateNode;x.memoizedState!==null?ee._visibility&2?ms(u,x,v,z,c):pr(u,x):(ee._visibility|=2,ms(u,x,v,z,c)),c&&V&2048&&ac(x.alternate,x);break;case 24:ms(u,x,v,z,c),c&&V&2048&&nc(x.alternate,x);break;default:ms(u,x,v,z,c)}t=t.sibling}}function pr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:pr(a,s),c&2048&&ac(s.alternate,s);break;case 24:pr(a,s),c&2048&&nc(s.alternate,s);break;default:pr(a,s)}t=t.sibling}}var xr=8192;function hs(e){if(e.subtreeFlags&xr)for(e=e.child;e!==null;)om(e),e=e.sibling}function om(e){switch(e.tag){case 26:hs(e),e.flags&xr&&e.memoizedState!==null&&ix(la,e.memoizedState,e.memoizedProps);break;case 5:hs(e);break;case 3:case 4:var t=la;la=Xl(e.stateNode.containerInfo),hs(e),la=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=xr,xr=16777216,hs(e),xr=t):hs(e));break;default:hs(e)}}function im(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 yr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];ht=s,um(s,e)}im(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)cm(e),e=e.sibling}function cm(e){switch(e.tag){case 0:case 11:case 15:yr(e),e.flags&2048&&Wa(9,e,e.return);break;case 3:yr(e);break;case 12:yr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):yr(e);break;default:yr(e)}}function Ll(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];ht=s,um(s,e)}im(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wa(8,t,t.return),Ll(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function um(e,t){for(;ht!==null;){var a=ht;switch(a.tag){case 0:case 11:case 15:Wa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:er(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,ht=s;else e:for(a=e;ht!==null;){s=ht;var c=s.sibling,u=s.return;if(tm(s),s===a){ht=null;break e}if(c!==null){c.return=u,ht=c;break e}ht=u}}}var S0={getCacheForType:function(e){var t=wt(it),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},C0=typeof WeakMap=="function"?WeakMap:Map,He=0,$e=null,Oe=null,De=0,Pe=0,Pt=null,an=!1,gs=!1,sc=!1,La=0,Je=0,nn=0,zn=0,rc=0,It=0,ps=0,br=null,Ot=null,lc=!1,oc=0,_l=1/0,Bl=null,sn=null,xt=0,rn=null,xs=null,ys=0,ic=0,cc=null,dm=null,vr=0,uc=null;function qt(){if((He&2)!==0&&De!==0)return De&-De;if(S.T!==null){var e=rs;return e!==0?e:xc()}return Bs()}function fm(){It===0&&(It=(De&536870912)===0||_e?fe():536870912);var e=Zt.current;return e!==null&&(e.flags|=32),It}function Vt(e,t,a){(e===$e&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(bs(e,0),ln(e,De,It,!1)),na(e,a),((He&2)===0||e!==$e)&&(e===$e&&((He&2)===0&&(zn|=a),Je===4&&ln(e,De,It,!1)),ya(e))}function mm(e,t,a){if((He&6)!==0)throw Error(i(327));var s=!a&&(t&124)===0&&(t&e.expiredLanes)===0||ce(e,t),c=s?T0(e,t):mc(e,t,!0),u=s;do{if(c===0){gs&&!s&&ln(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!E0(a)){c=mc(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var v=e;c=br;var z=v.current.memoizedState.isDehydrated;if(z&&(bs(v,x).flags|=256),x=mc(v,x,!1),x!==2){if(sc&&!z){v.errorRecoveryDisabledLanes|=u,zn|=u,c=4;break e}u=Ot,Ot=c,u!==null&&(Ot===null?Ot=u:Ot.push.apply(Ot,u))}c=x}if(u=!1,c!==2)continue}}if(c===1){bs(e,0),ln(e,t,0,!0);break}e:{switch(s=e,u=c,u){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ln(s,t,It,!an);break e;case 2:Ot=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=oc+300-Ue(),10<c)){if(ln(s,t,It,!an),Ce(s,0,!0)!==0)break e;s.timeoutHandle=Vm(hm.bind(null,s,a,Ot,Bl,lc,t,It,zn,ps,an,u,2,-0,0),c);break e}hm(s,a,Ot,Bl,lc,t,It,zn,ps,an,u,0,-0,0)}}break}while(!0);ya(e)}function hm(e,t,a,s,c,u,x,v,z,V,ee,re,Y,Q){if(e.timeoutHandle=-1,re=t.subtreeFlags,(re&8192||(re&16785408)===16785408)&&(kr={stylesheets:null,count:0,unsuspend:ox},om(t),re=cx(),re!==null)){e.cancelPendingCommit=re(wm.bind(null,e,t,u,a,s,c,x,v,z,ee,1,Y,Q)),ln(e,u,x,!V);return}wm(e,t,u,a,s,c,x,v,z)}function E0(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var c=a[s],u=c.getSnapshot;c=c.value;try{if(!Lt(u(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ln(e,t,a,s){t&=~rc,t&=~zn,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var u=31-at(c),x=1<<u;s[u]=-1,c&=~x}a!==0&&Xr(e,a,t)}function Hl(){return(He&6)===0?(wr(0),!1):!0}function dc(){if(Oe!==null){if(Pe===0)var e=Oe.return;else e=Oe,Ta=kn=null,Ti(e),ds=null,dr=0,e=Oe;for(;e!==null;)Yf(e.alternate,e),e=e.return;Oe=null}}function bs(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,K0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),dc(),$e=e,Oe=a=Ca(e.current,null),De=t,Pe=0,Pt=null,an=!1,gs=ce(e,t),sc=!1,ps=It=rc=zn=nn=Je=0,Ot=br=null,lc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-at(s),u=1<<c;t|=e[c],s&=~u}return La=t,ol(),a}function gm(e,t){Ae=null,S.H=El,t===ar||t===pl?(t=Md(),Pe=3):t===Td?(t=Md(),Pe=4):Pe=t===zf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pt=t,Oe===null&&(Je=1,Ml(e,Ft(t,e.current)))}function pm(){var e=S.H;return S.H=El,e===null?El:e}function xm(){var e=S.A;return S.A=S0,e}function fc(){Je=4,an||(De&4194048)!==De&&Zt.current!==null||(gs=!0),(nn&134217727)===0&&(zn&134217727)===0||$e===null||ln($e,De,It,!1)}function mc(e,t,a){var s=He;He|=2;var c=pm(),u=xm();($e!==e||De!==t)&&(Bl=null,bs(e,t)),t=!1;var x=Je;e:do try{if(Pe!==0&&Oe!==null){var v=Oe,z=Pt;switch(Pe){case 8:dc(),x=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(t=!0);var V=Pe;if(Pe=0,Pt=null,vs(e,v,z,V),a&&gs){x=0;break e}break;default:V=Pe,Pe=0,Pt=null,vs(e,v,z,V)}}k0(),x=Je;break}catch(ee){gm(e,ee)}while(!0);return t&&e.shellSuspendCounter++,Ta=kn=null,He=s,S.H=c,S.A=u,Oe===null&&($e=null,De=0,ol()),x}function k0(){for(;Oe!==null;)ym(Oe)}function T0(e,t){var a=He;He|=2;var s=pm(),c=xm();$e!==e||De!==t?(Bl=null,_l=Ue()+500,bs(e,t)):gs=ce(e,t);e:do try{if(Pe!==0&&Oe!==null){t=Oe;var u=Pt;t:switch(Pe){case 1:Pe=0,Pt=null,vs(e,t,u,1);break;case 2:case 9:if(Ad(u)){Pe=0,Pt=null,bm(t);break}t=function(){Pe!==2&&Pe!==9||$e!==e||(Pe=7),ya(e)},u.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Ad(u)?(Pe=0,Pt=null,bm(t)):(Pe=0,Pt=null,vs(e,t,u,7));break;case 5:var x=null;switch(Oe.tag){case 26:x=Oe.memoizedState;case 5:case 27:var v=Oe;if(!x||eh(x)){Pe=0,Pt=null;var z=v.sibling;if(z!==null)Oe=z;else{var V=v.return;V!==null?(Oe=V,Pl(V)):Oe=null}break t}}Pe=0,Pt=null,vs(e,t,u,5);break;case 6:Pe=0,Pt=null,vs(e,t,u,6);break;case 8:dc(),Je=6;break e;default:throw Error(i(462))}}A0();break}catch(ee){gm(e,ee)}while(!0);return Ta=kn=null,S.H=s,S.A=c,He=a,Oe!==null?0:($e=null,De=0,ol(),Je)}function A0(){for(;Oe!==null&&!wa();)ym(Oe)}function ym(e){var t=$f(e.alternate,e,La);e.memoizedProps=e.pendingProps,t===null?Pl(e):Oe=t}function bm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Hf(a,t,t.pendingProps,t.type,void 0,De);break;case 11:t=Hf(a,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:Ti(t);default:Yf(a,t),t=Oe=bd(t,La),t=$f(a,t,La)}e.memoizedProps=e.pendingProps,t===null?Pl(e):Oe=t}function vs(e,t,a,s){Ta=kn=null,Ti(t),ds=null,dr=0;var c=t.return;try{if(y0(e,c,t,a,De)){Je=1,Ml(e,Ft(a,e.current)),Oe=null;return}}catch(u){if(c!==null)throw Oe=c,u;Je=1,Ml(e,Ft(a,e.current)),Oe=null;return}t.flags&32768?(_e||s===1?e=!0:gs||(De&536870912)!==0?e=!1:(an=e=!0,(s===2||s===9||s===3||s===6)&&(s=Zt.current,s!==null&&s.tag===13&&(s.flags|=16384))),vm(t,e)):Pl(t)}function Pl(e){var t=e;do{if((t.flags&32768)!==0){vm(t,an);return}e=t.return;var a=v0(t.alternate,t,La);if(a!==null){Oe=a;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);Je===0&&(Je=5)}function vm(e,t){do{var a=w0(e.alternate,e);if(a!==null){a.flags&=32767,Oe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=a}while(e!==null);Je=6,Oe=null}function wm(e,t,a,s,c,u,x,v,z){e.cancelPendingCommit=null;do ql();while(xt!==0);if((He&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(u=t.lanes|t.childLanes,u|=ni,xn(e,a,u,x,v,z),e===$e&&(Oe=$e=null,De=0),xs=t,rn=e,ys=a,ic=u,cc=c,dm=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,z0(Gt,function(){return Em(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=S.T,S.T=null,c=B.p,B.p=2,x=He,He|=4;try{j0(e,t,a)}finally{He=x,B.p=c,S.T=s}}xt=1,jm(),Nm(),Sm()}}function jm(){if(xt===1){xt=0;var e=rn,t=xs,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=S.T,S.T=null;var s=B.p;B.p=2;var c=He;He|=4;try{sm(t,e);var u=Cc,x=cd(e.containerInfo),v=u.focusedElem,z=u.selectionRange;if(x!==v&&v&&v.ownerDocument&&id(v.ownerDocument.documentElement,v)){if(z!==null&&Jo(v)){var V=z.start,ee=z.end;if(ee===void 0&&(ee=V),"selectionStart"in v)v.selectionStart=V,v.selectionEnd=Math.min(ee,v.value.length);else{var re=v.ownerDocument||document,Y=re&&re.defaultView||window;if(Y.getSelection){var Q=Y.getSelection(),Ne=v.textContent.length,ve=Math.min(z.start,Ne),Ge=z.end===void 0?ve:Math.min(z.end,Ne);!Q.extend&&ve>Ge&&(x=Ge,Ge=ve,ve=x);var L=od(v,ve),U=od(v,Ge);if(L&&U&&(Q.rangeCount!==1||Q.anchorNode!==L.node||Q.anchorOffset!==L.offset||Q.focusNode!==U.node||Q.focusOffset!==U.offset)){var P=re.createRange();P.setStart(L.node,L.offset),Q.removeAllRanges(),ve>Ge?(Q.addRange(P),Q.extend(U.node,U.offset)):(P.setEnd(U.node,U.offset),Q.addRange(P))}}}}for(re=[],Q=v;Q=Q.parentNode;)Q.nodeType===1&&re.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<re.length;v++){var ne=re[v];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Wl=!!Sc,Cc=Sc=null}finally{He=c,B.p=s,S.T=a}}e.current=t,xt=2}}function Nm(){if(xt===2){xt=0;var e=rn,t=xs,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=S.T,S.T=null;var s=B.p;B.p=2;var c=He;He|=4;try{em(e,t.alternate,t)}finally{He=c,B.p=s,S.T=a}}xt=3}}function Sm(){if(xt===4||xt===3){xt=0,ca();var e=rn,t=xs,a=ys,s=dm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?xt=5:(xt=0,xs=rn=null,Cm(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(sn=null),Pn(a),t=t.stateNode,lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(zt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=S.T,c=B.p,B.p=2,S.T=null;try{for(var u=e.onRecoverableError,x=0;x<s.length;x++){var v=s[x];u(v.value,{componentStack:v.stack})}}finally{S.T=t,B.p=c}}(ys&3)!==0&&ql(),ya(e),c=e.pendingLanes,(a&4194090)!==0&&(c&42)!==0?e===uc?vr++:(vr=0,uc=e):vr=0,wr(0)}}function Cm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,er(t)))}function ql(e){return jm(),Nm(),Sm(),Em()}function Em(){if(xt!==5)return!1;var e=rn,t=ic;ic=0;var a=Pn(ys),s=S.T,c=B.p;try{B.p=32>a?32:a,S.T=null,a=cc,cc=null;var u=rn,x=ys;if(xt=0,xs=rn=null,ys=0,(He&6)!==0)throw Error(i(331));var v=He;if(He|=4,cm(u.current),lm(u,u.current,x,a),He=v,wr(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(zt,u)}catch{}return!0}finally{B.p=c,S.T=s,Cm(e,t)}}function km(e,t,a){t=Ft(a,t),t=Vi(e.stateNode,t,2),e=Qa(e,t,2),e!==null&&(na(e,2),ya(e))}function Ke(e,t,a){if(e.tag===3)km(e,e,a);else for(;t!==null;){if(t.tag===3){km(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(sn===null||!sn.has(s))){e=Ft(a,e),a=Mf(2),s=Qa(t,a,2),s!==null&&(Of(a,s,t,e),na(s,2),ya(s));break}}t=t.return}}function hc(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new C0;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(sc=!0,c.add(a),e=R0.bind(null,e,t,a),t.then(e,e))}function R0(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(De&a)===a&&(Je===4||Je===3&&(De&62914560)===De&&300>Ue()-oc?(He&2)===0&&bs(e,0):rc|=a,ps===De&&(ps=0)),ya(e)}function Tm(e,t){t===0&&(t=dt()),e=ts(e,t),e!==null&&(na(e,t),ya(e))}function M0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Tm(e,a)}function O0(e,t){var a=0;switch(e.tag){case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(t),Tm(e,a)}function z0(e,t){return Be(e,t)}var Vl=null,ws=null,gc=!1,Gl=!1,pc=!1,Dn=0;function ya(e){e!==ws&&e.next===null&&(ws===null?Vl=ws=e:ws=ws.next=e),Gl=!0,gc||(gc=!0,U0())}function wr(e,t){if(!pc&&Gl){pc=!0;do for(var a=!1,s=Vl;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var u=0;else{var x=s.suspendedLanes,v=s.pingedLanes;u=(1<<31-at(42|e)+1)-1,u&=c&~(x&~v),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Om(s,u))}else u=De,u=Ce(s,s===$e?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(u&3)===0||ce(s,u)||(a=!0,Om(s,u));s=s.next}while(a);pc=!1}}function D0(){Am()}function Am(){Gl=gc=!1;var e=0;Dn!==0&&(G0()&&(e=Dn),Dn=0);for(var t=Ue(),a=null,s=Vl;s!==null;){var c=s.next,u=Rm(s,t);u===0?(s.next=null,a===null?Vl=c:a.next=c,c===null&&(ws=a)):(a=s,(e!==0||(u&3)!==0)&&(Gl=!0)),s=c}wr(e)}function Rm(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var x=31-at(u),v=1<<x,z=c[x];z===-1?((v&a)===0||(v&s)!==0)&&(c[x]=ue(v,t)):z<=t&&(e.expiredLanes|=v),u&=~v}if(t=$e,a=De,a=Ce(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&rt(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ce(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&rt(s),Pn(a)){case 2:case 8:a=da;break;case 32:a=Gt;break;case 268435456:a=gn;break;default:a=Gt}return s=Mm.bind(null,e),a=Be(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&rt(s),e.callbackPriority=2,e.callbackNode=null,2}function Mm(e,t){if(xt!==0&&xt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(ql()&&e.callbackNode!==a)return null;var s=De;return s=Ce(e,e===$e?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(mm(e,s,t),Rm(e,Ue()),e.callbackNode!=null&&e.callbackNode===a?Mm.bind(null,e):null)}function Om(e,t){if(ql())return null;mm(e,t,!0)}function U0(){$0(function(){(He&6)!==0?Be(ua,D0):Am()})}function xc(){return Dn===0&&(Dn=fe()),Dn}function zm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:el(""+e)}function Dm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function L0(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var u=zm((c[St]||null).action),x=s.submitter;x&&(t=(t=x[St]||null)?zm(t.formAction):x.getAttribute("formAction"),t!==null&&(u=t,x=null));var v=new sl("action","action",null,s,c);e.push({event:v,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Dn!==0){var z=x?Dm(c,x):new FormData(c);_i(a,{pending:!0,data:z,method:c.method,action:u},null,z)}}else typeof u=="function"&&(v.preventDefault(),z=x?Dm(c,x):new FormData(c),_i(a,{pending:!0,data:z,method:c.method,action:u},u,z))},currentTarget:c}]})}}for(var yc=0;yc<ai.length;yc++){var bc=ai[yc],_0=bc.toLowerCase(),B0=bc[0].toUpperCase()+bc.slice(1);ra(_0,"on"+B0)}ra(fd,"onAnimationEnd"),ra(md,"onAnimationIteration"),ra(hd,"onAnimationStart"),ra("dblclick","onDoubleClick"),ra("focusin","onFocus"),ra("focusout","onBlur"),ra(t0,"onTransitionRun"),ra(a0,"onTransitionStart"),ra(n0,"onTransitionCancel"),ra(gd,"onTransitionEnd"),$n("onMouseEnter",["mouseout","mouseover"]),$n("onMouseLeave",["mouseout","mouseover"]),$n("onPointerEnter",["pointerout","pointerover"]),$n("onPointerLeave",["pointerout","pointerover"]),yn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),yn("onBeforeInput",["compositionend","keypress","textInput","paste"]),yn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jr="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(" "),H0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jr));function Um(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var u=void 0;if(t)for(var x=s.length-1;0<=x;x--){var v=s[x],z=v.instance,V=v.currentTarget;if(v=v.listener,z!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=V;try{u(c)}catch(ee){Rl(ee)}c.currentTarget=null,u=z}else for(x=0;x<s.length;x++){if(v=s[x],z=v.instance,V=v.currentTarget,v=v.listener,z!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=V;try{u(c)}catch(ee){Rl(ee)}c.currentTarget=null,u=z}}}}function ze(e,t){var a=t[Oo];a===void 0&&(a=t[Oo]=new Set);var s=e+"__bubble";a.has(s)||(Lm(t,e,2,!1),a.add(s))}function vc(e,t,a){var s=0;t&&(s|=4),Lm(a,e,s,t)}var Kl="_reactListening"+Math.random().toString(36).slice(2);function wc(e){if(!e[Kl]){e[Kl]=!0,Tu.forEach(function(a){a!=="selectionchange"&&(H0.has(a)||vc(a,!1,e),vc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kl]||(t[Kl]=!0,vc("selectionchange",!1,t))}}function Lm(e,t,a,s){switch(lh(t)){case 2:var c=fx;break;case 8:c=mx;break;default:c=Uc}a=c.bind(null,t,a,e),c=void 0,!Go||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function jc(e,t,a,s,c){var u=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var x=s.tag;if(x===3||x===4){var v=s.stateNode.containerInfo;if(v===c)break;if(x===4)for(x=s.return;x!==null;){var z=x.tag;if((z===3||z===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;v!==null;){if(x=Vn(v),x===null)return;if(z=x.tag,z===5||z===6||z===26||z===27){s=u=x;continue e}v=v.parentNode}}s=s.return}Vu(function(){var V=u,ee=qo(a),re=[];e:{var Y=pd.get(e);if(Y!==void 0){var Q=sl,Ne=e;switch(e){case"keypress":if(al(a)===0)break e;case"keydown":case"keyup":Q=zp;break;case"focusin":Ne="focus",Q=Yo;break;case"focusout":Ne="blur",Q=Yo;break;case"beforeblur":case"afterblur":Q=Yo;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=$u;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=wp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Lp;break;case fd:case md:case hd:Q=Sp;break;case gd:Q=Bp;break;case"scroll":case"scrollend":Q=bp;break;case"wheel":Q=Pp;break;case"copy":case"cut":case"paste":Q=Ep;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Yu;break;case"toggle":case"beforetoggle":Q=Vp}var ve=(t&4)!==0,Ge=!ve&&(e==="scroll"||e==="scrollend"),L=ve?Y!==null?Y+"Capture":null:Y;ve=[];for(var U=V,P;U!==null;){var ne=U;if(P=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||P===null||L===null||(ne=qs(U,L),ne!=null&&ve.push(Nr(U,ne,P))),Ge)break;U=U.return}0<ve.length&&(Y=new Q(Y,Ne,null,a,ee),re.push({event:Y,listeners:ve}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",Y&&a!==Po&&(Ne=a.relatedTarget||a.fromElement)&&(Vn(Ne)||Ne[qn]))break e;if((Q||Y)&&(Y=ee.window===ee?ee:(Y=ee.ownerDocument)?Y.defaultView||Y.parentWindow:window,Q?(Ne=a.relatedTarget||a.toElement,Q=V,Ne=Ne?Vn(Ne):null,Ne!==null&&(Ge=f(Ne),ve=Ne.tag,Ne!==Ge||ve!==5&&ve!==27&&ve!==6)&&(Ne=null)):(Q=null,Ne=V),Q!==Ne)){if(ve=$u,ne="onMouseLeave",L="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Yu,ne="onPointerLeave",L="onPointerEnter",U="pointer"),Ge=Q==null?Y:Ps(Q),P=Ne==null?Y:Ps(Ne),Y=new ve(ne,U+"leave",Q,a,ee),Y.target=Ge,Y.relatedTarget=P,ne=null,Vn(ee)===V&&(ve=new ve(L,U+"enter",Ne,a,ee),ve.target=P,ve.relatedTarget=Ge,ne=ve),Ge=ne,Q&&Ne)t:{for(ve=Q,L=Ne,U=0,P=ve;P;P=js(P))U++;for(P=0,ne=L;ne;ne=js(ne))P++;for(;0<U-P;)ve=js(ve),U--;for(;0<P-U;)L=js(L),P--;for(;U--;){if(ve===L||L!==null&&ve===L.alternate)break t;ve=js(ve),L=js(L)}ve=null}else ve=null;Q!==null&&_m(re,Y,Q,ve,!1),Ne!==null&&Ge!==null&&_m(re,Ge,Ne,ve,!0)}}e:{if(Y=V?Ps(V):window,Q=Y.nodeName&&Y.nodeName.toLowerCase(),Q==="select"||Q==="input"&&Y.type==="file")var he=td;else if(Wu(Y))if(ad)he=Jp;else{he=Zp;var Me=Qp}else Q=Y.nodeName,!Q||Q.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?V&&Ho(V.elementType)&&(he=td):he=Ip;if(he&&(he=he(e,V))){ed(re,he,a,ee);break e}Me&&Me(e,Y,V),e==="focusout"&&V&&Y.type==="number"&&V.memoizedProps.value!=null&&Bo(Y,"number",Y.value)}switch(Me=V?Ps(V):window,e){case"focusin":(Wu(Me)||Me.contentEditable==="true")&&(Jn=Me,Wo=V,Qs=null);break;case"focusout":Qs=Wo=Jn=null;break;case"mousedown":ei=!0;break;case"contextmenu":case"mouseup":case"dragend":ei=!1,ud(re,a,ee);break;case"selectionchange":if(e0)break;case"keydown":case"keyup":ud(re,a,ee)}var ye;if(Qo)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else In?Iu(e,a)&&(we="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(we="onCompositionStart");we&&(Xu&&a.locale!=="ko"&&(In||we!=="onCompositionStart"?we==="onCompositionEnd"&&In&&(ye=Gu()):($a=ee,Ko="value"in $a?$a.value:$a.textContent,In=!0)),Me=$l(V,we),0<Me.length&&(we=new Fu(we,e,null,a,ee),re.push({event:we,listeners:Me}),ye?we.data=ye:(ye=Ju(a),ye!==null&&(we.data=ye)))),(ye=Kp?$p(e,a):Fp(e,a))&&(we=$l(V,"onBeforeInput"),0<we.length&&(Me=new Fu("onBeforeInput","beforeinput",null,a,ee),re.push({event:Me,listeners:we}),Me.data=ye)),L0(re,e,V,a,ee)}Um(re,t)})}function Nr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function $l(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=qs(e,a),c!=null&&s.unshift(Nr(e,c,u)),c=qs(e,t),c!=null&&s.push(Nr(e,c,u))),e.tag===3)return s;e=e.return}return[]}function js(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _m(e,t,a,s,c){for(var u=t._reactName,x=[];a!==null&&a!==s;){var v=a,z=v.alternate,V=v.stateNode;if(v=v.tag,z!==null&&z===s)break;v!==5&&v!==26&&v!==27||V===null||(z=V,c?(V=qs(a,u),V!=null&&x.unshift(Nr(a,V,z))):c||(V=qs(a,u),V!=null&&x.push(Nr(a,V,z)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var P0=/\r\n?/g,q0=/\u0000|\uFFFD/g;function Bm(e){return(typeof e=="string"?e:""+e).replace(P0,`
|
|
49
|
+
`).replace(q0,"")}function Hm(e,t){return t=Bm(t),Bm(e)===t}function Fl(){}function Ve(e,t,a,s,c,u){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Xn(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Xn(e,""+s);break;case"className":Ir(e,"class",s);break;case"tabIndex":Ir(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Ir(e,a,s);break;case"style":Pu(e,s,u);break;case"data":if(t!=="object"){Ir(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=el(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(a==="formAction"?(t!=="input"&&Ve(e,t,"name",c.name,c,null),Ve(e,t,"formEncType",c.formEncType,c,null),Ve(e,t,"formMethod",c.formMethod,c,null),Ve(e,t,"formTarget",c.formTarget,c,null)):(Ve(e,t,"encType",c.encType,c,null),Ve(e,t,"method",c.method,c,null),Ve(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=el(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Fl);break;case"onScroll":s!=null&&ze("scroll",e);break;case"onScrollEnd":s!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=el(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":ze("beforetoggle",e),ze("toggle",e),Zr(e,"popover",s);break;case"xlinkActuate":Na(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Na(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Na(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Na(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Na(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Na(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Na(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Zr(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=xp.get(a)||a,Zr(e,a,s))}}function Nc(e,t,a,s,c,u){switch(a){case"style":Pu(e,s,u);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof s=="string"?Xn(e,s):(typeof s=="number"||typeof s=="bigint")&&Xn(e,""+s);break;case"onScroll":s!=null&&ze("scroll",e);break;case"onScrollEnd":s!=null&&ze("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Fl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Au.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),u=e[St]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof s=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):Zr(e,a,s)}}}function yt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var s=!1,c=!1,u;for(u in a)if(a.hasOwnProperty(u)){var x=a[u];if(x!=null)switch(u){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ve(e,t,u,x,a,null)}}c&&Ve(e,t,"srcSet",a.srcSet,a,null),s&&Ve(e,t,"src",a.src,a,null);return;case"input":ze("invalid",e);var v=u=x=c=null,z=null,V=null;for(s in a)if(a.hasOwnProperty(s)){var ee=a[s];if(ee!=null)switch(s){case"name":c=ee;break;case"type":x=ee;break;case"checked":z=ee;break;case"defaultChecked":V=ee;break;case"value":u=ee;break;case"defaultValue":v=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(i(137,t));break;default:Ve(e,t,s,ee,a,null)}}Lu(e,u,v,z,V,x,c,!1),Jr(e);return;case"select":ze("invalid",e),s=x=u=null;for(c in a)if(a.hasOwnProperty(c)&&(v=a[c],v!=null))switch(c){case"value":u=v;break;case"defaultValue":x=v;break;case"multiple":s=v;default:Ve(e,t,c,v,a,null)}t=u,a=x,e.multiple=!!s,t!=null?Yn(e,!!s,t,!1):a!=null&&Yn(e,!!s,a,!0);return;case"textarea":ze("invalid",e),u=c=s=null;for(x in a)if(a.hasOwnProperty(x)&&(v=a[x],v!=null))switch(x){case"value":s=v;break;case"defaultValue":c=v;break;case"children":u=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:Ve(e,t,x,v,a,null)}Bu(e,s,c,u),Jr(e);return;case"option":for(z in a)if(a.hasOwnProperty(z)&&(s=a[z],s!=null))switch(z){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ve(e,t,z,s,a,null)}return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(s=0;s<jr.length;s++)ze(jr[s],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in a)if(a.hasOwnProperty(V)&&(s=a[V],s!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ve(e,t,V,s,a,null)}return;default:if(Ho(t)){for(ee in a)a.hasOwnProperty(ee)&&(s=a[ee],s!==void 0&&Nc(e,t,ee,s,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(s=a[v],s!=null&&Ve(e,t,v,s,a,null))}function V0(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,x=null,v=null,z=null,V=null,ee=null;for(Q in a){var re=a[Q];if(a.hasOwnProperty(Q)&&re!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":z=re;default:s.hasOwnProperty(Q)||Ve(e,t,Q,null,s,re)}}for(var Y in s){var Q=s[Y];if(re=a[Y],s.hasOwnProperty(Y)&&(Q!=null||re!=null))switch(Y){case"type":u=Q;break;case"name":c=Q;break;case"checked":V=Q;break;case"defaultChecked":ee=Q;break;case"value":x=Q;break;case"defaultValue":v=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,t));break;default:Q!==re&&Ve(e,t,Y,Q,s,re)}}_o(e,x,v,z,V,ee,u,c);return;case"select":Q=x=v=Y=null;for(u in a)if(z=a[u],a.hasOwnProperty(u)&&z!=null)switch(u){case"value":break;case"multiple":Q=z;default:s.hasOwnProperty(u)||Ve(e,t,u,null,s,z)}for(c in s)if(u=s[c],z=a[c],s.hasOwnProperty(c)&&(u!=null||z!=null))switch(c){case"value":Y=u;break;case"defaultValue":v=u;break;case"multiple":x=u;default:u!==z&&Ve(e,t,c,u,s,z)}t=v,a=x,s=Q,Y!=null?Yn(e,!!a,Y,!1):!!s!=!!a&&(t!=null?Yn(e,!!a,t,!0):Yn(e,!!a,a?[]:"",!1));return;case"textarea":Q=Y=null;for(v in a)if(c=a[v],a.hasOwnProperty(v)&&c!=null&&!s.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ve(e,t,v,null,s,c)}for(x in s)if(c=s[x],u=a[x],s.hasOwnProperty(x)&&(c!=null||u!=null))switch(x){case"value":Y=c;break;case"defaultValue":Q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==u&&Ve(e,t,x,c,s,u)}_u(e,Y,Q);return;case"option":for(var Ne in a)if(Y=a[Ne],a.hasOwnProperty(Ne)&&Y!=null&&!s.hasOwnProperty(Ne))switch(Ne){case"selected":e.selected=!1;break;default:Ve(e,t,Ne,null,s,Y)}for(z in s)if(Y=s[z],Q=a[z],s.hasOwnProperty(z)&&Y!==Q&&(Y!=null||Q!=null))switch(z){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:Ve(e,t,z,Y,s,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in a)Y=a[ve],a.hasOwnProperty(ve)&&Y!=null&&!s.hasOwnProperty(ve)&&Ve(e,t,ve,null,s,Y);for(V in s)if(Y=s[V],Q=a[V],s.hasOwnProperty(V)&&Y!==Q&&(Y!=null||Q!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:Ve(e,t,V,Y,s,Q)}return;default:if(Ho(t)){for(var Ge in a)Y=a[Ge],a.hasOwnProperty(Ge)&&Y!==void 0&&!s.hasOwnProperty(Ge)&&Nc(e,t,Ge,void 0,s,Y);for(ee in s)Y=s[ee],Q=a[ee],!s.hasOwnProperty(ee)||Y===Q||Y===void 0&&Q===void 0||Nc(e,t,ee,Y,s,Q);return}}for(var L in a)Y=a[L],a.hasOwnProperty(L)&&Y!=null&&!s.hasOwnProperty(L)&&Ve(e,t,L,null,s,Y);for(re in s)Y=s[re],Q=a[re],!s.hasOwnProperty(re)||Y===Q||Y==null&&Q==null||Ve(e,t,re,Y,s,Q)}var Sc=null,Cc=null;function Yl(e){return e.nodeType===9?e:e.ownerDocument}function Pm(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 qm(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 Ec(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 kc=null;function G0(){var e=window.event;return e&&e.type==="popstate"?e===kc?!1:(kc=e,!0):(kc=null,!1)}var Vm=typeof setTimeout=="function"?setTimeout:void 0,K0=typeof clearTimeout=="function"?clearTimeout:void 0,Gm=typeof Promise=="function"?Promise:void 0,$0=typeof queueMicrotask=="function"?queueMicrotask:typeof Gm<"u"?function(e){return Gm.resolve(null).then(e).catch(F0)}:Vm;function F0(e){setTimeout(function(){throw e})}function on(e){return e==="head"}function Km(e,t){var a=t,s=0,c=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(0<s&&8>s){a=s;var x=e.ownerDocument;if(a&1&&Sr(x.documentElement),a&2&&Sr(x.body),a&4)for(a=x.head,Sr(a),x=a.firstChild;x;){var v=x.nextSibling,z=x.nodeName;x[Hs]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&x.rel.toLowerCase()==="stylesheet"||a.removeChild(x),x=v}}if(c===0){e.removeChild(u),Or(t);return}c--}else a==="$"||a==="$?"||a==="$!"?c++:s=a.charCodeAt(0)-48;else s=0;a=u}while(a);Or(t)}function Tc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Tc(a),zo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Y0(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Hs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==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(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=oa(e.nextSibling),e===null)break}return null}function X0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=oa(e.nextSibling),e===null))return null;return e}function Ac(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function Q0(e,t){var a=e.ownerDocument;if(e.data!=="$?"||a.readyState==="complete")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function oa(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 Rc=null;function $m(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}function Fm(e,t,a){switch(t=Yl(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zo(e)}var Jt=new Map,Ym=new Set;function Xl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _a=B.d;B.d={f:Z0,r:I0,D:J0,C:W0,L:ex,m:tx,X:nx,S:ax,M:sx};function Z0(){var e=_a.f(),t=Hl();return e||t}function I0(e){var t=Gn(e);t!==null&&t.tag===5&&t.type==="form"?mf(t):_a.r(e)}var Ns=typeof document>"u"?null:document;function Xm(e,t,a){var s=Ns;if(s&&typeof t=="string"&&t){var c=$t(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Ym.has(c)||(Ym.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),yt(t,"link",e),ft(t),s.head.appendChild(t)))}}function J0(e){_a.D(e),Xm("dns-prefetch",e,null)}function W0(e,t){_a.C(e,t),Xm("preconnect",e,t)}function ex(e,t,a){_a.L(e,t,a);var s=Ns;if(s&&e&&t){var c='link[rel="preload"][as="'+$t(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+$t(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+$t(a.imageSizes)+'"]')):c+='[href="'+$t(e)+'"]';var u=c;switch(t){case"style":u=Ss(e);break;case"script":u=Cs(e)}Jt.has(u)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Jt.set(u,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(Cr(u))||t==="script"&&s.querySelector(Er(u))||(t=s.createElement("link"),yt(t,"link",e),ft(t),s.head.appendChild(t)))}}function tx(e,t){_a.m(e,t);var a=Ns;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+$t(s)+'"][href="'+$t(e)+'"]',u=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Cs(e)}if(!Jt.has(u)&&(e=y({rel:"modulepreload",href:e},t),Jt.set(u,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Er(u)))return}s=a.createElement("link"),yt(s,"link",e),ft(s),a.head.appendChild(s)}}}function ax(e,t,a){_a.S(e,t,a);var s=Ns;if(s&&e){var c=Kn(s).hoistableStyles,u=Ss(e);t=t||"default";var x=c.get(u);if(!x){var v={loading:0,preload:null};if(x=s.querySelector(Cr(u)))v.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Jt.get(u))&&Mc(e,a);var z=x=s.createElement("link");ft(z),yt(z,"link",e),z._p=new Promise(function(V,ee){z.onload=V,z.onerror=ee}),z.addEventListener("load",function(){v.loading|=1}),z.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Ql(x,t,s)}x={type:"stylesheet",instance:x,count:1,state:v},c.set(u,x)}}}function nx(e,t){_a.X(e,t);var a=Ns;if(a&&e){var s=Kn(a).hoistableScripts,c=Cs(e),u=s.get(c);u||(u=a.querySelector(Er(c)),u||(e=y({src:e,async:!0},t),(t=Jt.get(c))&&Oc(e,t),u=a.createElement("script"),ft(u),yt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(c,u))}}function sx(e,t){_a.M(e,t);var a=Ns;if(a&&e){var s=Kn(a).hoistableScripts,c=Cs(e),u=s.get(c);u||(u=a.querySelector(Er(c)),u||(e=y({src:e,async:!0,type:"module"},t),(t=Jt.get(c))&&Oc(e,t),u=a.createElement("script"),ft(u),yt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(c,u))}}function Qm(e,t,a,s){var c=(c=J.current)?Xl(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ss(a.href),a=Kn(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ss(a.href);var u=Kn(c).hoistableStyles,x=u.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,x),(u=c.querySelector(Cr(e)))&&!u._p&&(x.instance=u,x.state.loading=5),Jt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Jt.set(e,a),u||rx(c,e,a,x.state))),t&&s===null)throw Error(i(528,""));return x}if(t&&s!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Cs(a),a=Kn(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ss(e){return'href="'+$t(e)+'"'}function Cr(e){return'link[rel="stylesheet"]['+e+"]"}function Zm(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function rx(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),yt(t,"link",a),ft(t),e.head.appendChild(t))}function Cs(e){return'[src="'+$t(e)+'"]'}function Er(e){return"script[async]"+e}function Im(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+$t(a.href)+'"]');if(s)return t.instance=s,ft(s),s;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ft(s),yt(s,"style",c),Ql(s,a.precedence,e),t.instance=s;case"stylesheet":c=Ss(a.href);var u=e.querySelector(Cr(c));if(u)return t.state.loading|=4,t.instance=u,ft(u),u;s=Zm(a),(c=Jt.get(c))&&Mc(s,c),u=(e.ownerDocument||e).createElement("link"),ft(u);var x=u;return x._p=new Promise(function(v,z){x.onload=v,x.onerror=z}),yt(u,"link",s),t.state.loading|=4,Ql(u,a.precedence,e),t.instance=u;case"script":return u=Cs(a.src),(c=e.querySelector(Er(u)))?(t.instance=c,ft(c),c):(s=a,(c=Jt.get(u))&&(s=y({},a),Oc(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),ft(c),yt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Ql(s,a.precedence,e));return t.instance}function Ql(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,u=c,x=0;x<s.length;x++){var v=s[x];if(v.dataset.precedence===t)u=v;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Oc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zl=null;function Jm(e,t,a){if(Zl===null){var s=new Map,c=Zl=new Map;c.set(a,s)}else c=Zl,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var u=a[c];if(!(u[Hs]||u[ot]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var x=u.getAttribute(t)||"";x=e+x;var v=s.get(x);v?v.push(u):s.set(x,[u])}}return s}function Wm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function lx(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function eh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var kr=null;function ox(){}function ix(e,t,a){if(kr===null)throw Error(i(475));var s=kr;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var c=Ss(a.href),u=e.querySelector(Cr(c));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=Il.bind(s),e.then(s,s)),t.state.loading|=4,t.instance=u,ft(u);return}u=e.ownerDocument||e,a=Zm(a),(c=Jt.get(c))&&Mc(a,c),u=u.createElement("link"),ft(u);var x=u;x._p=new Promise(function(v,z){x.onload=v,x.onerror=z}),yt(u,"link",a),t.instance=u}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(s.count++,t=Il.bind(s),e.addEventListener("load",t),e.addEventListener("error",t))}}function cx(){if(kr===null)throw Error(i(475));var e=kr;return e.stylesheets&&e.count===0&&zc(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function Il(){if(this.count--,this.count===0){if(this.stylesheets)zc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Jl=null;function zc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Jl=new Map,t.forEach(ux,e),Jl=null,Il.call(e))}function ux(e,t){if(!(t.state.loading&4)){var a=Jl.get(e);if(a)var s=a.get(null);else{a=new Map,Jl.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var x=c[u];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),s=x)}s&&a.set(null,s)}c=t.instance,x=c.getAttribute("data-precedence"),u=a.get(x)||s,u===s&&a.set(null,c),a.set(x,c),this.count++,s=Il.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Tr={$$typeof:R,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function dx(e,t,a,s,c,u,x,v){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=aa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aa(0),this.hiddenUpdates=aa(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=v,this.incompleteTransitions=new Map}function th(e,t,a,s,c,u,x,v,z,V,ee,re){return e=new dx(e,t,a,x,v,z,V,re),t=1,u===!0&&(t|=24),u=_t(3,null,null,t),e.current=u,u.stateNode=e,t=hi(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:s,isDehydrated:a,cache:t},yi(u),e}function ah(e){return e?(e=as,e):as}function nh(e,t,a,s,c,u){c=ah(c),s.context===null?s.context=c:s.pendingContext=c,s=Xa(t),s.payload={element:a},u=u===void 0?null:u,u!==null&&(s.callback=u),a=Qa(e,s,t),a!==null&&(Vt(a,e,t),sr(a,e,t))}function sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Dc(e,t){sh(e,t),(e=e.alternate)&&sh(e,t)}function rh(e){if(e.tag===13){var t=ts(e,67108864);t!==null&&Vt(t,e,67108864),Dc(e,67108864)}}var Wl=!0;function fx(e,t,a,s){var c=S.T;S.T=null;var u=B.p;try{B.p=2,Uc(e,t,a,s)}finally{B.p=u,S.T=c}}function mx(e,t,a,s){var c=S.T;S.T=null;var u=B.p;try{B.p=8,Uc(e,t,a,s)}finally{B.p=u,S.T=c}}function Uc(e,t,a,s){if(Wl){var c=Lc(s);if(c===null)jc(e,t,s,eo,a),oh(e,s);else if(gx(c,e,t,a,s))s.stopPropagation();else if(oh(e,s),t&4&&-1<hx.indexOf(e)){for(;c!==null;){var u=Gn(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var x=vt(u.pendingLanes);if(x!==0){var v=u;for(v.pendingLanes|=2,v.entangledLanes|=2;x;){var z=1<<31-at(x);v.entanglements[1]|=z,x&=~z}ya(u),(He&6)===0&&(_l=Ue()+500,wr(0))}}break;case 13:v=ts(u,2),v!==null&&Vt(v,u,2),Hl(),Dc(u,2)}if(u=Lc(s),u===null&&jc(e,t,s,eo,a),u===c)break;c=u}c!==null&&s.stopPropagation()}else jc(e,t,s,null,a)}}function Lc(e){return e=qo(e),_c(e)}var eo=null;function _c(e){if(eo=null,e=Vn(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return eo=e,null}function lh(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(bt()){case ua:return 2;case da:return 8;case Gt:case fa:return 32;case gn:return 268435456;default:return 32}default:return 32}}var Bc=!1,cn=null,un=null,dn=null,Ar=new Map,Rr=new Map,fn=[],hx="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 oh(e,t){switch(e){case"focusin":case"focusout":cn=null;break;case"dragenter":case"dragleave":un=null;break;case"mouseover":case"mouseout":dn=null;break;case"pointerover":case"pointerout":Ar.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rr.delete(t.pointerId)}}function Mr(e,t,a,s,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:u,targetContainers:[c]},t!==null&&(t=Gn(t),t!==null&&rh(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function gx(e,t,a,s,c){switch(t){case"focusin":return cn=Mr(cn,e,t,a,s,c),!0;case"dragenter":return un=Mr(un,e,t,a,s,c),!0;case"mouseover":return dn=Mr(dn,e,t,a,s,c),!0;case"pointerover":var u=c.pointerId;return Ar.set(u,Mr(Ar.get(u)||null,e,t,a,s,c)),!0;case"gotpointercapture":return u=c.pointerId,Rr.set(u,Mr(Rr.get(u)||null,e,t,a,s,c)),!0}return!1}function ih(e){var t=Vn(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,Qr(e.priority,function(){if(a.tag===13){var s=qt();s=ma(s);var c=ts(a,s);c!==null&&Vt(c,a,s),Dc(a,s)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function to(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Lc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Po=s,a.target.dispatchEvent(s),Po=null}else return t=Gn(a),t!==null&&rh(t),e.blockedOn=a,!1;t.shift()}return!0}function ch(e,t,a){to(e)&&a.delete(t)}function px(){Bc=!1,cn!==null&&to(cn)&&(cn=null),un!==null&&to(un)&&(un=null),dn!==null&&to(dn)&&(dn=null),Ar.forEach(ch),Rr.forEach(ch)}function ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Bc||(Bc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,px)))}var no=null;function uh(e){no!==e&&(no=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){no===e&&(no=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(_c(s||a)===null)continue;break}var u=Gn(a);u!==null&&(e.splice(t,3),t-=3,_i(u,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function Or(e){function t(z){return ao(z,e)}cn!==null&&ao(cn,e),un!==null&&ao(un,e),dn!==null&&ao(dn,e),Ar.forEach(t),Rr.forEach(t);for(var a=0;a<fn.length;a++){var s=fn[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<fn.length&&(a=fn[0],a.blockedOn===null);)ih(a),a.blockedOn===null&&fn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],u=a[s+1],x=c[St]||null;if(typeof u=="function")x||uh(a);else if(x){var v=null;if(u&&u.hasAttribute("formAction")){if(c=u,x=u[St]||null)v=x.formAction;else if(_c(c)!==null)continue}else v=x.action;typeof v=="function"?a[s+1]=v:(a.splice(s,3),s-=3),uh(a)}}}function Hc(e){this._internalRoot=e}so.prototype.render=Hc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,s=qt();nh(a,s,e,t,null,null)},so.prototype.unmount=Hc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;nh(e.current,2,null,e,null,null),Hl(),t[qn]=null}};function so(e){this._internalRoot=e}so.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bs();e={blockedOn:null,target:e,priority:t};for(var a=0;a<fn.length&&t!==0&&t<fn[a].priority;a++);fn.splice(a,0,e),a===0&&ih(e)}};var dh=o.version;if(dh!=="19.1.1")throw Error(i(527,dh,"19.1.1"));B.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=g(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var xx={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:S,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ro=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ro.isDisabled&&ro.supportsFiber)try{zt=ro.inject(xx),lt=ro}catch{}}return Dr.createRoot=function(e,t){if(!d(e))throw Error(i(299));var a=!1,s="",c=kf,u=Tf,x=Af,v=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(v=t.unstable_transitionCallbacks)),t=th(e,1,!1,null,null,a,s,c,u,x,v,null),e[qn]=t.current,wc(e),new Hc(t)},Dr.hydrateRoot=function(e,t,a){if(!d(e))throw Error(i(299));var s=!1,c="",u=kf,x=Tf,v=Af,z=null,V=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(z=a.unstable_transitionCallbacks),a.formState!==void 0&&(V=a.formState)),t=th(e,1,!0,t,a??null,s,c,u,x,v,z,V),t.context=ah(null),a=t.current,s=qt(),s=ma(s),c=Xa(s),c.callback=null,Qa(a,c,s),a=s,t.current.lanes=a,na(t,a),ya(t),e[qn]=t.current,wc(e),new so(t)},Dr.version="19.1.1",Dr}var wh;function kx(){if(wh)return Vc.exports;wh=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),Vc.exports=Ex(),Vc.exports}var Tx=kx();const jh=ng(Tx);/**
|
|
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 Nh="popstate";function Ax(r={}){function o(i,d){let{pathname:f,search:m,hash:p}=i.location;return Ic("",{pathname:f,search:m,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function l(i,d){return typeof d=="string"?d:Hr(d)}return Mx(o,l,null,r)}function Qe(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function ea(r,o){if(!r){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function Rx(){return Math.random().toString(36).substring(2,10)}function Sh(r,o){return{usr:r.state,key:r.key,idx:o}}function Ic(r,o,l=null,i){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof o=="string"?Os(o):o,state:l,key:o&&o.key||i||Rx()}}function Hr({pathname:r="/",search:o="",hash:l=""}){return o&&o!=="?"&&(r+=o.charAt(0)==="?"?o:"?"+o),l&&l!=="#"&&(r+=l.charAt(0)==="#"?l:"#"+l),r}function Os(r){let o={};if(r){let l=r.indexOf("#");l>=0&&(o.hash=r.substring(l),r=r.substring(0,l));let i=r.indexOf("?");i>=0&&(o.search=r.substring(i),r=r.substring(0,i)),r&&(o.pathname=r)}return o}function Mx(r,o,l,i={}){let{window:d=document.defaultView,v5Compat:f=!1}=i,m=d.history,p="POP",g=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function N(){p="POP";let M=y(),C=M==null?null:M-h;h=M,g&&g({action:p,location:O.location,delta:C})}function j(M,C){p="PUSH";let T=Ic(O.location,M,C);h=y()+1;let R=Sh(T,h),W=O.createHref(T);try{m.pushState(R,"",W)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;d.location.assign(W)}f&&g&&g({action:p,location:O.location,delta:1})}function A(M,C){p="REPLACE";let T=Ic(O.location,M,C);h=y();let R=Sh(T,h),W=O.createHref(T);m.replaceState(R,"",W),f&&g&&g({action:p,location:O.location,delta:0})}function D(M){return Ox(M)}let O={get action(){return p},get location(){return r(d,m)},listen(M){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Nh,N),g=M,()=>{d.removeEventListener(Nh,N),g=null}},createHref(M){return o(d,M)},createURL:D,encodeLocation(M){let C=D(M);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:j,replace:A,go(M){return m.go(M)}};return O}function Ox(r,o=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),Qe(l,"No window.location.(origin|href) available to create URL");let i=typeof r=="string"?r:Hr(r);return i=i.replace(/ $/,"%20"),!o&&i.startsWith("//")&&(i=l+i),new URL(i,l)}function sg(r,o,l="/"){return zx(r,o,l,!1)}function zx(r,o,l,i){let d=typeof o=="string"?Os(o):o,f=qa(d.pathname||"/",l);if(f==null)return null;let m=rg(r);Dx(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=$x(f);p=Gx(m[g],h,i)}return p}function rg(r,o=[],l=[],i="",d=!1){let f=(m,p,g=d,h)=>{let y={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&g)return;Qe(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let N=Ha([i,y.relativePath]),j=l.concat(y);m.children&&m.children.length>0&&(Qe(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${N}".`),rg(m.children,o,j,N,g)),!(m.path==null&&!m.index)&&o.push({path:N,score:qx(N,m.index),routesMeta:j})};return r.forEach((m,p)=>{var g;if(m.path===""||!((g=m.path)!=null&&g.includes("?")))f(m,p);else for(let h of lg(m.path))f(m,p,!0,h)}),o}function lg(r){let o=r.split("/");if(o.length===0)return[];let[l,...i]=o,d=l.endsWith("?"),f=l.replace(/\?$/,"");if(i.length===0)return d?[f,""]:[f];let m=lg(i.join("/")),p=[];return p.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&p.push(...m),p.map(g=>r.startsWith("/")&&g===""?"/":g)}function Dx(r){r.sort((o,l)=>o.score!==l.score?l.score-o.score:Vx(o.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}var Ux=/^:[\w-]+$/,Lx=3,_x=2,Bx=1,Hx=10,Px=-2,Ch=r=>r==="*";function qx(r,o){let l=r.split("/"),i=l.length;return l.some(Ch)&&(i+=Px),o&&(i+=_x),l.filter(d=>!Ch(d)).reduce((d,f)=>d+(Ux.test(f)?Lx:f===""?Bx:Hx),i)}function Vx(r,o){return r.length===o.length&&r.slice(0,-1).every((i,d)=>i===o[d])?r[r.length-1]-o[o.length-1]:0}function Gx(r,o,l=!1){let{routesMeta:i}=r,d={},f="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,y=f==="/"?o:o.slice(f.length)||"/",N=yo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),j=g.route;if(!N&&h&&l&&!i[i.length-1].route.index&&(N=yo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!N)return null;Object.assign(d,N.params),m.push({params:d,pathname:Ha([f,N.pathname]),pathnameBase:Qx(Ha([f,N.pathnameBase])),route:j}),N.pathnameBase!=="/"&&(f=Ha([f,N.pathnameBase]))}return m}function yo(r,o){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[l,i]=Kx(r.path,r.caseSensitive,r.end),d=o.match(l);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),p=d.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:N},j)=>{if(y==="*"){let D=p[j]||"";m=f.slice(0,f.length-D.length).replace(/(.)\/+$/,"$1")}const A=p[j];return N&&!A?h[y]=void 0:h[y]=(A||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:r}}function Kx(r,o=!1,l=!0){ea(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let i=[],d="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g)=>(i.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(i.push({paramName:"*"}),d+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?d+="\\/*$":r!==""&&r!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),i]}function $x(r){try{return r.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return ea(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),r}}function qa(r,o){if(o==="/")return r;if(!r.toLowerCase().startsWith(o.toLowerCase()))return null;let l=o.endsWith("/")?o.length-1:o.length,i=r.charAt(l);return i&&i!=="/"?null:r.slice(l)||"/"}function Fx(r,o="/"){let{pathname:l,search:i="",hash:d=""}=typeof r=="string"?Os(r):r;return{pathname:l?l.startsWith("/")?l:Yx(l,o):o,search:Zx(i),hash:Ix(d)}}function Yx(r,o){let l=o.replace(/\/+$/,"").split("/");return r.split("/").forEach(d=>{d===".."?l.length>1&&l.pop():d!=="."&&l.push(d)}),l.length>1?l.join("/"):"/"}function Fc(r,o,l,i){return`Cannot include a '${r}' character in a manually specified \`to.${o}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Xx(r){return r.filter((o,l)=>l===0||o.route.path&&o.route.path.length>0)}function uu(r){let o=Xx(r);return o.map((l,i)=>i===o.length-1?l.pathname:l.pathnameBase)}function du(r,o,l,i=!1){let d;typeof r=="string"?d=Os(r):(d={...r},Qe(!d.pathname||!d.pathname.includes("?"),Fc("?","pathname","search",d)),Qe(!d.pathname||!d.pathname.includes("#"),Fc("#","pathname","hash",d)),Qe(!d.search||!d.search.includes("#"),Fc("#","search","hash",d)));let f=r===""||d.pathname==="",m=f?"/":d.pathname,p;if(m==null)p=l;else{let N=o.length-1;if(!i&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),N-=1;d.pathname=j.join("/")}p=N>=0?o[N]:"/"}let g=Fx(d,p),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var Ha=r=>r.join("/").replace(/\/\/+/g,"/"),Qx=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Zx=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Ix=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Jx(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}var og=["POST","PUT","PATCH","DELETE"];new Set(og);var Wx=["GET",...og];new Set(Wx);var zs=b.createContext(null);zs.displayName="DataRouter";var Eo=b.createContext(null);Eo.displayName="DataRouterState";b.createContext(!1);var ig=b.createContext({isTransitioning:!1});ig.displayName="ViewTransition";var ey=b.createContext(new Map);ey.displayName="Fetchers";var ty=b.createContext(null);ty.displayName="Await";var ia=b.createContext(null);ia.displayName="Navigation";var Vr=b.createContext(null);Vr.displayName="Location";var ta=b.createContext({outlet:null,matches:[],isDataRoute:!1});ta.displayName="Route";var fu=b.createContext(null);fu.displayName="RouteError";function ay(r,{relative:o}={}){Qe(Ds(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:i}=b.useContext(ia),{hash:d,pathname:f,search:m}=Gr(r,{relative:o}),p=f;return l!=="/"&&(p=f==="/"?l:Ha([l,f])),i.createHref({pathname:p,search:m,hash:d})}function Ds(){return b.useContext(Vr)!=null}function Va(){return Qe(Ds(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Vr).location}var cg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ug(r){b.useContext(ia).static||b.useLayoutEffect(r)}function Ga(){let{isDataRoute:r}=b.useContext(ta);return r?xy():ny()}function ny(){Qe(Ds(),"useNavigate() may be used only in the context of a <Router> component.");let r=b.useContext(zs),{basename:o,navigator:l}=b.useContext(ia),{matches:i}=b.useContext(ta),{pathname:d}=Va(),f=JSON.stringify(uu(i)),m=b.useRef(!1);return ug(()=>{m.current=!0}),b.useCallback((g,h={})=>{if(ea(m.current,cg),!m.current)return;if(typeof g=="number"){l.go(g);return}let y=du(g,JSON.parse(f),d,h.relative==="path");r==null&&o!=="/"&&(y.pathname=y.pathname==="/"?o:Ha([o,y.pathname])),(h.replace?l.replace:l.push)(y,h.state,h)},[o,l,f,d,r])}var sy=b.createContext(null);function ry(r){let o=b.useContext(ta).outlet;return o&&b.createElement(sy.Provider,{value:r},o)}function dg(){let{matches:r}=b.useContext(ta),o=r[r.length-1];return o?o.params:{}}function Gr(r,{relative:o}={}){let{matches:l}=b.useContext(ta),{pathname:i}=Va(),d=JSON.stringify(uu(l));return b.useMemo(()=>du(r,JSON.parse(d),i,o==="path"),[r,d,i,o])}function ly(r,o){return fg(r,o)}function fg(r,o,l,i,d){var T;Qe(Ds(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=b.useContext(ia),{matches:m}=b.useContext(ta),p=m[m.length-1],g=p?p.params:{},h=p?p.pathname:"/",y=p?p.pathnameBase:"/",N=p&&p.route;{let R=N&&N.path||"";mg(h,!N||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${R}">) 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="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let j=Va(),A;if(o){let R=typeof o=="string"?Os(o):o;Qe(y==="/"||((T=R.pathname)==null?void 0:T.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${R.pathname}" was given in the \`location\` prop.`),A=R}else A=j;let D=A.pathname||"/",O=D;if(y!=="/"){let R=y.replace(/^\//,"").split("/");O="/"+D.replace(/^\//,"").split("/").slice(R.length).join("/")}let M=sg(r,{pathname:O});ea(N||M!=null,`No routes matched location "${A.pathname}${A.search}${A.hash}" `),ea(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 "${A.pathname}${A.search}${A.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 C=dy(M&&M.map(R=>Object.assign({},R,{params:Object.assign({},g,R.params),pathname:Ha([y,f.encodeLocation?f.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?y:Ha([y,f.encodeLocation?f.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),m,l,i,d);return o&&C?b.createElement(Vr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...A},navigationType:"POP"}},C):C}function oy(){let r=py(),o=Jx(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,i="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",r),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:f},"ErrorBoundary")," or"," ",b.createElement("code",{style:f},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},o),l?b.createElement("pre",{style:d},l):null,m)}var iy=b.createElement(oy,null),cy=class extends b.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,o){return o.location!==r.location||o.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:o.error,location:o.location,revalidation:r.revalidation||o.revalidation}}componentDidCatch(r,o){this.props.unstable_onError?this.props.unstable_onError(r,o):console.error("React Router caught the following error during render",r)}render(){return this.state.error!==void 0?b.createElement(ta.Provider,{value:this.props.routeContext},b.createElement(fu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function uy({routeContext:r,match:o,children:l}){let i=b.useContext(zs);return i&&i.static&&i.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=o.route.id),b.createElement(ta.Provider,{value:r},l)}function dy(r,o=[],l=null,i=null,d=null){if(r==null){if(!l)return null;if(l.errors)r=l.matches;else if(o.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let f=r,m=l==null?void 0:l.errors;if(m!=null){let h=f.findIndex(y=>y.route.id&&(m==null?void 0:m[y.route.id])!==void 0);Qe(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,h+1))}let p=!1,g=-1;if(l)for(let h=0;h<f.length;h++){let y=f[h];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(g=h),y.route.id){let{loaderData:N,errors:j}=l,A=y.route.loader&&!N.hasOwnProperty(y.route.id)&&(!j||j[y.route.id]===void 0);if(y.route.lazy||A){p=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((h,y,N)=>{let j,A=!1,D=null,O=null;l&&(j=m&&y.route.id?m[y.route.id]:void 0,D=y.route.errorElement||iy,p&&(g<0&&N===0?(mg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,O=null):g===N&&(A=!0,O=y.route.hydrateFallbackElement||null)));let M=o.concat(f.slice(0,N+1)),C=()=>{let T;return j?T=D:A?T=O:y.route.Component?T=b.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=h,b.createElement(uy,{match:y,routeContext:{outlet:h,matches:M,isDataRoute:l!=null},children:T})};return l&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?b.createElement(cy,{location:l.location,revalidation:l.revalidation,component:D,error:j,children:C(),routeContext:{outlet:null,matches:M,isDataRoute:!0},unstable_onError:i}):C()},null)}function mu(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fy(r){let o=b.useContext(zs);return Qe(o,mu(r)),o}function my(r){let o=b.useContext(Eo);return Qe(o,mu(r)),o}function hy(r){let o=b.useContext(ta);return Qe(o,mu(r)),o}function hu(r){let o=hy(r),l=o.matches[o.matches.length-1];return Qe(l.route.id,`${r} can only be used on routes that contain a unique "id"`),l.route.id}function gy(){return hu("useRouteId")}function py(){var i;let r=b.useContext(fu),o=my("useRouteError"),l=hu("useRouteError");return r!==void 0?r:(i=o.errors)==null?void 0:i[l]}function xy(){let{router:r}=fy("useNavigate"),o=hu("useNavigate"),l=b.useRef(!1);return ug(()=>{l.current=!0}),b.useCallback(async(d,f={})=>{ea(l.current,cg),l.current&&(typeof d=="number"?r.navigate(d):await r.navigate(d,{fromRouteId:o,...f}))},[r,o])}var Eh={};function mg(r,o,l){!o&&!Eh[r]&&(Eh[r]=!0,ea(!1,l))}b.memo(yy);function yy({routes:r,future:o,state:l,unstable_onError:i}){return fg(r,void 0,l,i,o)}function bo({to:r,replace:o,state:l,relative:i}){Qe(Ds(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=b.useContext(ia);ea(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=b.useContext(ta),{pathname:m}=Va(),p=Ga(),g=du(r,uu(f),m,i==="path"),h=JSON.stringify(g);return b.useEffect(()=>{p(JSON.parse(h),{replace:o,state:l,relative:i})},[p,h,i,o,l]),null}function hg(r){return ry(r.context)}function Et(r){Qe(!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 by({basename:r="/",children:o=null,location:l,navigationType:i="POP",navigator:d,static:f=!1}){Qe(!Ds(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=r.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:m,navigator:d,static:f,future:{}}),[m,d,f]);typeof l=="string"&&(l=Os(l));let{pathname:g="/",search:h="",hash:y="",state:N=null,key:j="default"}=l,A=b.useMemo(()=>{let D=qa(g,m);return D==null?null:{location:{pathname:D,search:h,hash:y,state:N,key:j},navigationType:i}},[m,g,h,y,N,j,i]);return ea(A!=null,`<Router basename="${m}"> is not able to match the URL "${g}${h}${y}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:b.createElement(ia.Provider,{value:p},b.createElement(Vr.Provider,{children:o,value:A}))}function vy({children:r,location:o}){return ly(Jc(r),o)}function Jc(r,o=[]){let l=[];return b.Children.forEach(r,(i,d)=>{if(!b.isValidElement(i))return;let f=[...o,d];if(i.type===b.Fragment){l.push.apply(l,Jc(i.props.children,f));return}Qe(i.type===Et,`[${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>`),Qe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let m={id:i.props.id||f.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=Jc(i.props.children,f)),l.push(m)}),l}var go="get",po="application/x-www-form-urlencoded";function ko(r){return r!=null&&typeof r.tagName=="string"}function wy(r){return ko(r)&&r.tagName.toLowerCase()==="button"}function jy(r){return ko(r)&&r.tagName.toLowerCase()==="form"}function Ny(r){return ko(r)&&r.tagName.toLowerCase()==="input"}function Sy(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Cy(r,o){return r.button===0&&(!o||o==="_self")&&!Sy(r)}function Wc(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((o,l)=>{let i=r[l];return o.concat(Array.isArray(i)?i.map(d=>[l,d]):[[l,i]])},[]))}function Ey(r,o){let l=Wc(r);return o&&o.forEach((i,d)=>{l.has(d)||o.getAll(d).forEach(f=>{l.append(d,f)})}),l}var lo=null;function ky(){if(lo===null)try{new FormData(document.createElement("form"),0),lo=!1}catch{lo=!0}return lo}var Ty=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Yc(r){return r!=null&&!Ty.has(r)?(ea(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${po}"`),null):r}function Ay(r,o){let l,i,d,f,m;if(jy(r)){let p=r.getAttribute("action");i=p?qa(p,o):null,l=r.getAttribute("method")||go,d=Yc(r.getAttribute("enctype"))||po,f=new FormData(r)}else if(wy(r)||Ny(r)&&(r.type==="submit"||r.type==="image")){let p=r.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=r.getAttribute("formaction")||p.getAttribute("action");if(i=g?qa(g,o):null,l=r.getAttribute("formmethod")||p.getAttribute("method")||go,d=Yc(r.getAttribute("formenctype"))||Yc(p.getAttribute("enctype"))||po,f=new FormData(p,r),!ky()){let{name:h,type:y,value:N}=r;if(y==="image"){let j=h?`${h}.`:"";f.append(`${j}x`,"0"),f.append(`${j}y`,"0")}else h&&f.append(h,N)}}else{if(ko(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=go,i=null,d=po,m=r}return f&&d==="text/plain"&&(m=f,f=void 0),{action:i,method:l.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gu(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function Ry(r,o,l){let i=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return i.pathname==="/"?i.pathname=`_root.${l}`:o&&qa(i.pathname,o)==="/"?i.pathname=`${o.replace(/\/$/,"")}/_root.${l}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${l}`,i}async function My(r,o){if(r.id in o)return o[r.id];try{let l=await import(r.module);return o[r.id]=l,l}catch(l){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Oy(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function zy(r,o,l){let i=await Promise.all(r.map(async d=>{let f=o.routes[d.route.id];if(f){let m=await My(f,l);return m.links?m.links():[]}return[]}));return _y(i.flat(1).filter(Oy).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function kh(r,o,l,i,d,f){let m=(g,h)=>l[h]?g.route.id!==l[h].route.id:!0,p=(g,h)=>{var y;return l[h].pathname!==g.pathname||((y=l[h].route.path)==null?void 0:y.endsWith("*"))&&l[h].params["*"]!==g.params["*"]};return f==="assets"?o.filter((g,h)=>m(g,h)||p(g,h)):f==="data"?o.filter((g,h)=>{var N;let y=i.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let j=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((N=l[0])==null?void 0:N.params)||{},nextUrl:new URL(r,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function Dy(r,o,{includeHydrateFallback:l}={}){return Uy(r.map(i=>{let d=o.routes[i.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),l&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function Uy(r){return[...new Set(r)]}function Ly(r){let o={},l=Object.keys(r).sort();for(let i of l)o[i]=r[i];return o}function _y(r,o){let l=new Set;return new Set(o),r.reduce((i,d)=>{let f=JSON.stringify(Ly(d));return l.has(f)||(l.add(f),i.push({key:f,link:d})),i},[])}function gg(){let r=b.useContext(zs);return gu(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function By(){let r=b.useContext(Eo);return gu(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var pu=b.createContext(void 0);pu.displayName="FrameworkContext";function pg(){let r=b.useContext(pu);return gu(r,"You must render this element inside a <HydratedRouter> element"),r}function Hy(r,o){let l=b.useContext(pu),[i,d]=b.useState(!1),[f,m]=b.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:N}=o,j=b.useRef(null);b.useEffect(()=>{if(r==="render"&&m(!0),r==="viewport"){let O=C=>{C.forEach(T=>{m(T.isIntersecting)})},M=new IntersectionObserver(O,{threshold:.5});return j.current&&M.observe(j.current),()=>{M.disconnect()}}},[r]),b.useEffect(()=>{if(i){let O=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(O)}}},[i]);let A=()=>{d(!0)},D=()=>{d(!1),m(!1)};return l?r!=="intent"?[f,j,{}]:[f,j,{onFocus:Ur(p,A),onBlur:Ur(g,D),onMouseEnter:Ur(h,A),onMouseLeave:Ur(y,D),onTouchStart:Ur(N,A)}]:[!1,j,{}]}function Ur(r,o){return l=>{r&&r(l),l.defaultPrevented||o(l)}}function Py({page:r,...o}){let{router:l}=gg(),i=b.useMemo(()=>sg(l.routes,r,l.basename),[l.routes,r,l.basename]);return i?b.createElement(Vy,{page:r,matches:i,...o}):null}function qy(r){let{manifest:o,routeModules:l}=pg(),[i,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return zy(r,o,l).then(m=>{f||d(m)}),()=>{f=!0}},[r,o,l]),i}function Vy({page:r,matches:o,...l}){let i=Va(),{manifest:d,routeModules:f}=pg(),{basename:m}=gg(),{loaderData:p,matches:g}=By(),h=b.useMemo(()=>kh(r,o,g,d,i,"data"),[r,o,g,d,i]),y=b.useMemo(()=>kh(r,o,g,d,i,"assets"),[r,o,g,d,i]),N=b.useMemo(()=>{if(r===i.pathname+i.search+i.hash)return[];let D=new Set,O=!1;if(o.forEach(C=>{var R;let T=d.routes[C.route.id];!T||!T.hasLoader||(!h.some(W=>W.route.id===C.route.id)&&C.route.id in p&&((R=f[C.route.id])!=null&&R.shouldRevalidate)||T.hasClientLoader?O=!0:D.add(C.route.id))}),D.size===0)return[];let M=Ry(r,m,"data");return O&&D.size>0&&M.searchParams.set("_routes",o.filter(C=>D.has(C.route.id)).map(C=>C.route.id).join(",")),[M.pathname+M.search]},[m,p,i,d,h,o,r,f]),j=b.useMemo(()=>Dy(y,d),[y,d]),A=qy(y);return b.createElement(b.Fragment,null,N.map(D=>b.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...l})),j.map(D=>b.createElement("link",{key:D,rel:"modulepreload",href:D,...l})),A.map(({key:D,link:O})=>b.createElement("link",{key:D,nonce:l.nonce,...O})))}function Gy(...r){return o=>{r.forEach(l=>{typeof l=="function"?l(o):l!=null&&(l.current=o)})}}var xg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{xg&&(window.__reactRouterVersion="7.8.2")}catch{}function Ky({basename:r,children:o,window:l}){let i=b.useRef();i.current==null&&(i.current=Ax({window:l,v5Compat:!0}));let d=i.current,[f,m]=b.useState({action:d.action,location:d.location}),p=b.useCallback(g=>{b.startTransition(()=>m(g))},[m]);return b.useLayoutEffect(()=>d.listen(p),[d,p]),b.createElement(by,{basename:r,children:o,location:f.location,navigationType:f.action,navigator:d})}var yg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bg=b.forwardRef(function({onClick:o,discover:l="render",prefetch:i="none",relative:d,reloadDocument:f,replace:m,state:p,target:g,to:h,preventScrollReset:y,viewTransition:N,...j},A){let{basename:D}=b.useContext(ia),O=typeof h=="string"&&yg.test(h),M,C=!1;if(typeof h=="string"&&O&&(M=h,xg))try{let oe=new URL(window.location.href),ie=h.startsWith("//")?new URL(oe.protocol+h):new URL(h),k=qa(ie.pathname,D);ie.origin===oe.origin&&k!=null?h=k+ie.search+ie.hash:C=!0}catch{ea(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=ay(h,{relative:d}),[R,W,Z]=Hy(i,j),te=Yy(h,{replace:m,state:p,target:g,preventScrollReset:y,relative:d,viewTransition:N});function ae(oe){o&&o(oe),oe.defaultPrevented||te(oe)}let F=b.createElement("a",{...j,...Z,href:M||T,onClick:C||f?o:ae,ref:Gy(A,W),target:g,"data-discover":!O&&l==="render"?"true":void 0});return R&&!O?b.createElement(b.Fragment,null,F,b.createElement(Py,{page:T})):F});bg.displayName="Link";var vg=b.forwardRef(function({"aria-current":o="page",caseSensitive:l=!1,className:i="",end:d=!1,style:f,to:m,viewTransition:p,children:g,...h},y){let N=Gr(m,{relative:h.relative}),j=Va(),A=b.useContext(Eo),{navigator:D,basename:O}=b.useContext(ia),M=A!=null&&Wy(N)&&p===!0,C=D.encodeLocation?D.encodeLocation(N).pathname:N.pathname,T=j.pathname,R=A&&A.navigation&&A.navigation.location?A.navigation.location.pathname:null;l||(T=T.toLowerCase(),R=R?R.toLowerCase():null,C=C.toLowerCase()),R&&O&&(R=qa(R,O)||R);const W=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let Z=T===C||!d&&T.startsWith(C)&&T.charAt(W)==="/",te=R!=null&&(R===C||!d&&R.startsWith(C)&&R.charAt(C.length)==="/"),ae={isActive:Z,isPending:te,isTransitioning:M},F=Z?o:void 0,oe;typeof i=="function"?oe=i(ae):oe=[i,Z?"active":null,te?"pending":null,M?"transitioning":null].filter(Boolean).join(" ");let ie=typeof f=="function"?f(ae):f;return b.createElement(bg,{...h,"aria-current":F,className:oe,ref:y,style:ie,to:m,viewTransition:p},typeof g=="function"?g(ae):g)});vg.displayName="NavLink";var $y=b.forwardRef(({discover:r="render",fetcherKey:o,navigate:l,reloadDocument:i,replace:d,state:f,method:m=go,action:p,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:N,...j},A)=>{let D=Iy(),O=Jy(p,{relative:h}),M=m.toLowerCase()==="get"?"get":"post",C=typeof p=="string"&&yg.test(p),T=R=>{if(g&&g(R),R.defaultPrevented)return;R.preventDefault();let W=R.nativeEvent.submitter,Z=(W==null?void 0:W.getAttribute("formmethod"))||m;D(W||R.currentTarget,{fetcherKey:o,method:Z,navigate:l,replace:d,state:f,relative:h,preventScrollReset:y,viewTransition:N})};return b.createElement("form",{ref:A,method:M,action:O,onSubmit:i?g:T,...j,"data-discover":!C&&r==="render"?"true":void 0})});$y.displayName="Form";function Fy(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wg(r){let o=b.useContext(zs);return Qe(o,Fy(r)),o}function Yy(r,{target:o,replace:l,state:i,preventScrollReset:d,relative:f,viewTransition:m}={}){let p=Ga(),g=Va(),h=Gr(r,{relative:f});return b.useCallback(y=>{if(Cy(y,o)){y.preventDefault();let N=l!==void 0?l:Hr(g)===Hr(h);p(r,{replace:N,state:i,preventScrollReset:d,relative:f,viewTransition:m})}},[g,p,h,l,i,o,r,d,f,m])}function Xy(r){ea(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 o=b.useRef(Wc(r)),l=b.useRef(!1),i=Va(),d=b.useMemo(()=>Ey(i.search,l.current?null:o.current),[i.search]),f=Ga(),m=b.useCallback((p,g)=>{const h=Wc(typeof p=="function"?p(new URLSearchParams(d)):p);l.current=!0,f("?"+h,g)},[f,d]);return[d,m]}var Qy=0,Zy=()=>`__${String(++Qy)}__`;function Iy(){let{router:r}=wg("useSubmit"),{basename:o}=b.useContext(ia),l=gy();return b.useCallback(async(i,d={})=>{let{action:f,method:m,encType:p,formData:g,body:h}=Ay(i,o);if(d.navigate===!1){let y=d.fetcherKey||Zy();await r.fetch(y,l,d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,flushSync:d.flushSync})}else await r.navigate(d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,replace:d.replace,state:d.state,fromRouteId:l,flushSync:d.flushSync,viewTransition:d.viewTransition})},[r,o,l])}function Jy(r,{relative:o}={}){let{basename:l}=b.useContext(ia),i=b.useContext(ta);Qe(i,"useFormAction must be used inside a RouteContext");let[d]=i.matches.slice(-1),f={...Gr(r||".",{relative:o})},m=Va();if(r==null){f.search=m.search;let p=new URLSearchParams(f.search),g=p.getAll("index");if(g.some(y=>y==="")){p.delete("index"),g.filter(N=>N).forEach(N=>p.append("index",N));let y=p.toString();f.search=y?`?${y}`:""}}return(!r||r===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(f.pathname=f.pathname==="/"?l:Ha([l,f.pathname])),Hr(f)}function Wy(r,{relative:o}={}){let l=b.useContext(ig);Qe(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=wg("useViewTransitionState"),d=Gr(r,{relative:o});if(!l.isTransitioning)return!1;let f=qa(l.currentLocation.pathname,i)||l.currentLocation.pathname,m=qa(l.nextLocation.pathname,i)||l.nextLocation.pathname;return yo(d.pathname,m)!=null||yo(d.pathname,f)!=null}const eb=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},xu=()=>{const o=eb().basePath||"";return o&&!o.startsWith("/")?"/"+o:o},tb=()=>xu()+"/api",yu=r=>{const o=tb(),l=r.startsWith("/")?r:"/"+r;return o+l},ab=async()=>{try{const r=window.location.pathname,o=[r.replace(/\/[^/]*$/,"")+"/config","/config",...r.includes("/")?[r.split("/")[1]?`/${r.split("/")[1]}/config`:"/config"]:["/config"]];for(const l of o)try{const i=await fetch(l,{method:"GET",headers:{Accept:"application/json","Cache-Control":"no-cache"}});if(i.ok){const d=await i.json();if(d.success&&d.data)return d.data}}catch(i){console.debug(`Failed to load config from ${l}:`,i)}return console.warn("Could not load runtime config from server, using defaults"),{basePath:"",version:"dev",name:"mcphub"}}catch(r){return console.error("Error loading runtime config:",r),{basePath:"",version:"dev",name:"mcphub"}}},xo=[],nb=r=>{xo.push(r)},bu=async(r,o={})=>{let l=r.toString(),i={...o};try{for(const f of xo)if(f.request){const m=await f.request(l,i);l=m.url,i=m.config}let d=await fetch(l,i);for(const f of xo)f.response&&(d=await f.response(d));return d}catch(d){let f=d;for(const m of xo)m.error&&(f=await m.error(f));throw f}},To=async(r,o={})=>{try{const l=yu(r),i=await bu(l,o);let d;try{d=await i.json()}catch{d={success:i.ok,message:i.ok?"Request successful":`HTTP ${i.status}: ${i.statusText}`}}if(!i.ok&&typeof d=="object"&&d!==null){const f=d;f.success!==!1&&(f.success=!1,f.message=f.message||`HTTP ${i.status}: ${i.statusText}`)}return d}catch(l){return console.error("API request error:",l),{success:!1,message:l instanceof Error?l.message:"An unknown error occurred"}}},Xe=(r,o={})=>To(r,{...o,method:"GET"}),kt=(r,o,l={})=>To(r,{...l,method:"POST",headers:{"Content-Type":"application/json",...l.headers},body:o?JSON.stringify(o):void 0}),Wt=(r,o,l={})=>To(r,{...l,method:"PUT",headers:{"Content-Type":"application/json",...l.headers},body:o?JSON.stringify(o):void 0}),vo=(r,o={})=>To(r,{...o,method:"DELETE"}),vu="mcphub_token",Kr=()=>localStorage.getItem(vu),jg=r=>{localStorage.setItem(vu,r)},wo=()=>{localStorage.removeItem(vu)},sb={request:async(r,o)=>{const l=new Headers(o.headers),i=localStorage.getItem("i18nextLng")||"en";l.set("Accept-Language",i);const d=Kr();return d&&l.set("x-auth-token",d),{url:r,config:{...o,headers:l}}},response:async r=>(r.status===401&&wo(),r),error:async r=>(console.error("Auth interceptor error:",r),r)},rb=()=>{nb(sb)},lb=async r=>{try{const o=await kt("/auth/login",r);return o.success&&o.token?(jg(o.token),o):{success:!1,message:o.message||"Login failed"}}catch(o){return console.error("Login error:",o),{success:!1,message:"An error occurred during login"}}},ob=async r=>{try{const o=await kt("/auth/register",r);return o.success&&o.token?(jg(o.token),o):{success:!1,message:o.message||"Registration failed"}}catch(o){return console.error("Register error:",o),{success:!1,message:"An error occurred during registration"}}},ib=async()=>{if(!Kr())return{success:!1,message:"No authentication token"};try{return await Xe("/auth/user")}catch(o){return console.error("Get current user error:",o),{success:!1,message:"An error occurred while fetching user data"}}},cb=async r=>{if(!Kr())return{success:!1,message:"No authentication token"};try{return await kt("/auth/change-password",r)}catch(l){return console.error("Change password error:",l),{success:!1,message:"An error occurred while changing password"}}},ub=()=>{wo()},db=async()=>{var r,o;try{const l=xu(),i=await bu(`${l}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});if(i.ok){const d=await i.json();return{skipAuth:((r=d.data)==null?void 0:r.skipAuth)===!0,permissions:((o=d.data)==null?void 0:o.permissions)||{}}}return{skipAuth:!1}}catch(l){return console.debug("Failed to get public config:",l),{skipAuth:!1}}},ba={isAuthenticated:!1,loading:!0,user:null,error:null},Ng=b.createContext({auth:ba,login:async()=>!1,register:async()=>!1,logout:()=>{}}),fb=({children:r})=>{const[o,l]=b.useState(ba);b.useEffect(()=>{(async()=>{const{skipAuth:p,permissions:g}=await db();if(p){l({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:g},error:null});return}if(!Kr()){l({...ba,loading:!1});return}try{const y=await ib();y.success&&y.user?l({isAuthenticated:!0,loading:!1,user:y.user,error:null}):(wo(),l({...ba,loading:!1}))}catch{wo(),l({...ba,loading:!1})}})()},[]);const i=async(m,p)=>{try{const g=await lb({username:m,password:p});return g.success&&g.token&&g.user?(l({isAuthenticated:!0,loading:!1,user:g.user,error:null}),!0):(l({...ba,loading:!1,error:g.message||"Authentication failed"}),!1)}catch{return l({...ba,loading:!1,error:"Authentication failed"}),!1}},d=async(m,p,g=!1)=>{try{const h=await ob({username:m,password:p,isAdmin:g});return h.success&&h.token&&h.user?(l({isAuthenticated:!0,loading:!1,user:h.user,error:null}),!0):(l({...ba,loading:!1,error:h.message||"Registration failed"}),!1)}catch{return l({...ba,loading:!1,error:"Registration failed"}),!1}},f=()=>{ub(),l({...ba,loading:!1})};return n.jsx(Ng.Provider,{value:{auth:o,login:i,register:d,logout:f},children:r})},Us=()=>b.useContext(Ng);/**
|
|
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 mb=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hb=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,l,i)=>i?i.toUpperCase():l.toLowerCase()),Th=r=>{const o=hb(r);return o.charAt(0).toUpperCase()+o.slice(1)},Sg=(...r)=>r.filter((o,l,i)=>!!o&&o.trim()!==""&&i.indexOf(o)===l).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 gb={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 pb=b.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:d="",children:f,iconNode:m,...p},g)=>b.createElement("svg",{ref:g,...gb,width:o,height:o,stroke:r,strokeWidth:i?Number(l)*24/Number(o):l,className:Sg("lucide",d),...p},[...m.map(([h,y])=>b.createElement(h,y)),...Array.isArray(f)?f:[f]]));/**
|
|
76
|
+
* @license lucide-react v0.486.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const We=(r,o)=>{const l=b.forwardRef(({className:i,...d},f)=>b.createElement(pb,{ref:f,iconNode:o,className:Sg(`lucide-${mb(Th(r))}`,`lucide-${r}`,i),...d}));return l.displayName=Th(r),l};/**
|
|
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 xb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],$r=We("check",xb);/**
|
|
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 yb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ao=We("chevron-down",yb);/**
|
|
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 bb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wu=We("chevron-right",bb);/**
|
|
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 vb=[["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"}]],ju=We("circle-alert",vb);/**
|
|
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 wb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Cg=We("circle-check-big",wb);/**
|
|
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 jb=[["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"}]],Eg=We("circle-x",jb);/**
|
|
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 Nb=[["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"}]],eu=We("copy",Nb);/**
|
|
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 Sb=[["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"}]],Cb=We("file-code",Sb);/**
|
|
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 Eb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],kb=We("info",Eb);/**
|
|
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 Tb=[["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"}]],Ab=We("link",Tb);/**
|
|
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 Rb=[["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"}]],kg=We("loader",Rb);/**
|
|
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 Mb=[["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"}]],Ob=We("log-out",Mb);/**
|
|
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 zb=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Db=We("moon",zb);/**
|
|
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 Ub=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Tg=We("play",Ub);/**
|
|
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 Lb=[["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"}]],_b=We("refresh-cw",Lb);/**
|
|
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 Bb=[["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"}]],Hb=We("settings",Bb);/**
|
|
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 Pb=[["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"}]],Nu=We("square-pen",Pb);/**
|
|
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 qb=[["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"}]],Vb=We("sun",qb);/**
|
|
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 Gb=[["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"}]],Kb=We("trash",Gb);/**
|
|
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 $b=[["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"}]],Fb=We("user",$b);/**
|
|
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 Yb=[["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"}]],Xb=We("wrench",Yb);/**
|
|
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 Qb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Pr=We("x",Qb);function Ag(r){var o,l,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var d=r.length;for(o=0;o<d;o++)r[o]&&(l=Ag(r[o]))&&(i&&(i+=" "),i+=l)}else for(l in r)r[l]&&(i&&(i+=" "),i+=l);return i}function Zb(){for(var r,o,l=0,i="",d=arguments.length;l<d;l++)(r=arguments[l])&&(o=Ag(r))&&(i&&(i+=" "),i+=o);return i}const Su="-",Ib=r=>{const o=Wb(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:m=>{const p=m.split(Su);return p[0]===""&&p.length!==1&&p.shift(),Rg(p,o)||Jb(m)},getConflictingClassGroupIds:(m,p)=>{const g=l[m]||[];return p&&i[m]?[...g,...i[m]]:g}}},Rg=(r,o)=>{var m;if(r.length===0)return o.classGroupId;const l=r[0],i=o.nextPart.get(l),d=i?Rg(r.slice(1),i):void 0;if(d)return d;if(o.validators.length===0)return;const f=r.join(Su);return(m=o.validators.find(({validator:p})=>p(f)))==null?void 0:m.classGroupId},Ah=/^\[(.+)\]$/,Jb=r=>{if(Ah.test(r)){const o=Ah.exec(r)[1],l=o==null?void 0:o.substring(0,o.indexOf(":"));if(l)return"arbitrary.."+l}},Wb=r=>{const{theme:o,classGroups:l}=r,i={nextPart:new Map,validators:[]};for(const d in l)tu(l[d],i,d,o);return i},tu=(r,o,l,i)=>{r.forEach(d=>{if(typeof d=="string"){const f=d===""?o:Rh(o,d);f.classGroupId=l;return}if(typeof d=="function"){if(e1(d)){tu(d(i),o,l,i);return}o.validators.push({validator:d,classGroupId:l});return}Object.entries(d).forEach(([f,m])=>{tu(m,Rh(o,f),l,i)})})},Rh=(r,o)=>{let l=r;return o.split(Su).forEach(i=>{l.nextPart.has(i)||l.nextPart.set(i,{nextPart:new Map,validators:[]}),l=l.nextPart.get(i)}),l},e1=r=>r.isThemeGetter,t1=r=>{if(r<1)return{get:()=>{},set:()=>{}};let o=0,l=new Map,i=new Map;const d=(f,m)=>{l.set(f,m),o++,o>r&&(o=0,i=l,l=new Map)};return{get(f){let m=l.get(f);if(m!==void 0)return m;if((m=i.get(f))!==void 0)return d(f,m),m},set(f,m){l.has(f)?l.set(f,m):d(f,m)}}},au="!",nu=":",a1=nu.length,n1=r=>{const{prefix:o,experimentalParseClassName:l}=r;let i=d=>{const f=[];let m=0,p=0,g=0,h;for(let D=0;D<d.length;D++){let O=d[D];if(m===0&&p===0){if(O===nu){f.push(d.slice(g,D)),g=D+a1;continue}if(O==="/"){h=D;continue}}O==="["?m++:O==="]"?m--:O==="("?p++:O===")"&&p--}const y=f.length===0?d:d.substring(g),N=s1(y),j=N!==y,A=h&&h>g?h-g:void 0;return{modifiers:f,hasImportantModifier:j,baseClassName:N,maybePostfixModifierPosition:A}};if(o){const d=o+nu,f=i;i=m=>m.startsWith(d)?f(m.substring(d.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(l){const d=i;i=f=>l({className:f,parseClassName:d})}return i},s1=r=>r.endsWith(au)?r.substring(0,r.length-1):r.startsWith(au)?r.substring(1):r,r1=r=>{const o=Object.fromEntries(r.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const d=[];let f=[];return i.forEach(m=>{m[0]==="["||o[m]?(d.push(...f.sort(),m),f=[]):f.push(m)}),d.push(...f.sort()),d}},l1=r=>({cache:t1(r.cacheSize),parseClassName:n1(r),sortModifiers:r1(r),...Ib(r)}),o1=/\s+/,i1=(r,o)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:d,sortModifiers:f}=o,m=[],p=r.trim().split(o1);let g="";for(let h=p.length-1;h>=0;h-=1){const y=p[h],{isExternal:N,modifiers:j,hasImportantModifier:A,baseClassName:D,maybePostfixModifierPosition:O}=l(y);if(N){g=y+(g.length>0?" "+g:g);continue}let M=!!O,C=i(M?D.substring(0,O):D);if(!C){if(!M){g=y+(g.length>0?" "+g:g);continue}if(C=i(D),!C){g=y+(g.length>0?" "+g:g);continue}M=!1}const T=f(j).join(":"),R=A?T+au:T,W=R+C;if(m.includes(W))continue;m.push(W);const Z=d(C,M);for(let te=0;te<Z.length;++te){const ae=Z[te];m.push(R+ae)}g=y+(g.length>0?" "+g:g)}return g};function c1(){let r=0,o,l,i="";for(;r<arguments.length;)(o=arguments[r++])&&(l=Mg(o))&&(i&&(i+=" "),i+=l);return i}const Mg=r=>{if(typeof r=="string")return r;let o,l="";for(let i=0;i<r.length;i++)r[i]&&(o=Mg(r[i]))&&(l&&(l+=" "),l+=o);return l};function u1(r,...o){let l,i,d,f=m;function m(g){const h=o.reduce((y,N)=>N(y),r());return l=l1(h),i=l.cache.get,d=l.cache.set,f=p,p(g)}function p(g){const h=i(g);if(h)return h;const y=i1(g,l);return d(g,y),y}return function(){return f(c1.apply(null,arguments))}}const ut=r=>{const o=l=>l[r]||[];return o.isThemeGetter=!0,o},Og=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,d1=/^\d+\/\d+$/,f1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,m1=/\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$/,h1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,p1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Es=r=>d1.test(r),Re=r=>!!r&&!Number.isNaN(Number(r)),hn=r=>!!r&&Number.isInteger(Number(r)),Xc=r=>r.endsWith("%")&&Re(r.slice(0,-1)),Ba=r=>f1.test(r),x1=()=>!0,y1=r=>m1.test(r)&&!h1.test(r),Dg=()=>!1,b1=r=>g1.test(r),v1=r=>p1.test(r),w1=r=>!ge(r)&&!pe(r),j1=r=>Ls(r,_g,Dg),ge=r=>Og.test(r),Un=r=>Ls(r,Bg,y1),Qc=r=>Ls(r,k1,Re),Mh=r=>Ls(r,Ug,Dg),N1=r=>Ls(r,Lg,v1),oo=r=>Ls(r,Hg,b1),pe=r=>zg.test(r),Lr=r=>_s(r,Bg),S1=r=>_s(r,T1),Oh=r=>_s(r,Ug),C1=r=>_s(r,_g),E1=r=>_s(r,Lg),io=r=>_s(r,Hg,!0),Ls=(r,o,l)=>{const i=Og.exec(r);return i?i[1]?o(i[1]):l(i[2]):!1},_s=(r,o,l=!1)=>{const i=zg.exec(r);return i?i[1]?o(i[1]):l:!1},Ug=r=>r==="position"||r==="percentage",Lg=r=>r==="image"||r==="url",_g=r=>r==="length"||r==="size"||r==="bg-size",Bg=r=>r==="length",k1=r=>r==="number",T1=r=>r==="family-name",Hg=r=>r==="shadow",A1=()=>{const r=ut("color"),o=ut("font"),l=ut("text"),i=ut("font-weight"),d=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),p=ut("container"),g=ut("spacing"),h=ut("radius"),y=ut("shadow"),N=ut("inset-shadow"),j=ut("text-shadow"),A=ut("drop-shadow"),D=ut("blur"),O=ut("perspective"),M=ut("aspect"),C=ut("ease"),T=ut("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Z=()=>[...W(),pe,ge],te=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto","contain","none"],F=()=>[pe,ge,g],oe=()=>[Es,"full","auto",...F()],ie=()=>[hn,"none","subgrid",pe,ge],k=()=>["auto",{span:["full",hn,pe,ge]},hn,pe,ge],E=()=>[hn,"auto",pe,ge],_=()=>["auto","min","max","fr",pe,ge],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],S=()=>["auto",...F()],B=()=>[Es,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],$=()=>[r,pe,ge],se=()=>[...W(),Oh,Mh,{position:[pe,ge]}],w=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",C1,j1,{size:[pe,ge]}],le=()=>[Xc,Lr,Un],H=()=>["","none","full",h,pe,ge],K=()=>["",Re,Lr,Un],me=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Re,Xc,Oh,Mh],de=()=>["","none",D,pe,ge],be=()=>["none",Re,pe,ge],je=()=>["none",Re,pe,ge],xe=()=>[Re,pe,ge],Te=()=>[Es,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ba],breakpoint:[Ba],color:[x1],container:[Ba],"drop-shadow":[Ba],ease:["in","out","in-out"],font:[w1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ba],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ba],shadow:[Ba],spacing:["px",Re],text:[Ba],"text-shadow":[Ba],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Es,ge,pe,M]}],container:["container"],columns:[{columns:[Re,ge,pe,p]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Z()}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:ae()}],"overscroll-x":[{"overscroll-x":ae()}],"overscroll-y":[{"overscroll-y":ae()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{start:oe()}],end:[{end:oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[hn,"auto",pe,ge]}],basis:[{basis:[Es,"full","auto",p,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Re,Es,"auto","initial","none",ge]}],grow:[{grow:["",Re,pe,ge]}],shrink:[{shrink:["",Re,pe,ge]}],order:[{order:[hn,"first","last","none",pe,ge]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":_()}],"auto-rows":[{"auto-rows":_()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],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:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[p,"screen",...B()]}],"min-w":[{"min-w":[p,"screen","none",...B()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",l,Lr,Un]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,pe,Qc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xc,ge]}],"font-family":[{font:[S1,ge,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,pe,ge]}],"line-clamp":[{"line-clamp":[Re,"none",pe,Qc]}],leading:[{leading:[f,...F()]}],"list-image":[{"list-image":["none",pe,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Re,"from-font","auto",pe,Un]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Re,"auto",pe,ge]}],"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",pe,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:w()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hn,pe,ge],radial:["",pe,ge],conic:[hn,pe,ge]},E1,N1]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],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:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Re,pe,ge]}],"outline-w":[{outline:["",Re,Lr,Un]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",y,io,oo]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",N,io,oo]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Re,Un]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",j,io,oo]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Re,pe,ge]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Re]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[pe,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":W()}],"mask-image-conic-pos":[{"mask-conic":[Re]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:w()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,ge]}],filter:[{filter:["","none",pe,ge]}],blur:[{blur:de()}],brightness:[{brightness:[Re,pe,ge]}],contrast:[{contrast:[Re,pe,ge]}],"drop-shadow":[{"drop-shadow":["","none",A,io,oo]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Re,pe,ge]}],"hue-rotate":[{"hue-rotate":[Re,pe,ge]}],invert:[{invert:["",Re,pe,ge]}],saturate:[{saturate:[Re,pe,ge]}],sepia:[{sepia:["",Re,pe,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,ge]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Re,pe,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Re,pe,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Re,pe,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Re,pe,ge]}],"backdrop-invert":[{"backdrop-invert":["",Re,pe,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Re,pe,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Re,pe,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Re,pe,ge]}],"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",pe,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Re,"initial",pe,ge]}],ease:[{ease:["linear","initial",C,pe,ge]}],delay:[{delay:[Re,pe,ge]}],animate:[{animate:["none",T,pe,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,pe,ge]}],"perspective-origin":[{"perspective-origin":Z()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:je()}],"scale-x":[{"scale-x":je()}],"scale-y":[{"scale-y":je()}],"scale-z":[{"scale-z":je()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[pe,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:Z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":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",pe,ge]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Re,Lr,Un,Qc]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},R1=u1(A1);function Pa(...r){return R1(Zb(r))}const M1=({message:r,type:o="info",duration:l=3e3,onClose:i,visible:d})=>{b.useEffect(()=>{if(d){const g=setTimeout(()=>{i()},l);return()=>clearTimeout(g)}},[d,l,i]);const f={success:n.jsx($r,{className:"w-5 h-5 text-green-500"}),error:n.jsx(Pr,{className:"w-5 h-5 text-red-500"}),info:n.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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:n.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})},m={success:"bg-green-50 border-green-200",error:"bg-red-50 border-red-200",info:"bg-blue-50 border-blue-200",warning:"bg-yellow-50 border-yellow-200"},p={success:"text-green-800",error:"text-red-800",info:"text-blue-800",warning:"text-yellow-800"};return n.jsx("div",{className:Pa("fixed top-4 right-4 z-50 max-w-sm p-4 rounded-md shadow-lg border",m[o],"transform transition-all duration-300 ease-in-out",d?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:n.jsxs("div",{className:"flex items-start",children:[n.jsx("div",{className:"flex-shrink-0",children:f[o]}),n.jsx("div",{className:"ml-3",children:n.jsx("p",{className:Pa("text-sm font-medium",p[o]),children:r})}),n.jsx("div",{className:"ml-auto pl-3",children:n.jsx("div",{className:"-mx-1.5 -my-1.5",children:n.jsxs("button",{onClick:i,className:Pa("inline-flex rounded-md p-1.5",`hover:bg-${o}-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${o}-500`),children:[n.jsx("span",{className:"sr-only",children:"Dismiss"}),n.jsx(Pr,{className:"h-5 w-5"})]})})})]})})},Pg=b.createContext(void 0),Fr=()=>{const r=b.useContext(Pg);if(!r)throw new Error("useToast must be used within a ToastProvider");return r},O1=({children:r})=>{const[o,l]=b.useState({message:"",type:"info",visible:!1,duration:3e3}),i=b.useCallback((f,m="info",p=3e3)=>{l({message:f,type:m,visible:!0,duration:p})},[]),d=b.useCallback(()=>{l(f=>({...f,visible:!1}))},[]);return n.jsxs(Pg.Provider,{value:{showToast:i},children:[r,n.jsx(M1,{message:o.message,type:o.type,duration:o.duration,onClose:d,visible:o.visible})]})},qg=b.createContext(void 0),z1=()=>{const r=b.useContext(qg);if(!r)throw new Error("useTheme must be used within a ThemeProvider");return r},D1=({children:r})=>{const[o,l]=b.useState(()=>localStorage.getItem("theme")||"system"),[i,d]=b.useState("light"),f=m=>{l(m),localStorage.setItem("theme",m)};return b.useEffect(()=>{const m=()=>{const g=window.document.documentElement,h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",y=o==="system"?h:o;d(y),y==="dark"?(console.log("Applying dark mode to HTML root element"),g.classList.add("dark"),document.body.style.backgroundColor="#111827"):(console.log("Removing dark mode from HTML root element"),g.classList.remove("dark"),document.body.style.backgroundColor="")},p=window.matchMedia("(prefers-color-scheme: dark)");return p.addEventListener("change",m),m(),()=>{p.removeEventListener("change",m)}},[o]),n.jsx(qg.Provider,{value:{theme:o,setTheme:f,resolvedTheme:i},children:r})},U1=(r,o,l,i)=>{var f,m,p,g;const d=[l,{code:o,...i||{}}];if((m=(f=r==null?void 0:r.services)==null?void 0:f.logger)!=null&&m.forward)return r.services.logger.forward(d,"warn","react-i18next::",!0);_n(d[0])&&(d[0]=`react-i18next:: ${d[0]}`),(g=(p=r==null?void 0:r.services)==null?void 0:p.logger)!=null&&g.warn?r.services.logger.warn(...d):console!=null&&console.warn&&console.warn(...d)},zh={},su=(r,o,l,i)=>{_n(l)&&zh[l]||(_n(l)&&(zh[l]=new Date),U1(r,o,l,i))},Vg=(r,o)=>()=>{if(r.isInitialized)o();else{const l=()=>{setTimeout(()=>{r.off("initialized",l)},0),o()};r.on("initialized",l)}},ru=(r,o,l)=>{r.loadNamespaces(o,Vg(r,l))},Dh=(r,o,l,i)=>{if(_n(l)&&(l=[l]),r.options.preload&&r.options.preload.indexOf(o)>-1)return ru(r,l,i);l.forEach(d=>{r.options.ns.indexOf(d)<0&&r.options.ns.push(d)}),r.loadLanguages(o,Vg(r,i))},L1=(r,o,l={})=>!o.languages||!o.languages.length?(su(o,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:o.languages}),!0):o.hasLoadedNamespace(r,{lng:l.lng,precheck:(i,d)=>{if(l.bindI18n&&l.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!d(i.isLanguageChangingTo,r))return!1}}),_n=r=>typeof r=="string",_1=r=>typeof r=="object"&&r!==null,B1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H1={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},P1=r=>H1[r],q1=r=>r.replace(B1,P1);let lu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:q1};const V1=(r={})=>{lu={...lu,...r}},G1=()=>lu;let Gg;const K1=r=>{Gg=r},$1=()=>Gg,F1={type:"3rdParty",init(r){V1(r.options.react),K1(r)}},Y1=b.createContext();class X1{constructor(){this.usedNamespaces={}}addUsedNamespaces(o){o.forEach(l=>{this.usedNamespaces[l]||(this.usedNamespaces[l]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Q1=(r,o)=>{const l=b.useRef();return b.useEffect(()=>{l.current=r},[r,o]),l.current},Kg=(r,o,l,i)=>r.getFixedT(o,l,i),Z1=(r,o,l,i)=>b.useCallback(Kg(r,o,l,i),[r,o,l,i]),Se=(r,o={})=>{var W,Z,te,ae;const{i18n:l}=o,{i18n:i,defaultNS:d}=b.useContext(Y1)||{},f=l||i||$1();if(f&&!f.reportNamespaces&&(f.reportNamespaces=new X1),!f){su(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const F=(ie,k)=>_n(k)?k:_1(k)&&_n(k.defaultValue)?k.defaultValue:Array.isArray(ie)?ie[ie.length-1]:ie,oe=[F,{},!1];return oe.t=F,oe.i18n={},oe.ready=!1,oe}(W=f.options.react)!=null&&W.wait&&su(f,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...G1(),...f.options.react,...o},{useSuspense:p,keyPrefix:g}=m;let h=d||((Z=f.options)==null?void 0:Z.defaultNS);h=_n(h)?[h]:h||["translation"],(ae=(te=f.reportNamespaces).addUsedNamespaces)==null||ae.call(te,h);const y=(f.isInitialized||f.initializedStoreOnce)&&h.every(F=>L1(F,f,m)),N=Z1(f,o.lng||null,m.nsMode==="fallback"?h:h[0],g),j=()=>N,A=()=>Kg(f,o.lng||null,m.nsMode==="fallback"?h:h[0],g),[D,O]=b.useState(j);let M=h.join();o.lng&&(M=`${o.lng}${M}`);const C=Q1(M),T=b.useRef(!0);b.useEffect(()=>{const{bindI18n:F,bindI18nStore:oe}=m;T.current=!0,!y&&!p&&(o.lng?Dh(f,o.lng,h,()=>{T.current&&O(A)}):ru(f,h,()=>{T.current&&O(A)})),y&&C&&C!==M&&T.current&&O(A);const ie=()=>{T.current&&O(A)};return F&&(f==null||f.on(F,ie)),oe&&(f==null||f.store.on(oe,ie)),()=>{T.current=!1,f&&F&&(F==null||F.split(" ").forEach(k=>f.off(k,ie))),oe&&f&&oe.split(" ").forEach(k=>f.store.off(k,ie))}},[f,M]),b.useEffect(()=>{T.current&&y&&O(j)},[f,g,y]);const R=[D,f,y];if(R.t=D,R.i18n=f,R.ready=y,y||!y&&!p)return R;throw new Promise(F=>{o.lng?Dh(f,o.lng,h,()=>F()):ru(f,h,()=>F())})},co={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},$g=b.createContext(void 0),I1=({children:r})=>{const{t:o}=Se(),{auth:l}=Us(),[i,d]=b.useState([]),[f,m]=b.useState(null),[p,g]=b.useState(0),[h,y]=b.useState(!0),[N,j]=b.useState(0),A=b.useRef(null),D=b.useRef(0),O=b.useRef(0),M=3e3,C=()=>{A.current&&(clearInterval(A.current),A.current=null)},T=b.useCallback(ie=>{const k=(ie==null?void 0:ie.immediate)??!0;C();const E=async()=>{try{console.log("[ServerContext] Fetching servers from API...");const _=await Xe("/servers");O.current=Date.now(),_&&_.success&&Array.isArray(_.data)?d(_.data):_&&Array.isArray(_)?d(_):(console.error("Invalid server data format:",_),d([])),m(null)}catch(_){console.error("Error fetching servers during normal polling:",_),navigator.onLine?_ instanceof TypeError&&(_.message.includes("NetworkError")||_.message.includes("Failed to fetch"))?m(o("errors.serverConnection")):m(o("errors.serverFetch")):m(o("errors.network"))}};k&&E(),A.current=setInterval(E,co.normal.pollingInterval)},[o]);b.useEffect(()=>{l.isAuthenticated?(console.log("[ServerContext] User authenticated, triggering refresh"),g(ie=>ie+1)):(console.log("[ServerContext] User not authenticated, clearing data and stopping polling"),C(),d([]),y(!1),m(null))},[l.isAuthenticated]),b.useEffect(()=>{if(!l.isAuthenticated){console.log("[ServerContext] User not authenticated, skipping polling setup");return}p>0&&(D.current=0,j(0));const ie=async()=>{try{console.log("[ServerContext] Initial fetch - attempt",D.current+1);const k=await Xe("/servers");return O.current=Date.now(),k&&k.success&&Array.isArray(k.data)?(d(k.data),y(!1),T({immediate:!1}),!0):k&&Array.isArray(k)?(d(k),y(!1),T({immediate:!1}),!0):(console.error("Invalid server data format:",k),d([]),y(!1),T({immediate:!1}),!0)}catch(k){return D.current+=1,console.error(`Initial loading attempt ${D.current} failed:`,k),j(D.current),navigator.onLine?m(o("errors.initialStartup")):m(o("errors.network")),D.current>=co.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),y(!1),C(),T()),!1}};return h?(C(),ie(),A.current=setInterval(ie,co.startup.pollingInterval),console.log(`Started initial polling with interval: ${co.startup.pollingInterval}ms`)):T(),()=>{C()}},[p,o,h,T]);const R=b.useCallback(()=>{C(),h&&(y(!0),D.current=0,j(0)),g(ie=>ie+1)},[h]),W=b.useCallback(()=>{const k=Date.now()-O.current;console.log("[ServerContext] refreshIfNeeded called, time since last fetch:",k,"ms"),k>=M?(console.log("[ServerContext] Triggering refresh (exceeded MIN_REFRESH_INTERVAL:",M,"ms)"),R()):console.log("[ServerContext] Skipping refresh (MIN_REFRESH_INTERVAL:",M,"ms, time since last:",k,"ms)")},[R]),Z=b.useCallback(()=>{g(ie=>ie+1)},[]),te=b.useCallback(async ie=>{try{const k=await Xe("/settings");if(k&&k.success&&k.data&&k.data.mcpServers&&k.data.mcpServers[ie.name]){const E=k.data.mcpServers[ie.name];return{name:ie.name,status:ie.status,tools:ie.tools||[],config:E}}else return console.error("Failed to get server config from settings:",k),m(o("server.invalidConfig",{serverName:ie.name})),null}catch(k){return console.error("Error fetching server settings:",k),m(k instanceof Error?k.message:String(k)),null}},[o]),ae=b.useCallback(async ie=>{try{const k=await vo(`/servers/${ie}`);return!k||!k.success?(m((k==null?void 0:k.message)||o("server.deleteError",{serverName:ie})),!1):(g(E=>E+1),!0)}catch(k){return m(o("errors.general")+": "+(k instanceof Error?k.message:String(k))),!1}},[o]),F=b.useCallback(async(ie,k)=>{try{const E=await kt(`/servers/${ie.name}/toggle`,{enabled:k});return!E||!E.success?(console.error("Failed to toggle server:",E),m((E==null?void 0:E.message)||o("server.toggleError",{serverName:ie.name})),!1):(g(_=>_+1),!0)}catch(E){return console.error("Error toggling server:",E),m(E instanceof Error?E.message:String(E)),!1}},[o]),oe={servers:i,error:f,setError:m,isLoading:h,fetchAttempts:N,triggerRefresh:R,refreshIfNeeded:W,handleServerAdd:Z,handleServerEdit:te,handleServerRemove:ae,handleServerToggle:F};return n.jsx($g.Provider,{value:oe,children:r})},J1=()=>{const r=b.useContext($g);if(r===void 0)throw new Error("useServerContext must be used within a ServerProvider");return r},Fg=()=>{const{t:r}=Se(),{theme:o,setTheme:l}=z1(),i=()=>{l(o==="light"?"dark":"light")};return n.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:r(o==="light"?"theme.dark":"theme.light"),"aria-label":r(o==="light"?"theme.dark":"theme.light"),children:o==="light"?n.jsx(Db,{className:"h-5 w-5"}):n.jsx(Vb,{className:"h-5 w-5"})})},W1=r=>{const{t:o}=Se();return n.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,...r,children:[n.jsx("title",{children:o("common.language")}),n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2 12h20"}),n.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"})]})},Yg=()=>{const{i18n:r}=Se(),[o,l]=b.useState(!1),[i,d]=b.useState(r.language),f=[{code:"en",label:"English"},{code:"zh",label:"中文"}];b.useEffect(()=>{d(r.language)},[r.language]),b.useEffect(()=>{const g=h=>{h.target.closest(".language-dropdown")||l(!1)};return o&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[o]);const m=g=>{localStorage.setItem("i18nextLng",g),l(!1),window.location.reload()},p=()=>{l(!o)};return n.jsxs("div",{className:"relative language-dropdown",children:[n.jsx("button",{onClick:p,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none","aria-label":"Language Switcher",children:n.jsx(W1,{className:"h-5 w-5"})}),o&&n.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:n.jsx("div",{children:f.map(g=>n.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))})})]})},ev=r=>n.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...r,children:[n.jsx("title",{children:"GitHub"}),n.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"})]}),tv=({onToggleSidebar:r})=>{const{t:o}=Se();return n.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-10",children:n.jsxs("div",{className:"flex justify-between items-center px-3 py-3",children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx("button",{onClick:r,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":o("app.toggleSidebar"),children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),n.jsx("h1",{className:"ml-4 text-xl font-bold text-gray-900 dark:text-white",children:o("app.title")})]}),n.jsxs("div",{className:"flex items-center space-x-1",children:[n.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 mr-2",children:"v0.9.7"}),n.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:n.jsx(ev,{className:"h-5 w-5"})}),n.jsx(Fg,{}),n.jsx(Yg,{})]})]})})},uo=({permissions:r,fallback:o=null,children:l})=>Xg(r)?n.jsx(n.Fragment,{children:l}):n.jsx(n.Fragment,{children:o}),Xg=r=>{const{auth:o}=Us();if(!o.isAuthenticated||!o.user)return!1;const l=o.user.permissions||[];return r==="x"&&!l.includes("x")?!1:l.includes("*")||o.user.isAdmin?!0:(Array.isArray(r)?r:[r]).some(d=>l.includes(d))},av="https://registry.npmjs.org",nv="@samanhappy/mcphub",Qg=async()=>{try{const r=await fetch(`${av}/${nv}/latest`);if(!r.ok)throw new Error(`Failed to fetch latest version: ${r.status}`);return(await r.json()).version||null}catch(r){return console.error("Error checking for latest version:",r),null}},Zg=(r,o)=>{if(r==="dev")return-1;const l=r.split(".").map(Number),i=o.split(".").map(Number);for(let d=0;d<3;d++){const f=l[d]||0,m=i[d]||0;if(f>m)return-1;if(f<m)return 1}return 0},sv=({isOpen:r,onClose:o,version:l})=>{const{t:i}=Se(),[d,f]=b.useState(!1),[m,p]=b.useState(""),[g,h]=b.useState(!1),y=async()=>{h(!0);try{const N=await Qg();N&&(p(N),f(Zg(l,N)>0))}catch(N){console.error("Failed to check for updates:",N)}finally{h(!1)}};return b.useEffect(()=>{r&&y()},[r,l]),r?n.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:n.jsxs("div",{className:"p-6 relative",children:[n.jsx("button",{onClick:o,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:n.jsx(Pr,{className:"h-5 w-5"})}),n.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:i("about.title")}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[i("about.currentVersion"),":"]}),n.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:l})]}),d&&m&&n.jsx("div",{className:"bg-blue-50 dark:bg-blue-900 p-3 rounded",children:n.jsxs("div",{className:"flex items-start",children:[n.jsx("div",{className:"flex-shrink-0",children:n.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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"})})}),n.jsxs("div",{className:"ml-3 flex-1 text-sm text-blue-700 dark:text-blue-300",children:[n.jsx("p",{children:i("about.newVersionAvailable",{version:m})}),n.jsx("p",{className:"mt-1",children:n.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")})})]})]})}),n.jsxs("button",{onClick:y,disabled:g,className:`mt-4 inline-flex items-center px-4 py-2 border border-gray-200 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium btn-secondary
|
|
191
|
+
${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:[n.jsx(_b,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),i(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},rv=({open:r,onOpenChange:o})=>{const{i18n:l,t:i}=Se();return r?n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:n.jsxs("div",{className:"p-6 relative",children:[n.jsx("button",{onClick:()=>o(!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:n.jsx(Pr,{className:"h-5 w-5"})}),n.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:i("sponsor.title")}),n.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:l.language==="zh"?n.jsx("img",{src:"./assets/reward.png",alt:i("sponsor.rewardAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}):n.jsxs("div",{className:"text-center",children:[n.jsx("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:i("sponsor.supportMessage")}),n.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},lv=({open:r,onOpenChange:o})=>{const{t:l}=Se();return r?n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:n.jsxs("div",{className:"p-6 relative",children:[n.jsx("button",{onClick:()=>o(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":l("common.close"),children:n.jsx(Pr,{className:"h-5 w-5"})}),n.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:l("wechat.title")}),n.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[n.jsx("img",{src:"./assets/wexin.png",alt:l("wechat.qrCodeAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}),n.jsx("p",{className:"mt-4 text-center text-gray-700 dark:text-gray-300",children:l("wechat.scanMessage")})]})]})})}):null},ov=r=>n.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...r,children:[n.jsx("title",{children:"WeChat"}),n.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"})]}),iv=r=>n.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...r,children:[n.jsx("title",{children:"Discord"}),n.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"})]}),cv=r=>n.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...r,children:[n.jsx("title",{children:"Sponsor"}),n.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"})]}),uv=({collapsed:r,version:o})=>{var ae;const{t:l,i18n:i}=Se(),d=Ga(),{auth:f,logout:m}=Us(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[N,j]=b.useState(!1),[A,D]=b.useState(!1),[O,M]=b.useState(!1),C=b.useRef(null);b.useEffect(()=>{(async()=>{try{const oe=await Qg();oe&&y(Zg(o,oe)>0)}catch(oe){console.error("Error checking for new version:",oe)}})()},[o]),b.useEffect(()=>{const F=oe=>{C.current&&!C.current.contains(oe.target)&&g(!1)};return document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[]);const T=()=>{d("/settings"),g(!1)},R=()=>{m(),d("/login")},W=()=>{j(!0),g(!1)},Z=()=>{D(!0),g(!1)},te=()=>{M(!0),g(!1)};return n.jsxs("div",{ref:C,className:"relative",children:[n.jsxs("button",{onClick:()=>g(!p),className:`flex ${r?"justify-center":"items-center"} w-full p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors rounded-md ${p?"bg-gray-100 dark:bg-gray-700":""}`,children:[n.jsxs("div",{className:"flex-shrink-0 relative",children:[n.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:n.jsx(Fb,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),h&&n.jsx("span",{className:"absolute -top-1 -right-1 block w-2 h-2 bg-red-500 rounded-full"})]}),!r&&n.jsx("div",{className:"ml-3 flex flex-col items-start",children:n.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:((ae=f.user)==null?void 0:ae.username)||l("auth.user")})})]}),p&&n.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:[n.jsxs("button",{onClick:Z,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[n.jsx(cv,{className:"h-4 w-4 mr-2"}),l("sponsor.label")]}),i.language==="zh"?n.jsxs("button",{onClick:te,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:[n.jsx(ov,{className:"h-4 w-4 mr-2"}),l("wechat.label")]}):n.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:[n.jsx(iv,{className:"h-4 w-4 mr-2"}),l("discord.label")]}),n.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:[n.jsx(Hb,{className:"h-4 w-4 mr-2"}),l("nav.settings")]}),n.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 relative",children:[n.jsx(kb,{className:"h-4 w-4 mr-2"}),l("about.title"),h&&n.jsx("span",{className:"absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"})]}),n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),n.jsxs("button",{onClick:R,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:[n.jsx(Ob,{className:"h-4 w-4 mr-2"}),l("app.logout")]})]}),n.jsx(sv,{isOpen:N,onClose:()=>j(!1),version:o}),n.jsx(rv,{open:A,onOpenChange:D}),n.jsx(lv,{open:O,onOpenChange:M})]})},dv=({collapsed:r})=>{var f;const{t:o}=Se(),{auth:l}=Us(),i="0.9.7",d=[{path:"/",label:o("nav.dashboard"),icon:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[n.jsx("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),n.jsx("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})]})},{path:"/servers",label:o("nav.servers"),icon:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:n.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:o("nav.groups"),icon:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{d:"M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"})})},...(f=l.user)!=null&&f.isAdmin&&Xg("x")?[{path:"/users",label:o("nav.users"),icon:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:n.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:o("nav.market"),icon:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:n.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:o("nav.logs"),icon:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:n.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 n.jsxs("aside",{className:`bg-white dark:bg-gray-800 shadow-sm transition-all duration-300 ease-in-out flex flex-col h-full relative ${r?"w-16":"w-64"}`,children:[n.jsx("div",{className:"overflow-y-auto flex-grow",children:n.jsx("nav",{className:"p-3 space-y-1",children:d.map(m=>n.jsxs(vg,{to:m.path,className:({isActive:p})=>`flex items-center px-2.5 py-2 rounded-lg transition-colors duration-200
|
|
192
|
+
${p?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,end:m.path==="/",children:[n.jsx("span",{className:"flex-shrink-0",children:m.icon}),!r&&n.jsx("span",{className:"ml-3",children:m.label})]},m.path))})}),n.jsx("div",{className:"p-3 bg-white dark:bg-gray-800",children:n.jsx(uv,{collapsed:r,version:i})})]})},fv=({children:r})=>n.jsx("main",{className:"flex-1 overflow-auto p-6 bg-gray-100 dark:bg-gray-900",children:n.jsx("div",{className:"container mx-auto",children:r})}),mv=()=>{const[r,o]=Ms.useState(!1),l=()=>{o(!r)};return n.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[n.jsx(tv,{onToggleSidebar:l}),n.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[n.jsx(dv,{collapsed:r}),n.jsx(fv,{children:n.jsx(hg,{})})]})]})},hv=({redirectPath:r="/login"})=>{const{t:o}=Se(),{auth:l}=Us();return l.loading?n.jsx("div",{className:"flex items-center justify-center h-screen",children:o("app.loading")}):l.isAuthenticated?n.jsx(hg,{}):n.jsx(bo,{to:r,replace:!0})},gv=()=>{const{t:r}=Se(),[o,l]=b.useState(""),[i,d]=b.useState(""),[f,m]=b.useState(null),[p,g]=b.useState(!1),{login:h}=Us(),y=Ga(),N=async j=>{j.preventDefault(),m(null),g(!0);try{if(!o||!i){m(r("auth.emptyFields")),g(!1);return}await h(o,i)?y("/"):m(r("auth.loginFailed"))}catch{m(r("auth.loginError"))}finally{g(!1)}};return n.jsxs("div",{className:"relative min-h-screen w-full overflow-hidden bg-gray-50 dark:bg-gray-950",children:[n.jsxs("div",{className:"absolute top-4 right-4 z-20 flex items-center gap-2",children:[n.jsx(Fg,{}),n.jsx(Yg,{})]}),n.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)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0 -z-10",children:n.jsxs("svg",{className:"h-full w-full opacity-[0.08] dark:opacity-[0.12]",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("defs",{children:n.jsx("pattern",{id:"grid",width:"32",height:"32",patternUnits:"userSpaceOnUse",children:n.jsx("path",{d:"M 32 0 L 0 0 0 32",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})})}),n.jsx("rect",{width:"100%",height:"100%",fill:"url(#grid)",className:"text-gray-400 dark:text-gray-300"})]})}),n.jsx("div",{className:"relative mx-auto flex min-h-screen w-full max-w-md items-center justify-center px-6 py-16",children:n.jsxs("div",{className:"w-full space-y-6",children:[n.jsx("div",{className:"flex justify-center w-full",children:n.jsx("h1",{className:"text-3xl font-extrabold leading-tight tracking-tight text-gray-900 dark:text-white sm:text-4xl whitespace-nowrap",children:n.jsx("span",{className:"bg-gradient-to-r from-indigo-400 via-cyan-400 to-emerald-400 bg-clip-text text-transparent",children:r("auth.slogan")})})}),n.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:[n.jsx("div",{className:"absolute -top-24 right-12 h-40 w-40 -translate-y-6 rounded-full bg-indigo-500/30 blur-3xl"}),n.jsx("div",{className:"absolute -bottom-24 -left-12 h-40 w-40 translate-y-6 rounded-full bg-cyan-500/20 blur-3xl"}),n.jsxs("form",{className:"mt-4 space-y-4",onSubmit:N,children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{htmlFor:"username",className:"sr-only",children:r("auth.username")}),n.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:r("auth.username"),value:o,onChange:j=>l(j.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{htmlFor:"password",className:"sr-only",children:r("auth.password")}),n.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:r("auth.password"),value:i,onChange:j=>d(j.target.value)})]})]}),f&&n.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:f}),n.jsx("div",{children:n.jsx("button",{type:"submit",disabled:p,className:"login-button btn-primary group relative flex w-full items-center justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white transition-all hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-70",children:r(p?"auth.loggingIn":"auth.login")})})]})]})]})})]})},Yr=r=>{const o=J1(),{refreshIfNeeded:l}=o;return b.useEffect(()=>{r!=null&&r.refreshOnMount&&l()},[r==null?void 0:r.refreshOnMount,l]),o},pv=()=>{const{t:r}=Se(),{servers:o,error:l,setError:i,isLoading:d}=Yr({refreshOnMount:!0}),f={total:o.length,online:o.filter(p=>p.status==="connected").length,offline:o.filter(p=>p.status==="disconnected").length,connecting:o.filter(p=>p.status==="connecting").length},m={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:r("pages.dashboard.title")}),l&&n.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-status-red text-lg font-medium",children:r("app.error")}),n.jsx("p",{className:"text-gray-600 mt-1",children:l})]}),n.jsx("button",{onClick:()=>i(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":r("app.closeButton"),children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:n.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&&n.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:n.jsxs("div",{className:"flex flex-col items-center",children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.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"})]}),n.jsx("p",{className:"text-gray-600",children:r("app.loading")})]})}),!d&&n.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4",children:[n.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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"})})}),n.jsxs("div",{className:"ml-4",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:r("pages.dashboard.totalServers")}),n.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.total})]})]})}),n.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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"})})}),n.jsxs("div",{className:"ml-4",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:r("pages.dashboard.onlineServers")}),n.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.online})]})]})}),n.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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"})})}),n.jsxs("div",{className:"ml-4",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:r("pages.dashboard.offlineServers")}),n.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.offline})]})]})}),n.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),n.jsxs("div",{className:"ml-4",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:r("pages.dashboard.connectingServers")}),n.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.connecting})]})]})})]}),o.length>0&&!d&&n.jsxs("div",{className:"mt-8",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:r("pages.dashboard.recentServers")}),n.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:n.jsxs("table",{className:"min-w-full",children:[n.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:n.jsxs("tr",{children:[n.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("server.name")}),n.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("server.status")}),n.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("server.tools")}),n.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("server.prompts")}),n.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("server.enabled")})]})}),n.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:o.slice(0,5).map((p,g)=>{var h,y;return n.jsxs("tr",{children:[n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:p.name}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:n.jsx("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${p.status==="connected"?"status-badge-online":p.status==="disconnected"?"status-badge-offline":"status-badge-connecting"}`,children:r(m[p.status]||p.status)})}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((h=p.tools)==null?void 0:h.length)||0}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((y=p.prompts)==null?void 0:y.length)||0}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:p.enabled!==!1?n.jsx("span",{className:"text-green-600",children:"✓"}):n.jsx("span",{className:"text-status-red",children:"✗"})})]},g)})})]})})]})]})},xv="modulepreload",yv=function(r,o){return new URL(r,o).href},Uh={},Lh=function(o,l,i){let d=Promise.resolve();if(l&&l.length>0){let m=function(y){return Promise.all(y.map(N=>Promise.resolve(N).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),h=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));d=m(l.map(y=>{if(y=yv(y,i),y in Uh)return;Uh[y]=!0;const N=y.endsWith(".css"),j=N?'[rel="stylesheet"]':"";if(!!i)for(let O=p.length-1;O>=0;O--){const M=p[O];if(M.href===y&&(!N||M.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${j}`))return;const D=document.createElement("link");if(D.rel=N?"stylesheet":xv,N||(D.as="script"),D.crossOrigin="",D.href=y,h&&D.setAttribute("nonce",h),document.head.appendChild(D),N)return new Promise((O,M)=>{D.addEventListener("load",O),D.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return d.then(m=>{for(const p of m||[])p.status==="rejected"&&f(p.reason);return o().catch(f)})},bv={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 fo({children:r,variant:o="default",className:l,onClick:i}){return n.jsx("span",{className:Pa("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",bv[o],i?"cursor-pointer":"",l),onClick:i,children:r})}const vv=({status:r})=>{const{t:o}=Se(),l={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline"},i={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return n.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${l[r]}`,children:o(i[r]||r)})},Ig=async(r,o)=>{try{const l=o?`/tools/${o}/${r.toolName}`:"/tools/call",i=await kt(l,r.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(l){return console.error("Error calling tool:",l),{success:!1,error:l instanceof Error?l.message:"Unknown error occurred"}}},wv=async(r,o,l)=>{try{const i=await kt(`/servers/${r}/tools/${o}/toggle`,{enabled:l},{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"}}},Jg=async(r,o,l)=>{try{const i=await Wt(`/servers/${r}/tools/${o}/description`,{description:l},{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"}}},jv=Object.freeze(Object.defineProperty({__proto__:null,callTool:Ig,toggleTool:wv,updateToolDescription:Jg},Symbol.toStringTag,{value:"Module"})),Ln=({checked:r,onCheckedChange:o,disabled:l=!1})=>n.jsx("button",{type:"button",role:"switch","aria-checked":r,disabled:l,className:Pa("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",r?"bg-blue-200":"bg-gray-100",l?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!l&&o(!r),children:n.jsx("span",{className:Pa("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",r?"translate-x-6":"translate-x-1")})}),Wg=({schema:r,onSubmit:o,onCancel:l,loading:i=!1,storageKey:d,title:f})=>{const{t:m}=Se(),[p,g]=b.useState({}),[h,y]=b.useState({}),[N,j]=b.useState(!1),[A,D]=b.useState(""),[O,M]=b.useState(""),C=b.useMemo(()=>(E=>{const _=q=>{if(typeof q=="object"&&q!==null){const G=q;return{type:G.type||"string",description:G.description,enum:G.enum,default:G.default,properties:G.properties?Object.fromEntries(Object.entries(G.properties).map(([S,B])=>[S,_(B)])):void 0,required:G.required,items:G.items?_(G.items):void 0}}return{type:"string"}};return{type:E.type,properties:E.properties?Object.fromEntries(Object.entries(E.properties).map(([q,G])=>[q,_(G)])):void 0,required:E.required}})(r),[r]);b.useEffect(()=>{const k=(_,q="")=>{const G={};return _.type==="object"&&_.properties&&Object.entries(_.properties).forEach(([S,B])=>{const $=q?`${q}.${S}`:S;B.default!==void 0?G[S]=B.default:B.type==="string"?G[S]="":B.type==="number"||B.type==="integer"?G[S]=0:B.type==="boolean"?G[S]=!1:B.type==="array"?G[S]=[]:B.type==="object"&&(B.properties?G[S]=k(B,$):G[S]={})}),G};let E=k(C);if(d)try{const _=localStorage.getItem(d);if(_){const q=JSON.parse(_);E={...E,...q}}}catch(_){console.warn("Failed to load saved form data:",_)}g(E)},[C,d]),b.useEffect(()=>{N&&Object.keys(p).length>0&&(D(JSON.stringify(p,null,2)),M(""))},[N,p]);const T=k=>{D(k),M("");try{const E=JSON.parse(k);if(g(E),d)try{localStorage.setItem(d,JSON.stringify(E))}catch(_){console.warn("Failed to save form data to localStorage:",_)}}catch{M(m("tool.invalidJsonFormat"))}},R=()=>{D(JSON.stringify(p,null,2)),M(""),j(!0)},W=()=>{if(A.trim())try{const k=JSON.parse(A);g(k),M(""),j(!1)}catch{M(m("tool.fixJsonBeforeSwitching"));return}else j(!1)},Z=(k,E)=>{g(_=>{const q={..._},G=k.split(".");let S=q;for(let B=0;B<G.length-1;B++)S[G[B]]||(S[G[B]]={}),S=S[G[B]];if(S[G[G.length-1]]=E,d)try{localStorage.setItem(d,JSON.stringify(q))}catch(B){console.warn("Failed to save form data to localStorage:",B)}return q}),h[k]&&y(_=>{const q={..._};return delete q[k],q})},te=()=>{const k={},E=(_,q,G="")=>{_.type==="object"&&_.properties&&Object.entries(_.properties).forEach(([S,B])=>{var w;const $=G?`${G}.${S}`:S,se=F(q,$);if((w=_.required)!=null&&w.includes(S)&&(se==null||se==="")){k[$]=`${S} is required`;return}se!=null&&se!==""&&(B.type==="string"&&typeof se!="string"?k[$]=`${S} must be a string`:B.type==="number"&&typeof se!="number"?k[$]=`${S} must be a number`:B.type==="integer"&&(!Number.isInteger(se)||typeof se!="number")?k[$]=`${S} must be an integer`:B.type==="boolean"&&typeof se!="boolean"?k[$]=`${S} must be a boolean`:B.type==="array"&&Array.isArray(se)?B.items&&se.forEach((I,le)=>{var H;((H=B.items)==null?void 0:H.type)==="object"&&B.items.properties&&E(B.items,I,`${$}.${le}`)}):B.type==="object"&&typeof se=="object"&&E(B,se,$))})};return E(C,p),y(k),Object.keys(k).length===0},ae=k=>{k.preventDefault(),te()&&o(p)},F=(k,E)=>E.split(".").reduce((_,q)=>_==null?void 0:_[q],k),oe=(k,E,_,q)=>{const G=_==null?void 0:_[k];return E.type==="string"?E.enum?n.jsxs("select",{value:G||"",onChange:S=>q(S.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:[n.jsx("option",{value:"",children:m("tool.selectOption")}),E.enum.map((S,B)=>n.jsx("option",{value:S,children:S},B))]}):n.jsx("input",{type:"text",value:G||"",onChange:S=>q(S.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:E.description||m("tool.enterKey",{key:k})}):E.type==="number"||E.type==="integer"?n.jsx("input",{type:"number",step:E.type==="integer"?"1":"any",value:G??"",onChange:S=>{const B=S.target.value===""?"":E.type==="integer"?parseInt(S.target.value):parseFloat(S.target.value);q(B)},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"}):E.type==="boolean"?n.jsx("input",{type:"checkbox",checked:G||!1,onChange:S=>q(S.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):n.jsx("input",{type:"text",value:G||"",onChange:S=>q(S.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:E.description||m("tool.enterKey",{key:k})})},ie=(k,E,_="")=>{var B,$,se,w,I,le,H,K,me,J,X,de,be,je;const q=_?`${_}.${k}`:k,G=F(p,q),S=h[q];if(E.type==="array"){const xe=F(p,q)||[];return n.jsxs("div",{className:"mb-6",children:[n.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[k,(_?($=(B=F(C,_))==null?void 0:B.required)==null?void 0:$.includes(k):(se=C.required)==null?void 0:se.includes(k))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),E.description&&n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:E.description}),n.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[xe.map((Te,Be)=>{var rt,wa,ca;return n.jsxs("div",{className:"mb-3 p-3 bg-white border rounded-md",children:[n.jsxs("div",{className:"flex justify-between items-center mb-2",children:[n.jsx("span",{className:"text-sm font-medium text-gray-600",children:m("tool.item",{index:Be+1})}),n.jsx("button",{type:"button",onClick:()=>{const Ue=[...xe];Ue.splice(Be,1),Z(q,Ue)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((rt=E.items)==null?void 0:rt.type)==="string"&&E.items.enum?n.jsxs("select",{value:Te||"",onChange:Ue=>{const bt=[...xe];bt[Be]=Ue.target.value,Z(q,bt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[n.jsx("option",{value:"",children:m("tool.selectOption")}),E.items.enum.map((Ue,bt)=>n.jsx("option",{value:Ue,children:Ue},bt))]}):((wa=E.items)==null?void 0:wa.type)==="object"&&E.items.properties?n.jsx("div",{className:"space-y-3",children:Object.entries(E.items.properties).map(([Ue,bt])=>{var ua,da;return n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Ue,((da=(ua=E.items)==null?void 0:ua.required)==null?void 0:da.includes(Ue))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),oe(Ue,bt,Te,Gt=>{const fa=[...xe];fa[Be]={...fa[Be],[Ue]:Gt},Z(q,fa)})]},Ue)})}):n.jsx("input",{type:"text",value:Te||"",onChange:Ue=>{const bt=[...xe];bt[Be]=Ue.target.value,Z(q,bt)},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:((ca=E.items)==null?void 0:ca.type)||"value"})})]},Be)}),n.jsx("button",{type:"button",onClick:()=>{var Be;const Te=((Be=E.items)==null?void 0:Be.type)==="object"?{}:"";Z(q,[...xe,Te])},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:k})})]}),S&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:S})]},q)}return E.type==="object"?E.properties?n.jsxs("div",{className:"mb-6",children:[n.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[k,(_?(I=(w=F(C,_))==null?void 0:w.required)==null?void 0:I.includes(k):(le=C.required)==null?void 0:le.includes(k))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),E.description&&n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:E.description}),n.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(E.properties).map(([xe,Te])=>ie(xe,Te,q))}),S&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:S})]},q):n.jsxs("div",{className:"mb-4",children:[n.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[k,(_?(K=(H=F(C,_))==null?void 0:H.required)==null?void 0:K.includes(k):(me=C.required)==null?void 0:me.includes(k))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"}),n.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),E.description&&n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:E.description}),n.jsx("textarea",{value:typeof G=="object"?JSON.stringify(G,null,2):G||"{}",onChange:xe=>{try{const Te=JSON.parse(xe.target.value);Z(q,Te)}catch{Z(q,xe.target.value)}},placeholder:`{
|
|
193
|
+
"key": "value"
|
|
194
|
+
}`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${S?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),S&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:S})]},q):E.type==="string"?E.enum?n.jsxs("div",{className:"mb-4",children:[n.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[k,(_?!1:(J=C.required)==null?void 0:J.includes(k))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),E.description&&n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:E.description}),n.jsxs("select",{value:G||"",onChange:xe=>Z(q,xe.target.value),className:`w-full border rounded-md px-3 py-2 ${S?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[n.jsx("option",{value:"",children:m("tool.selectOption")}),E.enum.map((xe,Te)=>n.jsx("option",{value:xe,children:xe},Te))]}),S&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:S})]},q):n.jsxs("div",{className:"mb-4",children:[n.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[k,(_?!1:(X=C.required)==null?void 0:X.includes(k))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),E.description&&n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:E.description}),n.jsx("input",{type:"text",value:G||"",onChange:xe=>Z(q,xe.target.value),className:`w-full border rounded-md px-3 py-2 ${S?"border-red":"border-gray-200"} focus:outline-none form-input`}),S&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:S})]},q):E.type==="number"||E.type==="integer"?n.jsxs("div",{className:"mb-4",children:[n.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[k,(_?!1:(de=C.required)==null?void 0:de.includes(k))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),E.description&&n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:E.description}),n.jsx("input",{type:"number",step:E.type==="integer"?"1":"any",value:G??"",onChange:xe=>{const Te=xe.target.value===""?"":E.type==="integer"?parseInt(xe.target.value):parseFloat(xe.target.value);Z(q,Te)},className:`w-full border rounded-md px-3 py-2 form-input ${S?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),S&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:S})]},q):E.type==="boolean"?n.jsxs("div",{className:"mb-4",children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx("input",{type:"checkbox",checked:G||!1,onChange:xe=>Z(q,xe.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),n.jsxs("label",{className:"ml-2 block text-sm text-gray-700",children:[k,(_?!1:(be=C.required)==null?void 0:be.includes(k))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),E.description&&n.jsx("p",{className:"text-xs text-gray-500 mt-1",children:E.description}),S&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:S})]},q):n.jsxs("div",{className:"mb-4",children:[n.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[k,(_?!1:(je=C.required)==null?void 0:je.includes(k))&&n.jsx("span",{className:"text-status-red ml-1",children:"*"}),n.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",E.type,")"]})]}),E.description&&n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:E.description}),n.jsx("input",{type:"text",value:G||"",onChange:xe=>Z(q,xe.target.value),placeholder:m("tool.enterValue",{type:E.type}),className:`w-full border rounded-md px-3 py-2 ${S?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),S&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:S})]},q)};return C.properties?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center pb-3",children:[n.jsx("h6",{className:"text-md font-medium text-gray-900",children:f}),n.jsxs("div",{className:"flex space-x-2",children:[n.jsx("button",{type:"button",onClick:W,className:`px-3 py-1 text-sm rounded-md transition-colors ${N?"text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary":"bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary"}`,children:m("tool.formMode")}),n.jsx("button",{type:"button",onClick:R,className:`px-3 py-1 text-sm rounded-md transition-colors ${N?"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary":"text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary"}`,children:m("tool.jsonMode")})]})]}),N?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("tool.jsonConfiguration")}),n.jsx("textarea",{value:A,onChange:k=>T(k.target.value),placeholder:`{
|
|
195
|
+
"key": "value"
|
|
196
|
+
}`,className:`w-full h-64 border rounded-md px-3 py-2 font-mono text-sm resize-y form-input ${O?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),O&&n.jsx("p",{className:"text-status-red text-xs mt-1",children:O})]}),n.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[n.jsx("button",{type:"button",onClick:l,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),n.jsx("button",{onClick:()=>{try{const k=JSON.parse(A);o(k)}catch{M(m("tool.invalidJsonFormat"))}},disabled:i||!!O,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")})]})]}):n.jsxs("form",{onSubmit:ae,className:"space-y-4",children:[Object.entries(C.properties||{}).map(([k,E])=>ie(k,E)),n.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[n.jsx("button",{type:"button",onClick:l,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),n.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")})]})]})]}):n.jsxs("div",{className:"p-4 bg-gray-50 rounded-md",children:[n.jsx("p",{className:"text-sm text-gray-600",children:m("tool.noParameters")}),n.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[n.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-sm text-gray-600 bg-gray-100 rounded-md hover:bg-gray-200",children:m("tool.cancel")}),n.jsx("button",{onClick:()=>o({}),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")})]})]})},Nv=({result:r,onClose:o})=>{const{t:l}=Se(),i=r.content,d=m=>Array.isArray(m)?m.map((p,g)=>n.jsx("div",{className:"mb-3 last:mb-0",children:f(p)},g)):f(m),f=m=>{if(typeof m=="string")return n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.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 n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m.text})});if(m.type==="image"&&m.data)return n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.jsx("img",{src:`data:${m.mimeType||"image/png"};base64,${m.data}`,alt:l("tool.toolResult"),className:"max-w-full h-auto rounded-md"})});try{const p=typeof m=="string"?JSON.parse(m):m;return n.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[n.jsx("div",{className:"text-xs text-gray-500 mb-2",children:l("tool.jsonResponse")}),n.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(p,null,2)})]})}catch{return n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})}}return n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})};return n.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[n.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center space-x-2",children:[r.success?n.jsx(Cg,{size:20,className:"text-status-green"}):n.jsx(Eg,{size:20,className:"text-status-red"}),n.jsx("div",{children:n.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[l("tool.execution")," ",r.success?l("tool.successful"):l("tool.failed")]})})]}),n.jsx("button",{onClick:o,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),n.jsx("div",{className:"p-4",children:r.success?n.jsx("div",{children:r.content&&r.content.length>0?n.jsxs("div",{children:[n.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.result")}),d(r.content)]}):n.jsx("div",{className:"text-sm text-gray-500 italic",children:l("tool.noContent")})}):n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[n.jsx(ju,{size:16,className:"text-red-500"}),n.jsx("span",{className:"text-sm font-medium text-red-700",children:l("tool.error")})]}),i&&i.length>0?n.jsxs("div",{children:[n.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.errorDetails")}),d(i)]}):n.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:n.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:r.error||r.message||l("tool.unknownError")})})]})})]})};function Sv(r){return r==null?!0:typeof r=="string"?r.trim()==="":Array.isArray(r)?r.length===0:typeof r=="object"?Object.keys(r).length===0:!1}const Cv=({tool:r,server:o,onToggle:l,onDescriptionUpdate:i})=>{const{t:d}=Se(),[f,m]=b.useState(!1),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[N,j]=b.useState(null),[A,D]=b.useState(!1),[O,M]=b.useState(r.description||""),C=b.useRef(null),T=b.useRef(null),[R,W]=b.useState(0);b.useEffect(()=>{A&&C.current&&(C.current.focus(),R>0&&(C.current.style.width=`${R+20}px`))},[A,R]),b.useEffect(()=>{!A&&T.current&&W(T.current.offsetWidth)},[A,O]);const Z=b.useCallback(()=>`mcphub_tool_form_${o?`${o}_`:""}${r.name}`,[r.name,o]),te=b.useCallback(()=>{localStorage.removeItem(Z())},[Z]),ae=G=>{l&&l(r.name,G)},F=()=>{D(!0)},oe=async()=>{try{const G=await Jg(o,r.name,O);G.success?(D(!1),i&&i(r.name,O)):(M(r.description||""),console.error("Failed to update tool description:",G.error))}catch(G){console.error("Error updating tool description:",G),M(r.description||""),D(!1)}},ie=G=>{M(G.target.value)},k=G=>{G.key==="Enter"?oe():G.key==="Escape"&&(M(r.description||""),D(!1))},E=async G=>{y(!0);try{G=Object.fromEntries(Object.entries(G).filter(([B,$])=>!Sv($)));const S=await Ig({toolName:r.name,arguments:G},o);j(S)}catch(S){j({success:!1,error:S instanceof Error?S.message:"Unknown error occurred"})}finally{y(!1)}},_=()=>{g(!1),te(),j(null)},q=()=>{j(null)};return n.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg p-4 mb-4",children:[n.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>m(!f),children:[n.jsx("div",{className:"flex-1",children:n.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[r.name.replace(o+"-",""),n.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:A?n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:C,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:O,onChange:ie,onKeyDown:k,onClick:G=>G.stopPropagation(),style:{minWidth:"100px",width:R>0?`${R+20}px`:"auto"}}),n.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:G=>{G.stopPropagation(),oe()},children:n.jsx($r,{size:16})})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{ref:T,children:O||d("tool.noDescription")}),n.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:G=>{G.stopPropagation(),F()},children:n.jsx(Nu,{size:14})})]})})]})}),n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx("div",{className:"flex items-center space-x-2",onClick:G=>G.stopPropagation(),children:n.jsx(Ln,{checked:r.enabled??!0,onCheckedChange:ae,disabled:h})}),n.jsxs("button",{onClick:G=>{G.stopPropagation(),m(!0),g(!0)},className:"flex items-center space-x-1 px-3 py-1 text-sm text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors btn-primary",disabled:h||!r.enabled,children:[h?n.jsx(kg,{size:14,className:"animate-spin"}):n.jsx(Tg,{size:14}),n.jsx("span",{children:d(h?"tool.running":"tool.run")})]}),n.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:f?n.jsx(Ao,{size:18}):n.jsx(wu,{size:18})})]})]}),f&&n.jsxs("div",{className:"mt-4 space-y-4",children:[!p&&n.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:d("tool.inputSchema")}),n.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(r.inputSchema,null,2)})]}),p&&n.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[n.jsx(Wg,{schema:r.inputSchema||{type:"object"},onSubmit:E,onCancel:_,loading:h,storageKey:Z(),title:d("tool.runToolWithName",{name:r.name.replace(o+"-","")})}),N&&n.jsx("div",{className:"mt-4",children:n.jsx(Nv,{result:N,onClose:q})})]})]})]})},ep=async(r,o)=>{try{const l=await kt(`/mcp/${o}/prompts/${encodeURIComponent(r.promptName)}`,{name:r.promptName,arguments:r.arguments});if(!l.success)throw new Error(`Failed to get prompt: ${l.message||"Unknown error"}`);return{success:!0,data:l.data}}catch(l){return console.error("Error getting prompt:",l),{success:!1,error:l instanceof Error?l.message:"Unknown error occurred"}}},Ev=async(r,o,l)=>{try{const i=await kt(`/servers/${r}/prompts/${o}/toggle`,{enabled:l});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"}}},kv=Object.freeze(Object.defineProperty({__proto__:null,getPrompt:ep,togglePrompt:Ev},Symbol.toStringTag,{value:"Module"})),_h=({result:r,onClose:o})=>{const{t:l}=Se(),i=d=>{if(typeof d=="string")return n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d})});if(typeof d=="object"&&d!==null){if(d.description||d.messages)return n.jsxs("div",{className:"space-y-4",children:[d.description&&n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:l("prompt.description")}),n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.jsx("p",{className:"text-sm text-gray-800",children:d.description})})]}),d.messages&&n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:l("prompt.messages")}),n.jsx("div",{className:"space-y-3",children:d.messages.map((f,m)=>n.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[n.jsx("div",{className:"flex items-center mb-2",children:n.jsxs("span",{className:"inline-block w-16 text-xs font-medium text-gray-500",children:[f.role,":"]})}),typeof f.content=="string"?n.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:f.content}):typeof f.content=="object"&&f.content.type==="text"?n.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:f.content.text}):n.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(f.content,null,2)})]},m))})]})]});try{const f=typeof d=="string"?JSON.parse(d):d;return n.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[n.jsx("div",{className:"text-xs text-gray-500 mb-2",children:l("prompt.jsonResponse")}),n.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(f,null,2)})]})}catch{return n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(d)})})}}return n.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:n.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(d)})})};return n.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[n.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center space-x-2",children:[r.success?n.jsx(Cg,{size:20,className:"text-status-green"}):n.jsx(Eg,{size:20,className:"text-status-red"}),n.jsx("div",{children:n.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[l("prompt.execution")," ",r.success?l("prompt.successful"):l("prompt.failed")]})})]}),n.jsx("button",{onClick:o,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),n.jsx("div",{className:"p-4",children:r.success?n.jsx("div",{children:r.data?n.jsxs("div",{children:[n.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("prompt.result")}),i(r.data)]}):n.jsx("div",{className:"text-sm text-gray-500 italic",children:l("prompt.noContent")})}):n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[n.jsx(ju,{size:16,className:"text-red-500"}),n.jsx("span",{className:"text-sm font-medium text-red-700",children:l("prompt.error")})]}),n.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:n.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:r.error||r.message||l("prompt.unknownError")})})]})})]})},Tv=({prompt:r,server:o,onToggle:l,onDescriptionUpdate:i})=>{const{t:d}=Se(),[f,m]=b.useState(!1),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[N,j]=b.useState(null),[A,D]=b.useState(!1),[O,M]=b.useState(r.description||""),C=b.useRef(null),T=b.useRef(null),[R,W]=b.useState(0);b.useEffect(()=>{A&&C.current&&(C.current.focus(),R>0&&(C.current.style.width=`${R+20}px`))},[A,R]),b.useEffect(()=>{!A&&T.current&&W(T.current.offsetWidth)},[A,O]);const Z=b.useCallback(()=>`mcphub_prompt_form_${o?`${o}_`:""}${r.name}`,[r.name,o]),te=b.useCallback(()=>{localStorage.removeItem(Z())},[Z]),ae=S=>{l&&l(r.name,S)},F=()=>{D(!0)},oe=async()=>{D(!1),i&&i(r.name,O)},ie=S=>{M(S.target.value)},k=S=>{S.key==="Enter"?oe():S.key==="Escape"&&(M(r.description||""),D(!1))},E=async S=>{y(!0);try{const B=await ep({promptName:r.name,arguments:S},o);console.log("GetPrompt result:",B),j({success:B.success,data:B.data,error:B.error})}catch(B){j({success:!1,error:B instanceof Error?B.message:"Unknown error occurred"})}finally{y(!1)}},_=()=>{g(!1),te(),j(null)},q=()=>{j(null)},G=()=>{if(!r.arguments||r.arguments.length===0)return{type:"object",properties:{},required:[]};const S={},B=[];return r.arguments.forEach($=>{S[$.name]={type:"string",description:$.description||""},$.required&&B.push($.name)}),{type:"object",properties:S,required:B}};return n.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg p-4 mb-4",children:[n.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>m(!f),children:[n.jsx("div",{className:"flex-1",children:n.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[r.name.replace(o+"-",""),r.title&&n.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600",children:r.title}),n.jsx("span",{className:"ml-2 text-sm font-normal text-gray-500 inline-flex items-center",children:A?n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:C,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:O,onChange:ie,onKeyDown:k,onClick:S=>S.stopPropagation(),style:{minWidth:"100px",width:R>0?`${R+20}px`:"auto"}}),n.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:S=>{S.stopPropagation(),oe()},children:n.jsx($r,{size:16})})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{ref:T,children:O||d("tool.noDescription")}),n.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:S=>{S.stopPropagation(),F()},children:n.jsx(Nu,{size:14})})]})})]})}),n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx("div",{className:"flex items-center space-x-2",onClick:S=>S.stopPropagation(),children:r.enabled!==void 0&&n.jsx(Ln,{checked:r.enabled,onCheckedChange:ae,disabled:h})}),n.jsxs("button",{onClick:S=>{S.stopPropagation(),m(!0),g(!0)},className:"flex items-center space-x-1 px-3 py-1 text-sm text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors btn-primary",disabled:h||!r.enabled,children:[h?n.jsx(kg,{size:14,className:"animate-spin"}):n.jsx(Tg,{size:14}),n.jsx("span",{children:d(h?"tool.running":"tool.run")})]}),n.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:f?n.jsx(Ao,{size:18}):n.jsx(wu,{size:18})})]})]}),f&&n.jsxs("div",{className:"mt-4 space-y-4",children:[p&&n.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[n.jsx(Wg,{schema:G(),onSubmit:E,onCancel:_,loading:h,storageKey:Z(),title:d("prompt.runPromptWithName",{name:r.name.replace(o+"-","")})}),N&&n.jsx("div",{className:"mt-4",children:n.jsx(_h,{result:N,onClose:q})})]}),!p&&r.arguments&&r.arguments.length>0&&n.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:d("tool.parameters")}),n.jsx("div",{className:"space-y-2",children:r.arguments.map((S,B)=>n.jsxs("div",{className:"flex items-start",children:[n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx("span",{className:"font-medium text-gray-700",children:S.name}),S.required&&n.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),S.description&&n.jsx("p",{className:"text-sm text-gray-600 mt-1",children:S.description})]}),n.jsx("div",{className:"text-xs text-gray-500 ml-2",children:S.title||""})]},B))})]}),!p&&N&&n.jsx("div",{className:"mt-4",children:n.jsx(_h,{result:N,onClose:q})})]})]})},tp=({isOpen:r,onClose:o,onConfirm:l,serverName:i,isGroup:d=!1,isUser:f=!1})=>{const{t:m}=Se();return r?n.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:n.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:n.jsxs("div",{className:"p-6",children:[n.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:m(f?"users.confirmDelete":d?"groups.confirmDelete":"server.confirmDelete")}),n.jsx("p",{className:"text-gray-500 mb-6",children:f?m("users.deleteWarning",{username:i}):d?m("groups.deleteWarning",{name:i}):m("server.deleteWarning",{name:i})}),n.jsxs("div",{className:"flex justify-end space-x-3",children:[n.jsx("button",{onClick:o,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),n.jsx("button",{onClick:l,className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger",children:m("common.delete")})]})]})})}):null},Av=({server:r,onRemove:o,onEdit:l,onToggle:i,onRefresh:d})=>{var ie,k;const{t:f}=Se(),{showToast:m}=Fr(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[N,j]=b.useState(!1),[A,D]=b.useState(!1),[O,M]=b.useState(!1),C=b.useRef(null);b.useEffect(()=>{const E=_=>{C.current&&!C.current.contains(_.target)&&D(!1)};return document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}},[]);const T=E=>{E.stopPropagation(),y(!0)},R=E=>{E.stopPropagation(),l(r)},W=async E=>{if(E.stopPropagation(),!(N||!i)){j(!0);try{await i(r,r.enabled===!1)}finally{j(!1)}}},Z=E=>{E.stopPropagation(),D(!A)},te=E=>{if(E.stopPropagation(),!!r.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(r.error).then(()=>{M(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>M(!1),2e3)});else{const _=document.createElement("textarea");_.value=r.error,_.style.position="fixed",_.style.left="-9999px",document.body.appendChild(_),_.focus(),_.select();try{document.execCommand("copy"),M(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>M(!1),2e3)}catch(q){m(f("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",q)}document.body.removeChild(_)}},ae=()=>{o(r.name),y(!1)},F=async(E,_)=>{try{const{toggleTool:q}=await Lh(async()=>{const{toggleTool:S}=await Promise.resolve().then(()=>jv);return{toggleTool:S}},[],import.meta.url),G=await q(r.name,E,_);G.success?(m(f(_?"tool.enableSuccess":"tool.disableSuccess",{name:E}),"success"),d&&d()):m(G.error||f("tool.toggleFailed"),"error")}catch(q){console.error("Error toggling tool:",q),m(f("tool.toggleFailed"),"error")}},oe=async(E,_)=>{try{const{togglePrompt:q}=await Lh(async()=>{const{togglePrompt:S}=await Promise.resolve().then(()=>kv);return{togglePrompt:S}},void 0,import.meta.url),G=await q(r.name,E,_);G.success?(m(f(_?"tool.enableSuccess":"tool.disableSuccess",{name:E}),"success"),d&&d()):m(G.error||f("tool.toggleFailed"),"error")}catch(q){console.error("Error toggling prompt:",q),m(f("tool.toggleFailed"),"error")}};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`bg-white shadow rounded-lg p-6 mb-6 page-card transition-all duration-200 ${r.enabled===!1?"opacity-60":""}`,children:[n.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>g(!p),children:[n.jsxs("div",{className:"flex items-center space-x-3",children:[n.jsx("h2",{className:`text-xl font-semibold ${r.enabled===!1?"text-gray-600":"text-gray-900"}`,children:r.name}),n.jsx(vv,{status:r.status}),n.jsxs("div",{className:"flex items-center px-2 py-1 bg-blue-50 text-blue-700 rounded-full text-sm btn-primary",children:[n.jsx("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:n.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"})}),n.jsxs("span",{children:[((ie=r.tools)==null?void 0:ie.length)||0," ",f("server.tools")]})]}),n.jsxs("div",{className:"flex items-center px-2 py-1 bg-purple-50 text-purple-700 rounded-full text-sm btn-primary",children:[n.jsxs("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:[n.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"}),n.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"})]}),n.jsxs("span",{children:[((k=r.prompts)==null?void 0:k.length)||0," ",f("server.prompts")]})]}),r.error&&n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"cursor-pointer",onClick:Z,"aria-label":f("server.viewErrorDetails"),children:n.jsx(ju,{className:"text-red-500 hover:text-red-600",size:18})}),A&&n.jsxs("div",{ref:C,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:E=>E.stopPropagation(),children:[n.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:[n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx("h4",{className:"text-sm font-medium text-red-600",children:f("server.errorDetails")}),n.jsx("button",{onClick:te,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:f("common.copy"),children:O?n.jsx($r,{size:14,className:"text-green-500"}):n.jsx(eu,{size:14})})]}),n.jsx("button",{onClick:E=>{E.stopPropagation(),D(!1)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),n.jsx("div",{className:"p-4 pt-2",children:n.jsx("pre",{className:"text-sm text-gray-700 break-words whitespace-pre-wrap",children:r.error})})]})]})]}),n.jsxs("div",{className:"flex space-x-2",children:[n.jsx("button",{onClick:R,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:f("server.edit")}),n.jsx("div",{className:"flex items-center",children:n.jsx("button",{onClick:W,className:`px-3 py-1 text-sm rounded transition-colors ${N?"bg-gray-200 text-gray-500":r.enabled!==!1?"bg-green-100 text-green-800 hover:bg-green-200 btn-secondary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-primary"}`,disabled:N,children:N?f("common.processing"):r.enabled!==!1?f("server.disable"):f("server.enable")})}),n.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:f("server.delete")}),n.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:p?n.jsx(Ao,{size:18}):n.jsx(wu,{size:18})})]})]}),p&&n.jsxs(n.Fragment,{children:[r.tools&&n.jsxs("div",{className:"mt-6",children:[n.jsx("h6",{className:`font-medium ${r.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:f("server.tools")}),n.jsx("div",{className:"space-y-4",children:r.tools.map((E,_)=>n.jsx(Cv,{server:r.name,tool:E,onToggle:F},_))})]}),r.prompts&&n.jsxs("div",{className:"mt-6",children:[n.jsx("h6",{className:`font-medium ${r.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:f("server.prompts")}),n.jsx("div",{className:"space-y-4",children:r.prompts.map((E,_)=>n.jsx(Tv,{server:r.name,prompt:E,onToggle:oe},_))})]})]})]}),n.jsx(tp,{isOpen:h,onClose:()=>y(!1),onConfirm:ae,serverName:r.name})]})},Ro=({onSubmit:r,onCancel:o,initialData:l=null,modalTitle:i,formError:d=null})=>{var G,S,B,$,se,w,I,le,H,K,me,J,X,de,be,je,xe,Te,Be,rt,wa,ca,Ue,bt,ua,da,Gt,fa,gn,Fe,pn,zt,lt,Tt,at,Bn,Ka,Hn,Dt,ja,vt,Ce;const{t:f}=Se(),m=()=>!l||!l.config?"stdio":l.config.type?l.config.type:l.config.url?"sse":"stdio",[p,g]=b.useState(m()),[h,y]=b.useState({name:l&&l.name||"",url:l&&l.config&&l.config.url||"",command:l&&l.config&&l.config.command||"",arguments:l&&l.config&&l.config.args?Array.isArray(l.config.args)?l.config.args.join(" "):String(l.config.args):"",args:l&&l.config&&l.config.args||[],type:m(),env:[],headers:[],options:{timeout:l&&l.config&&l.config.options&&l.config.options.timeout||6e4,resetTimeoutOnProgress:l&&l.config&&l.config.options&&l.config.options.resetTimeoutOnProgress||!1,maxTotalTimeout:l&&l.config&&l.config.options&&l.config.options.maxTotalTimeout||void 0},openapi:l&&l.config&&l.config.openapi?{url:l.config.openapi.url||"",schema:l.config.openapi.schema?JSON.stringify(l.config.openapi.schema,null,2):"",inputMode:l.config.openapi.url?"url":l.config.openapi.schema?"schema":"url",version:l.config.openapi.version||"3.1.0",securityType:((G=l.config.openapi.security)==null?void 0:G.type)||"none",apiKeyName:((B=(S=l.config.openapi.security)==null?void 0:S.apiKey)==null?void 0:B.name)||"",apiKeyIn:((se=($=l.config.openapi.security)==null?void 0:$.apiKey)==null?void 0:se.in)||"header",apiKeyValue:((I=(w=l.config.openapi.security)==null?void 0:w.apiKey)==null?void 0:I.value)||"",httpScheme:((H=(le=l.config.openapi.security)==null?void 0:le.http)==null?void 0:H.scheme)||"bearer",httpCredentials:((me=(K=l.config.openapi.security)==null?void 0:K.http)==null?void 0:me.credentials)||"",oauth2Token:((X=(J=l.config.openapi.security)==null?void 0:J.oauth2)==null?void 0:X.token)||"",openIdConnectUrl:((be=(de=l.config.openapi.security)==null?void 0:de.openIdConnect)==null?void 0:be.url)||"",openIdConnectToken:((xe=(je=l.config.openapi.security)==null?void 0:je.openIdConnect)==null?void 0:xe.token)||""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none"}}),[N,j]=b.useState(l&&l.config&&l.config.env?Object.entries(l.config.env).map(([ce,ue])=>({key:ce,value:ue})):[]),[A,D]=b.useState(l&&l.config&&l.config.headers?Object.entries(l.config.headers).map(([ce,ue])=>({key:ce,value:ue})):[]),[O,M]=b.useState(!1),[C,T]=b.useState(null),R=!!l,W=ce=>{const{name:ue,value:fe}=ce.target;y({...h,[ue]:fe})},Z=ce=>{const ue=ce.split(" ").filter(fe=>fe.trim()!=="");y({...h,arguments:ce,args:ue})},te=ce=>{g(ce),y(ue=>({...ue,type:ce}))},ae=(ce,ue,fe)=>{const dt=[...N];dt[ce][ue]=fe,j(dt)},F=()=>{j([...N,{key:"",value:""}])},oe=ce=>{const ue=[...N];ue.splice(ce,1),j(ue)},ie=(ce,ue,fe)=>{const dt=[...A];dt[ce][ue]=fe,D(dt)},k=()=>{D([...A,{key:"",value:""}])},E=ce=>{const ue=[...A];ue.splice(ce,1),D(ue)},_=(ce,ue)=>{y(fe=>({...fe,options:{...fe.options,[ce]:ue}}))},q=async ce=>{var ue,fe,dt;ce.preventDefault(),T(null);try{const aa={};N.forEach(({key:Ut,value:ma})=>{Ut.trim()&&(aa[Ut.trim()]=ma)});const na={};A.forEach(({key:Ut,value:ma})=>{Ut.trim()&&(na[Ut.trim()]=ma)});const xn={};(ue=h.options)!=null&&ue.timeout&&h.options.timeout!==6e4&&(xn.timeout=h.options.timeout),(fe=h.options)!=null&&fe.resetTimeoutOnProgress&&(xn.resetTimeoutOnProgress=h.options.resetTimeoutOnProgress),(dt=h.options)!=null&&dt.maxTotalTimeout&&(xn.maxTotalTimeout=h.options.maxTotalTimeout);const Xr={name:h.name,config:{type:p,...p==="openapi"?{openapi:(()=>{var ma,Pn,Bs,Qr,sa,ot;const Ut={version:((ma=h.openapi)==null?void 0:ma.version)||"3.1.0"};if(((Pn=h.openapi)==null?void 0:Pn.inputMode)==="url")Ut.url=((Bs=h.openapi)==null?void 0:Bs.url)||"";else if(((Qr=h.openapi)==null?void 0:Qr.inputMode)==="schema"&&((sa=h.openapi)!=null&&sa.schema))try{Ut.schema=JSON.parse(h.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(ot=h.openapi)!=null&&ot.securityType&&h.openapi.securityType!=="none"&&(Ut.security={type:h.openapi.securityType,...h.openapi.securityType==="apiKey"&&{apiKey:{name:h.openapi.apiKeyName||"",in:h.openapi.apiKeyIn||"header",value:h.openapi.apiKeyValue||""}},...h.openapi.securityType==="http"&&{http:{scheme:h.openapi.httpScheme||"bearer",credentials:h.openapi.httpCredentials||""}},...h.openapi.securityType==="oauth2"&&{oauth2:{token:h.openapi.oauth2Token||""}},...h.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:h.openapi.openIdConnectUrl||"",token:h.openapi.openIdConnectToken||""}}}),Ut})(),...Object.keys(na).length>0?{headers:na}:{}}:p==="sse"||p==="streamable-http"?{url:h.url,...Object.keys(na).length>0?{headers:na}:{}}:{command:h.command,args:h.args,env:Object.keys(aa).length>0?aa:void 0},...Object.keys(xn).length>0?{options:xn}:{}}};r(Xr)}catch(aa){T(`Error: ${aa instanceof Error?aa.message:String(aa)}`)}};return n.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-xl max-h-screen overflow-y-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:i}),n.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(C||d)&&n.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:d||C}),n.jsxs("form",{onSubmit:q,children:[n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:f("server.name")}),n.jsx("input",{type:"text",name:"name",id:"name",value:h.name,onChange:W,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: time-mcp",required:!0,disabled:R})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.type")}),n.jsxs("div",{className:"flex space-x-4",children:[n.jsxs("div",{children:[n.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:p==="stdio",onChange:()=>te("stdio"),className:"mr-1"}),n.jsx("label",{htmlFor:"command",children:"STDIO"})]}),n.jsxs("div",{children:[n.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>te("sse"),className:"mr-1"}),n.jsx("label",{htmlFor:"url",children:"SSE"})]}),n.jsxs("div",{children:[n.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>te("streamable-http"),className:"mr-1"}),n.jsx("label",{htmlFor:"streamable-http",children:"Streamable HTTP"})]}),n.jsxs("div",{children:[n.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>te("openapi"),className:"mr-1"}),n.jsx("label",{htmlFor:"openapi",children:"OpenAPI"})]})]})]}),p==="openapi"?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.inputMode")}),n.jsxs("div",{className:"flex space-x-4",children:[n.jsxs("div",{children:[n.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((Te=h.openapi)==null?void 0:Te.inputMode)==="url",onChange:()=>y(ce=>({...ce,openapi:{...ce.openapi,inputMode:"url"}})),className:"mr-1"}),n.jsx("label",{htmlFor:"input-mode-url",children:f("server.openapi.inputModeUrl")})]}),n.jsxs("div",{children:[n.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((Be=h.openapi)==null?void 0:Be.inputMode)==="schema",onChange:()=>y(ce=>({...ce,openapi:{...ce.openapi,inputMode:"schema"}})),className:"mr-1"}),n.jsx("label",{htmlFor:"input-mode-schema",children:f("server.openapi.inputModeSchema")})]})]})]}),((rt=h.openapi)==null?void 0:rt.inputMode)==="url"&&n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-url",children:f("server.openapi.specUrl")}),n.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((wa=h.openapi)==null?void 0:wa.url)||"",onChange:ce=>y(ue=>({...ue,openapi:{...ue.openapi,url:ce.target.value}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: https://api.example.com/openapi.json",required:p==="openapi"&&((ca=h.openapi)==null?void 0:ca.inputMode)==="url"})]}),((Ue=h.openapi)==null?void 0:Ue.inputMode)==="schema"&&n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-schema",children:f("server.openapi.schema")}),n.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((bt=h.openapi)==null?void 0:bt.schema)||"",onChange:ce=>y(ue=>({...ue,openapi:{...ue.openapi,schema:ce.target.value}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline font-mono text-sm",placeholder:`{
|
|
197
|
+
"openapi": "3.1.0",
|
|
198
|
+
"info": {
|
|
199
|
+
"title": "API",
|
|
200
|
+
"version": "1.0.0"
|
|
201
|
+
},
|
|
202
|
+
"servers": [
|
|
203
|
+
{
|
|
204
|
+
"url": "https://api.example.com"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"paths": {
|
|
208
|
+
...
|
|
209
|
+
}
|
|
210
|
+
}`,required:p==="openapi"&&((ua=h.openapi)==null?void 0:ua.inputMode)==="schema"}),n.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.openapi.schemaHelp")})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.security")}),n.jsxs("select",{value:((da=h.openapi)==null?void 0:da.securityType)||"none",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,securityType:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.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:[n.jsx("option",{value:"none",children:f("server.openapi.securityNone")}),n.jsx("option",{value:"apiKey",children:f("server.openapi.securityApiKey")}),n.jsx("option",{value:"http",children:f("server.openapi.securityHttp")}),n.jsx("option",{value:"oauth2",children:f("server.openapi.securityOAuth2")}),n.jsx("option",{value:"openIdConnect",children:f("server.openapi.securityOpenIdConnect")})]})]}),((Gt=h.openapi)==null?void 0:Gt.securityType)==="apiKey"&&n.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.apiKeyConfig")}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyName")}),n.jsx("input",{type:"text",value:((fa=h.openapi)==null?void 0:fa.apiKeyName)||"",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,apiKeyName:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyIn")}),n.jsxs("select",{value:((gn=h.openapi)==null?void 0:gn.apiKeyIn)||"header",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,apiKeyIn:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[n.jsx("option",{value:"header",children:"Header"}),n.jsx("option",{value:"query",children:"Query"}),n.jsx("option",{value:"cookie",children:"Cookie"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyValue")}),n.jsx("input",{type:"password",value:((Fe=h.openapi)==null?void 0:Fe.apiKeyValue)||"",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,apiKeyValue:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),((pn=h.openapi)==null?void 0:pn.securityType)==="http"&&n.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.httpAuthConfig")}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpScheme")}),n.jsxs("select",{value:((zt=h.openapi)==null?void 0:zt.httpScheme)||"bearer",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,httpScheme:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[n.jsx("option",{value:"basic",children:"Basic"}),n.jsx("option",{value:"bearer",children:"Bearer"}),n.jsx("option",{value:"digest",children:"Digest"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpCredentials")}),n.jsx("input",{type:"password",value:((lt=h.openapi)==null?void 0:lt.httpCredentials)||"",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,httpCredentials:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((Tt=h.openapi)==null?void 0:Tt.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((at=h.openapi)==null?void 0:at.securityType)==="oauth2"&&n.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.oauth2Config")}),n.jsx("div",{className:"grid grid-cols-1 gap-3",children:n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.oauth2Token")}),n.jsx("input",{type:"password",value:((Bn=h.openapi)==null?void 0:Bn.oauth2Token)||"",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,oauth2Token:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})})]}),((Ka=h.openapi)==null?void 0:Ka.securityType)==="openIdConnect"&&n.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.openIdConnectConfig")}),n.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectUrl")}),n.jsx("input",{type:"url",value:((Hn=h.openapi)==null?void 0:Hn.openIdConnectUrl)||"",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,openIdConnectUrl:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.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"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectToken")}),n.jsx("input",{type:"password",value:((Dt=h.openapi)==null?void 0:Dt.openIdConnectToken)||"",onChange:ce=>y(ue=>{var fe;return{...ue,openapi:{...ue.openapi,openIdConnectToken:ce.target.value,url:((fe=ue.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"id-token"})]})]})]}),n.jsxs("div",{className:"mb-4",children:[n.jsxs("div",{className:"flex justify-between items-center mb-2",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),n.jsx("button",{type:"button",onClick:k,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),A.map((ce,ue)=>n.jsxs("div",{className:"flex items-center mb-2",children:[n.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[n.jsx("input",{type:"text",value:ce.key,onChange:fe=>ie(ue,"key",fe.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"}),n.jsx("span",{className:"flex items-center",children:":"}),n.jsx("input",{type:"text",value:ce.value,onChange:fe=>ie(ue,"value",fe.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..."})]}),n.jsx("button",{type:"button",onClick:()=>E(ue),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:"-"})]},ue))]})]}):p==="sse"||p==="streamable-http"?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"url",children:f("server.url")}),n.jsx("input",{type:"url",name:"url",id:"url",value:h.url,onChange:W,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:p==="streamable-http"?"e.g.: http://localhost:3000/mcp":"e.g.: http://localhost:3000/sse",required:p==="sse"||p==="streamable-http"})]}),n.jsxs("div",{className:"mb-4",children:[n.jsxs("div",{className:"flex justify-between items-center mb-2",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),n.jsx("button",{type:"button",onClick:k,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),A.map((ce,ue)=>n.jsxs("div",{className:"flex items-center mb-2",children:[n.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[n.jsx("input",{type:"text",value:ce.key,onChange:fe=>ie(ue,"key",fe.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"}),n.jsx("span",{className:"flex items-center",children:":"}),n.jsx("input",{type:"text",value:ce.value,onChange:fe=>ie(ue,"value",fe.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..."})]}),n.jsx("button",{type:"button",onClick:()=>E(ue),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:"-"})]},ue))]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"command",children:f("server.command")}),n.jsx("input",{type:"text",name:"command",id:"command",value:h.command,onChange:W,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: npx",required:p==="stdio"})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"arguments",children:f("server.arguments")}),n.jsx("input",{type:"text",name:"arguments",id:"arguments",value:h.arguments,onChange:ce=>Z(ce.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: -y time-mcp",required:p==="stdio"})]}),n.jsxs("div",{className:"mb-4",children:[n.jsxs("div",{className:"flex justify-between items-center mb-2",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.envVars")}),n.jsx("button",{type:"button",onClick:F,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),N.map((ce,ue)=>n.jsxs("div",{className:"flex items-center mb-2",children:[n.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[n.jsx("input",{type:"text",value:ce.key,onChange:fe=>ae(ue,"key",fe.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:f("server.key")}),n.jsx("span",{className:"flex items-center",children:":"}),n.jsx("input",{type:"text",value:ce.value,onChange:fe=>ae(ue,"value",fe.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:f("server.value")})]}),n.jsx("button",{type:"button",onClick:()=>oe(ue),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:"-"})]},ue))]})]}),p!=="openapi"&&n.jsxs("div",{className:"mb-4",children:[n.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:()=>M(!O),children:[n.jsx("label",{className:"text-gray-700 text-sm font-bold",children:f("server.requestOptions")}),n.jsx("span",{className:"text-gray-500 text-sm",children:O?"▼":"▶"})]}),O&&n.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:f("server.timeout")}),n.jsx("input",{type:"number",id:"timeout",value:((ja=h.options)==null?void 0:ja.timeout)||6e4,onChange:ce=>_("timeout",parseInt(ce.target.value)||6e4),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"30000",min:"1000",max:"300000"}),n.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.timeoutDescription")})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:f("server.maxTotalTimeout")}),n.jsx("input",{type:"number",id:"maxTotalTimeout",value:((vt=h.options)==null?void 0:vt.maxTotalTimeout)||"",onChange:ce=>_("maxTotalTimeout",ce.target.value?parseInt(ce.target.value):void 0),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"Optional",min:"1000"}),n.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.maxTotalTimeoutDescription")})]})]}),n.jsxs("div",{className:"mt-3",children:[n.jsxs("label",{className:"flex items-center",children:[n.jsx("input",{type:"checkbox",checked:((Ce=h.options)==null?void 0:Ce.resetTimeoutOnProgress)||!1,onChange:ce=>_("resetTimeoutOnProgress",ce.target.checked),className:"mr-2"}),n.jsx("span",{className:"text-gray-600 text-sm",children:f("server.resetTimeoutOnProgress")})]}),n.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:f("server.resetTimeoutOnProgressDescription")})]})]})]}),n.jsxs("div",{className:"flex justify-end mt-6",children:[n.jsx("button",{type:"button",onClick:o,className:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-medium py-2 px-4 rounded mr-2 btn-secondary",children:f("server.cancel")}),n.jsx("button",{type:"submit",className:"bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded btn-primary",children:f(R?"server.save":"server.add")})]})]})]})},ap=r=>{const o=new Set,l=/\$\{([^}]+)\}/g,i=f=>{let m;for(;(m=l.exec(f))!==null;)o.add(m[1])},d=(f,m="")=>{typeof f=="string"?i(f):Array.isArray(f)?f.forEach((p,g)=>d(p,`${m}[${g}]`)):f&&typeof f=="object"&&Object.entries(f).forEach(([p,g])=>{d(g,m?`${m}.${p}`:p)})};return d(r),Array.from(o)},Rv=({onAdd:r})=>{const{t:o}=Se(),[l,i]=b.useState(!1),[d,f]=b.useState(null),[m,p]=b.useState(!1),[g,h]=b.useState(null),[y,N]=b.useState([]),j=()=>{i(!l),f(null),p(!1),h(null)},A=async()=>{g&&(await D(g),p(!1),h(null))},D=async M=>{try{f(null);const C=await kt("/servers",M);if(!C.success){C&&C.message?f(C.message):f(o("server.addError"));return}i(!1),r()}catch(C){console.error("Error adding server:",C),navigator.onLine?C instanceof TypeError&&(C.message.includes("NetworkError")||C.message.includes("Failed to fetch"))?f(o("errors.serverConnection")):f(o("errors.serverAdd")):f(o("errors.network"))}},O=async M=>{try{const C=ap(M);C.length>0?(N(C),h(M),p(!0)):await D(M)}catch(C){console.error("Error processing server submission:",C),f(o("errors.serverAdd"))}};return n.jsxs("div",{children:[n.jsxs("button",{onClick:j,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:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})}),o("server.add")]}),l&&n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsx(Ro,{onSubmit:O,onCancel:j,modalTitle:o("server.addServer"),formError:d})}),m&&n.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:n.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[n.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:o("server.confirmVariables")}),n.jsx("p",{className:"text-gray-600 mb-4",children:o("server.variablesDetected")}),n.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:n.jsxs("div",{className:"flex items-start",children:[n.jsx("div",{className:"flex-shrink-0",children:n.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})})}),n.jsxs("div",{className:"ml-3",children:[n.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[o("server.detectedVariables"),":"]}),n.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:y.map((M,C)=>n.jsxs("li",{className:"font-mono",children:["$",`{${M}}`]},C))})]})]})}),n.jsx("p",{className:"text-gray-600 text-sm mb-6",children:o("server.confirmVariablesMessage")}),n.jsxs("div",{className:"flex justify-end space-x-3",children:[n.jsx("button",{onClick:()=>{p(!1),h(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:o("common.cancel")}),n.jsx("button",{onClick:A,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:o("server.confirmAndAdd")})]})]})})]})},Mv=({server:r,onEdit:o,onCancel:l})=>{const{t:i}=Se(),[d,f]=b.useState(null),m=async p=>{try{f(null);const g=await Wt(`/servers/${r.name}`,p);if(!g.success){g&&g.message?f(g.message):f(i("server.updateError",{serverName:r.name}));return}o()}catch(g){console.error("Error updating server:",g),navigator.onLine?g instanceof TypeError&&(g.message.includes("NetworkError")||g.message.includes("Failed to fetch"))?f(i("errors.serverConnection")):f(i("errors.serverUpdate",{serverName:r.name})):f(i("errors.network"))}};return n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsx(Ro,{onSubmit:m,onCancel:l,initialData:r,modalTitle:i("server.editTitle",{serverName:r.name}),formError:d})})},Ov=({isOpen:r,onClose:o,onConfirm:l,title:i,message:d,confirmText:f,cancelText:m,variant:p="warning"})=>{const{t:g}=Se();if(!r)return null;const h=()=>{switch(p){case"danger":return{icon:n.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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:n.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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:n.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"};default:return{icon:null,confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"}}},{icon:y,confirmClass:N}=h(),j=D=>{D.target===D.currentTarget&&o()},A=D=>{D.key==="Escape"?o():D.key==="Enter"&&l()};return n.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:j,onKeyDown:A,tabIndex:-1,children:n.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:n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex items-start space-x-3",children:[y&&n.jsx("div",{className:"flex-shrink-0",children:y}),n.jsxs("div",{className:"flex-1",children:[i&&n.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:i}),n.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:d})]})]}),n.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[n.jsx("button",{onClick:o,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")}),n.jsx("button",{onClick:l,className:`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${N} ${p==="danger"?"btn-danger":p==="warning"?"btn-warning":"btn-primary"}`,children:f||g("common.confirm")})]})]})})})},zv=({onSuccess:r,onCancel:o})=>{const{t:l}=Se(),[i,d]=b.useState(!1),[f,m]=b.useState(!1),[p,g]=b.useState(null),[h,y]=b.useState(null),[N,j]=b.useState(!1),[A,D]=b.useState(null),[O,M]=b.useState(""),[C,T]=b.useState(!1),[R,W]=b.useState(""),Z=q=>{q.preventDefault(),d(!0)},te=q=>{q.preventDefault(),d(!1)},ae=q=>{q.preventDefault(),d(!1);const G=q.dataTransfer.files;if(G.length>0){const S=G[0];S.name.endsWith(".dxt")?(y(S),g(null)):g(l("dxt.invalidFileType"))}},F=q=>{const G=q.target.files;if(G&&G.length>0){const S=G[0];S.name.endsWith(".dxt")?(y(S),g(null)):g(l("dxt.invalidFileType"))}},oe=async()=>{if(!h){g(l("dxt.noFileSelected"));return}m(!0),g(null);try{const q=new FormData;q.append("dxtFile",h);const G=await bu(yu("/dxt/upload"),{method:"POST",body:q}),S=await G.json();if(!G.ok)throw new Error(S.message||`HTTP error! Status: ${G.status}`);if(S.success&&S.data)D(S.data.manifest),M(S.data.extractDir),j(!0);else throw new Error(S.message||l("dxt.uploadFailed"))}catch(q){console.error("DXT upload error:",q),g(q instanceof Error?q.message:l("dxt.uploadFailed"))}finally{m(!1)}},ie=async(q,G=!1)=>{var S;m(!0),g(null);try{const B=_(A,O,q);if(!G){const se=await Xe("/servers");if(se.success&&((S=se.data)==null?void 0:S.find(I=>I.name===q))){W(q),T(!0),m(!1);return}}let $;if(G?$=await Wt(`/servers/${encodeURIComponent(q)}`,{name:q,config:B}):$=await kt("/servers",{name:q,config:B}),$.success)r(B);else throw new Error($.message||l("dxt.installFailed"))}catch(B){console.error("DXT install error:",B),g(B instanceof Error?B.message:l("dxt.installFailed")),m(!1)}},k=()=>{T(!1),R&&ie(R,!0)},E=()=>{T(!1),W(""),m(!1)},_=(q,G,S)=>{var se;const B=((se=q.server)==null?void 0:se.mcp_config)||{},$={type:"stdio",command:B.command||"node",args:(B.args||[]).map(w=>w.replace("${__dirname}",G))};return B.env&&Object.keys(B.env).length>0&&($.env={...B.env},Object.keys($.env).forEach(w=>{typeof $.env[w]=="string"&&($.env[w]=$.env[w].replace("${__dirname}",G))})),$};return N&&A?n.jsxs(n.Fragment,{children:[n.jsx(Ov,{isOpen:C,onClose:E,onConfirm:k,title:l("dxt.serverExistsTitle"),message:l("dxt.serverExistsConfirm",{serverName:R}),confirmText:l("dxt.override"),cancelText:l("common.cancel"),variant:"warning"}),n.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${C?"opacity-50 pointer-events-none":""}`,children:n.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-6",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("dxt.installServer")}),n.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&n.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:n.jsx("p",{className:"text-red-700",children:p})}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[n.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:l("dxt.extensionInfo")}),n.jsxs("div",{className:"space-y-2 text-sm",children:[n.jsxs("div",{children:[n.jsxs("strong",{children:[l("dxt.name"),":"]})," ",A.display_name||A.name]}),n.jsxs("div",{children:[n.jsxs("strong",{children:[l("dxt.version"),":"]})," ",A.version]}),n.jsxs("div",{children:[n.jsxs("strong",{children:[l("dxt.description"),":"]})," ",A.description]}),A.author&&n.jsxs("div",{children:[n.jsxs("strong",{children:[l("dxt.author"),":"]})," ",A.author.name]}),A.tools&&A.tools.length>0&&n.jsxs("div",{children:[n.jsxs("strong",{children:[l("dxt.tools"),":"]}),n.jsx("ul",{className:"list-disc list-inside ml-4",children:A.tools.map((q,G)=>n.jsxs("li",{children:[q.name," - ",q.description]},G))})]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("dxt.serverName")}),n.jsx("input",{type:"text",id:"serverName",defaultValue:A.name,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:l("dxt.serverNamePlaceholder")})]}),n.jsxs("div",{className:"flex justify-end space-x-4",children:[n.jsx("button",{onClick:o,disabled:f,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.cancel")}),n.jsx("button",{onClick:()=>{const q=document.getElementById("serverName"),G=(q==null?void 0:q.value.trim())||A.name;ie(G)},disabled:f,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:f?n.jsxs(n.Fragment,{children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("dxt.installing")]}):l("dxt.install")})]})]})]})})]}):n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-lg",children:[n.jsxs("div",{className:"flex justify-between items-center mb-6",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("dxt.uploadTitle")}),n.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&n.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:n.jsx("p",{className:"text-red-700",children:p})}),n.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center transition-colors ${i?"border-blue-500 bg-blue-50":h?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:Z,onDragLeave:te,onDrop:ae,children:[h?n.jsxs("div",{className:"space-y-2",children:[n.jsx("svg",{className:"mx-auto h-12 w-12 text-green-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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"})}),n.jsx("p",{className:"text-sm text-gray-900 font-medium",children:h.name}),n.jsxs("p",{className:"text-xs text-gray-500",children:[(h.size/1024/1024).toFixed(2)," MB"]})]}):n.jsxs("div",{className:"space-y-2",children:[n.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm text-gray-900",children:l("dxt.dropFileHere")}),n.jsx("p",{className:"text-xs text-gray-500",children:l("dxt.orClickToSelect")})]})]}),n.jsx("input",{type:"file",accept:".dxt",onChange:F,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),n.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[n.jsx("button",{onClick:o,disabled:f,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.cancel")}),n.jsx("button",{onClick:oe,disabled:!h||f,className:"px-4 py-2 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:f?n.jsxs(n.Fragment,{children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("dxt.uploading")]}):l("dxt.upload")})]})]})})},Dv=()=>{const{t:r}=Se(),o=Ga(),{servers:l,error:i,setError:d,isLoading:f,handleServerAdd:m,handleServerEdit:p,handleServerRemove:g,handleServerToggle:h,triggerRefresh:y}=Yr({refreshOnMount:!0}),[N,j]=b.useState(null),[A,D]=b.useState(!1),[O,M]=b.useState(!1),C=async Z=>{const te=await p(Z);te&&j(te)},T=()=>{j(null),y()},R=async()=>{D(!0);try{y(),await new Promise(Z=>setTimeout(Z,500))}finally{D(!1)}},W=Z=>{M(!1),y()};return n.jsxs("div",{children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:r("pages.servers.title")}),n.jsxs("div",{className:"flex space-x-4",children:[n.jsxs("button",{onClick:()=>o("/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:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})}),r("nav.market")]}),n.jsx(Rv,{onAdd:m}),n.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:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})}),r("dxt.upload")]}),n.jsxs("button",{onClick:R,disabled:A,className:`px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200 ${A?"opacity-70 cursor-not-allowed":""}`,children:[A?n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.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"})]}):n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})}),r("common.refresh")]})]})]}),i&&n.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:n.jsx("p",{className:"text-gray-600 mt-1",children:i})}),n.jsx("button",{onClick:()=>d(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":r("app.closeButton"),children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),f?n.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:n.jsxs("div",{className:"flex flex-col items-center",children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.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"})]}),n.jsx("p",{className:"text-gray-600",children:r("app.loading")})]})}):l.length===0?n.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:n.jsx("p",{className:"text-gray-600",children:r("app.noServers")})}):n.jsx("div",{className:"space-y-6",children:l.map((Z,te)=>n.jsx(Av,{server:Z,onRemove:g,onEdit:C,onToggle:h,onRefresh:y},te))}),N&&n.jsx(Mv,{server:N,onEdit:T,onCancel:()=>j(null)}),O&&n.jsx(zv,{onSuccess:W,onCancel:()=>M(!1)})]})},Cu=()=>{const{t:r}=Se(),[o,l]=b.useState([]),[i,d]=b.useState(!0),[f,m]=b.useState(null),[p,g]=b.useState(0),h=b.useCallback(async()=>{try{d(!0);const C=await Xe("/groups");C&&C.success&&Array.isArray(C.data)?l(C.data):(console.error("Invalid group data format:",C),l([])),m(null)}catch(C){console.error("Error fetching groups:",C),m(C instanceof Error?C.message:"Failed to fetch groups"),l([])}finally{d(!1)}},[]),y=b.useCallback(()=>{g(C=>C+1)},[]),N=async(C,T,R=[])=>{try{const W=await kt("/groups",{name:C,description:T,servers:R});return console.log("Group created successfully:",W),!W||!W.success?(m((W==null?void 0:W.message)||r("groups.createError")),W):(y(),W||null)}catch(W){return m(W instanceof Error?W.message:"Failed to create group"),null}},j=async(C,T)=>{try{const R=await Wt(`/groups/${C}`,T);return!R||!R.success?(m((R==null?void 0:R.message)||r("groups.updateError")),R):(y(),R||null)}catch(R){return m(R instanceof Error?R.message:"Failed to update group"),null}},A=async(C,T)=>{try{const R=await Wt(`/groups/${C}/servers/batch`,{servers:T});return!R||!R.success?(m((R==null?void 0:R.message)||r("groups.updateError")),null):(y(),R.data||null)}catch(R){return m(R instanceof Error?R.message:"Failed to update group servers"),null}},D=async C=>{try{const T=await vo(`/groups/${C}`);return!T||!T.success?(m((T==null?void 0:T.message)||r("groups.deleteError")),T):(y(),T)}catch(T){return m(T instanceof Error?T.message:"Failed to delete group"),null}},O=async(C,T)=>{try{const R=await kt(`/groups/${C}/servers`,{serverName:T});return!R||!R.success?(m((R==null?void 0:R.message)||r("groups.serverAddError")),null):(y(),R.data||null)}catch(R){return m(R instanceof Error?R.message:"Failed to add server to group"),null}},M=async(C,T)=>{try{const R=await vo(`/groups/${C}/servers/${T}`);return!R||!R.success?(m((R==null?void 0:R.message)||r("groups.serverRemoveError")),null):(y(),R.data||null)}catch(R){return m(R instanceof Error?R.message:"Failed to remove server from group"),null}};return b.useEffect(()=>{h()},[h,p]),{groups:o,loading:i,error:f,setError:m,triggerRefresh:y,createGroup:N,updateGroup:j,updateGroupServers:A,deleteGroup:D,addServerToGroup:O,removeServerFromGroup:M}},np=({servers:r,value:o,onChange:l,className:i})=>{const{t:d}=Se(),[f,m]=b.useState(new Set),p=Ms.useMemo(()=>o.map(C=>typeof C=="string"?{name:C,tools:"all"}:{...C,tools:C.tools||"all"}),[o]),g=Ms.useMemo(()=>r.filter(C=>C.enabled!==!1),[r]);Ms.useEffect(()=>{const C=new Set(p.map(R=>R.name)),T=new Set(g.map(R=>R.name));m(R=>{const W=new Set;return R.forEach(Z=>{(C.has(Z)||T.has(Z))&&W.add(Z)}),W})},[p,g]);const h=C=>{if(p.findIndex(R=>R.name===C)>=0){const R=p.filter(W=>W.name!==C);l(R)}else{const R=[...p,{name:C,tools:"all"}];l(R)}},y=C=>{m(T=>{const R=new Set(T);return R.has(C)?R.delete(C):R.add(C),R})},N=(C,T,R=!1)=>{if(Array.isArray(T)&&T.length===0){const W=p.filter(Z=>Z.name!==C);l(W),R||m(Z=>{const te=new Set(Z);return te.delete(C),te})}else if(p.findIndex(Z=>Z.name===C)>=0){const Z=p.map(te=>te.name===C?{...te,tools:T}:te);l(Z)}else{const Z=[...p,{name:C,tools:T}];l(Z)}},j=(C,T)=>{var te;const R=g.find(ae=>ae.name===C);if(!R)return;const W=((te=R.tools)==null?void 0:te.map(ae=>ae.name.replace(`${C}-`,"")))||[],Z=p.find(ae=>ae.name===C);if(!Z){const ae=[...p,{name:C,tools:[T]}];l(ae);return}if(Z.tools==="all"){const ae=W.filter(F=>F!==T);N(C,ae)}else if(Array.isArray(Z.tools)){const ae=Z.tools;if(ae.includes(T)){const F=ae.filter(oe=>oe!==T);N(C,F)}else{const F=[...ae,T];F.length===W.length?N(C,"all"):N(C,F)}}},A=C=>{const T=p.find(R=>R.name===C);return T?T.tools==="all":!1},D=C=>{const T=p.find(R=>R.name===C);return T?Array.isArray(T.tools)&&T.tools.length>0:!1},O=(C,T)=>{const R=p.find(W=>W.name===C);return R?R.tools==="all"?!0:Array.isArray(R.tools)?R.tools.includes(T):!1:!1},M=C=>{const T=g.find(R=>R.name===C);return(T==null?void 0:T.tools)||[]};return n.jsxs("div",{className:Pa("space-y-4",i),children:[n.jsx("div",{className:"space-y-3",children:g.map(C=>{const T=A(C.name),R=D(C.name),W=f.has(C.name),Z=M(C.name),te=p.find(ae=>ae.name===C.name);return n.jsxs("div",{className:"border border-gray-200 rounded-lg hover:border-gray-300 hover:bg-gray-50 transition-colors",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors",onClick:()=>y(C.name),children:[n.jsxs("div",{className:"flex items-center space-x-3",onClick:ae=>{ae.stopPropagation(),h(C.name)},children:[n.jsx("input",{type:"checkbox",checked:T||R,onChange:()=>h(C.name),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),n.jsx("span",{className:"font-medium text-gray-900 cursor-pointer select-none",children:C.name})]}),n.jsxs("div",{className:"flex items-center space-x-3",children:[te&&te.tools!=="all"&&Array.isArray(te.tools)&&n.jsxs("span",{className:"text-sm text-green-600",children:["(",d("groups.toolsSelected")," ",te.tools.length,"/",Z.length,")"]}),te&&te.tools==="all"&&n.jsxs("span",{className:"text-sm text-green-600",children:["(",d("groups.allTools")," ",Z.length,"/",Z.length,")"]}),Z.length>0&&n.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:n.jsx("svg",{className:Pa("w-5 h-5 transition-transform",W&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),W&&Z.length>0&&n.jsxs("div",{className:"border-t border-gray-200 bg-gray-50 p-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("span",{className:"text-sm font-medium text-gray-700",children:d("groups.toolSelection")}),n.jsx("button",{type:"button",onClick:()=>{(te==null?void 0:te.tools)==="all"||Array.isArray(te==null?void 0:te.tools)&&te.tools.length===Z.length?N(C.name,[],!0):N(C.name,"all")},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:(te==null?void 0:te.tools)==="all"||Array.isArray(te==null?void 0:te.tools)&&te.tools.length===Z.length?d("groups.selectNone"):d("groups.selectAll")})]}),n.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:Z.map(ae=>{const F=ae.name.replace(`${C.name}-`,""),oe=O(C.name,F);return n.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[n.jsx("input",{type:"checkbox",checked:oe,onChange:()=>j(C.name,F),className:"w-3 h-3 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),n.jsx("span",{className:"text-gray-700",children:F}),ae.description&&n.jsx("span",{className:"text-gray-400 text-xs truncate",children:ae.description})]},ae.name)})})]})]},C.name)})}),g.length===0&&n.jsx("p",{className:"text-gray-500 text-sm",children:d("groups.noServerOptions")})]})},Uv=({onAdd:r,onCancel:o})=>{const{t:l}=Se(),{createGroup:i}=Cu(),{servers:d}=Yr(),[f,m]=b.useState([]),[p,g]=b.useState(null),[h,y]=b.useState(!1),[N,j]=b.useState({name:"",description:"",servers:[]});b.useEffect(()=>{m(d.filter(O=>O.enabled!==!1))},[d]);const A=O=>{const{name:M,value:C}=O.target;j(T=>({...T,[M]:C}))},D=async O=>{O.preventDefault(),y(!0),g(null);try{if(!N.name.trim()){g(l("groups.nameRequired")),y(!1);return}const M=await i(N.name,N.description,N.servers);if(!M||!M.success){g((M==null?void 0:M.message)||l("groups.createError")),y(!1);return}r()}catch(M){g(M instanceof Error?M.message:String(M)),y(!1)}};return n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[n.jsxs("div",{className:"p-6 flex-shrink-0",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:l("groups.addNew")}),p&&n.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:p})]}),n.jsxs("form",{onSubmit:D,className:"flex flex-col flex-1 min-h-0",children:[n.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[l("groups.name")," *"]}),n.jsx("input",{type:"text",id:"name",name:"name",value:N.name,onChange:A,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:l("groups.namePlaceholder"),required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:l("groups.configureTools")}),n.jsx(np,{servers:f,value:N.servers,onChange:O=>j(M=>({...M,servers:O})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),n.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[n.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:h,children:l("common.cancel")}),n.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:h,children:l(h?"common.submitting":"common.create")})]})]})]})})},Lv=({group:r,onEdit:o,onCancel:l})=>{const{t:i}=Se(),{updateGroup:d}=Cu(),{servers:f}=Yr(),[m,p]=b.useState([]),[g,h]=b.useState(null),[y,N]=b.useState(!1),[j,A]=b.useState({name:r.name,description:r.description||"",servers:r.servers||[]});b.useEffect(()=>{p(f.filter(M=>M.enabled!==!1))},[f]);const D=M=>{const{name:C,value:T}=M.target;A(R=>({...R,[C]:T}))},O=async M=>{M.preventDefault(),N(!0),h(null);try{if(!j.name.trim()){h(i("groups.nameRequired")),N(!1);return}const C=await d(r.id,{name:j.name,description:j.description,servers:j.servers});if(!C||!C.success){h((C==null?void 0:C.message)||i("groups.updateError")),N(!1);return}o()}catch(C){h(C instanceof Error?C.message:String(C)),N(!1)}};return n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[n.jsxs("div",{className:"p-6 flex-shrink-0",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:i("groups.edit")}),g&&n.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:g})]}),n.jsxs("form",{onSubmit:O,className:"flex flex-col flex-1 min-h-0",children:[n.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[i("groups.name")," *"]}),n.jsx("input",{type:"text",id:"name",name:"name",value:j.name,onChange:D,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})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:i("groups.configureTools")}),n.jsx(np,{servers:m,value:j.servers,onChange:M=>A(C=>({...C,servers:M})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),n.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[n.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",disabled:y,children:i("common.cancel")}),n.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:y,children:i(y?"common.submitting":"common.save")})]})]})]})})},Eu=()=>{const{t:r}=Se(),{showToast:o}=Fr(),[l,i]=b.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!1,bearerAuthKey:"",skipAuth:!1}),[d,f]=b.useState({bearerAuthKey:""}),[m,p]=b.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[g,h]=b.useState({enabled:!1,dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[y,N]=b.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[j,A]=b.useState(!1),[D,O]=b.useState(null),[M,C]=b.useState(0),T=b.useCallback(()=>{C(k=>k+1)},[]),R=b.useCallback(async()=>{var k,E,_,q,G,S,B,$;A(!0),O(null);try{const se=await Xe("/settings");se.success&&((E=(k=se.data)==null?void 0:k.systemConfig)!=null&&E.routing)&&i({enableGlobalRoute:se.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:se.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:se.data.systemConfig.routing.enableBearerAuth??!1,bearerAuthKey:se.data.systemConfig.routing.bearerAuthKey||"",skipAuth:se.data.systemConfig.routing.skipAuth??!1}),se.success&&((q=(_=se.data)==null?void 0:_.systemConfig)!=null&&q.install)&&p({pythonIndexUrl:se.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:se.data.systemConfig.install.npmRegistry||"",baseUrl:se.data.systemConfig.install.baseUrl||"http://localhost:3000"}),se.success&&((S=(G=se.data)==null?void 0:G.systemConfig)!=null&&S.smartRouting)&&h({enabled:se.data.systemConfig.smartRouting.enabled??!1,dbUrl:se.data.systemConfig.smartRouting.dbUrl||"",openaiApiBaseUrl:se.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:se.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:se.data.systemConfig.smartRouting.openaiApiEmbeddingModel||""}),se.success&&(($=(B=se.data)==null?void 0:B.systemConfig)!=null&&$.mcpRouter)&&N({apiKey:se.data.systemConfig.mcpRouter.apiKey||"",referer:se.data.systemConfig.mcpRouter.referer||"https://www.mcphubx.com",title:se.data.systemConfig.mcpRouter.title||"MCPHub",baseUrl:se.data.systemConfig.mcpRouter.baseUrl||"https://api.mcprouter.to/v1"})}catch(se){console.error("Failed to fetch settings:",se),O(se instanceof Error?se.message:"Failed to fetch settings"),o(r("errors.failedToFetchSettings"))}finally{A(!1)}},[r]),W=async(k,E)=>{A(!0),O(null);try{const _=await Wt("/system-config",{routing:{[k]:E}});return _.success?(i({...l,[k]:E}),o(r("settings.systemConfigUpdated")),!0):(o(_.message||r("errors.failedToUpdateRouteConfig")),!1)}catch(_){return console.error("Failed to update routing config:",_),O(_ instanceof Error?_.message:"Failed to update routing config"),o(r("errors.failedToUpdateRouteConfig")),!1}finally{A(!1)}},Z=async(k,E)=>{A(!0),O(null);try{const _=await Wt("/system-config",{install:{[k]:E}});return _.success?(p({...m,[k]:E}),o(r("settings.systemConfigUpdated")),!0):(o(_.message||r("errors.failedToUpdateSystemConfig")),!1)}catch(_){return console.error("Failed to update system config:",_),O(_ instanceof Error?_.message:"Failed to update system config"),o(r("errors.failedToUpdateSystemConfig")),!1}finally{A(!1)}},te=async(k,E)=>{A(!0),O(null);try{const _=await Wt("/system-config",{smartRouting:{[k]:E}});return _.success?(h({...g,[k]:E}),o(r("settings.systemConfigUpdated")),!0):(o(_.message||r("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(_){console.error("Failed to update smart routing config:",_);const q=_ instanceof Error?_.message:"Failed to update smart routing config";return O(q),o(q),!1}finally{A(!1)}},ae=async k=>{A(!0),O(null);try{const E=await Wt("/system-config",{smartRouting:k});return E.success?(h({...g,...k}),o(r("settings.systemConfigUpdated")),!0):(o(E.message||r("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(E){console.error("Failed to update smart routing config:",E);const _=E instanceof Error?E.message:"Failed to update smart routing config";return O(_),o(_),!1}finally{A(!1)}},F=async k=>{A(!0),O(null);try{const E=await Wt("/system-config",{routing:k});return E.success?(i({...l,...k}),o(r("settings.systemConfigUpdated")),!0):(o(E.message||r("errors.failedToUpdateRouteConfig")),!1)}catch(E){return console.error("Failed to update routing config:",E),O(E instanceof Error?E.message:"Failed to update routing config"),o(r("errors.failedToUpdateRouteConfig")),!1}finally{A(!1)}},oe=async(k,E)=>{A(!0),O(null);try{const _=await Wt("/system-config",{mcpRouter:{[k]:E}});return _.success?(N({...y,[k]:E}),o(r("settings.systemConfigUpdated")),!0):(o(_.message||r("errors.failedToUpdateSystemConfig")),!1)}catch(_){console.error("Failed to update MCPRouter config:",_);const q=_ instanceof Error?_.message:"Failed to update MCPRouter config";return O(q),o(q),!1}finally{A(!1)}},ie=async k=>{A(!0),O(null);try{const E=await Wt("/system-config",{mcpRouter:k});return E.success?(N({...y,...k}),o(r("settings.systemConfigUpdated")),!0):(o(E.message||r("errors.failedToUpdateSystemConfig")),!1)}catch(E){console.error("Failed to update MCPRouter config:",E);const _=E instanceof Error?E.message:"Failed to update MCPRouter config";return O(_),o(_),!1}finally{A(!1)}};return b.useEffect(()=>{R()},[R,M]),b.useEffect(()=>{l&&f({bearerAuthKey:l.bearerAuthKey})},[l]),{routingConfig:l,tempRoutingConfig:d,setTempRoutingConfig:f,installConfig:m,smartRoutingConfig:g,mcpRouterConfig:y,loading:j,error:D,setError:O,triggerRefresh:T,fetchSettings:R,updateRoutingConfig:W,updateInstallConfig:Z,updateSmartRoutingConfig:te,updateSmartRoutingConfigBatch:ae,updateRoutingConfigBatch:F,updateMCPRouterConfig:oe,updateMCPRouterConfigBatch:ie}},_v=({group:r,servers:o,onEdit:l,onDelete:i})=>{const{t:d}=Se(),{showToast:f}=Fr(),{installConfig:m}=Eu(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[N,j]=b.useState(!1),[A,D]=b.useState(null),O=b.useRef(null);b.useEffect(()=>{const k=E=>{O.current&&!O.current.contains(E.target)&&j(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]);const M=()=>{l(r)},C=()=>{g(!0)},T=()=>{i(r.id),g(!1)},R=k=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(k).then(()=>{y(!0),j(!1),f(d("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)});else{const E=document.createElement("textarea");E.value=k,E.style.position="fixed",E.style.left="-9999px",document.body.appendChild(E),E.focus(),E.select();try{document.execCommand("copy"),y(!0),j(!1),f(d("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)}catch(_){f(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",_)}document.body.removeChild(E)}},W=()=>{R(r.id)},Z=()=>{R(`${m.baseUrl}/mcp/${r.id}`)},te=()=>{const k={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${r.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};R(JSON.stringify(k,null,2))},ae=k=>k.map(E=>typeof E=="string"?E:E.name),F=k=>{const E=r.servers.find(_=>typeof _=="string"?_===k:_.name===k);return typeof E=="string"?{name:E,tools:"all"}:E},oe=ae(r.servers),ie=o.filter(k=>oe.includes(k.name));return n.jsxs("div",{className:"bg-white shadow rounded-lg p-6 ",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:r.name}),n.jsxs("div",{className:"flex items-center ml-3",children:[n.jsx("span",{className:"text-xs text-gray-500 mr-1",children:r.id}),n.jsxs("div",{className:"relative",ref:O,children:[n.jsxs("button",{onClick:()=>j(!N),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:d("common.copy"),children:[h?n.jsx($r,{size:14,className:"text-green-500"}):n.jsx(eu,{size:14}),n.jsx(Ao,{size:12,className:"ml-1"})]}),N&&n.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:[n.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:[n.jsx(eu,{size:12,className:"mr-2"}),d("common.copyId")]}),n.jsxs("button",{onClick:Z,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[n.jsx(Ab,{size:12,className:"mr-2"}),d("common.copyUrl")]}),n.jsxs("button",{onClick:te,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[n.jsx(Cb,{size:12,className:"mr-2"}),d("common.copyJson")]})]})]})]})]}),r.description&&n.jsx("p",{className:"text-gray-600 text-sm mt-1",children:r.description})]}),n.jsxs("div",{className:"flex items-center space-x-3",children:[n.jsx("div",{className:"bg-blue-50 text-blue-700 px-3 py-1 rounded-full text-sm btn-secondary",children:d("groups.serverCount",{count:r.servers.length})}),n.jsx("button",{onClick:M,className:"text-gray-500 hover:text-gray-700",title:d("groups.edit"),children:n.jsx(Nu,{size:18})}),n.jsx("button",{onClick:C,className:"text-gray-500 hover:text-red-600",title:d("groups.delete"),children:n.jsx(Kb,{size:18})})]})]}),n.jsx("div",{className:"mt-4",children:ie.length===0?n.jsx("p",{className:"text-gray-500 italic",children:d("groups.noServers")}):n.jsx("div",{className:"flex flex-wrap gap-2",children:ie.map(k=>{var $;const E=F(k.name),_=E&&E.tools!=="all"&&Array.isArray(E.tools),q=_&&Array.isArray(E==null?void 0:E.tools)?E.tools.length:(($=k.tools)==null?void 0:$.length)||0,G=A===k.name,S=()=>_&&Array.isArray(E==null?void 0:E.tools)?E.tools:k.tools&&k.tools.length>0?k.tools.map(se=>se.name):[],B=()=>{D(G?null:k.name)};return n.jsxs("div",{className:"relative",children:[n.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:B,children:[n.jsx("span",{className:"font-medium text-gray-700 text-sm",children:k.name}),n.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${k.status==="connected"?"bg-green-500":k.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),q>0&&n.jsxs("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded flex items-center gap-1",children:[n.jsx(Xb,{size:12}),q]})]}),G&&n.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:[n.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[d(_?"groups.selectedTools":"groups.allTools"),":"]}),n.jsx("div",{className:"flex flex-wrap gap-1",children:S().map((se,w)=>n.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:se},w))})]})]},k.name)})})}),n.jsx(tp,{isOpen:p,onClose:()=>g(!1),onConfirm:T,serverName:r.name,isGroup:!0})]})},Bv=()=>{const{t:r}=Se(),{groups:o,loading:l,error:i,setError:d,deleteGroup:f,triggerRefresh:m}=Cu(),{servers:p}=Yr({refreshOnMount:!0}),[g,h]=b.useState(null),[y,N]=b.useState(!1),j=C=>{h(C)},A=()=>{h(null),m()},D=async C=>{const T=await f(C);(!T||!T.success)&&d((T==null?void 0:T.message)||r("groups.deleteError"))},O=()=>{N(!0)},M=()=>{N(!1),m()};return n.jsxs("div",{children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:r("pages.groups.title")}),n.jsx("div",{className:"flex space-x-4",children:n.jsxs("button",{onClick:O,className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})}),r("groups.add")]})})]}),i&&n.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:n.jsx("p",{children:i})}),l?n.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:n.jsxs("div",{className:"flex flex-col items-center justify-center",children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.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"})]}),n.jsx("p",{className:"text-gray-600",children:r("app.loading")})]})}):o.length===0?n.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:n.jsx("p",{className:"text-gray-600",children:r("groups.noGroups")})}):n.jsx("div",{className:"space-y-6",children:o.map(C=>n.jsx(_v,{group:C,servers:p,onEdit:j,onDelete:D},C.id))}),y&&n.jsx(Uv,{onAdd:M,onCancel:M}),g&&n.jsx(Lv,{group:g,onEdit:A,onCancel:()=>h(null)})]})},Hv=()=>n.jsx("div",{}),Pv=({onSuccess:r,onCancel:o})=>{const{t:l}=Se(),[i,d]=b.useState({currentPassword:"",newPassword:""}),[f,m]=b.useState(""),[p,g]=b.useState(!1),[h,y]=b.useState(null),[N,j]=b.useState(!1),A=O=>{const{name:M,value:C}=O.target;M==="confirmPassword"?m(C):d(T=>({...T,[M]:C}))},D=async O=>{if(O.preventDefault(),y(null),i.newPassword!==f){y(l("auth.passwordsNotMatch"));return}g(!0);try{const M=await cb(i);M.success?(j(!0),r&&r()):y(M.message||l("auth.changePasswordError"))}catch{y(l("auth.changePasswordError"))}finally{g(!1)}};return n.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-md",children:[n.jsx("h2",{className:"text-xl font-bold mb-4",children:l("auth.changePassword")}),N?n.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:l("auth.changePasswordSuccess")}):n.jsxs("form",{onSubmit:D,children:[h&&n.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:h}),n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"currentPassword",children:l("auth.currentPassword")}),n.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:A,required:!0})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"newPassword",children:l("auth.newPassword")}),n.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:A,required:!0,minLength:6})]}),n.jsxs("div",{className:"mb-6",children:[n.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"confirmPassword",children:l("auth.confirmPassword")}),n.jsx("input",{type:"password",id:"confirmPassword",name:"confirmPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:f,onChange:A,required:!0,minLength:6})]}),n.jsxs("div",{className:"flex justify-end space-x-2",children:[o&&n.jsx("button",{type:"button",onClick:o,disabled:p,className:"py-2 px-4 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:l("common.cancel")}),n.jsx("button",{type:"submit",disabled:p,className:"py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 btn-primary",children:p?n.jsxs("span",{className:"flex items-center",children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("common.save")]}):l("common.save")})]})]})]})};function qv(r=32){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",l=new Uint8Array(r);return crypto.getRandomValues(l),Array.from(l).map(i=>o.charAt(i%o.length)).join("")}const mo={SETTINGS_SMART_ROUTING:"settings:smart_routing",SETTINGS_SKIP_AUTH:"settings:skip_auth",SETTINGS_INSTALL_CONFIG:"settings:install_config"},Vv=()=>{const{t:r}=Se(),o=Ga(),{showToast:l}=Fr(),[i,d]=b.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[f,m]=b.useState({dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[p,g]=b.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),{routingConfig:h,tempRoutingConfig:y,setTempRoutingConfig:N,installConfig:j,smartRoutingConfig:A,mcpRouterConfig:D,loading:O,updateRoutingConfig:M,updateRoutingConfigBatch:C,updateInstallConfig:T,updateSmartRoutingConfig:R,updateSmartRoutingConfigBatch:W,updateMCPRouterConfig:Z}=Eu();b.useEffect(()=>{j&&d(j)},[j]),b.useEffect(()=>{A&&m({dbUrl:A.dbUrl||"",openaiApiBaseUrl:A.openaiApiBaseUrl||"",openaiApiKey:A.openaiApiKey||"",openaiApiEmbeddingModel:A.openaiApiEmbeddingModel||""})},[A]),b.useEffect(()=>{D&&g({apiKey:D.apiKey||"",referer:D.referer||"https://www.mcphubx.com",title:D.title||"MCPHub",baseUrl:D.baseUrl||"https://api.mcprouter.to/v1"})},[D]);const[te,ae]=b.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,mcpRouterConfig:!1,password:!1}),F=w=>{ae(I=>({...I,[w]:!I[w]}))},oe=async(w,I)=>{if(w==="enableBearerAuth"&&I===!0&&!y.bearerAuthKey&&!h.bearerAuthKey){const le=qv();ie(le),await C({enableBearerAuth:!0,bearerAuthKey:le})&&N(K=>({...K,bearerAuthKey:le}));return}await M(w,I)},ie=w=>{N(I=>({...I,bearerAuthKey:w}))},k=async()=>{await M("bearerAuthKey",y.bearerAuthKey)},E=(w,I)=>{d({...i,[w]:I})},_=async w=>{await T(w,i[w])},q=(w,I)=>{m({...f,[w]:I})},G=async w=>{await R(w,f[w])},S=(w,I)=>{g({...p,[w]:I})},B=async w=>{await Z(w,p[w])},$=async w=>{if(w){const I=f.dbUrl||A.dbUrl,le=f.openaiApiKey||A.openaiApiKey;if(!I||!le){const K=[];I||K.push(r("settings.dbUrl")),le||K.push(r("settings.openaiApiKey")),l(r("settings.smartRoutingValidationError",{fields:K.join(", ")}));return}const H={enabled:w};f.dbUrl!==A.dbUrl&&(H.dbUrl=f.dbUrl),f.openaiApiBaseUrl!==A.openaiApiBaseUrl&&(H.openaiApiBaseUrl=f.openaiApiBaseUrl),f.openaiApiKey!==A.openaiApiKey&&(H.openaiApiKey=f.openaiApiKey),f.openaiApiEmbeddingModel!==A.openaiApiEmbeddingModel&&(H.openaiApiEmbeddingModel=f.openaiApiEmbeddingModel),await W(H)}else await R("enabled",w)},se=()=>{setTimeout(()=>{o("/")},2e3)};return n.jsxs("div",{className:"container mx-auto",children:[n.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:r("pages.settings.title")}),n.jsx(uo,{permissions:mo.SETTINGS_SMART_ROUTING,children:n.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card dashboard-card",children:[n.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>F("smartRoutingConfig"),children:[n.jsx("h2",{className:"font-semibold text-gray-800",children:r("pages.settings.smartRouting")}),n.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:te.smartRoutingConfig?"▼":"►"})]}),te.smartRoutingConfig&&n.jsxs("div",{className:"space-y-4 mt-4",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.enableSmartRouting")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.enableSmartRoutingDescription")})]}),n.jsx(Ln,{disabled:O,checked:A.enabled,onCheckedChange:w=>$(w)})]}),n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsx("div",{className:"mb-2",children:n.jsxs("h3",{className:"font-medium text-gray-700",children:[n.jsx("span",{className:"text-red-500 px-1",children:"*"}),r("settings.dbUrl")]})}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",value:f.dbUrl,onChange:w=>q("dbUrl",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>G("dbUrl"),disabled:O,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:r("common.save")})]})]}),n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsx("div",{className:"mb-2",children:n.jsxs("h3",{className:"font-medium text-gray-700",children:[n.jsx("span",{className:"text-red-500 px-1",children:"*"}),r("settings.openaiApiKey")]})}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"password",value:f.openaiApiKey,onChange:w=>q("openaiApiKey",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>G("openaiApiKey"),disabled:O,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:r("common.save")})]})]}),n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsx("div",{className:"mb-2",children:n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.openaiApiBaseUrl")})}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",value:f.openaiApiBaseUrl,onChange:w=>q("openaiApiBaseUrl",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>G("openaiApiBaseUrl"),disabled:O,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:r("common.save")})]})]}),n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsx("div",{className:"mb-2",children:n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.openaiApiEmbeddingModel")})}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",value:f.openaiApiEmbeddingModel,onChange:w=>q("openaiApiEmbeddingModel",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>G("openaiApiEmbeddingModel"),disabled:O,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:r("common.save")})]})]})]})]})}),n.jsx(uo,{permissions:mo.SETTINGS_INSTALL_CONFIG,children:n.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card dashboard-card",children:[n.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>F("mcpRouterConfig"),children:[n.jsx("h2",{className:"font-semibold text-gray-800",children:r("settings.mcpRouterConfig")}),n.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:te.mcpRouterConfig?"▼":"►"})]}),te.mcpRouterConfig&&n.jsxs("div",{className:"space-y-4 mt-4",children:[n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.mcpRouterApiKey")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.mcpRouterApiKeyDescription")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"password",value:p.apiKey,onChange:w=>S("apiKey",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>B("apiKey"),disabled:O,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:r("common.save")})]})]}),n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.mcpRouterBaseUrl")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.mcpRouterBaseUrlDescription")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",value:p.baseUrl,onChange:w=>S("baseUrl",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>B("baseUrl"),disabled:O,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:r("common.save")})]})]})]})]})}),n.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[n.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>F("routingConfig"),children:[n.jsx("h2",{className:"font-semibold text-gray-800",children:r("pages.settings.routeConfig")}),n.jsx("span",{className:"text-gray-500",children:te.routingConfig?"▼":"►"})]}),te.routingConfig&&n.jsxs("div",{className:"space-y-4 mt-4",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.enableBearerAuth")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.enableBearerAuthDescription")})]}),n.jsx(Ln,{disabled:O,checked:h.enableBearerAuth,onCheckedChange:w=>oe("enableBearerAuth",w)})]}),h.enableBearerAuth&&n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.bearerAuthKey")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.bearerAuthKeyDescription")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",value:y.bearerAuthKey,onChange:w=>ie(w.target.value),placeholder:r("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:O||!h.enableBearerAuth}),n.jsx("button",{onClick:k,disabled:O||!h.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:r("common.save")})]})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.enableGlobalRoute")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.enableGlobalRouteDescription")})]}),n.jsx(Ln,{disabled:O,checked:h.enableGlobalRoute,onCheckedChange:w=>oe("enableGlobalRoute",w)})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.enableGroupNameRoute")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.enableGroupNameRouteDescription")})]}),n.jsx(Ln,{disabled:O,checked:h.enableGroupNameRoute,onCheckedChange:w=>oe("enableGroupNameRoute",w)})]}),n.jsx(uo,{permissions:mo.SETTINGS_SKIP_AUTH,children:n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.skipAuth")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.skipAuthDescription")})]}),n.jsx(Ln,{disabled:O,checked:h.skipAuth,onCheckedChange:w=>oe("skipAuth",w)})]})})]})]}),n.jsx(uo,{permissions:mo.SETTINGS_INSTALL_CONFIG,children:n.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[n.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>F("installConfig"),children:[n.jsx("h2",{className:"font-semibold text-gray-800",children:r("settings.installConfig")}),n.jsx("span",{className:"text-gray-500",children:te.installConfig?"▼":"►"})]}),te.installConfig&&n.jsxs("div",{className:"space-y-4 mt-4",children:[n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.baseUrl")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.baseUrlDescription")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",value:i.baseUrl,onChange:w=>E("baseUrl",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>_("baseUrl"),disabled:O,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:r("common.save")})]})]}),n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.pythonIndexUrl")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.pythonIndexUrlDescription")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",value:i.pythonIndexUrl,onChange:w=>E("pythonIndexUrl",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>_("pythonIndexUrl"),disabled:O,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:r("common.save")})]})]}),n.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"font-medium text-gray-700",children:r("settings.npmRegistry")}),n.jsx("p",{className:"text-sm text-gray-500",children:r("settings.npmRegistryDescription")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",value:i.npmRegistry,onChange:w=>E("npmRegistry",w.target.value),placeholder:r("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:O}),n.jsx("button",{onClick:()=>_("npmRegistry"),disabled:O,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:r("common.save")})]})]})]})]})}),n.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[n.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>F("password"),children:[n.jsx("h2",{className:"font-semibold text-gray-800",children:r("auth.changePassword")}),n.jsx("span",{className:"text-gray-500",children:te.password?"▼":"►"})]}),te.password&&n.jsx("div",{className:"max-w-lg mt-4",children:n.jsx(Pv,{onSuccess:se})})]})]})},Gv=()=>{const{t:r}=Se(),[o,l]=b.useState([]),[i,d]=b.useState([]),[f,m]=b.useState([]),[p,g]=b.useState([]),[h,y]=b.useState(""),[N,j]=b.useState(""),[A,D]=b.useState(""),[O,M]=b.useState(!0),[C,T]=b.useState(null),[R,W]=b.useState(null),[Z,te]=b.useState([]),[ae,F]=b.useState(1),[oe,ie]=b.useState(9),[k,E]=b.useState(1),_=b.useCallback(async()=>{try{M(!0);const J=await Xe("/market/servers");J&&J.success&&Array.isArray(J.data)?(d(J.data),q(J.data,ae)):(console.error("Invalid market servers data format:",J),T(r("market.fetchError")))}catch(J){console.error("Error fetching market servers:",J),T(J instanceof Error?J.message:String(J))}finally{M(!1)}},[r]),q=b.useCallback((J,X,de=oe)=>{const be=J.length,je=Math.ceil(be/de);E(je);const xe=Math.max(1,Math.min(X,je));xe!==X&&F(xe);const Te=(xe-1)*de,Be=J.slice(Te,Te+de);l(Be)},[oe]),G=b.useCallback(J=>{F(J),q(i,J,oe)},[i,q,oe]),S=b.useCallback(async()=>{try{const J=await Xe("/market/categories");J&&J.success&&Array.isArray(J.data)?m(J.data):console.error("Invalid categories data format:",J)}catch(J){console.error("Error fetching categories:",J)}},[]),B=b.useCallback(async()=>{try{const J=await Xe("/market/tags");J&&J.success&&Array.isArray(J.data)?g(J.data):console.error("Invalid tags data format:",J)}catch(J){console.error("Error fetching tags:",J)}},[]),$=b.useCallback(async J=>{try{M(!0);const X=await Xe(`/market/servers/${J}`);return X&&X.success&&X.data?(W(X.data),X.data):(console.error("Invalid server data format:",X),T(r("market.serverNotFound")),null)}catch(X){return console.error(`Error fetching server ${J}:`,X),T(X instanceof Error?X.message:String(X)),null}finally{M(!1)}},[r]),se=b.useCallback(async J=>{try{if(M(!0),D(J),!J.trim()){_();return}const X=await Xe(`/market/servers/search?query=${encodeURIComponent(J)}`);X&&X.success&&Array.isArray(X.data)?(d(X.data),F(1),q(X.data,1)):(console.error("Invalid search results format:",X),T(r("market.searchError")))}catch(X){console.error("Error searching servers:",X),T(X instanceof Error?X.message:String(X))}finally{M(!1)}},[r,i,q,_]),w=b.useCallback(async J=>{try{if(M(!0),y(J),j(""),!J){_();return}const X=await Xe(`/market/categories/${encodeURIComponent(J)}`);X&&X.success&&Array.isArray(X.data)?(d(X.data),F(1),q(X.data,1)):(console.error("Invalid category filter results format:",X),T(r("market.filterError")))}catch(X){console.error("Error filtering servers by category:",X),T(X instanceof Error?X.message:String(X))}finally{M(!1)}},[r,_,q]),I=b.useCallback(async J=>{try{if(M(!0),j(J),y(""),!J){_();return}const X=await Xe(`/market/tags/${encodeURIComponent(J)}`);X&&X.success&&Array.isArray(X.data)?(d(X.data),F(1),q(X.data,1)):(console.error("Invalid tag filter results format:",X),T(r("market.tagFilterError")))}catch(X){console.error("Error filtering servers by tag:",X),T(X instanceof Error?X.message:String(X))}finally{M(!1)}},[r,_,q]),le=b.useCallback(async()=>{try{const J=await Xe("/servers");if(J&&J.success&&Array.isArray(J.data)){const X=J.data.map(de=>de.name);te(X)}}catch(J){console.error("Error fetching installed servers:",J)}},[]),H=b.useCallback(J=>Z.includes(J),[Z]),K=b.useCallback(async(J,X)=>{var de,be;try{const je=(de=J.installations)!=null&&de.npm?"npm":Object.keys(J.installations||{}).length>0?Object.keys(J.installations)[0]:null;if(!je||!((be=J.installations)!=null&&be[je]))return T(r("market.noInstallationMethod")),!1;const xe=J.installations[je],Te={name:J.name,config:X.type==="stdio"?{command:X.command||xe.command||"",args:X.args||xe.args||[],env:{...xe.env,...X.env}}:X},Be=await kt("/servers",Te);if(!Be.success)throw new Error(Be.message||"Failed to install server");return await le(),!0}catch(je){return console.error("Error installing server:",je),T(je instanceof Error?je.message:String(je)),!1}},[r,le]),me=b.useCallback(J=>{ie(J),F(1),q(i,1,J)},[i,q]);return b.useEffect(()=>{_(),S(),B(),le()},[_,S,B,le]),{servers:o,allServers:i,categories:f,tags:p,selectedCategory:h,selectedTag:N,searchQuery:A,loading:O,error:C,setError:T,currentServer:R,fetchMarketServers:_,fetchServerByName:$,searchServers:se,filterByCategory:w,filterByTag:I,installServer:K,currentPage:ae,totalPages:k,serversPerPage:oe,changePage:G,changeServersPerPage:me,isServerInstalled:H}},Kv=()=>{const{t:r}=Se(),[o,l]=b.useState([]),[i,d]=b.useState([]),[f,m]=b.useState([]),[p,g]=b.useState([]),[h,y]=b.useState(""),[N,j]=b.useState(""),[A,D]=b.useState(""),[O,M]=b.useState(!0),[C,T]=b.useState(null),[R,W]=b.useState(null),[Z,te]=b.useState(1),[ae,F]=b.useState(9),[oe,ie]=b.useState(1),k=b.useCallback(async()=>{try{M(!0);const H=await Xe("/cloud/servers");H&&H.success&&Array.isArray(H.data)?(d(H.data),E(H.data,Z)):(console.error("Invalid cloud market servers data format:",H),T(r("cloud.fetchError")))}catch(H){console.error("Error fetching cloud market servers:",H);const K=H instanceof Error?H.message:String(H);K==="MCPROUTER_API_KEY_NOT_CONFIGURED"||K.toLowerCase().includes("mcprouter api key not configured"),T(K)}finally{M(!1)}},[r]),E=b.useCallback((H,K,me=ae)=>{const J=H.length,X=Math.ceil(J/me);ie(X);const de=Math.max(1,Math.min(K,X));de!==K&&te(de);const be=(de-1)*me,je=H.slice(be,be+me);l(je)},[ae]),_=b.useCallback(H=>{te(H),E(i,H,ae)},[i,E,ae]),q=b.useCallback(async()=>{try{const H=await Xe("/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)}},[]),G=b.useCallback(async()=>{try{const H=await Xe("/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)}},[]),S=b.useCallback(async H=>{try{M(!0);const K=await Xe(`/cloud/servers/${H}`);return K&&K.success&&K.data?(W(K.data),K.data):(console.error("Invalid cloud server data format:",K),T(r("cloud.serverNotFound")),null)}catch(K){console.error(`Error fetching cloud server ${H}:`,K);const me=K instanceof Error?K.message:String(K);return me==="MCPROUTER_API_KEY_NOT_CONFIGURED"||me.toLowerCase().includes("mcprouter api key not configured"),T(me),null}finally{M(!1)}},[r]),B=b.useCallback(async H=>{try{if(M(!0),D(H),!H.trim()){k();return}const K=await Xe(`/cloud/servers/search?query=${encodeURIComponent(H)}`);K&&K.success&&Array.isArray(K.data)?(d(K.data),te(1),E(K.data,1)):(console.error("Invalid cloud search results format:",K),T(r("cloud.searchError")))}catch(K){console.error("Error searching cloud servers:",K),T(K instanceof Error?K.message:String(K))}finally{M(!1)}},[r,i,E,k]),$=b.useCallback(async H=>{try{if(M(!0),y(H),j(""),!H){k();return}const K=await Xe(`/cloud/categories/${encodeURIComponent(H)}`);K&&K.success&&Array.isArray(K.data)?(d(K.data),te(1),E(K.data,1)):(console.error("Invalid cloud category filter results format:",K),T(r("cloud.filterError")))}catch(K){console.error("Error filtering cloud servers by category:",K),T(K instanceof Error?K.message:String(K))}finally{M(!1)}},[r,k,E]),se=b.useCallback(async H=>{try{if(M(!0),j(H),y(""),!H){k();return}const K=await Xe(`/cloud/tags/${encodeURIComponent(H)}`);K&&K.success&&Array.isArray(K.data)?(d(K.data),te(1),E(K.data,1)):(console.error("Invalid cloud tag filter results format:",K),T(r("cloud.tagFilterError")))}catch(K){console.error("Error filtering cloud servers by tag:",K),T(K instanceof Error?K.message:String(K))}finally{M(!1)}},[r,k,E]),w=b.useCallback(async H=>{try{const K=await Xe(`/cloud/servers/${H}/tools`);if(!K.success)throw console.error("Failed to fetch cloud server tools:",K),new Error(K.message||"Failed to fetch cloud server tools");return K&&K.success&&Array.isArray(K.data)?K.data:(console.error("Invalid cloud server tools data format:",K),[])}catch(K){console.error(`Error fetching tools for cloud server ${H}:`,K);const me=K instanceof Error?K.message:String(K);if(me==="MCPROUTER_API_KEY_NOT_CONFIGURED"||me.toLowerCase().includes("mcprouter api key not configured"))throw K;return[]}},[]),I=b.useCallback(async(H,K,me)=>{try{const J=await kt(`/cloud/servers/${H}/tools/${K}/call`,{arguments:me});if(J&&J.success)return J.data;throw new Error(J.message||"Failed to call tool")}catch(J){throw console.error(`Error calling tool ${K} on cloud server ${H}:`,J),J}},[]),le=b.useCallback(H=>{F(H),te(1),E(i,1,H)},[i,E]);return b.useEffect(()=>{k(),q(),G()},[k,q,G]),{servers:o,allServers:i,categories:f,tags:p,selectedCategory:h,selectedTag:N,searchQuery:A,loading:O,error:C,setError:T,currentServer:R,fetchCloudServers:k,fetchServerByName:S,searchServers:B,filterByCategory:$,filterByTag:se,fetchServerTools:w,callServerTool:I,currentPage:Z,totalPages:oe,serversPerPage:ae,changePage:_,changeServersPerPage:le}},$v=({server:r,onClick:o})=>{var g,h,y,N;const{t:l}=Se(),i=j=>j.split(" ").map(A=>A.charAt(0)).join("").toUpperCase().slice(0,2),d=()=>{if(!r.tags||r.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const j=28,A=R=>R.length+3;let D=0,O=0;const M=[...r.tags].sort((R,W)=>R.length-W.length);for(O=0;O<M.length;O++){const R=A(M[O]);if(D+R>j)break;if(D+=R,O===M.length-1)return{tagsToShow:M,hasMore:!1,moreCount:0}}O===0&&M.length>0&&(O=1);const C=M.length-O,T=3+String(C).length+l("market.moreTags").length;return D+T<=j||O<1?{tagsToShow:M.slice(0,O),hasMore:!0,moreCount:C}:{tagsToShow:M.slice(0,Math.max(1,O-1)),hasMore:!0,moreCount:C+1}},{tagsToShow:f,hasMore:m,moreCount:p}=d();return n.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:()=>o(r),children:[n.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"}),n.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsxs("div",{className:"flex-1",children:[n.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:r.display_name}),n.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[n.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=r.author)==null?void 0:g.name)||l("market.unknown"))}),n.jsx("div",{children:n.jsx("p",{className:"text-xs font-medium text-gray-700",children:((h=r.author)==null?void 0:h.name)||l("market.unknown")})})]})]}),n.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.is_official&&n.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:l("market.official")})})]}),n.jsx("div",{className:"mb-2 flex-1",children:n.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2 min-h-[36px]",children:r.description})}),n.jsx("div",{className:"mb-2",children:n.jsx("div",{className:"flex flex-wrap gap-1 min-h-[24px]",children:((y=r.categories)==null?void 0:y.length)>0?r.categories.map((j,A)=>n.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded whitespace-nowrap",children:j},A)):n.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})}),n.jsx("div",{className:"mb-2",children:n.jsx("div",{className:"relative min-h-[24px] overflow-x-auto",children:((N=r.tags)==null?void 0:N.length)>0?n.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[f.map((j,A)=>n.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0",children:["#",j]},A)),m&&n.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",p," ",l("market.moreTags")]})]}):n.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})})]})]})},Fv=({server:r,onBack:o,onInstall:l,installing:i=!1,isInstalled:d=!1})=>{var oe,ie;const{t:f}=Se(),[m,p]=b.useState(!1),[g,h]=b.useState(null),[y,N]=b.useState(!1),[j,A]=b.useState(null),[D,O]=b.useState([]),M=()=>d?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installed")}:i?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white btn-primary",disabled:!1,text:f("market.install")},C=()=>{p(!m),h(null),N(!1),A(null)},T=async()=>{j&&(await R(j),N(!1),A(null))},R=async k=>{try{h(null),l(r,k.config),p(!1)}catch(E){console.error("Error installing server:",E),h(f("errors.serverInstall"))}},W=()=>{d||C()},Z=()=>{if(!r.installations)return;if(r.installations.npm)return r.installations.npm;if(r.installations.uvx)return r.installations.uvx;if(r.installations.default)return r.installations.default;const k=Object.keys(r.installations);if(k.length>0)return r.installations[k[0]]},te=async k=>{try{const E=ap(k);E.length>0?(O(E),A(k),N(!0)):await R(k)}catch(E){console.error("Error processing server installation:",E),h(f("errors.serverInstall"))}},ae=M(),F=Z();return n.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[n.jsx("div",{className:"mb-4",children:n.jsxs("button",{onClick:o,className:"text-gray-600 hover:text-gray-900 flex items-center",children:[n.jsx("svg",{className:"h-5 w-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),f("market.backToList")]})}),n.jsxs("div",{className:"flex justify-between items-start mb-4",children:[n.jsx("div",{children:n.jsxs("h2",{className:"text-2xl font-bold text-gray-900 flex items-center flex-wrap",children:[r.display_name,n.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",r.name,")"]}),n.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[f("market.author"),": ",r.author.name," • ",f("market.license"),": ",r.license," •",n.jsx("a",{href:r.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:f("market.repository")})]})]})}),n.jsxs("div",{className:"flex items-center",children:[r.is_official&&n.jsx("span",{className:"bg-blue-100 text-blue-800 text-sm font-normal px-4 py-2 rounded mr-2 flex items-center label-primary",children:f("market.official")}),n.jsx("button",{onClick:W,disabled:ae.disabled,className:ae.className,children:ae.text})]})]}),n.jsx("p",{className:"text-gray-700 mb-6",children:r.description}),n.jsxs("div",{className:"mb-6",children:[n.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[f("market.categories")," & ",f("market.tags")]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[(oe=r.categories)==null?void 0:oe.map((k,E)=>n.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:k},`cat-${E}`)),r.tags&&r.tags.map((k,E)=>n.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",k]},`tag-${E}`))]})]}),r.arguments&&Object.keys(r.arguments).length>0&&n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.arguments")}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[n.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.argumentName")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.description")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.required")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.example")})]})}),n.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(r.arguments).map(([k,E],_)=>n.jsxs("tr",{children:[n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:k}),n.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:E.description}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:E.required?n.jsx("span",{className:"text-green-600",children:"✓"}):n.jsx("span",{className:"text-gray-600",children:"✗"})}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:n.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:E.example})})]},_))})]})})]}),n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.tools")}),n.jsx("div",{className:"space-y-4",children:(ie=r.tools)==null?void 0:ie.map((k,E)=>n.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[n.jsxs("h4",{className:"font-medium mb-2",children:[k.name,n.jsx("button",{type:"button",onClick:()=>{const _=document.getElementById(`schema-${E}`);_&&_.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:f("market.viewSchema")})]}),n.jsx("p",{className:"text-gray-600 mb-2",children:k.description}),n.jsx("div",{className:"mt-2",children:n.jsx("pre",{id:`schema-${E}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(k.inputSchema,null,2)})})]},E))})]}),r.examples&&r.examples.length>0&&n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.examples")}),n.jsx("div",{className:"space-y-4",children:r.examples.map((k,E)=>n.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[n.jsx("h4",{className:"font-medium mb-2",children:k.title}),n.jsx("p",{className:"text-gray-600 mb-2",children:k.description}),n.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:k.prompt})]},E))})]}),n.jsx("div",{className:"mt-6 flex justify-end",children:n.jsx("button",{onClick:W,disabled:ae.disabled,className:ae.className,children:ae.text})}),m&&n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsx(Ro,{onSubmit:te,onCancel:C,modalTitle:f("market.installServer",{name:r.display_name}),formError:g,initialData:{name:r.name,status:"disconnected",config:F?{command:F.command||"",args:F.args||[],env:F.env||{}}:void 0}})}),y&&n.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:n.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[n.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:f("server.confirmVariables")}),n.jsx("p",{className:"text-gray-600 mb-4",children:f("server.variablesDetected")}),n.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:n.jsxs("div",{className:"flex items-start",children:[n.jsx("div",{className:"flex-shrink-0",children:n.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})})}),n.jsxs("div",{className:"ml-3",children:[n.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[f("server.detectedVariables"),":"]}),n.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:D.map((k,E)=>n.jsxs("li",{className:"font-mono",children:["$",`{${k}}`]},E))})]})]})}),n.jsx("p",{className:"text-gray-600 text-sm mb-6",children:f("market.confirmVariablesMessage")}),n.jsxs("div",{className:"flex justify-end space-x-3",children:[n.jsx("button",{onClick:()=>{N(!1),A(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:f("common.cancel")}),n.jsx("button",{onClick:T,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:f("market.confirmAndInstall")})]})]})})]})},Yv=({server:r,onClick:o})=>{const{t:l}=Se(),i=()=>{o(r)},d=()=>{if(r.description&&r.description.length<=150)return r.description;if(r.content){const p=r.content.split(`
|
|
211
|
+
`).filter(g=>g.trim());for(const g of p)if(g.length>50&&g.length<=150)return g}return r.description?r.description.slice(0,150)+"...":l("cloud.noDescription")},f=p=>{try{const g=new Date(p),h=g.getFullYear(),y=(g.getMonth()+1).toString().padStart(2,"0"),N=g.getDate().toString().padStart(2,"0");return`${h}/${y}/${N}`}catch{return""}},m=p=>p.split(" ").map(g=>g.charAt(0)).join("").toUpperCase().slice(0,2);return n.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:[n.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"}),n.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[n.jsxs("div",{className:"flex items-start justify-between mb-3",children:[n.jsxs("div",{className:"flex-1",children:[n.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:r.title||r.name}),n.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[n.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(r.author_name)}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-gray-700",children:r.author_name}),r.updated_at&&n.jsxs("p",{className:"text-xs text-gray-500",children:[l("cloud.updated")," ",f(r.updated_at)]})]})]})]}),n.jsx("div",{className:"flex flex-col items-end space-y-2",children:n.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"})})]}),n.jsx("div",{className:"mb-3 flex-1",children:n.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2",children:d()})}),r.tools&&r.tools.length>0&&n.jsx("div",{className:"mb-3",children:n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsxs("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[n.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"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),n.jsxs("span",{className:"text-sm text-gray-600 font-medium",children:[r.tools.length," ",r.tools.length===1?l("cloud.tool"):l("cloud.tools")]})]})}),n.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[n.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:[n.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:n.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"})}),n.jsx("span",{children:f(r.created_at)})]}),n.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[n.jsx("span",{children:l("cloud.viewDetails")}),n.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:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},ou=()=>{const{t:r}=Se(),o=Ga(),l=()=>{o("/settings")},i=()=>{window.open("https://mcprouter.co","_blank","noopener,noreferrer")};return n.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-6 mb-6",children:n.jsxs("div",{className:"flex items-start",children:[n.jsx("div",{className:"flex-shrink-0",children:n.jsx("svg",{className:"h-5 w-5 text-amber-400",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})})}),n.jsxs("div",{className:"ml-3 flex-1",children:[n.jsx("h3",{className:"text-sm font-medium text-amber-800",children:r("cloud.apiKeyNotConfigured")}),n.jsx("div",{className:"mt-2 text-sm text-amber-700",children:n.jsx("p",{children:r("cloud.apiKeyNotConfiguredDescription")})}),n.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[n.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:[n.jsx("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.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"})}),r("cloud.getApiKey")]}),n.jsxs("button",{onClick:l,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:[n.jsxs("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[n.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"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),r("cloud.configureInSettings")]})]})]})]})})},Xv=({serverName:r,onBack:o,onCallTool:l,fetchServerTools:i,onInstall:d,installing:f=!1,isInstalled:m=!1})=>{const{t:p}=Se(),{mcpRouterConfig:g}=Eu(),[h,y]=b.useState(null),[N,j]=b.useState(!0),[A,D]=b.useState(null),[O,M]=b.useState([]),[C,T]=b.useState(!1),[R,W]=b.useState(!1),[Z,te]=b.useState(null),[ae,F]=b.useState({}),[oe,ie]=b.useState({}),[k,E]=b.useState({}),[_,q]=b.useState(!1),[G,S]=b.useState(null),B=X=>(console.error("Checking for MCPRouter API key error:",X),X==="MCPROUTER_API_KEY_NOT_CONFIGURED"||X.toLowerCase().includes("mcprouter api key not configured")),$=()=>m?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:p("market.installed")}:f?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:p("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white transition-colors",disabled:!1,text:p("market.install")},se=()=>{!m&&d&&(q(!0),S(null))},w=()=>{q(!1),S(null)},I=async X=>{try{if(!h||!d)return;S(null),d(h,X.config),q(!1)}catch(de){console.error("Error installing server:",de),S(p("errors.serverInstall"))}};b.useEffect(()=>{(async()=>{try{j(!0),D(null);const de=await Xe(`/cloud/servers/${r}`);de&&de.success&&de.data?(y(de.data),M(de.data.tools||[])):D(p("cloud.serverNotFound"))}catch(de){console.error("Failed to load server details:",de),D(de instanceof Error?de.message:String(de))}finally{j(!1)}})()},[r,p]),b.useEffect(()=>{(async()=>{if(h&&(!h.tools||h.tools.length===0)&&i){T(!0),W(!1);try{const de=await i(h.name);M(de)}catch(de){console.error("Failed to load tools:",de);const be=de instanceof Error?de.message:String(de);B(be)&&W(!0)}finally{T(!1)}}})()},[h==null?void 0:h.name,h==null?void 0:h.tools,i]);const le=X=>{try{const de=new Date(X),be=de.getFullYear(),je=String(de.getMonth()+1).padStart(2,"0"),xe=String(de.getDate()).padStart(2,"0"),Te=String(de.getHours()).padStart(2,"0"),Be=String(de.getMinutes()).padStart(2,"0"),rt=String(de.getSeconds()).padStart(2,"0");return`${be}-${je}-${xe} ${Te}:${Be}:${rt}`}catch{return X}},H=(X,de,be)=>{ie(je=>({...je,[X]:{...je[X],[de]:be}}))},K=async X=>{if(!(!l||!h)){te(X);try{const de=oe[X]||{},be=await l(h.server_key,X,de);F(je=>({...je,[X]:be}))}catch(de){console.error("Tool call failed:",de);const be=de instanceof Error?de.message:String(de);F(je=>({...je,[X]:{error:be}}))}finally{te(null)}}},me=X=>{E(de=>({...de,[X]:!de[X]}))},J=(X,de,be)=>{var Te;const je=((Te=oe[X.name])==null?void 0:Te[de])||"",xe=Be=>{let rt=Be.target.value;be.type==="number"||be.type==="integer"?rt=rt===""?void 0:Number(rt):be.type==="boolean"&&(rt=Be.target.value==="true"),H(X.name,de,rt)};return be.type==="boolean"?n.jsxs("select",{value:je===!0?"true":je===!1?"false":"",onChange:xe,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:[n.jsx("option",{value:""}),n.jsx("option",{value:"true",children:"True"}),n.jsx("option",{value:"false",children:"False"})]}):be.type==="number"||be.type==="integer"?n.jsx("input",{type:"number",step:be.type==="integer"?"1":"any",value:je||"",onChange:xe,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"}):n.jsx("input",{type:"text",value:je||"",onChange:xe,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 n.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[n.jsx("div",{className:"mb-6",children:n.jsxs("button",{onClick:o,className:"inline-flex items-center text-gray-600 hover:text-gray-900 transition-colors group",children:[n.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:n.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),p("cloud.backToList")]})}),N?n.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:n.jsxs("div",{className:"flex flex-col items-center",children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.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"})]}),n.jsx("p",{className:"text-gray-600 text-lg",children:p("app.loading")})]})}):A&&!B(A)?n.jsx("div",{className:"bg-white rounded-xl shadow-sm p-6",children:n.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("svg",{className:"h-5 w-5 text-red-400 mr-3",fill:"currentColor",viewBox:"0 0 20 20",children:n.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"})}),n.jsx("p",{className:"text-red-700",children:A})]})})}):h?n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden",children:n.jsx("div",{className:"bg-gradient-to-r from-gray-100 to-gray-200 px-6 py-4",children:n.jsxs("div",{className:"flex justify-between items-end",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("h1",{className:"text-2xl font-bold text-gray-800 mb-2",children:h.title||h.name}),n.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[n.jsx("span",{className:"text-sm bg-white/60 text-gray-700 px-3 py-1 rounded-full",children:h.name}),n.jsxs("div",{className:"flex items-center",children:[n.jsx("svg",{className:"h-4 w-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})}),p("cloud.by")," ",h.author_name]})]})]}),n.jsxs("div",{className:"text-right flex flex-col items-end gap-3",children:[n.jsxs("div",{className:"text-xs text-gray-500",children:[p("cloud.updated"),": ",le(h.updated_at)]}),d&&!B(A||"")&&!R&&n.jsx("button",{onClick:se,disabled:$().disabled,className:$().className,children:$().text})]})]})})}),n.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[n.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[n.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),p("cloud.description")]}),n.jsx("p",{className:"text-gray-700 leading-relaxed",children:h.description})]}),h.content&&n.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[n.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[n.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),p("cloud.details")]}),n.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:n.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:h.content})})]}),n.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[n.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[n.jsxs("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[n.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"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),p("cloud.tools"),O.length>0&&n.jsx("span",{className:"ml-2 bg-blue-100 text-blue-800 text-sm font-medium px-2.5 py-0.5 rounded-full",children:O.length})]}),R&&n.jsx(ou,{}),C?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.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"})]}),n.jsx("span",{className:"text-gray-600",children:p("cloud.loadingTools")})]}):O.length===0&&!R?n.jsxs("div",{className:"text-center py-12",children:[n.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.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"})}),n.jsx("p",{className:"text-gray-600",children:p("cloud.noTools")})]}):O.length>0?n.jsx("div",{className:"space-y-4",children:O.map((X,de)=>n.jsxs("div",{className:"border border-gray-200 rounded-lg p-6 hover:border-gray-300 transition-colors",children:[n.jsxs("div",{className:"flex justify-between items-start mb-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-2 flex items-center",children:[n.jsx("span",{className:"bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded mr-3",children:"TOOL"}),X.name]}),n.jsx("p",{className:"text-gray-600 leading-relaxed whitespace-pre-wrap",children:X.description})]}),l&&n.jsx("button",{onClick:()=>K(X.name),disabled:Z===X.name,className:"ml-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center min-w-[100px] justify-center",children:Z===X.name?n.jsxs(n.Fragment,{children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),p("cloud.calling")]}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h6m2 8l4-4H7l4 4z"})}),p("cloud.callTool")]})})]}),X.inputSchema&&X.inputSchema.properties&&Object.keys(X.inputSchema.properties).length>0&&n.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700",children:p("cloud.parameters")}),n.jsxs("button",{onClick:()=>me(X.name),className:"text-sm text-blue-600 hover:text-blue-800 focus:outline-none flex items-center gap-1 transition-colors",children:[p("cloud.viewSchema"),n.jsx("svg",{className:`h-3 w-3 transition-transform duration-200 ${k[X.name]?"rotate-90":"rotate-0"}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})})]})]}),k[X.name]&&n.jsx("div",{className:"mb-4",children:n.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-3 overflow-auto",children:n.jsx("pre",{className:"text-sm text-gray-800",children:JSON.stringify(X.inputSchema,null,2)})})}),n.jsx("div",{className:"space-y-4",children:Object.entries(X.inputSchema.properties).map(([be,je])=>{var xe;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[be,((xe=X.inputSchema.required)==null?void 0:xe.includes(be))&&n.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),je.description&&n.jsx("p",{className:"text-xs text-gray-500",children:je.description}),J(X,be,je)]},be)})})]}),ae[X.name]&&n.jsx("div",{className:"border-t border-gray-100 pt-4 mt-4",children:ae[X.name].error?n.jsx(n.Fragment,{children:B(ae[X.name].error)?n.jsx(ou,{}):n.jsxs(n.Fragment,{children:[n.jsxs("h4",{className:"text-sm font-medium text-red-600 mb-3 flex items-center",children:[n.jsx("svg",{className:"h-4 w-4 text-red-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),p("cloud.error")]}),n.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:n.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap overflow-auto",children:ae[X.name].error})})]})}):n.jsxs(n.Fragment,{children:[n.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-3 flex items-center",children:[n.jsx("svg",{className:"h-4 w-4 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),p("cloud.result")]}),n.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:n.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap overflow-auto",children:JSON.stringify(ae[X.name],null,2)})})]})})]},de))}):null]})]}):n.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:n.jsxs("div",{className:"text-center",children:[n.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.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"})}),n.jsx("p",{className:"text-gray-600 text-lg",children:p("cloud.serverNotFound")})]})}),_&&h&&n.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:n.jsx(Ro,{onSubmit:I,onCancel:w,modalTitle:p("cloud.installServer",{name:h.title||h.name}),formError:G,initialData:{name:h.name,status:"disconnected",config:{type:"streamable-http",url:h.server_url,headers:{Authorization:`Bearer ${g.apiKey||"<MCPROUTER_API_KEY>"}`,"HTTP-Referer":g.referer||"<YOUR_APP_URL>","X-Title":g.title||"<YOUR_APP_NAME>"}}}})})]})},Qv=({currentPage:r,totalPages:o,onPageChange:l})=>{const i=()=>{const d=[];d.push(n.jsx("button",{onClick:()=>l(1),className:`px-3 py-1 mx-1 rounded ${r===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,r-Math.floor(5/2));m>2&&d.push(n.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let p=m;p<=Math.min(o-1,m+5-3);p++)d.push(n.jsx("button",{onClick:()=>l(p),className:`px-3 py-1 mx-1 rounded ${r===p?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:p},p));return m+5-3<o-1&&d.push(n.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),o>1&&d.push(n.jsx("button",{onClick:()=>l(o),className:`px-3 py-1 mx-1 rounded ${r===o?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:o},"last")),d};return o<=1?null:n.jsxs("div",{className:"flex justify-center items-center my-6",children:[n.jsx("button",{onClick:()=>l(Math.max(1,r-1)),disabled:r===1,className:`px-3 py-1 rounded mr-2 ${r===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"« Prev"}),n.jsx("div",{className:"flex",children:i()}),n.jsx("button",{onClick:()=>l(Math.min(o,r+1)),disabled:r===o,className:`px-3 py-1 rounded ml-2 ${r===o?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"Next »"})]})},Bh=()=>{const{t:r}=Se(),o=Ga(),{serverName:l}=dg(),{showToast:i}=Fr(),[d,f]=Xy(),m=d.get("tab")||"cloud",{servers:p,allServers:g,categories:h,loading:y,error:N,setError:j,searchServers:A,filterByCategory:D,filterByTag:O,selectedCategory:M,selectedTag:C,installServer:T,fetchServerByName:R,isServerInstalled:W,currentPage:Z,totalPages:te,changePage:ae,serversPerPage:F,changeServersPerPage:oe}=Gv(),{servers:ie,allServers:k,loading:E,error:_,setError:q,fetchServerTools:G,callServerTool:S,currentPage:B,totalPages:$,changePage:se,serversPerPage:w,changeServersPerPage:I}=Kv(),[le,H]=b.useState(null),[K,me]=b.useState(null),[J,X]=b.useState(""),[de,be]=b.useState(!1),[je,xe]=b.useState(new Set);b.useEffect(()=>{(async()=>{if(l)if(m==="cloud"){const ce=ie.find(ue=>ue.name===l);ce?me(ce):o("/market?tab=cloud")}else{const ce=await R(l);ce?H(ce):o("/market?tab=local")}else H(null),me(null)})()},[l,m,ie,R,o]);const Te=Ce=>{const ce=new URLSearchParams(d);ce.set("tab",Ce),f(ce),l&&o("/market?"+ce.toString())},Be=Ce=>{Ce.preventDefault(),m==="local"&&A(J)},rt=Ce=>{m==="local"&&D(Ce)},wa=()=>{X(""),m==="local"&&(D(""),O(""))},ca=Ce=>{o(m==="cloud"?`/market/${Ce.name}?tab=cloud`:`/market/${Ce.name}?tab=local`)},Ue=()=>{o(`/market?tab=${m}`)},bt=async(Ce,ce)=>{try{be(!0),await T(Ce,ce)&&i(r("market.installSuccess",{serverName:Ce.display_name}),"success")}finally{be(!1)}},ua=async(Ce,ce)=>{try{be(!0);const ue={name:Ce.name,config:ce},fe=await kt("/servers",ue);if(!fe.success){const dt=(fe==null?void 0:fe.message)||r("server.addError");i(dt,"error");return}xe(dt=>new Set(dt).add(Ce.name)),i(r("cloud.installSuccess",{name:Ce.title||Ce.name}),"success")}catch(ue){console.error("Error installing cloud server:",ue);const fe=ue instanceof Error?ue.message:String(ue);i(r("cloud.installError",{error:fe}),"error")}finally{be(!1)}},da=async(Ce,ce,ue)=>{try{const fe=await S(Ce,ce,ue);return i(r("cloud.toolCallSuccess",{toolName:ce}),"success"),fe}catch(fe){const dt=fe instanceof Error?fe.message:String(fe);throw Gt(dt)||i(r("cloud.toolCallError",{toolName:ce,error:dt}),"error"),fe}},Gt=Ce=>Ce==="MCPROUTER_API_KEY_NOT_CONFIGURED"||Ce.toLowerCase().includes("mcprouter api key not configured"),fa=Ce=>{m==="local"?ae(Ce):se(Ce),window.scrollTo({top:0,behavior:"smooth"})},gn=Ce=>{const ce=parseInt(Ce.target.value,10);m==="local"?oe(ce):I(ce)};if(le)return n.jsx(Fv,{server:le,onBack:Ue,onInstall:bt,installing:de,isInstalled:W(le.name)});if(K)return n.jsx(Xv,{serverName:K.name,onBack:Ue,onCallTool:da,fetchServerTools:G,onInstall:ua,installing:de,isInstalled:je.has(K.name)});const Fe=m==="local",pn=Fe?p:ie,zt=Fe?g:k,lt=Fe?h:[],Tt=Fe?y:E,at=Fe?N:_,Bn=Fe?j:q,Ka=Fe?M:"",Hn=Fe?C:"",Dt=Fe?Z:B,ja=Fe?te:$,vt=Fe?F:w;return n.jsxs("div",{children:[n.jsx("div",{className:"mb-6",children:n.jsx("div",{className:"border-b border-gray-200",children:n.jsxs("nav",{className:"-mb-px flex space-x-3",children:[n.jsxs("button",{onClick:()=>Te("cloud"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Fe?"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300":"border-blue-500 text-blue-600"}`,children:[r("cloud.title"),n.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",n.jsx("a",{href:"https://mcprouter.co",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPRouter"}),")"]})]}),n.jsxs("button",{onClick:()=>Te("local"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Fe?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[r("market.title"),n.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",n.jsx("a",{href:"https://mcpm.sh",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPM"}),")"]})]})]})})}),at&&n.jsx(n.Fragment,{children:!Fe&&Gt(at)?n.jsx(ou,{}):n.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("p",{children:at}),n.jsx("button",{onClick:()=>Bn(null),className:"text-red-700 hover:text-red-900 transition-colors duration-200",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})})})]})})}),Fe&&n.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:n.jsxs("form",{onSubmit:Be,className:"flex space-x-4 mb-0",children:[n.jsx("div",{className:"flex-grow",children:n.jsx("input",{type:"text",value:J,onChange:Ce=>X(Ce.target.value),placeholder:r("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"})}),n.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:r("market.search")}),(J||Ka||Hn)&&n.jsx("button",{type:"button",onClick:wa,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:r("market.clearFilters")})]})}),n.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[Fe&&n.jsx("div",{className:"md:w-48 flex-shrink-0",children:n.jsx("div",{className:"bg-white shadow rounded-lg p-4 mb-6 sticky top-4 page-card",children:lt.length>0?n.jsxs("div",{className:"mb-6",children:[n.jsxs("div",{className:"flex justify-between items-center mb-3",children:[n.jsx("h3",{className:"font-medium text-gray-900",children:r("market.categories")}),Ka&&n.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>D(""),children:r("market.clearCategoryFilter")})]}),n.jsx("div",{className:"flex flex-col gap-2",children:lt.map(Ce=>n.jsx("button",{onClick:()=>rt(Ce),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${Ka===Ce?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:Ce},Ce))})]}):Tt?n.jsxs("div",{className:"mb-6",children:[n.jsx("div",{className:"mb-3",children:n.jsx("h3",{className:"font-medium text-gray-900",children:r("market.categories")})}),n.jsxs("div",{className:"flex flex-col gap-2 items-center py-4 loading-container",children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.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"})]}),n.jsx("p",{className:"text-sm text-gray-600",children:r("app.loading")})]})]}):n.jsxs("div",{className:"mb-6",children:[n.jsx("div",{className:"mb-3",children:n.jsx("h3",{className:"font-medium text-gray-900",children:r("market.categories")})}),n.jsx("p",{className:"text-sm text-gray-600 py-2",children:r("market.noCategories")})]})})}),n.jsx("div",{className:"flex-grow",children:Tt?n.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center",children:n.jsxs("div",{className:"flex flex-col items-center",children:[n.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:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.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"})]}),n.jsx("p",{className:"text-gray-600",children:r("app.loading")})]})}):pn.length===0?n.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:n.jsx("p",{className:"text-gray-600",children:r(Fe?"market.noServers":"cloud.noServers")})}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:pn.map((Ce,ce)=>Fe?n.jsx($v,{server:Ce,onClick:ca},ce):n.jsx(Yv,{server:Ce,onClick:ca},ce))}),n.jsxs("div",{className:"flex justify-between items-center mb-4",children:[n.jsx("div",{className:"text-sm text-gray-500",children:Fe?r("market.showing",{from:(Dt-1)*vt+1,to:Math.min(Dt*vt,zt.length),total:zt.length}):r("cloud.showing",{from:(Dt-1)*vt+1,to:Math.min(Dt*vt,zt.length),total:zt.length})}),n.jsx(Qv,{currentPage:Dt,totalPages:ja,onPageChange:fa}),n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[r(Fe?"market.perPage":"cloud.perPage"),":"]}),n.jsxs("select",{id:"perPage",value:vt,onChange:gn,className:"border rounded p-1 text-sm btn-secondary outline-none",children:[n.jsx("option",{value:"6",children:"6"}),n.jsx("option",{value:"9",children:"9"}),n.jsx("option",{value:"12",children:"12"}),n.jsx("option",{value:"24",children:"24"})]})]})]}),n.jsx("div",{className:"mt-6"})]})})]})]})},Zv={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"},Iv={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 Jv({variant:r="default",size:o="default",className:l,disabled:i,children:d,...f}){return n.jsx("button",{className:Pa("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",Zv[r],Iv[o],l),disabled:i,...f,children:d})}const Wv=({logs:r,isLoading:o=!1,error:l=null,onClear:i})=>{const{t:d}=Se(),f=b.useRef(null),[m,p]=b.useState(!0),[g,h]=b.useState(""),[y,N]=b.useState(["info","error","warn","debug"]),[j,A]=b.useState(["main","child"]);b.useEffect(()=>{m&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[r,m]);const D=r.filter(T=>{const R=g?T.message.toLowerCase().includes(g.toLowerCase()):!0,W=y.includes(T.type),Z=j.includes(T.source);return R&&W&&Z}),O=T=>new Date(T).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),M=T=>{switch(T){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"}},C=T=>{switch(T){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 n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"bg-card p-3 rounded-t-md flex flex-wrap items-center justify-between gap-2",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("span",{className:"font-semibold text-sm",children:[d("logs.filters"),":"]}),n.jsx("input",{type:"text",placeholder:d("logs.search"),className:"shadow appearance-none border border-gray-200 rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",value:g,onChange:T=>h(T.target.value)}),n.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(T=>n.jsx(fo,{variant:y.includes(T)?"default":"outline",className:`cursor-pointer ${y.includes(T)?M(T):""}`,onClick:()=>{y.includes(T)?N(R=>R.filter(W=>W!==T)):N(R=>[...R,T])},children:T},T))}),n.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(T=>n.jsx(fo,{variant:j.includes(T)?"default":"outline",className:`cursor-pointer ${j.includes(T)?C(T):""}`,onClick:()=>{j.includes(T)?A(R=>R.filter(W=>W!==T)):A(R=>[...R,T])},children:d(T==="main"?"logs.mainProcess":"logs.childProcess")},T))})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("label",{className:"flex items-center gap-1 text-sm",children:[n.jsx("input",{type:"checkbox",checked:m,onChange:()=>p(!m),className:"form-checkbox h-4 w-4"}),d("logs.autoScroll")]}),n.jsx(Jv,{variant:"outline",size:"sm",onClick:i,className:"btn-secondary",disabled:o||r.length===0,children:d("logs.clearLogs")})]})]}),n.jsx("div",{ref:f,className:"flex-grow p-2 overflow-auto bg-card rounded-b-md font-mono text-sm",style:{maxHeight:"calc(100vh - 300px)"},children:o?n.jsx("div",{className:"flex justify-center items-center h-full",children:n.jsx("span",{children:d("logs.loading")})}):l?n.jsx("div",{className:"text-red-500 p-2",children:l.message}):D.length===0?n.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||y.length<4||j.length<2?d("logs.noMatch"):d("logs.noLogs")}):D.map((T,R)=>n.jsxs("div",{className:`py-1 ${T.type==="error"?"text-red-500":T.type==="warn"?"text-yellow-500":""}`,children:[n.jsxs("span",{className:"text-gray-400",children:["[",O(T.timestamp),"]"]}),n.jsx(fo,{className:`ml-2 mr-1 ${M(T.type)}`,children:T.type}),n.jsxs(fo,{variant:"default",className:`mr-2 ${C(T.source)}`,children:[T.source==="main"?d("logs.main"):d("logs.child"),T.processId?` (${T.processId})`:""]}),n.jsx("span",{className:"whitespace-pre-wrap",children:T.message})]},`${T.timestamp}-${R}`))})]})},e2=async()=>{try{const r=await vo("/logs");if(!r.success)throw new Error(r.error||"Failed to clear logs")}catch(r){throw console.error("Error clearing logs:",r),r}},t2=()=>{const[r,o]=b.useState([]),[l,i]=b.useState(!0),[d,f]=b.useState(null);return b.useEffect(()=>{let p=null,g=!0;const h=()=>{try{p&&p.close();const y=Kr();p=new EventSource(yu(`/logs/stream?token=${y}`)),p.onmessage=N=>{if(g)try{const j=JSON.parse(N.data);j.type==="initial"?(o(j.logs),i(!1)):j.type==="log"&&o(A=>[...A,j.log])}catch(j){console.error("Error parsing SSE message:",j)}},p.onerror=()=>{g&&(p&&(p.close(),setTimeout(h,5e3)),f(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(y){if(!g)return;f(y instanceof Error?y:new Error("Failed to connect to log stream")),i(!1)}};return h(),()=>{g=!1,p&&p.close()}},[]),{logs:r,loading:l,error:d,clearLogs:async()=>{try{await e2(),o([])}catch(p){f(p instanceof Error?p:new Error("Failed to clear logs"))}}}},a2=()=>{const{t:r}=Se(),{logs:o,loading:l,error:i,clearLogs:d}=t2();return n.jsxs("div",{className:"container mx-auto p-4",children:[n.jsx("div",{className:"flex justify-between items-center mb-4",children:n.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:r("pages.logs.title")})}),n.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:n.jsx(Wv,{logs:o,isLoading:l,error:i,onClear:d})})]})},n2=()=>{const{serverName:r}=dg();return n.jsx(bo,{to:`/market/${r}?tab=cloud`,replace:!0})};function Hh(){const r=xu();return n.jsx(D1,{children:n.jsx(fb,{children:n.jsx(I1,{children:n.jsx(O1,{children:n.jsx(Ky,{basename:r,children:n.jsxs(vy,{children:[n.jsx(Et,{path:"/login",element:n.jsx(gv,{})}),n.jsx(Et,{element:n.jsx(hv,{}),children:n.jsxs(Et,{element:n.jsx(mv,{}),children:[n.jsx(Et,{path:"/",element:n.jsx(pv,{})}),n.jsx(Et,{path:"/servers",element:n.jsx(Dv,{})}),n.jsx(Et,{path:"/groups",element:n.jsx(Bv,{})}),n.jsx(Et,{path:"/users",element:n.jsx(Hv,{})}),n.jsx(Et,{path:"/market",element:n.jsx(Bh,{})}),n.jsx(Et,{path:"/market/:serverName",element:n.jsx(Bh,{})}),n.jsx(Et,{path:"/cloud",element:n.jsx(bo,{to:"/market?tab=cloud",replace:!0})}),n.jsx(Et,{path:"/cloud/:serverName",element:n.jsx(n2,{})}),n.jsx(Et,{path:"/logs",element:n.jsx(a2,{})}),n.jsx(Et,{path:"/settings",element:n.jsx(Vv,{})})]})}),n.jsx(Et,{path:"*",element:n.jsx(bo,{to:"/"})})]})})})})})})}const Ee=r=>typeof r=="string",_r=()=>{let r,o;const l=new Promise((i,d)=>{r=i,o=d});return l.resolve=r,l.reject=o,l},Ph=r=>r==null?"":""+r,s2=(r,o,l)=>{r.forEach(i=>{o[i]&&(l[i]=o[i])})},r2=/###/g,qh=r=>r&&r.indexOf("###")>-1?r.replace(r2,"."):r,Vh=r=>!r||Ee(r),Br=(r,o,l)=>{const i=Ee(o)?o.split("."):o;let d=0;for(;d<i.length-1;){if(Vh(r))return{};const f=qh(i[d]);!r[f]&&l&&(r[f]=new l),Object.prototype.hasOwnProperty.call(r,f)?r=r[f]:r={},++d}return Vh(r)?{}:{obj:r,k:qh(i[d])}},Gh=(r,o,l)=>{const{obj:i,k:d}=Br(r,o,Object);if(i!==void 0||o.length===1){i[d]=l;return}let f=o[o.length-1],m=o.slice(0,o.length-1),p=Br(r,m,Object);for(;p.obj===void 0&&m.length;)f=`${m[m.length-1]}.${f}`,m=m.slice(0,m.length-1),p=Br(r,m,Object),p!=null&&p.obj&&typeof p.obj[`${p.k}.${f}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${f}`]=l},l2=(r,o,l,i)=>{const{obj:d,k:f}=Br(r,o,Object);d[f]=d[f]||[],d[f].push(l)},jo=(r,o)=>{const{obj:l,k:i}=Br(r,o);if(l&&Object.prototype.hasOwnProperty.call(l,i))return l[i]},o2=(r,o,l)=>{const i=jo(r,l);return i!==void 0?i:jo(o,l)},sp=(r,o,l)=>{for(const i in o)i!=="__proto__"&&i!=="constructor"&&(i in r?Ee(r[i])||r[i]instanceof String||Ee(o[i])||o[i]instanceof String?l&&(r[i]=o[i]):sp(r[i],o[i],l):r[i]=o[i]);return r},ks=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var i2={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const c2=r=>Ee(r)?r.replace(/[&<>"'\/]/g,o=>i2[o]):r;class u2{constructor(o){this.capacity=o,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(o){const l=this.regExpMap.get(o);if(l!==void 0)return l;const i=new RegExp(o);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(o,i),this.regExpQueue.push(o),i}}const d2=[" ",",","?","!",";"],f2=new u2(20),m2=(r,o,l)=>{o=o||"",l=l||"";const i=d2.filter(m=>o.indexOf(m)<0&&l.indexOf(m)<0);if(i.length===0)return!0;const d=f2.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let f=!d.test(r);if(!f){const m=r.indexOf(l);m>0&&!d.test(r.substring(0,m))&&(f=!0)}return f},iu=function(r,o){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!r)return;if(r[o])return Object.prototype.hasOwnProperty.call(r,o)?r[o]:void 0;const i=o.split(l);let d=r;for(let f=0;f<i.length;){if(!d||typeof d!="object")return;let m,p="";for(let g=f;g<i.length;++g)if(g!==f&&(p+=l),p+=i[g],m=d[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;f+=g-f+1;break}d=m}return d},No=r=>r==null?void 0:r.replace("_","-"),h2={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,o){var l,i;(i=(l=console==null?void 0:console[r])==null?void 0:l.apply)==null||i.call(l,console,o)}};class So{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(o,l)}init(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=l.prefix||"i18next:",this.logger=o||h2,this.options=l,this.debug=l.debug}log(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return this.forward(l,"log","",!0)}warn(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return this.forward(l,"warn","",!0)}error(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return this.forward(l,"error","")}deprecate(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(o,l,i,d){return d&&!this.debug?null:(Ee(o[0])&&(o[0]=`${i}${this.prefix} ${o[0]}`),this.logger[l](o))}create(o){return new So(this.logger,{prefix:`${this.prefix}:${o}:`,...this.options})}clone(o){return o=o||this.options,o.prefix=o.prefix||this.prefix,new So(this.logger,o)}}var va=new So;class Mo{constructor(){this.observers={}}on(o,l){return o.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const d=this.observers[i].get(l)||0;this.observers[i].set(l,d+1)}),this}off(o,l){if(this.observers[o]){if(!l){delete this.observers[o];return}this.observers[o].delete(l)}}emit(o){for(var l=arguments.length,i=new Array(l>1?l-1:0),d=1;d<l;d++)i[d-1]=arguments[d];this.observers[o]&&Array.from(this.observers[o].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p.apply(p,[o,...i])})}}class Kh extends Mo{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=o||{},this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}removeNamespaces(o){const l=this.options.ns.indexOf(o);l>-1&&this.options.ns.splice(l,1)}getResource(o,l,i){var h,y;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator,m=d.ignoreJSONStructure!==void 0?d.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;o.indexOf(".")>-1?p=o.split("."):(p=[o,l],i&&(Array.isArray(i)?p.push(...i):Ee(i)&&f?p.push(...i.split(f)):p.push(i)));const g=jo(this.data,p);return!g&&!l&&!i&&o.indexOf(".")>-1&&(o=p[0],l=p[1],i=p.slice(2).join(".")),g||!m||!Ee(i)?g:iu((y=(h=this.data)==null?void 0:h[o])==null?void 0:y[l],i,f)}addResource(o,l,i,d){let f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const m=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let p=[o,l];i&&(p=p.concat(m?i.split(m):i)),o.indexOf(".")>-1&&(p=o.split("."),d=l,l=p[1]),this.addNamespaces(l),Gh(this.data,p,d),f.silent||this.emit("added",o,l,i,d)}addResources(o,l,i){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const f in i)(Ee(i[f])||Array.isArray(i[f]))&&this.addResource(o,l,f,i[f],{silent:!0});d.silent||this.emit("added",o,l,i)}addResourceBundle(o,l,i,d,f){let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},p=[o,l];o.indexOf(".")>-1&&(p=o.split("."),d=i,i=l,l=p[1]),this.addNamespaces(l);let g=jo(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),d?sp(g,i,f):g={...g,...i},Gh(this.data,p,g),m.silent||this.emit("added",o,l,i)}removeResourceBundle(o,l){this.hasResourceBundle(o,l)&&delete this.data[o][l],this.removeNamespaces(l),this.emit("removed",o,l)}hasResourceBundle(o,l){return this.getResource(o,l)!==void 0}getResourceBundle(o,l){return l||(l=this.options.defaultNS),this.getResource(o,l)}getDataByLanguage(o){return this.data[o]}hasLanguageSomeTranslations(o){const l=this.getDataByLanguage(o);return!!(l&&Object.keys(l)||[]).find(d=>l[d]&&Object.keys(l[d]).length>0)}toJSON(){return this.data}}var rp={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,o,l,i,d){return r.forEach(f=>{var m;o=((m=this.processors[f])==null?void 0:m.process(o,l,i,d))??o}),o}};const $h={},Fh=r=>!Ee(r)&&typeof r!="boolean"&&typeof r!="number";class Co extends Mo{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),s2(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o,this),this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=va.create("translator")}changeLanguage(o){o&&(this.language=o)}exists(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;const i=this.resolve(o,l);return(i==null?void 0:i.res)!==void 0}extractFromKey(o,l){let i=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const d=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=l.ns||this.options.defaultNS||[];const m=i&&o.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!l.keySeparator&&!this.options.userDefinedNsSeparator&&!l.nsSeparator&&!m2(o,i,d);if(m&&!p){const g=o.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:o,namespaces:Ee(f)?[f]:f};const h=o.split(i);(i!==d||i===d&&this.options.ns.indexOf(h[0])>-1)&&(f=h.shift()),o=h.join(d)}return{key:o,namespaces:Ee(f)?[f]:f}}translate(o,l,i){if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof l=="object"&&(l={...l}),l||(l={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);const d=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,f=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:m,namespaces:p}=this.extractFromKey(o[o.length-1],l),g=p[p.length-1],h=l.lng||this.language,y=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode"){if(y){const k=l.nsSeparator||this.options.nsSeparator;return d?{res:`${g}${k}${m}`,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(l)}:`${g}${k}${m}`}return d?{res:m,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(l)}:m}const N=this.resolve(o,l);let j=N==null?void 0:N.res;const A=(N==null?void 0:N.usedKey)||m,D=(N==null?void 0:N.exactUsedKey)||m,O=["[object Number]","[object Function]","[object RegExp]"],M=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,T=l.count!==void 0&&!Ee(l.count),R=Co.hasDefaultValue(l),W=T?this.pluralResolver.getSuffix(h,l.count,l):"",Z=l.ordinal&&T?this.pluralResolver.getSuffix(h,l.count,{ordinal:!1}):"",te=T&&!l.ordinal&&l.count===0,ae=te&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${W}`]||l[`defaultValue${Z}`]||l.defaultValue;let F=j;C&&!j&&R&&(F=ae);const oe=Fh(F),ie=Object.prototype.toString.apply(F);if(C&&F&&oe&&O.indexOf(ie)<0&&!(Ee(M)&&Array.isArray(F))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(A,F,{...l,ns:p}):`key '${m} (${this.language})' returned an object instead of string.`;return d?(N.res=k,N.usedParams=this.getUsedParamsDetails(l),N):k}if(f){const k=Array.isArray(F),E=k?[]:{},_=k?D:A;for(const q in F)if(Object.prototype.hasOwnProperty.call(F,q)){const G=`${_}${f}${q}`;R&&!j?E[q]=this.translate(G,{...l,defaultValue:Fh(ae)?ae[q]:void 0,joinArrays:!1,ns:p}):E[q]=this.translate(G,{...l,joinArrays:!1,ns:p}),E[q]===G&&(E[q]=F[q])}j=E}}else if(C&&Ee(M)&&Array.isArray(j))j=j.join(M),j&&(j=this.extendTranslation(j,o,l,i));else{let k=!1,E=!1;!this.isValidLookup(j)&&R&&(k=!0,j=ae),this.isValidLookup(j)||(E=!0,j=m);const q=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:j,G=R&&ae!==j&&this.options.updateMissing;if(E||k||G){if(this.logger.log(G?"updateKey":"missingKey",h,g,m,G?ae:j),f){const se=this.resolve(m,{...l,keySeparator:!1});se&&se.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 S=[];const B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(let se=0;se<B.length;se++)S.push(B[se]);else this.options.saveMissingTo==="all"?S=this.languageUtils.toResolveHierarchy(l.lng||this.language):S.push(l.lng||this.language);const $=(se,w,I)=>{var H;const le=R&&I!==j?I:q;this.options.missingKeyHandler?this.options.missingKeyHandler(se,g,w,le,G,l):(H=this.backendConnector)!=null&&H.saveMissing&&this.backendConnector.saveMissing(se,g,w,le,G,l),this.emit("missingKey",se,g,w,j)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?S.forEach(se=>{const w=this.pluralResolver.getSuffixes(se,l);te&&l[`defaultValue${this.options.pluralSeparator}zero`]&&w.indexOf(`${this.options.pluralSeparator}zero`)<0&&w.push(`${this.options.pluralSeparator}zero`),w.forEach(I=>{$([se],m+I,l[`defaultValue${I}`]||ae)})}):$(S,m,ae))}j=this.extendTranslation(j,o,l,N,i),E&&j===m&&this.options.appendNamespaceToMissingKey&&(j=`${g}:${m}`),(E||k)&&this.options.parseMissingKeyHandler&&(j=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}:${m}`:m,k?j:void 0))}return d?(N.res=j,N.usedParams=this.getUsedParamsDetails(l),N):j}extendTranslation(o,l,i,d,f){var h,y;var m=this;if((h=this.i18nFormat)!=null&&h.parse)o=this.i18nFormat.parse(o,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||d.usedLng,d.usedNS,d.usedKey,{resolved:d});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const N=Ee(o)&&(((y=i==null?void 0:i.interpolation)==null?void 0:y.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let j;if(N){const D=o.match(this.interpolator.nestingRegexp);j=D&&D.length}let A=i.replace&&!Ee(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(A={...this.options.interpolation.defaultVariables,...A}),o=this.interpolator.interpolate(o,A,i.lng||this.language||d.usedLng,i),N){const D=o.match(this.interpolator.nestingRegexp),O=D&&D.length;j<O&&(i.nest=!1)}!i.lng&&d&&d.res&&(i.lng=this.language||d.usedLng),i.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var D=arguments.length,O=new Array(D),M=0;M<D;M++)O[M]=arguments[M];return(f==null?void 0:f[0])===O[0]&&!i.context?(m.logger.warn(`It seems you are nesting recursively key: ${O[0]} in key: ${l[0]}`),null):m.translate(...O,l)},i)),i.interpolation&&this.interpolator.reset()}const p=i.postProcess||this.options.postProcess,g=Ee(p)?[p]:p;return o!=null&&(g!=null&&g.length)&&i.applyPostProcessor!==!1&&(o=rp.handle(g,o,l,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...d,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),o}resolve(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,d,f,m,p;return Ee(o)&&(o=[o]),o.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,l),y=h.key;d=y;let N=h.namespaces;this.options.fallbackNS&&(N=N.concat(this.options.fallbackNS));const j=l.count!==void 0&&!Ee(l.count),A=j&&!l.ordinal&&l.count===0,D=l.context!==void 0&&(Ee(l.context)||typeof l.context=="number")&&l.context!=="",O=l.lngs?l.lngs:this.languageUtils.toResolveHierarchy(l.lng||this.language,l.fallbackLng);N.forEach(M=>{var C,T;this.isValidLookup(i)||(p=M,!$h[`${O[0]}-${M}`]&&((C=this.utils)!=null&&C.hasLoadedNamespace)&&!((T=this.utils)!=null&&T.hasLoadedNamespace(p))&&($h[`${O[0]}-${M}`]=!0,this.logger.warn(`key "${d}" for languages "${O.join(", ")}" won't get resolved as namespace "${p}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),O.forEach(R=>{var te;if(this.isValidLookup(i))return;m=R;const W=[y];if((te=this.i18nFormat)!=null&&te.addLookupKeys)this.i18nFormat.addLookupKeys(W,y,R,M,l);else{let ae;j&&(ae=this.pluralResolver.getSuffix(R,l.count,l));const F=`${this.options.pluralSeparator}zero`,oe=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(j&&(W.push(y+ae),l.ordinal&&ae.indexOf(oe)===0&&W.push(y+ae.replace(oe,this.options.pluralSeparator)),A&&W.push(y+F)),D){const ie=`${y}${this.options.contextSeparator}${l.context}`;W.push(ie),j&&(W.push(ie+ae),l.ordinal&&ae.indexOf(oe)===0&&W.push(ie+ae.replace(oe,this.options.pluralSeparator)),A&&W.push(ie+F))}}let Z;for(;Z=W.pop();)this.isValidLookup(i)||(f=Z,i=this.getResource(R,M,Z,l))}))})}),{res:i,usedKey:d,exactUsedKey:f,usedLng:m,usedNS:p}}isValidLookup(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}getResource(o,l,i){var f;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(o,l,i,d):this.resourceStore.getResource(o,l,i,d)}getUsedParamsDetails(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const l=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=o.replace&&!Ee(o.replace);let d=i?o.replace:o;if(i&&typeof o.count<"u"&&(d.count=o.count),this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),!i){d={...d};for(const f of l)delete d[f]}return d}static hasDefaultValue(o){const l="defaultValue";for(const i in o)if(Object.prototype.hasOwnProperty.call(o,i)&&l===i.substring(0,l.length)&&o[i]!==void 0)return!0;return!1}}class Yh{constructor(o){this.options=o,this.supportedLngs=this.options.supportedLngs||!1,this.logger=va.create("languageUtils")}getScriptPartFromCode(o){if(o=No(o),!o||o.indexOf("-")<0)return null;const l=o.split("-");return l.length===2||(l.pop(),l[l.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(l.join("-"))}getLanguagePartFromCode(o){if(o=No(o),!o||o.indexOf("-")<0)return o;const l=o.split("-");return this.formatLanguageCode(l[0])}formatLanguageCode(o){if(Ee(o)&&o.indexOf("-")>-1){let l;try{l=Intl.getCanonicalLocales(o)[0]}catch{}return l&&this.options.lowerCaseLng&&(l=l.toLowerCase()),l||(this.options.lowerCaseLng?o.toLowerCase():o)}return this.options.cleanCode||this.options.lowerCaseLng?o.toLowerCase():o}isSupportedCode(o){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(o=this.getLanguagePartFromCode(o)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(o)>-1}getBestMatchFromCodes(o){if(!o)return null;let l;return o.forEach(i=>{if(l)return;const d=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(d))&&(l=d)}),!l&&this.options.supportedLngs&&o.forEach(i=>{if(l)return;const d=this.getLanguagePartFromCode(i);if(this.isSupportedCode(d))return l=d;l=this.options.supportedLngs.find(f=>{if(f===d)return f;if(!(f.indexOf("-")<0&&d.indexOf("-")<0)&&(f.indexOf("-")>0&&d.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===d||f.indexOf(d)===0&&d.length>1))return f})}),l||(l=this.getFallbackCodes(this.options.fallbackLng)[0]),l}getFallbackCodes(o,l){if(!o)return[];if(typeof o=="function"&&(o=o(l)),Ee(o)&&(o=[o]),Array.isArray(o))return o;if(!l)return o.default||[];let i=o[l];return i||(i=o[this.getScriptPartFromCode(l)]),i||(i=o[this.formatLanguageCode(l)]),i||(i=o[this.getLanguagePartFromCode(l)]),i||(i=o.default),i||[]}toResolveHierarchy(o,l){const i=this.getFallbackCodes(l||this.options.fallbackLng||[],o),d=[],f=m=>{m&&(this.isSupportedCode(m)?d.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return Ee(o)&&(o.indexOf("-")>-1||o.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(o)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(o)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(o))):Ee(o)&&f(this.formatLanguageCode(o)),i.forEach(m=>{d.indexOf(m)<0&&f(this.formatLanguageCode(m))}),d}}const Xh={zero:0,one:1,two:2,few:3,many:4,other:5},Qh={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class g2{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=o,this.options=l,this.logger=va.create("pluralResolver"),this.pluralRulesCache={}}addRule(o,l){this.rules[o]=l}clearCache(){this.pluralRulesCache={}}getRule(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=No(o==="dev"?"en":o),d=l.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:i,type:d});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let m;try{m=new Intl.PluralRules(i,{type:d})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Qh;if(!o.match(/-|_/))return Qh;const g=this.languageUtils.getLanguagePartFromCode(o);m=this.getRule(g,l)}return this.pluralRulesCache[f]=m,m}needsPlural(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(o,l);return i||(i=this.getRule("dev",l)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(o,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(o,i).map(d=>`${l}${d}`)}getSuffixes(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(o,l);return i||(i=this.getRule("dev",l)),i?i.resolvedOptions().pluralCategories.sort((d,f)=>Xh[d]-Xh[f]).map(d=>`${this.options.prepend}${l.ordinal?`ordinal${this.options.prepend}`:""}${d}`):[]}getSuffix(o,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const d=this.getRule(o,i);return d?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${d.select(l)}`:(this.logger.warn(`no plural rule found for: ${o}`),this.getSuffix("dev",l,i))}}const Zh=function(r,o,l){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,f=o2(r,o,l);return!f&&d&&Ee(l)&&(f=iu(r,l,i),f===void 0&&(f=iu(o,l,i))),f},Zc=r=>r.replace(/\$/g,"$$$$");class p2{constructor(){var l;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=va.create("interpolator"),this.options=o,this.format=((l=o==null?void 0:o.interpolation)==null?void 0:l.format)||(i=>i),this.init(o)}init(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};o.interpolation||(o.interpolation={escapeValue:!0});const{escape:l,escapeValue:i,useRawValueToEscape:d,prefix:f,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:y,unescapePrefix:N,nestingPrefix:j,nestingPrefixEscaped:A,nestingSuffix:D,nestingSuffixEscaped:O,nestingOptionsSeparator:M,maxReplaces:C,alwaysFormat:T}=o.interpolation;this.escape=l!==void 0?l:c2,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=d!==void 0?d:!1,this.prefix=f?ks(f):m||"{{",this.suffix=p?ks(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=y?"":N||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=j?ks(j):A||ks("$t("),this.nestingSuffix=D?ks(D):O||ks(")"),this.nestingOptionsSeparator=M||",",this.maxReplaces=C||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const o=(l,i)=>(l==null?void 0:l.source)===i?(l.lastIndex=0,l):new RegExp(i,"g");this.regexp=o(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=o(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=o(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(o,l,i,d){var A;let f,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=D=>{if(D.indexOf(this.formatSeparator)<0){const T=Zh(l,g,D,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,i,{...d,...l,interpolationkey:D}):T}const O=D.split(this.formatSeparator),M=O.shift().trim(),C=O.join(this.formatSeparator).trim();return this.format(Zh(l,g,M,this.options.keySeparator,this.options.ignoreJSONStructure),C,i,{...d,...l,interpolationkey:M})};this.resetRegExp();const y=(d==null?void 0:d.missingInterpolationHandler)||this.options.missingInterpolationHandler,N=((A=d==null?void 0:d.interpolation)==null?void 0:A.skipOnVariables)!==void 0?d.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:D=>Zc(D)},{regex:this.regexp,safeValue:D=>this.escapeValue?Zc(this.escape(D)):Zc(D)}].forEach(D=>{for(p=0;f=D.regex.exec(o);){const O=f[1].trim();if(m=h(O),m===void 0)if(typeof y=="function"){const C=y(o,f,d);m=Ee(C)?C:""}else if(d&&Object.prototype.hasOwnProperty.call(d,O))m="";else if(N){m=f[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${o}`),m="";else!Ee(m)&&!this.useRawValueToEscape&&(m=Ph(m));const M=D.safeValue(m);if(o=o.replace(f[0],M),N?(D.regex.lastIndex+=m.length,D.regex.lastIndex-=f[0].length):D.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),o}nest(o,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,f,m;const p=(g,h)=>{const y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;const N=g.split(new RegExp(`${y}[ ]*{`));let j=`{${N[1]}`;g=N[0],j=this.interpolate(j,m);const A=j.match(/'/g),D=j.match(/"/g);(((A==null?void 0:A.length)??0)%2===0&&!D||D.length%2!==0)&&(j=j.replace(/'/g,'"'));try{m=JSON.parse(j),h&&(m={...h,...m})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,O),`${g}${y}${j}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;d=this.nestingRegexp.exec(o);){let g=[];m={...i},m=m.replace&&!Ee(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;let h=!1;if(d[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(d[1])){const y=d[1].split(this.formatSeparator).map(N=>N.trim());d[1]=y.shift(),g=y,h=!0}if(f=l(p.call(this,d[1].trim(),m),m),f&&d[0]===o&&!Ee(f))return f;Ee(f)||(f=Ph(f)),f||(this.logger.warn(`missed to resolve ${d[1]} for nesting ${o}`),f=""),h&&(f=g.reduce((y,N)=>this.format(y,N,i.lng,{...i,interpolationkey:d[1].trim()}),f.trim())),o=o.replace(d[0],f),this.regexp.lastIndex=0}return o}}const x2=r=>{let o=r.toLowerCase().trim();const l={};if(r.indexOf("(")>-1){const i=r.split("(");o=i[0].toLowerCase().trim();const d=i[1].substring(0,i[1].length-1);o==="currency"&&d.indexOf(":")<0?l.currency||(l.currency=d.trim()):o==="relativetime"&&d.indexOf(":")<0?l.range||(l.range=d.trim()):d.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),y=p.trim();l[y]||(l[y]=h),h==="false"&&(l[y]=!1),h==="true"&&(l[y]=!0),isNaN(h)||(l[y]=parseInt(h,10))}})}return{formatName:o,formatOptions:l}},Ts=r=>{const o={};return(l,i,d)=>{let f=d;d&&d.interpolationkey&&d.formatParams&&d.formatParams[d.interpolationkey]&&d[d.interpolationkey]&&(f={...f,[d.interpolationkey]:void 0});const m=i+JSON.stringify(f);let p=o[m];return p||(p=r(No(i),d),o[m]=p),p(l)}};class y2{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=va.create("formatter"),this.options=o,this.formats={number:Ts((l,i)=>{const d=new Intl.NumberFormat(l,{...i});return f=>d.format(f)}),currency:Ts((l,i)=>{const d=new Intl.NumberFormat(l,{...i,style:"currency"});return f=>d.format(f)}),datetime:Ts((l,i)=>{const d=new Intl.DateTimeFormat(l,{...i});return f=>d.format(f)}),relativetime:Ts((l,i)=>{const d=new Intl.RelativeTimeFormat(l,{...i});return f=>d.format(f,i.range||"day")}),list:Ts((l,i)=>{const d=new Intl.ListFormat(l,{...i});return f=>d.format(f)})},this.init(o)}init(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=l.interpolation.formatSeparator||","}add(o,l){this.formats[o.toLowerCase().trim()]=l}addCached(o,l){this.formats[o.toLowerCase().trim()]=Ts(l)}format(o,l,i){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=l.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(p=>p.indexOf(")")>-1)){const p=f.findIndex(g=>g.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,p)].join(this.formatSeparator)}return f.reduce((p,g)=>{var N;const{formatName:h,formatOptions:y}=x2(g);if(this.formats[h]){let j=p;try{const A=((N=d==null?void 0:d.formatParams)==null?void 0:N[d.interpolationkey])||{},D=A.locale||A.lng||d.locale||d.lng||i;j=this.formats[h](p,D,{...y,...d,...A})}catch(A){this.logger.warn(A)}return j}else this.logger.warn(`there was no format function for ${h}`);return p},o)}}const b2=(r,o)=>{r.pending[o]!==void 0&&(delete r.pending[o],r.pendingCount--)};class v2 extends Mo{constructor(o,l,i){var f,m;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=o,this.store=l,this.services=i,this.languageUtils=i.languageUtils,this.options=d,this.logger=va.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=d.maxParallelReads||10,this.readingCalls=0,this.maxRetries=d.maxRetries>=0?d.maxRetries:5,this.retryTimeout=d.retryTimeout>=1?d.retryTimeout:350,this.state={},this.queue=[],(m=(f=this.backend)==null?void 0:f.init)==null||m.call(f,i,d.backend,d)}queueLoad(o,l,i,d){const f={},m={},p={},g={};return o.forEach(h=>{let y=!0;l.forEach(N=>{const j=`${h}|${N}`;!i.reload&&this.store.hasResourceBundle(h,N)?this.state[j]=2:this.state[j]<0||(this.state[j]===1?m[j]===void 0&&(m[j]=!0):(this.state[j]=1,y=!1,m[j]===void 0&&(m[j]=!0),f[j]===void 0&&(f[j]=!0),g[N]===void 0&&(g[N]=!0)))}),y||(p[h]=!0)}),(Object.keys(f).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:d}),{toLoad:Object.keys(f),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(o,l,i){const d=o.split("|"),f=d[0],m=d[1];l&&this.emit("failedLoading",f,m,l),!l&&i&&this.store.addResourceBundle(f,m,i,void 0,void 0,{skipCopy:!0}),this.state[o]=l?-1:2,l&&i&&(this.state[o]=0);const p={};this.queue.forEach(g=>{l2(g.loaded,[f],m),b2(g,o),l&&g.errors.push(l),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const y=g.loaded[h];y.length&&y.forEach(N=>{p[h][N]===void 0&&(p[h][N]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(o,l,i){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,m=arguments.length>5?arguments[5]:void 0;if(!o.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:l,fcName:i,tried:d,wait:f,callback:m});return}this.readingCalls++;const p=(h,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const N=this.waitingReads.shift();this.read(N.lng,N.ns,N.fcName,N.tried,N.wait,N.callback)}if(h&&y&&d<this.maxRetries){setTimeout(()=>{this.read.call(this,o,l,i,d+1,f*2,m)},f);return}m(h,y)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(o,l);h&&typeof h.then=="function"?h.then(y=>p(null,y)).catch(p):p(null,h)}catch(h){p(h)}return}return g(o,l,p)}prepareLoading(o,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),d&&d();Ee(o)&&(o=this.languageUtils.toResolveHierarchy(o)),Ee(l)&&(l=[l]);const f=this.queueLoad(o,l,i,d);if(!f.toLoad.length)return f.pending.length||d(),null;f.toLoad.forEach(m=>{this.loadOne(m)})}load(o,l,i){this.prepareLoading(o,l,{},i)}reload(o,l,i){this.prepareLoading(o,l,{reload:!0},i)}loadOne(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=o.split("|"),d=i[0],f=i[1];this.read(d,f,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${l}loading namespace ${f} for language ${d} failed`,m),!m&&p&&this.logger.log(`${l}loaded namespace ${f} for language ${d}`,p),this.loaded(o,m,p)})}saveMissing(o,l,i,d,f){var g,h,y,N,j;let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},p=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((h=(g=this.services)==null?void 0:g.utils)!=null&&h.hasLoadedNamespace&&!((N=(y=this.services)==null?void 0:y.utils)!=null&&N.hasLoadedNamespace(l))){this.logger.warn(`did not save key "${i}" as the namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((j=this.backend)!=null&&j.create){const A={...m,isUpdate:f},D=this.backend.create.bind(this.backend);if(D.length<6)try{let O;D.length===5?O=D(o,l,i,d,A):O=D(o,l,i,d),O&&typeof O.then=="function"?O.then(M=>p(null,M)).catch(p):p(null,O)}catch(O){p(O)}else D(o,l,i,d,p,A)}!o||!o[0]||this.store.addResource(o[0],l,i,d)}}}const Ih=()=>({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:r=>{let o={};if(typeof r[1]=="object"&&(o=r[1]),Ee(r[1])&&(o.defaultValue=r[1]),Ee(r[2])&&(o.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const l=r[3]||r[2];Object.keys(l).forEach(i=>{o[i]=l[i]})}return o},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Jh=r=>{var o,l;return Ee(r.ns)&&(r.ns=[r.ns]),Ee(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),Ee(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((l=(o=r.supportedLngs)==null?void 0:o.indexOf)==null?void 0:l.call(o,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},ho=()=>{},w2=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(l=>{typeof r[l]=="function"&&(r[l]=r[l].bind(r))})};class qr extends Mo{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Jh(o),this.services={},this.logger=va,this.modules={external:[]},w2(this),l&&!this.isInitialized&&!o.isClone){if(!this.options.initAsync)return this.init(o,l),this;setTimeout(()=>{this.init(o,l)},0)}}init(){var o=this;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof l=="function"&&(i=l,l={}),l.defaultNS==null&&l.ns&&(Ee(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const d=Ih();this.options={...d,...this.options,...Jh(l)},this.options.interpolation={...d.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator);const f=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?va.init(f(this.modules.logger),this.options):va.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=y2;const N=new Yh(this.options);this.store=new Kh(this.options.resources,this.options);const j=this.services;j.logger=va,j.resourceStore=this.store,j.languageUtils=N,j.pluralResolver=new g2(N,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),y&&(!this.options.interpolation.format||this.options.interpolation.format===d.interpolation.format)&&(j.formatter=f(y),j.formatter.init(j,this.options),this.options.interpolation.format=j.formatter.format.bind(j.formatter)),j.interpolator=new p2(this.options),j.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},j.backendConnector=new v2(f(this.modules.backend),j.resourceStore,j,this.options),j.backendConnector.on("*",function(A){for(var D=arguments.length,O=new Array(D>1?D-1:0),M=1;M<D;M++)O[M-1]=arguments[M];o.emit(A,...O)}),this.modules.languageDetector&&(j.languageDetector=f(this.modules.languageDetector),j.languageDetector.init&&j.languageDetector.init(j,this.options.detection,this.options)),this.modules.i18nFormat&&(j.i18nFormat=f(this.modules.i18nFormat),j.i18nFormat.init&&j.i18nFormat.init(this)),this.translator=new Co(this.services,this.options),this.translator.on("*",function(A){for(var D=arguments.length,O=new Array(D>1?D-1:0),M=1;M<D;M++)O[M-1]=arguments[M];o.emit(A,...O)}),this.modules.external.forEach(A=>{A.init&&A.init(this)})}if(this.format=this.options.interpolation.format,i||(i=ho),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(y=>{this[y]=function(){return o.store[y](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=function(){return o.store[y](...arguments),o}});const g=_r(),h=()=>{const y=(N,j)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),g.resolve(j),i(N,j)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),g}loadResources(o){var f,m;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ho;const d=Ee(o)?o:this.language;if(typeof o=="function"&&(i=o),!this.options.resources||this.options.partialBundledLanguages){if((d==null?void 0:d.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const p=[],g=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(N=>{N!=="cimode"&&p.indexOf(N)<0&&p.push(N)})};d?g(d):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>g(y)),(m=(f=this.options.preload)==null?void 0:f.forEach)==null||m.call(f,h=>g(h)),this.services.backendConnector.load(p,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(h)})}else i(null)}reloadResources(o,l,i){const d=_r();return typeof o=="function"&&(i=o,o=void 0),typeof l=="function"&&(i=l,l=void 0),o||(o=this.languages),l||(l=this.options.ns),i||(i=ho),this.services.backendConnector.reload(o,l,f=>{d.resolve(),i(f)}),d}use(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&rp.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}setResolvedLanguage(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(let l=0;l<this.languages.length;l++){const i=this.languages[l];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(o,l){var i=this;this.isLanguageChangingTo=o;const d=_r();this.emit("languageChanging",o);const f=g=>{this.language=g,this.languages=this.services.languageUtils.toResolveHierarchy(g),this.resolvedLanguage=void 0,this.setResolvedLanguage(g)},m=(g,h)=>{h?(f(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,d.resolve(function(){return i.t(...arguments)}),l&&l(g,function(){return i.t(...arguments)})},p=g=>{var y,N;!o&&!g&&this.services.languageDetector&&(g=[]);const h=Ee(g)?g:this.services.languageUtils.getBestMatchFromCodes(g);h&&(this.language||f(h),this.translator.language||this.translator.changeLanguage(h),(N=(y=this.services.languageDetector)==null?void 0:y.cacheUserLanguage)==null||N.call(y,h)),this.loadResources(h,j=>{m(j,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?p(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(p):this.services.languageDetector.detect(p):p(o),d}getFixedT(o,l,i){var d=this;const f=function(m,p){let g;if(typeof p!="object"){for(var h=arguments.length,y=new Array(h>2?h-2:0),N=2;N<h;N++)y[N-2]=arguments[N];g=d.options.overloadTranslationOptionHandler([m,p].concat(y))}else g={...p};g.lng=g.lng||f.lng,g.lngs=g.lngs||f.lngs,g.ns=g.ns||f.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||f.keyPrefix);const j=d.options.keySeparator||".";let A;return g.keyPrefix&&Array.isArray(m)?A=m.map(D=>`${g.keyPrefix}${j}${D}`):A=g.keyPrefix?`${g.keyPrefix}${j}${m}`:m,d.t(A,g)};return Ee(o)?f.lng=o:f.lngs=o,f.ns=l,f.keyPrefix=i,f}t(){var d;for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return(d=this.translator)==null?void 0:d.translate(...l)}exists(){var d;for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return(d=this.translator)==null?void 0:d.exists(...l)}setDefaultNamespace(o){this.options.defaultNS=o}hasLoadedNamespace(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=l.lng||this.resolvedLanguage||this.languages[0],d=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(l.precheck){const p=l.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(i,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,o)&&(!d||m(f,o)))}loadNamespaces(o,l){const i=_r();return this.options.ns?(Ee(o)&&(o=[o]),o.forEach(d=>{this.options.ns.indexOf(d)<0&&this.options.ns.push(d)}),this.loadResources(d=>{i.resolve(),l&&l(d)}),i):(l&&l(),Promise.resolve())}loadLanguages(o,l){const i=_r();Ee(o)&&(o=[o]);const d=this.options.preload||[],f=o.filter(m=>d.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return f.length?(this.options.preload=d.concat(f),this.loadResources(m=>{i.resolve(),l&&l(m)}),i):(l&&l(),Promise.resolve())}dir(o){var d,f;if(o||(o=this.resolvedLanguage||(((d=this.languages)==null?void 0:d.length)>0?this.languages[0]:this.language)),!o)return"rtl";const l=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((f=this.services)==null?void 0:f.languageUtils)||new Yh(Ih());return l.indexOf(i.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;return new qr(o,l)}cloneInstance(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ho;const i=o.forkResourceStore;i&&delete o.forkResourceStore;const d={...this.options,...o,isClone:!0},f=new qr(d);if((o.debug!==void 0||o.prefix!==void 0)&&(f.logger=f.logger.clone(o)),["store","services","language"].forEach(p=>{f[p]=this[p]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},i){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},Object.keys(g[h]).reduce((y,N)=>(y[N]={...g[h][N]},y),{})),{});f.store=new Kh(p,d),f.services.resourceStore=f.store}return f.translator=new Co(f.services,d),f.translator.on("*",function(p){for(var g=arguments.length,h=new Array(g>1?g-1:0),y=1;y<g;y++)h[y-1]=arguments[y];f.emit(p,...h)}),f.init(d,l),f.translator.options=d,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Nt=qr.createInstance();Nt.createInstance=qr.createInstance;Nt.createInstance;Nt.dir;Nt.init;Nt.loadResources;Nt.reloadResources;Nt.use;Nt.changeLanguage;Nt.getFixedT;Nt.t;Nt.exists;Nt.setDefaultNamespace;Nt.hasLoadedNamespace;Nt.loadNamespaces;Nt.loadLanguages;const{slice:j2,forEach:N2}=[];function S2(r){return N2.call(j2.call(arguments,1),o=>{if(o)for(const l in o)r[l]===void 0&&(r[l]=o[l])}),r}function C2(r){return typeof r!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(l=>l.test(r))}const Wh=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,E2=function(r,o){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},d=encodeURIComponent(o);let f=`${r}=${d}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");f+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Wh.test(i.domain))throw new TypeError("option domain is invalid");f+=`; Domain=${i.domain}`}if(i.path){if(!Wh.test(i.path))throw new TypeError("option path is invalid");f+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");f+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(f+="; HttpOnly"),i.secure&&(f+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:f+="; SameSite=Strict";break;case"lax":f+="; SameSite=Lax";break;case"strict":f+="; SameSite=Strict";break;case"none":f+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(f+="; Partitioned"),f},eg={create(r,o,l,i){let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};l&&(d.expires=new Date,d.expires.setTime(d.expires.getTime()+l*60*1e3)),i&&(d.domain=i),document.cookie=E2(r,o,d)},read(r){const o=`${r}=`,l=document.cookie.split(";");for(let i=0;i<l.length;i++){let d=l[i];for(;d.charAt(0)===" ";)d=d.substring(1,d.length);if(d.indexOf(o)===0)return d.substring(o.length,d.length)}return null},remove(r,o){this.create(r,"",-1,o)}};var k2={name:"cookie",lookup(r){let{lookupCookie:o}=r;if(o&&typeof document<"u")return eg.read(o)||void 0},cacheUserLanguage(r,o){let{lookupCookie:l,cookieMinutes:i,cookieDomain:d,cookieOptions:f}=o;l&&typeof document<"u"&&eg.create(l,r,i,d,f)}},T2={name:"querystring",lookup(r){var i;let{lookupQuerystring:o}=r,l;if(typeof window<"u"){let{search:d}=window.location;!window.location.search&&((i=window.location.hash)==null?void 0:i.indexOf("?"))>-1&&(d=window.location.hash.substring(window.location.hash.indexOf("?")));const m=d.substring(1).split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===o&&(l=m[p].substring(g+1))}}return l}},A2={name:"hash",lookup(r){var d;let{lookupHash:o,lookupFromHashIndex:l}=r,i;if(typeof window<"u"){const{hash:f}=window.location;if(f&&f.length>2){const m=f.substring(1);if(o){const p=m.split("&");for(let g=0;g<p.length;g++){const h=p[g].indexOf("=");h>0&&p[g].substring(0,h)===o&&(i=p[g].substring(h+1))}}if(i)return i;if(!i&&l>-1){const p=f.match(/\/([a-zA-Z-]*)/g);return Array.isArray(p)?(d=p[typeof l=="number"?l:0])==null?void 0:d.replace("/",""):void 0}}}return i}};let As=null;const tg=()=>{if(As!==null)return As;try{if(As=typeof window<"u"&&window.localStorage!==null,!As)return!1;const r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{As=!1}return As};var R2={name:"localStorage",lookup(r){let{lookupLocalStorage:o}=r;if(o&&tg())return window.localStorage.getItem(o)||void 0},cacheUserLanguage(r,o){let{lookupLocalStorage:l}=o;l&&tg()&&window.localStorage.setItem(l,r)}};let Rs=null;const ag=()=>{if(Rs!==null)return Rs;try{if(Rs=typeof window<"u"&&window.sessionStorage!==null,!Rs)return!1;const r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{Rs=!1}return Rs};var M2={name:"sessionStorage",lookup(r){let{lookupSessionStorage:o}=r;if(o&&ag())return window.sessionStorage.getItem(o)||void 0},cacheUserLanguage(r,o){let{lookupSessionStorage:l}=o;l&&ag()&&window.sessionStorage.setItem(l,r)}},O2={name:"navigator",lookup(r){const o=[];if(typeof navigator<"u"){const{languages:l,userLanguage:i,language:d}=navigator;if(l)for(let f=0;f<l.length;f++)o.push(l[f]);i&&o.push(i),d&&o.push(d)}return o.length>0?o:void 0}},z2={name:"htmlTag",lookup(r){let{htmlTag:o}=r,l;const i=o||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(l=i.getAttribute("lang")),l}},D2={name:"path",lookup(r){var d;let{lookupFromPathIndex:o}=r;if(typeof window>"u")return;const l=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(d=l[typeof o=="number"?o:0])==null?void 0:d.replace("/",""):void 0}},U2={name:"subdomain",lookup(r){var d,f;let{lookupFromSubdomainIndex:o}=r;const l=typeof o=="number"?o+1:1,i=typeof window<"u"&&((f=(d=window.location)==null?void 0:d.hostname)==null?void 0:f.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(i)return i[l]}};let lp=!1;try{document.cookie,lp=!0}catch{}const op=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];lp||op.splice(1,1);const L2=()=>({order:op,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:r=>r});class ip{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(o,l)}init(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=o,this.options=S2(l,this.options||{},L2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=d=>d.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(k2),this.addDetector(T2),this.addDetector(R2),this.addDetector(M2),this.addDetector(O2),this.addDetector(z2),this.addDetector(D2),this.addDetector(U2),this.addDetector(A2)}addDetector(o){return this.detectors[o.name]=o,this}detect(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,l=[];return o.forEach(i=>{if(this.detectors[i]){let d=this.detectors[i].lookup(this.options);d&&typeof d=="string"&&(d=[d]),d&&(l=l.concat(d))}}),l=l.filter(i=>i!=null&&!C2(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?l:l.length>0?l[0]:null}cacheUserLanguage(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;l&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(o)>-1||l.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(o,this.options)}))}}ip.type="languageDetector";const _2={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"},B2={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..."},H2={viewProfile:"View profile",userCenter:"User Center"},P2={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"},q2={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},V2={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},G2={title:"Theme",light:"Light",dark:"Dark",system:"System"},K2={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"},$2={addServer:"Add Server",add:"Add",edit:"Edit",delete:"Delete",confirmDelete:"Are you sure you want to delete this server?",deleteWarning:"Deleting server '{{name}}' will remove it and all its data. This action cannot be undone.",status:"Status",tools:"Tools",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",command:"Command",arguments:"Arguments",envVars:"Environment Variables",headers:"HTTP Headers",key:"key",value:"value",enabled:"Enabled",enable:"Enable",disable:"Disable",requestOptions:"Configuration",timeout:"Request Timeout",timeoutDescription:"Timeout for requests to the MCP server (ms)",maxTotalTimeout:"Maximum Total Timeout",maxTotalTimeoutDescription:"Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",resetTimeoutOnProgress:"Reset Timeout on Progress",resetTimeoutOnProgressDescription:"Reset timeout on progress notifications",remove:"Remove",toggleError:"Failed to toggle server {{serverName}}",alreadyExists:"Server {{serverName}} already exists",invalidData:"Invalid server data provided",notFound:"Server {{serverName}} not found",namePlaceholder:"Enter server name",urlPlaceholder:"Enter server URL",commandPlaceholder:"Enter command",argumentsPlaceholder:"Enter arguments",errorDetails:"Error Details",viewErrorDetails:"View error details",confirmVariables:"Confirm Variable Configuration",variablesDetected:"Variables detected in configuration. Please confirm these variables are properly configured:",detectedVariables:"Detected Variables",confirmVariablesMessage:"Please ensure these variables are properly defined in your runtime environment. Continue adding server?",confirmAndAdd:"Confirm and Add",openapi:{inputMode:"Input Mode",inputModeUrl:"Specification URL",inputModeSchema:"JSON Schema",specUrl:"OpenAPI Specification URL",schema:"OpenAPI JSON Schema",schemaHelp:"Paste your complete OpenAPI JSON schema here",security:"Security Type",securityNone:"None",securityApiKey:"API Key",securityHttp:"HTTP Authentication",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API Key Configuration",apiKeyName:"Header/Parameter Name",apiKeyIn:"Location",apiKeyValue:"API Key Value",httpAuthConfig:"HTTP Authentication Configuration",httpScheme:"Authentication Scheme",httpCredentials:"Credentials",oauth2Config:"OAuth 2.0 Configuration",oauth2Token:"Access Token",openIdConnectConfig:"OpenID Connect Configuration",openIdConnectUrl:"Discovery URL",openIdConnectToken:"ID Token"}},F2={online:"Online",offline:"Offline",connecting:"Connecting"},Y2={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"},X2={processing:"Processing...",save:"Save",cancel:"Cancel",refresh:"Refresh",create:"Create",creating:"Creating...",update:"Update",updating:"Updating...",submitting:"Submitting...",delete:"Delete",remove:"Remove",copy:"Copy",copyId:"Copy ID",copyUrl:"Copy URL",copyJson:"Copy JSON",copySuccess:"Copied to clipboard",copyFailed:"Copy failed",close:"Close",confirm:"Confirm",language:"Language"},Q2={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",cloud:"Cloud Market",logs:"Logs"},Z2={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"}},I2={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"},J2={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"},W2={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"},ew={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}}"},tw={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}}"},aw={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}}"},nw={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"},sw={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"},rw={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."},lw={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"}},ow={app:_2,about:B2,profile:H2,sponsor:P2,wechat:q2,discord:V2,theme:G2,auth:K2,server:$2,status:F2,errors:Y2,common:X2,nav:Q2,pages:Z2,logs:I2,groups:J2,market:W2,cloud:ew,tool:tw,prompt:aw,settings:nw,dxt:sw,users:rw,api:lw},iw={title:"MCPHub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCPHub"},cw={title:"关于",versionInfo:"MCPHub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},uw={viewProfile:"查看个人中心",userCenter:"个人中心"},dw={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCPHub 的开发!",supportButton:"在 Ko-fi 上支持"},fw={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},mw={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},hw={title:"主题",light:"浅色",dark:"深色",system:"系统"},gw={login:"登录",loginTitle:"登录 MCPHub",slogan:"统一的 MCP 服务器管理平台",subtitle:"模型上下文协议服务器的集中管理平台,通过灵活的路由策略组织、监控和扩展多个 MCP 服务器。",username:"用户名",password:"密码",loggingIn:"登录中...",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败"},pw={addServer:"添加服务器",add:"添加",edit:"编辑",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:"服务器类型",command:"命令",arguments:"参数",envVars:"环境变量",headers:"HTTP 请求头",key:"键",value:"值",enabled:"已启用",enable:"启用",disable:"禁用",requestOptions:"配置",timeout:"请求超时",timeoutDescription:"请求超时时间(毫秒)",maxTotalTimeout:"最大总超时",maxTotalTimeoutDescription:"无论是否有进度通知的最大总超时时间(毫秒)",resetTimeoutOnProgress:"收到进度通知时重置超时",resetTimeoutOnProgressDescription:"适用于发送周期性进度更新的长时间运行操作",remove:"移除",toggleError:"切换服务器 {{serverName}} 状态失败",alreadyExists:"服务器 {{serverName}} 已经存在",invalidData:"提供的服务器数据无效",notFound:"找不到服务器 {{serverName}}",namePlaceholder:"请输入服务器名称",urlPlaceholder:"请输入服务器URL",commandPlaceholder:"请输入命令",argumentsPlaceholder:"请输入参数",errorDetails:"错误详情",viewErrorDetails:"查看错误详情",confirmVariables:"确认变量配置",variablesDetected:"检测到配置中包含变量,请确认这些变量是否已正确配置:",detectedVariables:"检测到的变量",confirmVariablesMessage:"请确保这些变量在运行环境中已正确定义。是否继续添加服务器?",confirmAndAdd:"确认并添加",openapi:{inputMode:"输入模式",inputModeUrl:"规范 URL",inputModeSchema:"JSON 模式",specUrl:"OpenAPI 规范 URL",schema:"OpenAPI JSON 模式",schemaHelp:"请在此处粘贴完整的 OpenAPI JSON 模式",security:"安全类型",securityNone:"无",securityApiKey:"API 密钥",securityHttp:"HTTP 认证",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API 密钥配置",apiKeyName:"请求头/参数名称",apiKeyIn:"位置",apiKeyValue:"API 密钥值",httpAuthConfig:"HTTP 认证配置",httpScheme:"认证方案",httpCredentials:"凭据",oauth2Config:"OAuth 2.0 配置",oauth2Token:"访问令牌",openIdConnectConfig:"OpenID Connect 配置",openIdConnectUrl:"发现 URL",openIdConnectToken:"ID 令牌"}},xw={online:"在线",offline:"离线",connecting:"连接中"},yw={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},bw={processing:"处理中...",save:"保存",cancel:"取消",refresh:"刷新",create:"创建",creating:"创建中...",update:"更新",updating:"更新中...",submitting:"提交中...",delete:"删除",remove:"移除",copy:"复制",copyId:"复制ID",copyUrl:"复制URL",copyJson:"复制JSON",copySuccess:"已复制到剪贴板",copyFailed:"复制失败",close:"关闭",confirm:"确认",language:"语言"},vw={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",cloud:"云端市场",logs:"日志"},ww={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:"系统日志"}},jw={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},Nw={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:"配置工具"},Sw={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:"确认并安装"},Cw={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}}"},Ew={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}}"},kw={run:"获取",running:"获取中...",result:"提示词结果",error:"提示词错误",execution:"提示词执行",successful:"成功",failed:"失败",errorDetails:"错误详情:",noContent:"提示词执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",description:"描述",messages:"消息",noDescription:"无描述信息",runPromptWithName:"获取提示词: {{name}}"},Tw={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"},Aw={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:"覆盖"},Rw={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}}' 吗?此操作无法撤消。"},Mw={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:"服务器工具更新成功"}},Ow={app:iw,about:cw,profile:uw,sponsor:dw,wechat:fw,discord:mw,theme:hw,auth:gw,server:pw,status:xw,errors:yw,common:bw,nav:vw,pages:ww,logs:jw,groups:Nw,market:Sw,cloud:Cw,tool:Ew,prompt:kw,settings:Tw,dxt:Aw,users:Rw,api:Mw};Nt.use(ip).use(F1).init({resources:{en:{translation:ow},zh:{translation:Ow}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const zw=()=>{rb()};zw();async function Dw(){try{console.log("Loading runtime configuration...");const r=await ab();console.log("Runtime configuration loaded:",r),window.__MCPHUB_CONFIG__=r,jh.createRoot(document.getElementById("root")).render(n.jsx(Ms.StrictMode,{children:n.jsx(Hh,{})}))}catch(r){console.error("Failed to initialize app:",r),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},jh.createRoot(document.getElementById("root")).render(n.jsx(Ms.StrictMode,{children:n.jsx(Hh,{})}))}}Dw();
|
|
212
|
+
//# sourceMappingURL=index-ISu9ai3k.js.map
|